Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 27, 2006, 7:51:06 PM (18 years ago)
Author:
patrick
Message:

extended the callback function for message handlers to match the new sender/dest message structure

File:
1 edited

Legend:

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

    r9508 r9521  
    166166 * @return true on successfull handling else handler will be called again
    167167 */
    168 bool NetworkGameManager::delSynchronizeableHandler( MessageType messageType, byte * data, int dataLength, void * someData, int userId )
     168bool NetworkGameManager::delSynchronizeableHandler( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId )
    169169{
    170170
     
    172172
    173173  if ( SharedNetworkData::getInstance()->isMasterServer() ||
    174        SharedNetworkData::getInstance()->isProxyServerActive() && SharedNetworkData::getInstance()->isUserClient(userId))
    175   {
    176     PRINTF(0)("Recieved DeleteSynchronizeable message from client %d!\n", userId);
     174       SharedNetworkData::getInstance()->isProxyServerActive() && SharedNetworkData::getInstance()->isUserClient(senderId))
     175  {
     176    PRINTF(0)("Recieved DeleteSynchronizeable message from client %d!\n", senderId);
    177177    return true;
    178178  }
     
    183183  if ( len != dataLength )
    184184  {
    185     PRINTF(2)("Recieved DeleteSynchronizeable message with incorrect size (%d) from client %d!\n", dataLength, userId);
     185    PRINTF(2)("Recieved DeleteSynchronizeable message with incorrect size (%d) from client %d!\n", dataLength, senderId);
    186186    return true;
    187187  }
     
    231231 * @return
    232232 */
    233 bool NetworkGameManager::preferedTeamHandler( MessageType messageType, byte * data, int dataLength, void * someData, int userId )
     233bool NetworkGameManager::preferedTeamHandler( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId )
    234234{
    235235  assert( SharedNetworkData::getInstance()->isMasterServer() /*||  SharedNetworkData::getInstance()->isProxyServerActive()*/);
     
    240240  if ( len != dataLength )
    241241  {
    242     PRINTF(2)("Recieved DeleteSynchronizeable message with incorrect size (%d) from client %d!\n", dataLength, userId);
     242    PRINTF(2)("Recieved DeleteSynchronizeable message with incorrect size (%d) from client %d!\n", dataLength, senderId);
    243243    return true;
    244244  }
    245245
    246   NetworkGameManager::getInstance()->setPreferedTeam( userId, teamId );
     246  NetworkGameManager::getInstance()->setPreferedTeam( senderId, teamId );
    247247
    248248  return true;
     
    314314
    315315
    316 bool NetworkGameManager::chatMessageHandler( MessageType messageType, byte * data, int dataLength, void * someData, int userId )
    317 {
    318   PRINTF(0)("NetworkGameManager::chatMessageHandler %d %d\n", userId, SharedNetworkData::getInstance()->getHostID() );
    319   if ( (SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/) && userId !=  SharedNetworkData::getInstance()->getHostID() )
     316bool NetworkGameManager::chatMessageHandler( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId )
     317{
     318  PRINTF(0)("NetworkGameManager::chatMessageHandler %d %d\n", senderId, SharedNetworkData::getInstance()->getHostID() );
     319  if ( (SharedNetworkData::getInstance()->isMasterServer() /*|| SharedNetworkData::getInstance()->isProxyServerActive()*/) && senderId !=  SharedNetworkData::getInstance()->getHostID() )
    320320  {
    321321    MessageManager::getInstance()->sendMessage( messageType, data, dataLength, RT_ALL_BUT_ME, 0, MP_HIGHBANDWIDTH );
     
    329329  if ( dataLength < 3*INTSIZE )
    330330  {
    331     PRINTF(2)("got too small chatmessage from client %d\n", userId);
     331    PRINTF(2)("got too small chatmessage from client %d\n", senderId);
    332332
    333333    return true;
Note: See TracChangeset for help on using the changeset viewer.