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.h | |
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.h')
-rw-r--r-- | src/player.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/player.h b/src/player.h index be93766fd..925252e49 100644 --- a/src/player.h +++ b/src/player.h @@ -25,6 +25,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "collision.h" #define PLAYERNAME_SIZE 20 +#define PASSWORD_SIZE 28 // Maximum password length. Allows for + // base64-encoded SHA-1. #define PLAYERNAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.," @@ -121,6 +123,16 @@ public: return m_name; } + virtual void updatePassword(const char *password) + { + snprintf(m_password, PASSWORD_SIZE, "%s", password); + } + + const char * getPassword() + { + return m_password; + } + virtual bool isLocal() const = 0; virtual void updateLight(u8 light_at_pos) {}; @@ -157,6 +169,7 @@ public: protected: char m_name[PLAYERNAME_SIZE]; + char m_password[PASSWORD_SIZE]; f32 m_pitch; f32 m_yaw; v3f m_speed; |