summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-03-08 17:37:36 +0100
committerGitHub <noreply@github.com>2021-03-08 17:37:36 +0100
commit01a4e696b3d2c973cdd1fb4345d747bd10e93ad9 (patch)
tree92996aef85fca3306b26535fa44feb812deb050b /src/Protocol/Protocol.h
parentSome emplace_back replacements (#5149) (diff)
downloadcuberite-01a4e696b3d2c973cdd1fb4345d747bd10e93ad9.tar
cuberite-01a4e696b3d2c973cdd1fb4345d747bd10e93ad9.tar.gz
cuberite-01a4e696b3d2c973cdd1fb4345d747bd10e93ad9.tar.bz2
cuberite-01a4e696b3d2c973cdd1fb4345d747bd10e93ad9.tar.lz
cuberite-01a4e696b3d2c973cdd1fb4345d747bd10e93ad9.tar.xz
cuberite-01a4e696b3d2c973cdd1fb4345d747bd10e93ad9.tar.zst
cuberite-01a4e696b3d2c973cdd1fb4345d747bd10e93ad9.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Protocol/Protocol.h b/src/Protocol/Protocol.h
index 41c461e76..743a73aba 100644
--- a/src/Protocol/Protocol.h
+++ b/src/Protocol/Protocol.h
@@ -48,6 +48,7 @@ typedef unsigned char Byte;
class cProtocol
{
public:
+
cProtocol(cClientHandle * a_Client) :
m_Client(a_Client),
m_OutPacketBuffer(64 KiB),
@@ -354,8 +355,9 @@ public:
Game = 3,
};
- /** Called when client sends some data */
- virtual void DataReceived(cByteBuffer & a_Buffer, const char * a_Data, size_t a_Size) = 0;
+ /** Called to process them, when client sends some data.
+ The protocol uses the provided buffers for storage and processing, and must have exclusive access to them. */
+ virtual void DataReceived(cByteBuffer & a_Buffer, ContiguousByteBuffer && a_Data) = 0;
// Sending stuff to clients (alphabetically sorted):
virtual void SendAttachEntity (const cEntity & a_Entity, const cEntity & a_Vehicle) = 0;