Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-08-04 18:24:36 +0000
committerStijn Buys <ingar@osirion.org>2008-08-04 18:24:36 +0000
commit50a1e2b2fe3c207c7227df4941f2f66990db0c2c (patch)
tree5c4293babed4434d81cf9284f522dd0e74482cf0 /src/core/netserver.h
parentebd5cd9daabb2d2eb6f5e06f9433cc8e6a4e0f7a (diff)
network protocol version 5, netserver per-client updates, zone change protocol
Diffstat (limited to 'src/core/netserver.h')
-rw-r--r--src/core/netserver.h45
1 files changed, 21 insertions, 24 deletions
diff --git a/src/core/netserver.h b/src/core/netserver.h
index 2340a5d..4dcae69 100644
--- a/src/core/netserver.h
+++ b/src/core/netserver.h
@@ -48,49 +48,43 @@ public:
/*----- mutators -------------------------------------------------- */
+ /// run a network server frame
+ void frame(float timestamp, float previoustimestamp);
+
/// receive data from clients
void receive();
- /// transmit data to clients
- void transmit();
-
/// broadcast a message
void broadcast_message(const char *channel, std::string const & message, Player *ignore_player=0);
- /// send a message to a single client
+ /// send a message to a client
void send_message(NetClient *client, const char *channel, std::string const & message);
- /// disconnect a single client
+ /// disconnect a client
void send_disconnect(NetClient *client);
- /// broadcast a server frame message
- void broadcast_frame(float timestamp, float previoustimestamp);
-
- /// broadcast a delete entity event
- void broadcast_entity_delete(Entity *entity);
+ /// find the client corresponding to a player
+ NetClient *find_client(Player const *player);
- /// broadcast a create entity event
- void broadcast_entity_create(Entity *entity);
+protected:
+ /// send a server frame marker
+ void send_frame_marker(NetClient *client, float timestamp, float previoustimestamp);
- /// send a create entity event to a single player
+ /// send a create entity event
void send_entity_create(NetClient *client, Entity *entity);
-
- /// send a zone update event to a single player
- void send_zone_update(NetClient *client, Zone *zone);
+
+ /// broadcast a delete entity event
+ void send_entity_delete(NetClient *client, Entity *entity);
/// broadcast a update entity event
- void broadcast_entity_update(Entity *entity);
+ void send_entity_update(NetClient *client, Entity *entity);
- /// broadcast updated player information, if necessary
- void broadcast_player_update();
+ /// send a zone update event
+ void send_zone_update(NetClient *client, Zone *zone);
- /// send an update player information message to a single client
+ /// send an update player information message
void send_player_update(NetClient *client);
- /// find the client corresponding to a player
- NetClient *find_client(Player const *player);
-
-protected:
/// set the error state
void abort();
@@ -106,6 +100,9 @@ protected:
/// parse incoming client messages
void parse_incoming_message(NetClient *client, const std::string & message);
+ /// send a server frame to a single client
+ void client_frame(NetClient *client, float timestamp, float previoustimestamp);
+
private:
bool netserver_error;
int netserver_fd;