- Timestamp:
- Jul 28, 2006, 12:42:36 PM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/message_manager.cc
r9555 r9562 291 291 msg.recieverType = (RecieverType)recieverType; 292 292 293 this->sendMessage(msg.messageType, msg.data, msg.length, msg.recieverType, msg. destinationId, MP_HIGHBANDWIDTH);293 this->sendMessage(msg.messageType, msg.data, msg.length, msg.recieverType, msg.senderId = senderId, msg.destinationId, MP_HIGHBANDWIDTH); 294 294 } 295 295 } … … 396 396 } 397 397 398 399 398 400 /** 399 401 * send a message to one or more clients … … 411 413 void MessageManager::sendMessage( MessageType messageType, byte * data, int dataLength, RecieverType recieverType, int reciever, MessagePriority messagePriority ) 412 414 { 415 this->sendMessage(messageType, data, dataLength, recieverType, SharedNetworkData::getInstance()->getHostID(), reciever, messagePriority); 416 } 417 418 419 /** 420 * send a message to one or more clients as a special client 421 * recieverType: 422 * RT_ALL send to all users. reciever is ignored 423 * RT_USER send only to reciever 424 * RT_NOT_USER send to all but reciever 425 * 426 * @param messageType message id 427 * @param data pointer to data 428 * @param dataLength length of data 429 * @param recieverType type of the receiver 430 * @param sender the userId of the sender if there is need for shadowing it (eg. for msg forwarding) 431 * @param reciever the userId of the receiver if needed (depends on the ReceiverType) 432 */ 433 void MessageManager::sendMessage( MessageType messageType, byte * data, int dataLength, RecieverType recieverType, int sender, int reciever, MessagePriority messagePriority ) 434 { 413 435 PRINTF(0)(" >>> MessageManager: sending msg with type: %i, recieverType: %i, reciever %i\n", messageType, recieverType, reciever); 414 436 … … 417 439 { 418 440 419 // relay server special handling 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 ( 441 if ( 455 442 recieverType == RT_ALL_ME || 456 443 recieverType == RT_ALL_BUT_ME || … … 468 455 msg.messageType = messageType; 469 456 msg.number = this->newNumber++; 470 msg.senderId = SharedNetworkData::getInstance()->getHostID();457 msg.senderId = sender; 471 458 msg.destinationId = reciever; 472 459 msg.recieverType = recieverType; … … 490 477 msg.messageType = messageType; 491 478 msg.number = SharedNetworkData::getInstance()->getHostID(); 492 msg.senderId = SharedNetworkData::getInstance()->getHostID();479 msg.senderId = sender; 493 480 msg.destinationId = reciever; 494 481 msg.recieverType = recieverType; -
branches/proxy/src/lib/network/message_manager.h
r9538 r9562 103 103 104 104 void sendMessage( MessageType messageType, byte * data, int dataLength, RecieverType recieverType, int reciever, MessagePriority messagePriority ); 105 void sendMessage( MessageType messageType, byte * data, int dataLength, RecieverType recieverType, int sender, int reciever, MessagePriority messagePriority ); 105 106 106 107 void initUser( int userId );
Note: See TracChangeset
for help on using the changeset viewer.