mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-11-23 12:28:07 +01:00
Fix some UDP packet size issues
This commit is contained in:
parent
05e2c3bef0
commit
373801b3a4
1 changed files with 4 additions and 2 deletions
|
@ -27,6 +27,8 @@ static uint32_t upper_range_ips[MAX_BROADCASTS];
|
|||
#define HEARTBEAT_TIMEOUT 20.0
|
||||
#define USER_TIMEOUT 20.0
|
||||
|
||||
#define MAX_UDP_SIZE 16384
|
||||
|
||||
#if defined(STEAM_WIN32)
|
||||
|
||||
//windows xp support
|
||||
|
@ -925,7 +927,7 @@ void Networking::Run()
|
|||
}
|
||||
|
||||
IP_PORT ip_port;
|
||||
char data[2048];
|
||||
char data[MAX_UDP_SIZE];
|
||||
int len;
|
||||
|
||||
PRINT_DEBUG("RECV UDP\n");
|
||||
|
@ -1178,7 +1180,7 @@ bool Networking::sendTo(Common_Message *msg, bool reliable, Connection *conn)
|
|||
if (!enabled) return false;
|
||||
|
||||
size_t size = msg->ByteSizeLong();
|
||||
if (size >= 65000) reliable = true; //too big for UDP
|
||||
if (size >= MAX_UDP_SIZE) reliable = true; //too big for UDP
|
||||
|
||||
bool ret = false;
|
||||
CSteamID dest_id((uint64)msg->dest_id());
|
||||
|
|
Loading…
Reference in a new issue