From eeb63b8901a9c049f1bb594abb9ce9b4a9c47620 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 11 Jan 2021 16:39:43 +0000 Subject: zlib -> libdeflate (#5085) + Use libdeflate + Use std::byte * Fix passing temporary to string_view + Emulate make_unique_for_overwrite --- src/Protocol/Protocol.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Protocol/Protocol.h') diff --git a/src/Protocol/Protocol.h b/src/Protocol/Protocol.h index 5c9d5105f..341e0b0f4 100644 --- a/src/Protocol/Protocol.h +++ b/src/Protocol/Protocol.h @@ -365,7 +365,7 @@ public: virtual void SendChat (const AString & a_Message, eChatType a_Type) = 0; virtual void SendChat (const cCompositeChat & a_Message, eChatType a_Type, bool a_ShouldUseChatPrefixes) = 0; virtual void SendChatRaw (const AString & a_MessageRaw, eChatType a_Type) = 0; - virtual void SendChunkData (const std::string_view a_ChunkData) = 0; + virtual void SendChunkData (ContiguousByteBufferView a_ChunkData) = 0; virtual void SendCollectEntity (const cEntity & a_Collected, const cEntity & a_Collector, unsigned a_Count) = 0; virtual void SendDestroyEntity (const cEntity & a_Entity) = 0; virtual void SendDetachEntity (const cEntity & a_Entity, const cEntity & a_PreviousVehicle) = 0; @@ -405,7 +405,7 @@ public: virtual void SendPlayerMoveLook (void) = 0; virtual void SendPlayerPosition (void) = 0; virtual void SendPlayerSpawn (const cPlayer & a_Player) = 0; - virtual void SendPluginMessage (const AString & a_Channel, const AString & a_Message) = 0; + virtual void SendPluginMessage (const AString & a_Channel, ContiguousByteBufferView a_Message) = 0; virtual void SendRemoveEntityEffect (const cEntity & a_Entity, int a_EffectID) = 0; virtual void SendResetTitle (void) = 0; virtual void SendResourcePack (const AString & a_ResourcePackUrl) = 0; @@ -468,7 +468,7 @@ protected: virtual Version GetProtocolVersion() = 0; /** A generic data-sending routine, all outgoing packet data needs to be routed through this so that descendants may override it. */ - virtual void SendData(const char * a_Data, size_t a_Size) = 0; + virtual void SendData(ContiguousByteBufferView a_Data) = 0; /** Sends a single packet contained within the cPacketizer class. The cPacketizer's destructor calls this to send the contained packet; protocol may transform the data (compression in 1.8 etc). */ -- cgit v1.2.3