diff options
author | Stijn Buys <ingar@osirion.org> | 2008-08-04 18:24:36 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-08-04 18:24:36 +0000 |
commit | 50a1e2b2fe3c207c7227df4941f2f66990db0c2c (patch) | |
tree | 5c4293babed4434d81cf9284f522dd0e74482cf0 /src/core/entity.h | |
parent | ebd5cd9daabb2d2eb6f5e06f9433cc8e6a4e0f7a (diff) |
network protocol version 5, netserver per-client updates, zone change protocol
Diffstat (limited to 'src/core/entity.h')
-rw-r--r-- | src/core/entity.h | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/core/entity.h b/src/core/entity.h index 2515796..feb99f7 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -109,7 +109,7 @@ public: inline float radius() const { return entity_radius; } /// serialize the entity to a stream - virtual void serialize(std::ostream & os) const; + virtual void serialize_server_create(std::ostream & os) const; /// serialize a client-to-server update on a stream virtual void serialize_client_update(std::ostream & os) const; @@ -123,6 +123,9 @@ public: /// receive a client-to-server update from a stream virtual void receive_client_update(std::istream &is); + /// receive a server-to-client create from a stream + virtual void receive_server_create(std::istream &is); + /// receive a server-to-client update from a stream virtual void receive_server_update(std::istream &is); @@ -150,6 +153,9 @@ public: /// find an entity in the registry static Entity *find(unsigned int id); + /// add an entity to the registry + static void add(Entity *ent, unsigned int it); + /// erase an entity from the registry and delete it static void erase(unsigned int entity_id); @@ -191,9 +197,6 @@ private: // add an entity to the registry static void add(Entity *ent); - // add an entity to the registry - static void add(Entity *ent, unsigned int it); - // the id is set by add() unsigned int entity_id; @@ -224,7 +227,7 @@ public: inline float speed() const { return entity_speed; } /// serialize the entity to a stream - virtual void serialize(std::ostream & os) const; + virtual void serialize_server_create(std::ostream & os) const; /// serialize a client-to-server update on a stream virtual void serialize_client_update(std::ostream & os) const ; @@ -237,6 +240,9 @@ public: /// receive a client-to-server update from a stream virtual void receive_client_update(std::istream &is); + /// receive a server-to-client create from a stream + virtual void receive_server_create(std::istream &is); + /// receive a server-to-client update from a stream virtual void receive_server_update(std::istream &is); @@ -278,7 +284,7 @@ public: inline float thrust() const { return entity_thrust; } /// serialize the entity to a stream - virtual void serialize(std::ostream & os) const; + virtual void serialize_server_create(std::ostream & os) const; /// serialize a client-to-server update on a stream virtual void serialize_client_update(std::ostream & os) const; @@ -295,6 +301,9 @@ public: /// receive a client-to-server update from a stream virtual void receive_client_update(std::istream &is); + /// receive a server-to-client create from a stream + virtual void receive_server_create(std::istream &is); + /// receive a server-to-client update from a stream virtual void receive_server_update(std::istream &is); @@ -354,7 +363,11 @@ public: ~EntityGlobe(); - virtual void serialize(std::ostream & os) const; + /// serialize the entity to a stream + virtual void serialize_server_create(std::ostream & os) const; + + /// receive a server-to-client create from a stream + virtual void receive_server_create(std::istream &is); inline const std::string &texture() const { return entity_texture; } |