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>2009-08-18 09:24:15 +0000
committerStijn Buys <ingar@osirion.org>2009-08-18 09:24:15 +0000
commitf030154fe727e25a2afe1f78b3998c2d2dba95e4 (patch)
treecd92baf9e4fa8a136523b9eb570e9811846c9250 /src/core/netserver.h
parent5636fad174f0bcff857c357c394c4cc8d424b302 (diff)
astyle cleanup, corrects not loading of material textures
Diffstat (limited to 'src/core/netserver.h')
-rw-r--r--src/core/netserver.h44
1 files changed, 26 insertions, 18 deletions
diff --git a/src/core/netserver.h b/src/core/netserver.h
index e54ea2e..afbb5a0 100644
--- a/src/core/netserver.h
+++ b/src/core/netserver.h
@@ -21,7 +21,7 @@
#include "core/player.h"
#include "core/info.h"
-namespace core
+namespace core
{
/// network server
@@ -32,26 +32,34 @@ public:
typedef std::list<NetClient *> Clients;
/// create a new network server, listening on host:port
- NetServer(std::string const host, unsigned int const port);
+ NetServer(std::string const host, unsigned int const port);
/// disconnect clients and shutdown the network server
- ~NetServer();
-
-/*----- inspectors ------------------------------------------------ */
+ ~NetServer();
+
+ /*----- inspectors ------------------------------------------------ */
/// Returns true if the TCP server has a valid file descriptor
- inline bool valid() const { return netserver_fd != -1; }
-
+ inline bool valid() const {
+ return netserver_fd != -1;
+ }
+
/// Returns true if the TCP server has an invalid file descriptor
- inline bool invalid() const { return netserver_fd == -1; }
-
+ inline bool invalid() const {
+ return netserver_fd == -1;
+ }
+
/// Returns the error state of the TCP server
- inline bool error() const { return netserver_error; }
+ inline bool error() const {
+ return netserver_error;
+ }
/// Return the socket file descriptor
- inline int fd() const { return netserver_fd; }
+ inline int fd() const {
+ return netserver_fd;
+ }
-/*----- mutators -------------------------------------------------- */
+ /*----- mutators -------------------------------------------------- */
/// run a network server frame
void frame(unsigned long timestamp);
@@ -74,7 +82,7 @@ protected:
/// send a create entity event
void send_entity_create(NetClient *client, Entity *entity);
-
+
/// broadcast a delete entity event
void send_entity_delete(NetClient *client, Entity *entity);
@@ -99,14 +107,14 @@ protected:
/// set the error state
void abort();
- /// called when a new client connects
- NetClient *client_connect(std::string const host, int const port);
+ /// called when a new client connects
+ NetClient *client_connect(std::string const host, int const port);
/// called when a client has send the intial handshake
void client_initialize(NetClient *client);
- /// remove terminated clients
- void reap();
+ /// remove terminated clients
+ void reap();
/// parse incoming client messages
void parse_incoming_message(NetClient *client, const std::string & message);
@@ -124,7 +132,7 @@ private:
char recbuf[FRAMESIZE];
- Clients clients;
+ Clients clients;
};
}