mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-11-27 05:04:01 +08:00
Send huge unreliable packets by TCP when they are too big.
This commit is contained in:
parent
d215070876
commit
95fc8ac687
@ -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 New Issue
Block a user