Changeset 9347 in orxonox.OLD for branches/proxy/src/lib/network/shared_network_data.h
- Timestamp:
- Jul 20, 2006, 11:43:27 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/shared_network_data.h
r6695 r9347 8 8 9 9 #include "base_object.h" 10 #include "netdefs.h" 11 #include "proxy/proxy_settings.h" 10 12 11 13 12 14 class NetworkStream; 13 15 class Synchronizeable; 14 template<typename> 15 class tList; 16 16 17 17 18 /* and here is the class itsself*/ … … 25 26 26 27 /** @returns the next uniqueID free for an object */ 27 inline int getNewUniqueID() { return ( this-> bGameServer)?this->newUniqueID++:-1; }28 inline int getNewUniqueID() { return ( this->nodeType != NET_CLIENT)?this->newUniqueID++:-1; } 28 29 29 /** @returns true is this node is a game server */ 30 inline bool isGameServer() { return this->bGameServer; } 30 /** @returns true is this node is a master server */ 31 inline bool isMasterServer() { return this->nodeType == NET_MASTER_SERVER; } 32 /** @returns true is this node is a proxy server */ 33 inline bool isProxyServer() { return this->nodeType == NET_PROXY_SERVER_ACTIVE; } 34 /** @returns true is this node is a client*/ 35 inline bool isClient() { return this->nodeType == NET_CLIENT; } 31 36 /** sets the game server flag @param bGameServer true if it is a game server */ 32 inline void setGameServer(bool bGameServer) { this->bGameServer = bGameServer; } 37 inline void setNodeType(int nodeType) { this->nodeType = nodeType; } 38 39 /** @returns the maximum number of players for this server */ 40 inline int getMaxPlayer() { return ProxySettings::getInstance()->getMaxPlayer(); } 33 41 34 42 /** @returns the hostID of the node */ … … 49 57 private: 50 58 int newUniqueID; //!< next uniqueID 51 bool bGameServer; //!< true if it is a server 59 int nodeType; //!< saves the node type here 60 52 61 int hostID; //!< The Host-ID of the Manager 53 62 NetworkStream* defaultSyncStream; //!< default synchronize NetworkStream
Note: See TracChangeset
for help on using the changeset viewer.