diff options
author | Rubidium <rubidium@openttd.org> | 2021-04-18 10:49:12 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-04-24 20:42:01 +0200 |
commit | 6f161f655942f2ca0091a75cdab8e3260e31bb5f (patch) | |
tree | 6bdcff599e22887cde7f9badbb3c03d63dd2edcd /src/network/core/packet.h | |
parent | 38d15fc9b788e2c904705d2ba8de4d5f1ff7988d (diff) | |
download | openttd-6f161f655942f2ca0091a75cdab8e3260e31bb5f.tar.xz |
Codechange: encapsulate the logic about how many bytes can be sent from a buffer in to a Packet
Diffstat (limited to 'src/network/core/packet.h')
-rw-r--r-- | src/network/core/packet.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/network/core/packet.h b/src/network/core/packet.h index b091d8a7e..4eb4703c1 100644 --- a/src/network/core/packet.h +++ b/src/network/core/packet.h @@ -65,13 +65,14 @@ 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); - void Send_uint32(uint32 data); - void Send_uint64(uint64 data); - void Send_string(const char *data); + bool CanWriteToPacket(size_t bytes_to_write); + void Send_bool (bool data); + void Send_uint8 (uint8 data); + void Send_uint16(uint16 data); + void Send_uint32(uint32 data); + void Send_uint64(uint64 data); + void Send_string(const char *data); + size_t Send_bytes (const byte *begin, const byte *end); /* Reading/receiving of packets */ bool HasPacketSizeData() const; |