Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9494 in orxonox.OLD for trunk/src/lib/network/shared_network_data.h


Ignore:
Timestamp:
Jul 27, 2006, 10:44:28 AM (18 years ago)
Author:
bensch
Message:

merged the proxy back

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/network/shared_network_data.h

    r9406 r9494  
    1414#define NET_MAX_CONNECTIONS 2
    1515
    16 class NetworkStream;
     16
    1717class Synchronizeable;
    1818
     
    2828
    2929    /** @returns the next uniqueID free for an object */
    30     inline int getNewUniqueID() { return ( this->nodeType != NET_CLIENT)?this->newUniqueID++:-1; }
     30    inline int getNewUniqueID() { return ( isMasterServer())?this->newUniqueID++:-1; }
    3131    /** sets the @param newUniqueID: the new offset for the next unique id */
    3232    inline void setNewUniqueID(int newUniqueID) { this->newUniqueID = newUniqueID; }
    3333
     34    /** sets the game server flag @param bGameServer true if it is a game server */
     35    inline void setNodeType(int nodeType) { this->nodeType = nodeType; }
    3436    /** @returns true is this node is a master server */
    3537    inline bool isMasterServer() { return this->nodeType == NET_MASTER_SERVER; }
    3638    /** @returns true is this node is a proxy server */
    37     inline bool isProxyServer() { return this->nodeType == NET_PROXY_SERVER_ACTIVE; }
     39    inline bool isProxyServerActive() { return this->nodeType == NET_PROXY_SERVER_ACTIVE; }
    3840    /** @returns true is this node is a client*/
    3941    inline bool isClient() { return this->nodeType == NET_CLIENT; }
    40     /** sets the game server flag @param bGameServer true if it is a game server */
    41     inline void setNodeType(int nodeType) { this->nodeType = nodeType; }
     42
     43    /** @return true if this user is connected to the local host */
     44    bool isUserLocal( int userID);
     45    /** @returns true if this user is a master server */
     46    bool isUserMasterServer( int userID );
     47    /** @returns true if this user is a proxy server */
     48    bool isUserProxyServerActive( int userID );
     49    /** @returns true if this user is a client */
     50    bool isUserClient( int userID );
     51
    4252
    4353    /** @returns the maximum number of players for this server */
Note: See TracChangeset for help on using the changeset viewer.