From f030154fe727e25a2afe1f78b3998c2d2dba95e4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 18 Aug 2009 09:24:15 +0000 Subject: astyle cleanup, corrects not loading of material textures --- src/core/netconnection.h | 52 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 17 deletions(-) (limited to 'src/core/netconnection.h') diff --git a/src/core/netconnection.h b/src/core/netconnection.h index 7c0b23d..36cf154 100644 --- a/src/core/netconnection.h +++ b/src/core/netconnection.h @@ -41,10 +41,10 @@ class NetConnection public: NetConnection(); virtual ~NetConnection(); - + /// connect to a remote host virtual void connect(std::string const &to_host, int to_port); - + /// disconnect from a remote host virtual void disconnect(); @@ -80,28 +80,46 @@ public: void abort(); - inline int fd() const { return connection_fd; } - - inline std::string host() const { return connection_host; } + inline int fd() const { + return connection_fd; + } + + inline std::string host() const { + return connection_host; + } - inline int port() const { return connection_port; } + inline int port() const { + return connection_port; + } - inline bool valid() const { return (connection_fd != -1); } + inline bool valid() const { + return (connection_fd != -1); + } - inline bool invalid() const { return (connection_fd == -1); } + inline bool invalid() const { + return (connection_fd == -1); + } - inline bool error() const { return connection_error; } + inline bool error() const { + return connection_error; + } - inline bool connected() const { return ((connection_fd != -1) && !connection_error); } + inline bool connected() const { + return ((connection_fd != -1) && !connection_error); + } - enum State {Connecting=0, Pending=1, Connected=2}; + enum State {Connecting = 0, Pending = 1, Connected = 2}; + + inline State state() const { + return connection_state; + } - inline State state() const { return connection_state; } - State connection_state; /// return the current game time - inline unsigned long timestamp() const { return connection_timestamp; } + inline unsigned long timestamp() const { + return connection_timestamp; + } protected: /// send a ping reply @@ -121,13 +139,13 @@ protected: /// parse an incoming message void parse_incoming_message(const std::string & message); - + private: - std::string messageblock; + std::string messageblock; std::deque recvq; std::string sendq; fd_set clientset; - + float connection_timeout; float connection_keepalive; int connection_fd; -- cgit v1.2.3