From eb075660e7cb61b138c2da337115c59857f89e17 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 16 Jul 2008 22:55:07 +0000 Subject: network protocol cleanup, radar test (doesn't work) --- src/core/netserver.h | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'src/core/netserver.h') 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 clients; - protected: /// set the error state void abort(); @@ -88,6 +104,8 @@ private: int fdmax; char recbuf[FRAMESIZE]; + + std::list clients; }; } -- cgit v1.2.3