summaryrefslogtreecommitdiff
path: root/src/client.h
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-02-13 20:17:42 +0100
committersapier <Sapier at GMX dot net>2014-04-08 21:12:20 +0200
commit142e2d3b74ad886eed83b0fc9d6cfea100dae10a (patch)
tree869bd3599c590e062bc838013b83088280734a81 /src/client.h
parent556bdc260a6938ddab8db22e2ebc4033ec3757eb (diff)
downloadminetest-142e2d3b74ad886eed83b0fc9d6cfea100dae10a.tar.gz
minetest-142e2d3b74ad886eed83b0fc9d6cfea100dae10a.tar.bz2
minetest-142e2d3b74ad886eed83b0fc9d6cfea100dae10a.zip
Cleanup client init states by bumping protocol version
Don't use TOSERVER_RECEIVED_MEDIA but TOSERVER_CLIENT_READY as indicatio for client ready Handle clients with protocol version < 23 (almost) same way as before Make client tell server about it's version Add client state to not send bogus player position updates prior init complete Add access to statistics information (peer connction time,rtt,version) Fix clients standing stalled in world while preloading item visuals (new clients only) Add get_player_information to read client specific information from lua
Diffstat (limited to 'src/client.h')
-rw-r--r--src/client.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/client.h b/src/client.h
index f2e1b86d7..a5fda98d7 100644
--- a/src/client.h
+++ b/src/client.h
@@ -57,6 +57,12 @@ struct QueuedMeshUpdate
~QueuedMeshUpdate();
};
+enum LocalClientState {
+ LC_Created,
+ LC_Init,
+ LC_Ready
+};
+
/*
A thread-safe queue of mesh update tasks
*/
@@ -319,14 +325,7 @@ public:
calling this, as it is sent in the initialization.
*/
void connect(Address address);
- /*
- returns true when
- m_con.Connected() == true
- AND m_server_ser_ver != SER_FMT_VER_INVALID
- throws con::PeerNotFoundException if connection has been deleted,
- eg. timed out.
- */
- bool connectedAndInitialized();
+
/*
Stuff that references the environment is valid only as
long as this is not called. (eg. Players)
@@ -354,6 +353,7 @@ public:
void sendDamage(u8 damage);
void sendBreath(u16 breath);
void sendRespawn();
+ void sendReady();
ClientEnvironment& getEnv()
{ return m_env; }
@@ -454,6 +454,8 @@ public:
// Send a notification that no conventional media transfer is needed
void received_media();
+ LocalClientState getState() { return m_state; }
+
private:
// Virtual methods from con::PeerHandler
@@ -537,6 +539,9 @@ private:
// Storage for mesh data for creating multiple instances of the same mesh
std::map<std::string, std::string> m_mesh_data;
+
+ // own state
+ LocalClientState m_state;
};
#endif // !CLIENT_HEADER