mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
Now texture handling is fast. Also now players are saved on disk.
This commit is contained in:
parent
bd100c5483
commit
64b5975732
23 changed files with 1167 additions and 656 deletions
28
src/player.h
28
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue