Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9492 in orxonox.OLD for branches/proxy/src/lib/network


Ignore:
Timestamp:
Jul 26, 2006, 3:14:17 PM (18 years ago)
Author:
patrick
Message:

extended the sharednetworkdata inteface. now synchronizeables should also be removed on proxy servers by message handling

Location:
branches/proxy/src/lib/network
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/message_manager.h

    r9491 r9492  
    4040enum RecieverType
    4141{
    42   RT_ALL_BUT_ME = 1,   //!< message is sent to all users
     42  RT_ALL_BUT_ME = 1,   //!< message is sent to all users but myself
    4343  RT_ALL_ME,           //!< message is sent to all users
    4444  RT_USER,             //!< message is only sent to reciever
  • branches/proxy/src/lib/network/network_game_manager.cc

    r9491 r9492  
    168168bool NetworkGameManager::delSynchronizeableHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId )
    169169{
    170   if ( SharedNetworkData::getInstance()->isMasterServer() ||  SharedNetworkData::getInstance()->isProxyServerActive())
     170  if ( SharedNetworkData::getInstance()->isMasterServer() ||
     171       SharedNetworkData::getInstance()->isProxyServerActive() && SharedNetworkData::getInstance()->isUserClient(userId))
    171172  {
    172173    PRINTF(2)("Recieved DeleteSynchronizeable message from client %d!\n", userId);
  • branches/proxy/src/lib/network/shared_network_data.cc

    r9409 r9492  
    1919#include "netdefs.h"
    2020#include "state.h"
     21
     22#include "network_stream.h"
    2123
    2224#include "debug.h"
     
    5153  SharedNetworkData::singletonRef = NULL;
    5254}
     55
     56
     57
     58/** @return true if this user is connected to the local host */
     59bool SharedNetworkData::isUserLocal( int userID)
     60{
     61  return this->defaultSyncStream->isUserLocal(userID);
     62}
     63
     64
     65/** @returns true if this user is a master server */
     66bool SharedNetworkData::isUserMasterServer( int userID )
     67{
     68  return this->defaultSyncStream->isUserMasterServer(userID);
     69}
     70
     71
     72/** @returns true if this user is a proxy server */
     73bool SharedNetworkData::isUserProxyServerActive( int userID )
     74{
     75   return this->defaultSyncStream->isUserProxyServerActive(userID);
     76}
     77
     78
     79/** @returns true if this user is a client */
     80bool SharedNetworkData::isUserClient( int userID )
     81{
     82  return this->defaultSyncStream->isUserClient(userID);
     83}
  • branches/proxy/src/lib/network/shared_network_data.h

    r9470 r9492  
    1414#define NET_MAX_CONNECTIONS 2
    1515
    16 class NetworkStream;
     16
    1717class Synchronizeable;
    1818
     
    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; }
     
    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.