创建事件:
//Create event
randomize();
var a = irandom_range(49152,65535);
var host = network_create_server(network_socket_udp, a, 5);
if (host<0) {
show_message('Failed to create a broadcast server');
game_end();
} else {
var tsock = network_create_socket(network_socket_udp);
var tbuff = buffer_create(32, buffer_fixed, 1);
buffer_fill(tbuff, 0, buffer_bool, 0, 32);
network_send_broadcast(tsock, a, tbuff, buffer_get_size(tbuff));
network_destroy(tsock);
buffer_delete(tbuff);
}
异步→Networking事件:
//Networking event
show_message(string(ds_map_find_value(async_load, "ip")));
instance_destroy();
//Create event
randomize();
var a = irandom_range(49152,65535);
var host = network_create_server(network_socket_udp, a, 5);
if (host<0) {
show_message('Failed to create a broadcast server');
game_end();
} else {
var tsock = network_create_socket(network_socket_udp);
var tbuff = buffer_create(32, buffer_fixed, 1);
buffer_fill(tbuff, 0, buffer_bool, 0, 32);
network_send_broadcast(tsock, a, tbuff, buffer_get_size(tbuff));
network_destroy(tsock);
buffer_delete(tbuff);
}
异步→Networking事件:
//Networking event
show_message(string(ds_map_find_value(async_load, "ip")));
instance_destroy();