Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 27, 2006, 8:37:24 PM (18 years ago)
Author:
patrick
Message:

of course clients shouldn't forward any messages. forgot one message handling case

File:
1 edited

Legend:

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

    r9522 r9523  
    228228    {
    229229
    230 //       RT_ALL_BUT_ME = 1,   //!< message is sent to all users but myself
    231 //       RT_ALL_ME,           //!< message is sent to all users
    232 //       RT_USER,             //!< message is only sent to reciever
    233 //       RT_NOT_USER,         //!< message is sent to all but reciever
    234 //       RT_SERVER
    235 
    236230      // find out if this message is addressed for this client too
    237231      if( messageType == RT_ALL_BUT_ME ||
    238232          messageType == RT_ALL_ME ||
     233          messageType == RT_NOT_USER && SharedNetworkData::getInstance()->getHostID() != destinationId ||
    239234          messageType == RT_USER  && SharedNetworkData::getInstance()->getHostID() == destinationId ||
    240235          messageType == RT_SERVER && SharedNetworkData::getInstance()->isMasterServer())
     
    265260      else
    266261      {
    267         PRINTF(0)("===========>> Forwarding Message\n");
    268         NetworkMessage msg;
    269 
    270         msg.data = new byte[messageLength];
    271         memcpy( msg.data, data + i, messageLength );
    272         msg.length = messageLength;
    273         msg.messageType = (MessageType)messageType;
    274         msg.number = userId;
    275         msg.senderId = senderId;
    276         msg.destinationId = destinationId;
    277 
    278         incomingMessageQueue.push_back( msg );
     262        // forwarding the messages but only if its not a client
     263        if( !SharedNetworkData::getInstance()->isClient())
     264        {
     265          PRINTF(0)("===========>> Forwarding Message\n");
     266          NetworkMessage msg;
     267
     268          msg.data = new byte[messageLength];
     269          memcpy( msg.data, data + i, messageLength );
     270          msg.length = messageLength;
     271          msg.messageType = (MessageType)messageType;
     272          msg.number = userId;
     273          msg.senderId = senderId;
     274          msg.destinationId = destinationId;
     275
     276          incomingMessageQueue.push_back( msg );
     277        }
    279278      }
    280279    }
Note: See TracChangeset for help on using the changeset viewer.