- // Get an sha-1 hash of the player's name combined with\r
- // the password entered. That's what the server uses as\r
- // their password. (Exception : if the password field is\r
- // blank, we send a blank password - this is for backwards\r
- // compatibility with password-less players).\r
- if(menudata.password.length() > 0)\r
- {\r
- std::string slt=playername + wide_to_narrow(menudata.password);\r
- SHA1 *sha1 = new SHA1();\r
- sha1->addBytes(slt.c_str(), slt.length());\r
- unsigned char *digest = sha1->getDigest();\r
- password = base64_encode(digest, 20);\r
- free(digest);\r
- }\r
- else\r
- {\r
- password = "";\r
- }\r