From 197542c7ec19b41e865be1e84c6c6898de8514d1 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Mon, 26 Nov 2012 09:49:07 +0200 Subject: New PROTOCOL_VERSION scheme (allow client to support a range of versions) --- src/client.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index f72c4b654..f6e97c52e 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -499,8 +499,9 @@ void Client::step(float dtime) // [2] u8 SER_FMT_VER_HIGHEST // [3] u8[20] player_name // [23] u8[28] password (new in some version) - // [51] u16 client network protocol version (new in some version) - SharedBuffer data(2+1+PLAYERNAME_SIZE+PASSWORD_SIZE+2); + // [51] u16 minimum supported network protocol version (added sometime) + // [53] u16 maximum supported network protocol version (added later than the previous one) + SharedBuffer data(2+1+PLAYERNAME_SIZE+PASSWORD_SIZE+2+2); writeU16(&data[0], TOSERVER_INIT); writeU8(&data[2], SER_FMT_VER_HIGHEST); @@ -513,8 +514,8 @@ void Client::step(float dtime) memset((char*)&data[23], 0, PASSWORD_SIZE); snprintf((char*)&data[23], PASSWORD_SIZE, "%s", m_password.c_str()); - // This should be incremented in each version - writeU16(&data[51], PROTOCOL_VERSION); + writeU16(&data[51], CLIENT_PROTOCOL_VERSION_MIN); + writeU16(&data[53], CLIENT_PROTOCOL_VERSION_MAX); // Send as unreliable Send(0, data, false); -- cgit v1.2.3