diff options
author | Rubidium <rubidium@openttd.org> | 2021-04-18 09:26:06 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-04-24 20:42:01 +0200 |
commit | a2051bad503618f37e941aca3e4a5d53af1b0fbe (patch) | |
tree | 3857e4b4df3298d8831bc104db72a418ca7bfed6 /src/network/core/packet.h | |
parent | c545cc9d7039a89e23de160b1c93adc959eabda5 (diff) | |
download | openttd-a2051bad503618f37e941aca3e4a5d53af1b0fbe.tar.xz |
Codechange: move logic whether there is enough space in a packet to write data into the Packet
Diffstat (limited to 'src/network/core/packet.h')
-rw-r--r-- | src/network/core/packet.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/core/packet.h b/src/network/core/packet.h index 6e5c5509c..901d3f593 100644 --- a/src/network/core/packet.h +++ b/src/network/core/packet.h @@ -63,6 +63,7 @@ public: /* Sending/writing of packets */ void PrepareToSend(); + bool CanWriteToPacket(size_t bytes_to_write); void Send_bool (bool data); void Send_uint8 (uint8 data); void Send_uint16(uint16 data); @@ -75,7 +76,7 @@ public: bool ParsePacketSize(); void PrepareToRead(); - bool CanReadFromPacket (uint bytes_to_read); + bool CanReadFromPacket(size_t bytes_to_read, bool close_connection = false); bool Recv_bool (); uint8 Recv_uint8 (); uint16 Recv_uint16(); |