diff options
author | Stijn Buys <ingar@osirion.org> | 2008-07-16 22:55:07 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-07-16 22:55:07 +0000 |
commit | eb075660e7cb61b138c2da337115c59857f89e17 (patch) | |
tree | 0fe031a8f3562b22f61d0f95b740fe5f2326fd7b /src/core/netserver.h | |
parent | fecc54ad8c5a108831c2bc268f9dd7e16b511b7e (diff) |
network protocol cleanup, radar test (doesn't work)
Diffstat (limited to 'src/core/netserver.h')
-rw-r--r-- | src/core/netserver.h | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/core/netserver.h b/src/core/netserver.h index a83229c..25bca5f 100644 --- a/src/core/netserver.h +++ b/src/core/netserver.h @@ -52,17 +52,33 @@ public: /// transmit data to clients void transmit(); - /// broadcast network data to all clients - void broadcast(std::string const & message, Player *ignore_player=0); + /// broadcast a message + void broadcast_message(const char *channel, std::string const & message, Player *ignore_player=0); - /// send network data to one client - void send(NetClient * client, std::string const & message); + /// send a message to a single client + void send_message(NetClient *client, const char *channel, std::string const & message); + + /// broadcast a server frame message + void broadcast_frame(float timestamp, float previoustimestamp); + + /// broadcast a delete entity event + void broadcast_entity_delete(Entity *entity); + + /// broadcast a create entity event + void broadcast_entity_create(Entity *entity); + + /// broadcast a update entity event + void broadcast_entity_update(Entity *entity); + + /// broadcast updated player information, if necessary + void broadcast_player_update(); + + /// send an update player information message to a single client + void send_player_update(NetClient *client); /// find the client corresponding to a player NetClient *find_client(Player const *player); - std::list<NetClient *> clients; - protected: /// set the error state void abort(); @@ -88,6 +104,8 @@ private: int fdmax; char recbuf[FRAMESIZE]; + + std::list<NetClient *> clients; }; } |