summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ClientHandle.cpp4
-rw-r--r--src/ClientHandle.h2
-rw-r--r--src/Protocol/LengthenedProtocol.h3
-rw-r--r--src/Protocol/Protocol.h2
-rw-r--r--src/Protocol/Protocol17x.h2
-rw-r--r--src/Protocol/Protocol18x.cpp14
-rw-r--r--src/Protocol/Protocol18x.h2
-rw-r--r--src/Protocol/ProtocolRecognizer.cpp8
-rw-r--r--src/Protocol/ProtocolRecognizer.h2
9 files changed, 20 insertions, 19 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 41b7f1fbc..253593d14 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -1803,7 +1803,7 @@ void cClientHandle::HandleTabCompletion(const AString & a_Text)
-
+#if 0
void cClientHandle::SendData(const char * a_Data, size_t a_Size)
{
if (m_HasSentDC)
@@ -1815,7 +1815,7 @@ void cClientHandle::SendData(const char * a_Data, size_t a_Size)
cCSLock Lock(m_CSOutgoingData);
m_OutgoingData.append(a_Data, a_Size);
}
-
+#endif
diff --git a/src/ClientHandle.h b/src/ClientHandle.h
index d7468d345..210324454 100644
--- a/src/ClientHandle.h
+++ b/src/ClientHandle.h
@@ -351,7 +351,7 @@ public: // tolua_export
*/
bool HandleLogin(UInt32 a_ProtocolVersion, const AString & a_Username);
- void SendData(const char * a_Data, size_t a_Size);
+ //void SendData(const char * a_Data, size_t a_Size);
/** Called when the player moves into a different world.
Sends an UnloadChunk packet for each loaded chunk and resets the streamed chunks. */
diff --git a/src/Protocol/LengthenedProtocol.h b/src/Protocol/LengthenedProtocol.h
index 4394614ce..a6e72fe05 100644
--- a/src/Protocol/LengthenedProtocol.h
+++ b/src/Protocol/LengthenedProtocol.h
@@ -2,6 +2,8 @@
#pragma once
#include "Protocol.h"
+extern void undefined();
+
class cLengthenedProtocol : public cProtocol
{
public:
@@ -9,6 +11,7 @@ public:
cProtocol(a_LogID),
m_ReceivedData(32 KiB)
{
+ undefined();
}
virtual ~cLengthenedProtocol() = default;
diff --git a/src/Protocol/Protocol.h b/src/Protocol/Protocol.h
index b3335b6b8..8e6bfae7d 100644
--- a/src/Protocol/Protocol.h
+++ b/src/Protocol/Protocol.h
@@ -204,7 +204,7 @@ protected:
/** 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(cByteBuffer & a_ByteBuffer, const char * a_Data, size_t a_Size) = 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). */
diff --git a/src/Protocol/Protocol17x.h b/src/Protocol/Protocol17x.h
index a98910bc3..bc4479529 100644
--- a/src/Protocol/Protocol17x.h
+++ b/src/Protocol/Protocol17x.h
@@ -200,7 +200,7 @@ protected:
void HandleVanillaPluginMessage(cByteBuffer & a_ByteBuffer, const AString & a_Channel, UInt16 a_PayloadLength);
/** Sends the data to the client, encrypting them if needed. */
- virtual void SendData(const char * a_Data, size_t a_Size) override;
+ //virtual void SendData(const char * a_Data, size_t a_Size) override;
/** Sends the packet to the client. Called by the cPacketizer's destructor. */
virtual void SendPacket(cPacketizer & a_Packet) override;
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp
index 8867ba21e..8c39d168e 100644
--- a/src/Protocol/Protocol18x.cpp
+++ b/src/Protocol/Protocol18x.cpp
@@ -100,19 +100,16 @@ extern bool g_ShouldLogCommIn, g_ShouldLogCommOut;
-
+#endif
////////////////////////////////////////////////////////////////////////////////
// cProtocol180:
-cProtocol180::cProtocol180(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State) :
- super(a_Client),
- m_ServerAddress(a_ServerAddress),
- m_ServerPort(a_ServerPort),
- m_State(a_State),
+cProtocol180::cProtocol180(const AString a_LogID) :
+ super(a_LogID),
m_ReceivedData(32 KiB),
m_LastSentDimension(dimNotSet)
{
-
+#if 0
// BungeeCord handling:
// If BC is setup with ip_forward == true, it sends additional data in the login packet's ServerAddress field:
// hostname\00ip-address\00uuid\00profile-properties-as-json
@@ -143,8 +140,9 @@ cProtocol180::cProtocol180(cClientHandle * a_Client, const AString & a_ServerAdd
LOG("Cannot log communication to file, the log file \"%s\" cannot be opened for writing.", FileName.c_str());
}
}
+#endif
}
-
+#if 0
diff --git a/src/Protocol/Protocol18x.h b/src/Protocol/Protocol18x.h
index 51d591e68..dcb6f7f22 100644
--- a/src/Protocol/Protocol18x.h
+++ b/src/Protocol/Protocol18x.h
@@ -222,7 +222,7 @@ protected:
/** Sends the data to the client, encrypting them if needed. */
- virtual void SendData(const char * a_Data, size_t a_Size) override;
+ //virtual void SendData(const char * a_Data, size_t a_Size) override;
/** Sends the packet to the client. Called by the cPacketizer's destructor. */
virtual void SendPacket(cPacketizer & a_Packet) override;
diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp
index 40d4222fe..1c4333305 100644
--- a/src/Protocol/ProtocolRecognizer.cpp
+++ b/src/Protocol/ProtocolRecognizer.cpp
@@ -177,17 +177,17 @@ void cProtocolRecognizer::SendDestroyEntity(const cEntity & a_Entity)
-void cProtocolRecognizer::SendDisconnect(const AString & a_Reason)
+void cProtocolRecognizer::SendDisconnect(cByteBuffer & a_ByteBuffer, const AString & a_Reason)
{
if (m_Protocol != nullptr)
{
- m_Protocol->SendDisconnect(a_Reason);
+ m_Protocol->SendDisconnect(a_ByteBuffer, a_Reason);
}
else
{
// This is used when the client sends a server-ping, respond with the default packet:
static const int Packet = 0xff; // PACKET_DISCONNECT
- SendData(reinterpret_cast<const char *>(&Packet), 1); // WriteByte()
+ a_ByteBuffer.Write(reinterpret_cast<const char *>(&Packet), 1); // WriteByte()
auto UTF16 = UTF8ToRawBEUTF16(a_Reason);
static const u_short Size = htons(static_cast<u_short>(UTF16.size()));
@@ -197,7 +197,7 @@ void cProtocolRecognizer::SendDisconnect(const AString & a_Reason)
}
-
+e
void cProtocolRecognizer::SendEditSign(int a_BlockX, int a_BlockY, int a_BlockZ)
{
diff --git a/src/Protocol/ProtocolRecognizer.h b/src/Protocol/ProtocolRecognizer.h
index 5cbe8f2c3..49a56047f 100644
--- a/src/Protocol/ProtocolRecognizer.h
+++ b/src/Protocol/ProtocolRecognizer.h
@@ -130,7 +130,7 @@ public:
virtual AString GetAuthServerID(void) override;
- virtual void SendData(const char * a_Data, size_t a_Size) override;
+ //virtual void SendData(const char * a_Data, size_t a_Size) override;
cProtocolError HandleHandshake(cByteBuffer & a_ByteBuffer, std::vector<std::unique_ptr<cClientAction>> & a_Actions) override WARN_UNUSED;