Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9509 in orxonox.OLD for branches/proxy


Ignore:
Timestamp:
Jul 27, 2006, 3:55:22 PM (18 years ago)
Author:
patrick
Message:

starting special implementation for message forwarding (pipeing)

File:
1 edited

Legend:

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

    r9508 r9509  
    324324void MessageManager::sendMessage( MessageType messageType, byte * data, int dataLength, RecieverType recieverType, int reciever, MessagePriority messagePriority )
    325325{
    326 
     326  // go through all outgoing message queues and add the message if its appropriate
    327327  for ( MessageQueue::iterator it = this->outgoingMessageQueue.begin(); it != this->outgoingMessageQueue.end(); it++ )
    328328  {
     329    // check for every node if the message is for it also
    329330    if (
    330331         recieverType == RT_ALL_ME ||
     
    332333         recieverType == RT_USER && it->first == reciever ||
    333334         recieverType == RT_NOT_USER && it->first != reciever ||
    334          recieverType == RT_SERVER && getNetworkStream()->isUserMasterServer( it->first ) ||
    335          recieverType == RT_SERVER && getNetworkStream()->isUserProxyServerActive( it->first )
     335         recieverType == RT_SERVER && getNetworkStream()->isUserMasterServer( it->first )
    336336       )
    337337    {
     
    342342      msg.length = dataLength;
    343343      msg.messageType = messageType;
    344       msg.number = newNumber++;
     344      msg.number = this->newNumber++;
    345345      msg.priority = messagePriority;
    346346
    347347      it->second.messages.push_back( msg );
    348348    }
    349   }
    350 
     349
     350    // relay server special handling
     351    if( SharedNetworkData::getInstance()->isMasterServer() && SharedNetworkData::getInstance()->isUserProxyServerActive(it->first))
     352    {
     353      NetworkMessage msg;
     354
     355      msg.data = new byte[dataLength];
     356      memcpy( msg.data, data, dataLength );
     357      msg.length = dataLength;
     358      msg.messageType = messageType;
     359      msg.number = this->newNumber++;
     360      msg.priority = messagePriority;
     361
     362      it->second.messages.push_back( msg );
     363    }
     364  }
     365
     366
     367  // if the message is also for myself, handle it here
    351368  if ( recieverType == RT_ALL_ME )
    352369  {
Note: See TracChangeset for help on using the changeset viewer.