summaryrefslogtreecommitdiff
path: root/src/player.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-05-21 01:11:58 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-05-21 01:11:58 +0300
commit76e241392d2ad232b751c74df7cba9e5acfa7855 (patch)
treee58f72b379c1a4e1b86a4e85c6c0007109635b32 /src/player.h
parent73a18b9271bebddfe6716529bb13cad30869bc16 (diff)
parent52d857cf1527948e1db5eead457e51b6741de8a2 (diff)
downloadminetest-76e241392d2ad232b751c74df7cba9e5acfa7855.tar.gz
minetest-76e241392d2ad232b751c74df7cba9e5acfa7855.tar.bz2
minetest-76e241392d2ad232b751c74df7cba9e5acfa7855.zip
Merge: New map directory structure and player passwords
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h13
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;