- Timestamp:
- Jul 13, 2006, 3:17:50 PM (18 years ago)
- Location:
- branches/proxy/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/handshake.cc
r9270 r9272 30 30 /* set the class id for the base object */ 31 31 this->setClassID(CL_HANDSHAKE, "Handshake"); 32 33 this->setIsServer( nodeType == NET_MASTER_SERVER);34 32 35 33 // register all variable handlers -
branches/proxy/src/lib/network/network_game_manager.cc
r9257 r9272 168 168 bool NetworkGameManager::delSynchronizeableHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId ) 169 169 { 170 if ( getInstance()->isServer() )170 if ( SharedNetworkData::getInstance()->isMasterServer() ) 171 171 { 172 172 PRINTF(2)("Recieved DeleteSynchronizeable message from client %d!\n", userId); … … 229 229 bool NetworkGameManager::preferedTeamHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId ) 230 230 { 231 assert( NetworkGameManager::getInstance()->isServer() );231 assert( SharedNetworkData::getInstance()->isMasterServer() ); 232 232 233 233 int teamId = 0; … … 261 261 void NetworkGameManager::prefereTeam( int teamId ) 262 262 { 263 if ( isServer() )263 if ( SharedNetworkData::getInstance()->isMasterServer() ) 264 264 setPreferedTeam( SharedNetworkData::getInstance()->getHostID(), teamId ); 265 265 else … … 305 305 { 306 306 PRINTF(0)("NetworkGameManager::chatMessageHandler %d %d\n", userId, SharedNetworkData::getInstance()->getHostID() ); 307 if ( NetworkGameManager::getInstance()->isServer() && userId != SharedNetworkData::getInstance()->getHostID() )307 if ( SharedNetworkData::getInstance()->isMasterServer() && userId != SharedNetworkData::getInstance()->getHostID() ) 308 308 { 309 309 MessageManager::getInstance()->sendMessage( messageId, data, dataLength, RT_ALL_NOT_ME, 0, MP_HIGHBANDWIDTH ); … … 347 347 assert( Converter::stringToByteArray(message, buf+2*INTSIZE, message.length()+INTSIZE) == message.length()+INTSIZE ); 348 348 349 if ( this->isServer() )349 if ( SharedNetworkData::getInstance()->isMasterServer() ) 350 350 MessageManager::getInstance()->sendMessage( MSGID_CHATMESSAGE, buf, message.length()+3*INTSIZE, RT_ALL_ME, 0, MP_HIGHBANDWIDTH ); 351 351 else -
branches/proxy/src/lib/network/network_monitor.cc
r9267 r9272 32 32 NetworkMonitor::NetworkMonitor(NetworkStream* networkStream) 33 33 { 34 34 this->playerNumber = 0; 35 35 } 36 36 … … 49 49 { 50 50 this->clientList.push_back(node); 51 this->playerNumber++; 51 52 } 52 53 … … 57 58 { 58 59 this->proxyServerList.push_back(node); 60 this->playerNumber++; 59 61 } 60 62 … … 65 67 { 66 68 this->masterServerList.push_back(node); 69 this->playerNumber++; 67 70 } 68 71 … … 78 81 { 79 82 this->clientList.erase(it); 83 this->playerNumber--; 80 84 return; 81 85 } … … 96 100 { 97 101 this->proxyServerList.erase(it); 102 this->playerNumber--; 98 103 return; 99 104 } … … 114 119 { 115 120 this->masterServerList.erase(it); 121 this->playerNumber--; 116 122 return; 117 123 } -
branches/proxy/src/lib/network/network_monitor.h
r9269 r9272 45 45 46 46 OrxGui::GLGuiBox* box; 47 48 int playerNumber; //!< total number of players in the game 47 49 }; 48 50 -
branches/proxy/src/lib/network/synchronizeable.cc
r9261 r9272 38 38 this->setClassID(CL_SYNCHRONIZEABLE, "Synchronizeable"); 39 39 this->owner = 0; 40 this->setIsServer(SharedNetworkData::getInstance()->getHostID() == 0);40 // this->setIsServer(SharedNetworkData::getInstance()->getHostID() == 0); 41 41 this->uniqueID = NET_UID_UNASSIGNED; 42 42 this->networkStream = NULL; … … 70 70 this->networkStream->disconnectSynchronizeable(*this); 71 71 72 if ( this->isServer() && this->beSynchronized() && this->getUniqueID() > 0 && !this->isA( CL_MESSAGE_MANAGER ) )72 if ( SharedNetworkData::getInstance()->isMasterServer() && this->beSynchronized() && this->getUniqueID() > 0 && !this->isA( CL_MESSAGE_MANAGER ) ) 73 73 NetworkGameManager::getInstance()->removeSynchronizeable( this->getUniqueID() ); 74 74 } … … 113 113 * @param isServer: the boolean value which the server flag is to set to 114 114 */ 115 void Synchronizeable::setIsServer(bool isServer)116 {117 if( isServer )118 this->state = this->state | STATE_SERVER;119 else120 this->state = this->state & (~STATE_SERVER);121 }115 // void Synchronizeable::setIsServer(bool isServer) 116 // { 117 // if( isServer ) 118 // this->state = this->state | STATE_SERVER; 119 // else 120 // this->state = this->state & (~STATE_SERVER); 121 // } 122 122 123 123 … … 126 126 * @return true, if the server flag is true, false else 127 127 */ 128 bool Synchronizeable::isServer()129 {130 return (this->state & STATE_SERVER) >0;131 }128 // bool Synchronizeable::isServer() 129 // { 130 // return (this->state & STATE_SERVER) >0; 131 // } 132 132 133 133 … … 222 222 { 223 223 hasPermission = ( 224 this->isServer() && (*it)->checkPermission( PERMISSION_MASTER_SERVER ) ||224 SharedNetworkData::getInstance()->isMasterServer() && (*it)->checkPermission( PERMISSION_MASTER_SERVER ) || 225 225 this->owner == SharedNetworkData::getInstance()->getHostID() && (*it)->checkPermission( PERMISSION_OWNER ) || 226 this->isServer() && this->owner != userId && (*it)->checkPermission( PERMISSION_OWNER ) ||226 SharedNetworkData::getInstance()->isMasterServer() && this->owner != userId && (*it)->checkPermission( PERMISSION_OWNER ) || 227 227 (*it)->checkPermission( PERMISSION_ALL ) 228 228 ); -
branches/proxy/src/lib/network/synchronizeable.h
r8708 r9272 51 51 virtual ~Synchronizeable(); 52 52 53 void setIsServer( bool isServer );54 bool isServer();53 // void setIsServer( bool isServer ); 54 // bool isServer(); 55 55 56 56 virtual void varChangeHandler( std::list<int> & id ); … … 61 61 virtual void handleSentState( int userId, int stateId, int fromStateId ); 62 62 virtual void handleRecvState( int userId, int stateId, int fromStateId ); 63 63 64 64 void registerVar( SynchronizeableVar * var ); 65 65 int registerVarId( SynchronizeableVar * var ); … … 82 82 protected: 83 83 NetworkStream* networkStream; //!< reference network stream we are connected to 84 int state;84 // int state; 85 85 86 86 private: -
branches/proxy/src/world_entities/space_ships/space_ship.cc
r9235 r9272 314 314 if( entity->isA(CL_PROJECTILE) && entity != ref) 315 315 { 316 if ( isServer() )316 if ( SharedNetworkData::getInstance()->isMasterServer() ) 317 317 { 318 318 //TODO handle this
Note: See TracChangeset
for help on using the changeset viewer.