summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-06 14:39:07 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-06 14:39:07 +0200
commit879806e5a149fbb133cb021670482b430a7e0aeb (patch)
tree88d3ce22546bab0910c7794b6d4e6ded8b09c8e9
parentProtoProxy: Added blockchange packet parsing (diff)
downloadcuberite-879806e5a149fbb133cb021670482b430a7e0aeb.tar
cuberite-879806e5a149fbb133cb021670482b430a7e0aeb.tar.gz
cuberite-879806e5a149fbb133cb021670482b430a7e0aeb.tar.bz2
cuberite-879806e5a149fbb133cb021670482b430a7e0aeb.tar.lz
cuberite-879806e5a149fbb133cb021670482b430a7e0aeb.tar.xz
cuberite-879806e5a149fbb133cb021670482b430a7e0aeb.tar.zst
cuberite-879806e5a149fbb133cb021670482b430a7e0aeb.zip
-rw-r--r--source/ProtocolRecognizer.cpp3
-rw-r--r--source/ProtocolRecognizer.h8
-rw-r--r--source/cClientHandle.h7
-rw-r--r--source/cServer.cpp3
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
{