summaryrefslogtreecommitdiff
path: root/src/player.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-01-28 01:38:16 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-01-28 01:38:16 +0200
commit64b59757322e29c331c0a75262baec4382673e6f (patch)
treeb1404f42db92b92202655bdd4f13a6c4c7fdd39d /src/player.h
parentbd100c5483eb77a27eeac4e476c81a1bf6afc710 (diff)
downloadminetest-64b59757322e29c331c0a75262baec4382673e6f.tar.gz
minetest-64b59757322e29c331c0a75262baec4382673e6f.tar.bz2
minetest-64b59757322e29c331c0a75262baec4382673e6f.zip
Now texture handling is fast. Also now players are saved on disk.
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/player.h b/src/player.h
index 9330bdd54..5ab027e0a 100644
--- a/src/player.h
+++ b/src/player.h
@@ -29,6 +29,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define PLAYERNAME_SIZE 20
+#define PLAYERNAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,"
+
class Map;
class Player
@@ -37,6 +39,8 @@ public:
Player();
virtual ~Player();
+ void resetInventory();
+
//void move(f32 dtime, Map &map);
virtual void move(f32 dtime, Map &map) = 0;
@@ -100,6 +104,14 @@ public:
// NOTE: Use peer_id == 0 for disconnected
/*virtual bool isClientConnected() { return false; }
virtual void setClientConnected(bool) {}*/
+
+ /*
+ serialize() writes a bunch of text that can contain
+ any characters except a '\0', and such an ending that
+ deSerialize stops reading exactly at the right point.
+ */
+ void serialize(std::ostream &os);
+ void deSerialize(std::istream &is);
bool touching_ground;
bool in_water;
@@ -119,8 +131,6 @@ protected:
class ServerRemotePlayer : public Player
{
public:
- /*ServerRemotePlayer(bool client_connected):
- m_client_connected(client_connected)*/
ServerRemotePlayer()
{
}
@@ -137,18 +147,6 @@ public:
{
}
- /*virtual bool isClientConnected()
- {
- return m_client_connected;
- }
- virtual void setClientConnected(bool client_connected)
- {
- m_client_connected = client_connected;
- }
-
- // This
- bool m_client_connected;*/
-
private:
};
@@ -252,7 +250,7 @@ private:
v3f m_showpos;
};
-#endif
+#endif // !SERVER
#ifndef SERVER
struct PlayerControl