D
Drepple
Guest
Hi there,
I've been working on a game that uses UDP to broadcast data for lobbies and then connects to the server with the lowest ping using TCP. The packets that are being broadcasted only contain a certain time. When another person receives the packet it will send back the time and the person who originally sent it can calculate the ping.
The problem is that the receiver doesn't send the time back. The broadcasting works fine but network_send_udp() returns -2, so it somehow can't send the packet. Here's the code I'm using:
Does anyone have an idea of what could cause this to happen? FYI: "server" is a TCP type server. I figured it would work for sending UDP messages as well as you also need a TCP server for broadcasting. Thanks in advance
I've been working on a game that uses UDP to broadcast data for lobbies and then connects to the server with the lowest ping using TCP. The packets that are being broadcasted only contain a certain time. When another person receives the packet it will send back the time and the person who originally sent it can calculate the ping.
The problem is that the receiver doesn't send the time back. The broadcasting works fine but network_send_udp() returns -2, so it somehow can't send the packet. Here's the code I'm using:
Code:
///scr_send_ping(ip,time)
var ip = argument[0];
var time = argument[1];
buffer_seek(buffer_connect,buffer_seek_start,0);
buffer_write(buffer_connect,buffer_u8,1);
buffer_write(buffer_connect,buffer_u32,time);
var sent = network_send_udp(server,ip,port,buffer_connect,buffer_tell(buffer_connect));
show_debug_message(sent);
buffer_resize(buffer_connect,1);