Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 31, 2006, 2:04:13 PM (18 years ago)
Author:
rennerc
Message:

added two missing files

File:
1 edited

Legend:

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

    r8014 r8024  
    5757
    5858  this->setSynchronized(true);
    59 
     59 
     60  MessageManager::getInstance()->registerMessageHandler( MSGID_DELETESYNCHRONIZEABLE, delSynchronizeableHandler, NULL );
    6061}
    6162
     
    121122
    122123
     124/**
     125 * handler for remove synchronizeable messages
     126 * @param messageId
     127 * @param data
     128 * @param dataLength
     129 * @param someData
     130 * @param userId
     131 * @return true on successfull handling else handler will be called again
     132 */
     133bool NetworkGameManager::delSynchronizeableHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId )
     134{
     135  if ( getInstance()->isServer() )
     136  {
     137    PRINTF(2)("Recieved DeleteSynchronizeable message from client %d!\n", userId);
     138    return true;
     139  }
     140 
     141  int uniqueId = 0;
     142  int len = Converter::byteArrayToInt( data, &uniqueId );
     143 
     144  if ( len != dataLength )
     145  {
     146    PRINTF(2)("Recieved DeleteSynchronizeable message with incorrect size (%d) from client %d!\n", dataLength, userId);
     147    return true;
     148  }
     149 
     150  const std::list<BaseObject*> * list = ClassList::getList( CL_SYNCHRONIZEABLE );
     151 
     152  for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
     153  {
     154    if ( dynamic_cast<Synchronizeable*>(*it)->getUniqueID() == uniqueId )
     155    {
     156      delete dynamic_cast<Synchronizeable*>(*it);
     157      return true;
     158    }
     159  }
     160}
     161
     162/**
     163 * removes synchronizeable (also on clients)
     164 * @param uniqueId uniqueid to delete
     165 */
     166void NetworkGameManager::removeSynchronizeable( int uniqueId )
     167{
     168}
    123169
    124170
    125171
    126172
     173
Note: See TracChangeset for help on using the changeset viewer.