Command: Replace binary_length field with auxiliary data
Use for CMD_ADD_PLAN_LINE
This commit is contained in:
@@ -85,6 +85,13 @@ bool Packet::CanWriteToPacket(size_t bytes_to_write)
|
||||
return this->Size() + bytes_to_write <= this->limit;
|
||||
}
|
||||
|
||||
void Packet::WriteAtOffset_uint16(size_t offset, uint16 data)
|
||||
{
|
||||
assert(offset + 1 < this->buffer.size());
|
||||
this->buffer[offset] = GB(data, 0, 8);
|
||||
this->buffer[offset + 1] = GB(data, 8, 8);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -72,7 +72,9 @@ public:
|
||||
PacketSize &GetDeserialisationPosition() { return this->pos; }
|
||||
bool CanDeserialiseBytes(size_t bytes_to_read, bool raise_error) { return this->CanReadFromPacket(bytes_to_read, raise_error); }
|
||||
|
||||
bool CanWriteToPacket(size_t bytes_to_write);
|
||||
bool CanWriteToPacket(size_t bytes_to_write);
|
||||
|
||||
void WriteAtOffset_uint16(size_t offset, uint16);
|
||||
|
||||
/* Reading/receiving of packets */
|
||||
size_t ReadRawPacketSize() const;
|
||||
|
||||
Reference in New Issue
Block a user