]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/client.cpp
Merge pull request #48 from Oblomov/master
[dragonfireclient.git] / src / client.cpp
index 4f0baa573d58eefd6c785611d9703809194296ee..02f78e233293236c193b08ab5ef7d1dfa1206016 100644 (file)
@@ -415,19 +415,23 @@ 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);
 
                        memset((char*)&data[3], 0, PLAYERNAME_SIZE);
                        snprintf((char*)&data[3], PLAYERNAME_SIZE, "%s", myplayer->getName());
 
-                       /*dstream<<"Client: password hash is \""<<m_password<<"\""
+                       /*dstream<<"Client: sending initial password hash: \""<<m_password<<"\""
                                        <<std::endl;*/
 
                        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);