diff options
author | Ciaran Gultnieks <ciaran@ciarang.com> | 2011-05-20 20:28:03 +0100 |
---|---|---|
committer | Ciaran Gultnieks <ciaran@ciarang.com> | 2011-05-20 20:28:03 +0100 |
commit | d4d49ee8f4d425e7a4136d65f519728869680951 (patch) | |
tree | 432202d226ebf03de47210ea5172d589815ab47e /src/player.cpp | |
parent | b5ceaf445a68b9cda47fbd4246f074aa0a1d3966 (diff) | |
download | minetest-d4d49ee8f4d425e7a4136d65f519728869680951.tar.gz minetest-d4d49ee8f4d425e7a4136d65f519728869680951.tar.bz2 minetest-d4d49ee8f4d425e7a4136d65f519728869680951.zip |
Passwords - password entry at main menu, stored and checked by server
Diffstat (limited to 'src/player.cpp')
-rw-r--r-- | src/player.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/player.cpp b/src/player.cpp index 3f92e899c..539244709 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -87,6 +87,7 @@ Player::Player(): m_position(0,0,0) { updateName("<not set>"); + updatePassword(""); resetInventory(); } @@ -145,6 +146,7 @@ void Player::serialize(std::ostream &os) Settings args; args.setS32("version", 1); args.set("name", m_name); + args.set("password", m_password); args.setFloat("pitch", m_pitch); args.setFloat("yaw", m_yaw); args.setV3F("position", m_position); @@ -179,6 +181,10 @@ void Player::deSerialize(std::istream &is) //args.getS32("version"); std::string name = args.get("name"); updateName(name.c_str()); + std::string password = ""; + if(args.exists("password")) + password = args.get("password"); + updatePassword(password.c_str()); m_pitch = args.getFloat("pitch"); m_yaw = args.getFloat("yaw"); m_position = args.getV3F("position"); |