diff options
author | Ciaran Gultnieks <ciaran@ciarang.com> | 2011-05-22 21:09:12 +0100 |
---|---|---|
committer | Ciaran Gultnieks <ciaran@ciarang.com> | 2011-05-22 21:09:12 +0100 |
commit | a8a3271470299820c5322523dc439415bc1ff8a0 (patch) | |
tree | a397578ce7032efe25298b4c653a3dcebd180579 /src/main.cpp | |
parent | e0329a3caee863a2302748f710401bfc0dfa78db (diff) | |
download | minetest-a8a3271470299820c5322523dc439415bc1ff8a0.tar.gz minetest-a8a3271470299820c5322523dc439415bc1ff8a0.tar.bz2 minetest-a8a3271470299820c5322523dc439415bc1ff8a0.zip |
Added the ability to change your password (via pause menu)
--HG--
extra : rebase_source : e8ec407f60711d42d33be4811b2880088f617b5b
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/main.cpp b/src/main.cpp index c3b075732..2913d019d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -353,8 +353,6 @@ Making it more portable: #include "materials.h"
#include "game.h"
#include "keycode.h"
-#include "sha1.h"
-#include "base64.h"
// This makes textures
ITextureSource *g_texturesource = NULL;
@@ -1468,24 +1466,7 @@ int main(int argc, char *argv[]) playername = wide_to_narrow(menudata.name);
- // Get an sha-1 hash of the player's name combined with
- // the password entered. That's what the server uses as
- // their password. (Exception : if the password field is
- // blank, we send a blank password - this is for backwards
- // compatibility with password-less players).
- if(menudata.password.length() > 0)
- {
- std::string slt=playername + wide_to_narrow(menudata.password);
- SHA1 *sha1 = new SHA1();
- sha1->addBytes(slt.c_str(), slt.length());
- unsigned char *digest = sha1->getDigest();
- password = base64_encode(digest, 20);
- free(digest);
- }
- else
- {
- password = "";
- }
+ password = translatePassword(playername, menudata.password);
address = wide_to_narrow(menudata.address);
int newport = stoi(wide_to_narrow(menudata.port));
|