diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/ProtocolRecognizer.cpp | 3 | ||||
-rw-r--r-- | source/ProtocolRecognizer.h | 8 | ||||
-rw-r--r-- | source/cClientHandle.h | 7 | ||||
-rw-r--r-- | source/cServer.cpp | 3 |
4 files changed, 13 insertions, 8 deletions
diff --git a/source/ProtocolRecognizer.cpp b/source/ProtocolRecognizer.cpp index 736694f5d..69b733c47 100644 --- a/source/ProtocolRecognizer.cpp +++ b/source/ProtocolRecognizer.cpp @@ -470,6 +470,9 @@ void cProtocolRecognizer::SendData(const char * a_Data, int a_Size) bool cProtocolRecognizer::TryRecognizeProtocol(void)
{
+ // NOTE: If a new protocol is added or an old one is removed, adjust MCS_CLIENT_VERSIONS and
+ // MCS_PROTOCOL_VERSIONS macros in the header file
+
// The first packet should be a Handshake, 0x02:
unsigned char PacketType;
if (!m_Buffer.ReadByte(PacketType))
diff --git a/source/ProtocolRecognizer.h b/source/ProtocolRecognizer.h index 0a5c5a61a..f773c7ac1 100644 --- a/source/ProtocolRecognizer.h +++ b/source/ProtocolRecognizer.h @@ -17,6 +17,14 @@ +// Adjust these if a new protocol is added or an old one is removed:
+#define MCS_CLIENT_VERSIONS "1.2.4, 1.2.5, 1.3.1, 1.3.2"
+#define MCS_PROTOCOL_VERSIONS "29, 39"
+
+
+
+
+
class cProtocolRecognizer :
public cProtocol
{
diff --git a/source/cClientHandle.h b/source/cClientHandle.h index cd0cbeae3..3ea94fa98 100644 --- a/source/cClientHandle.h +++ b/source/cClientHandle.h @@ -21,13 +21,6 @@ -#define MCS_PROTOCOL_VERSION 29 // Synchronize this with MCS_CLIENT_VERSION below! -#define MCS_CLIENT_VERSION "1.2.4, 1.2.5" - - - - - class cChunkDataSerializer; class cInventory; class cMonster; diff --git a/source/cServer.cpp b/source/cServer.cpp index 988594943..9653a2542 100644 --- a/source/cServer.cpp +++ b/source/cServer.cpp @@ -21,6 +21,7 @@ #include "cFurnaceRecipe.h" #include "cTracer.h" #include "cWebAdmin.h" +#include "ProtocolRecognizer.h" #include "MersenneTwister.h" @@ -163,7 +164,7 @@ bool cServer::InitServer( int a_Port ) printf("email: faketruth@gmail.com\n\n"); LOG("Starting up server."); - LOGINFO("Compatible clients: %s, protocol version %d", MCS_CLIENT_VERSION, MCS_PROTOCOL_VERSION); + LOGINFO("Compatible clients: %s, protocol versions %s", MCS_CLIENT_VERSIONS, MCS_PROTOCOL_VERSIONS); if( cSocket::WSAStartup() != 0 ) // Only does anything on Windows, but whatever { |