mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-11-23 12:28:07 +01:00
Send huge unreliable packets by TCP when they are too big.
This commit is contained in:
parent
d215070876
commit
95fc8ac687
1 changed files with 3 additions and 1 deletions
|
@ -1153,6 +1153,9 @@ 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
|
||||
|
||||
bool ret = false;
|
||||
CSteamID dest_id((uint64)msg->dest_id());
|
||||
if (std::find(ids.begin(), ids.end(), dest_id) != ids.end()) {
|
||||
|
@ -1178,7 +1181,6 @@ bool Networking::sendTo(Common_Message *msg, bool reliable, Connection *conn)
|
|||
ret = true;
|
||||
}
|
||||
} else {
|
||||
size_t size = msg->ByteSizeLong();
|
||||
char *buffer = new char[size];
|
||||
msg->SerializeToArray(buffer, size);
|
||||
send_packet_to(udp_socket, conn->udp_ip_port, buffer, size);
|
||||
|
|
Loading…
Reference in a new issue