diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-07-30 20:02:17 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-07-30 20:02:17 +0300 |
commit | 24a662705cb73f8a5630114654c38a0e1328b9ec (patch) | |
tree | 9c29eebe1551467c5234c247f040caa7f410f102 /src/client.cpp | |
parent | cdadbdbd17d624dd45cca67f41309cbe776dc348 (diff) | |
download | minetest-24a662705cb73f8a5630114654c38a0e1328b9ec.tar.gz minetest-24a662705cb73f8a5630114654c38a0e1328b9ec.tar.bz2 minetest-24a662705cb73f8a5630114654c38a0e1328b9ec.zip |
Added network protocol version number in protocol
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client.cpp b/src/client.cpp index 7ebb30fba..5f299890a 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -415,8 +415,9 @@ void Client::step(float dtime) // [0] u16 TOSERVER_INIT // [2] u8 SER_FMT_VER_HIGHEST // [3] u8[20] player_name - // [23] u8[28] password - SharedBuffer<u8> data(2+1+PLAYERNAME_SIZE+PASSWORD_SIZE); + // [23] u8[28] password (new in some version) + // [51] u16 client network protocol version (new in some version) + SharedBuffer<u8> data(2+1+PLAYERNAME_SIZE+PASSWORD_SIZE+2); writeU16(&data[0], TOSERVER_INIT); writeU8(&data[2], SER_FMT_VER_HIGHEST); @@ -428,6 +429,9 @@ 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], 1); // Send as unreliable Send(0, data, false); |