Changeset 9542 in orxonox.OLD for branches/proxy/src
- Timestamp:
- Jul 28, 2006, 10:48:17 AM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/message_manager.cc
r9541 r9542 249 249 recieverType == RT_NOT_USER && SharedNetworkData::getInstance()->getHostID() != destinationId || 250 250 recieverType == RT_USER && SharedNetworkData::getInstance()->getHostID() == destinationId || 251 recieverType == RT_SERVER && SharedNetworkData::getInstance()->isMasterServer()) 251 recieverType == RT_SERVER && SharedNetworkData::getInstance()->isMasterServer() || 252 recieverType == RT_SERVER && SharedNetworkData::getInstance()->isProxyServerActive()) 252 253 { 253 254 … … 417 418 418 419 // relay server special handling 419 if( SharedNetworkData::getInstance()->isMasterServer() && SharedNetworkData::getInstance()->isUserProxyServerActive(it->first)) 420 // if( SharedNetworkData::getInstance()->isMasterServer() && SharedNetworkData::getInstance()->isUserProxyServerActive(it->first)) 421 // { 422 // NetworkMessage msg; 423 // 424 // msg.data = new byte[dataLength]; 425 // memcpy( msg.data, data, dataLength ); 426 // msg.length = dataLength; 427 // msg.messageType = messageType; 428 // msg.number = this->newNumber++; 429 // msg.senderId = SharedNetworkData::getInstance()->getHostID(); 430 // msg.destinationId = reciever; 431 // msg.recieverType = recieverType; 432 // msg.priority = messagePriority; 433 // 434 // it->second.messages.push_back( msg ); 435 // } 436 // // proxy server to master server 437 // else if( SharedNetworkData::getInstance()->isProxyServerActive() && SharedNetworkData::getInstance()->isUserMasterServer(it->first)) 438 // { 439 // NetworkMessage msg; 440 // 441 // msg.data = new byte[dataLength]; 442 // memcpy( msg.data, data, dataLength ); 443 // msg.length = dataLength; 444 // msg.messageType = messageType; 445 // msg.number = this->newNumber++; 446 // msg.senderId = SharedNetworkData::getInstance()->getHostID(); 447 // msg.destinationId = reciever; 448 // msg.recieverType = recieverType; 449 // msg.priority = messagePriority; 450 // 451 // it->second.messages.push_back( msg ); 452 // } 453 // check for every node if the message is for it also 454 /*else*/ if ( 455 recieverType == RT_ALL_ME || 456 recieverType == RT_ALL_BUT_ME || 457 recieverType == RT_USER && it->first == reciever || 458 recieverType == RT_NOT_USER && it->first != reciever || 459 recieverType == RT_SERVER && getNetworkStream()->isUserMasterServer( it->first ) || 460 recieverType == RT_SERVER && getNetworkStream()->isUserProxyServerActive( it->first ) 461 ) 420 462 { 421 463 NetworkMessage msg; … … 433 475 it->second.messages.push_back( msg ); 434 476 } 435 // proxy server to master server436 else if( SharedNetworkData::getInstance()->isProxyServerActive() && SharedNetworkData::getInstance()->isUserMasterServer(it->first))437 {438 NetworkMessage msg;439 440 msg.data = new byte[dataLength];441 memcpy( msg.data, data, dataLength );442 msg.length = dataLength;443 msg.messageType = messageType;444 msg.number = this->newNumber++;445 msg.senderId = SharedNetworkData::getInstance()->getHostID();446 msg.destinationId = reciever;447 msg.recieverType = recieverType;448 msg.priority = messagePriority;449 450 it->second.messages.push_back( msg );451 }452 // check for every node if the message is for it also453 else if (454 recieverType == RT_ALL_ME ||455 recieverType == RT_ALL_BUT_ME ||456 recieverType == RT_USER && it->first == reciever ||457 recieverType == RT_NOT_USER && it->first != reciever ||458 recieverType == RT_SERVER && getNetworkStream()->isUserMasterServer( it->first ) ||459 recieverType == RT_SERVER && getNetworkStream()->isUserProxyServerActive( it->first )460 )461 {462 NetworkMessage msg;463 464 msg.data = new byte[dataLength];465 memcpy( msg.data, data, dataLength );466 msg.length = dataLength;467 msg.messageType = messageType;468 msg.number = this->newNumber++;469 msg.senderId = SharedNetworkData::getInstance()->getHostID();470 msg.destinationId = reciever;471 msg.recieverType = recieverType;472 msg.priority = messagePriority;473 474 it->second.messages.push_back( msg );475 }476 477 477 478 -
branches/proxy/src/lib/network/player_stats.cc
r9541 r9542 163 163 if ( this->playable && userId == SharedNetworkData::getInstance()->getHostID() ) 164 164 { 165 PRINTF(0)(">>>>>>>>>>>>>>>>>>>>>> assign playable %i to user %i (localuser)\n\n\n", this->playable->getUniqueID(), userId);166 165 State::getPlayer()->setPlayable( this->playable ); 167 166 // also set the team id -
branches/proxy/src/lib/network/proxy/proxy_control.cc
r9541 r9542 87 87 assert( Converter::intToByteArray( userId, data + INTSIZE, INTSIZE ) == INTSIZE ); 88 88 89 MessageManager::getInstance()->sendMessage( MSGID_PROXY_NEWCLIENT, data, INTSIZE, RT_ ALL_BUT_ME, NET_UNASSIGNED, MP_HIGHBANDWIDTH );89 MessageManager::getInstance()->sendMessage( MSGID_PROXY_NEWCLIENT, data, INTSIZE, RT_SERVER, NET_UNASSIGNED, MP_HIGHBANDWIDTH ); 90 90 } 91 91 … … 104 104 bool ProxyControl::messageHandlerNewClient( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId ) 105 105 { 106 PRINTF(0)("\n\nulla\n\n"); 106 107 int userId; 107 108 // body data length correct?
Note: See TracChangeset
for help on using the changeset viewer.