Changeset 8024 in orxonox.OLD for branches/network/src/lib/network/network_game_manager.cc
- Timestamp:
- May 31, 2006, 2:04:13 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_game_manager.cc
r8014 r8024 57 57 58 58 this->setSynchronized(true); 59 59 60 MessageManager::getInstance()->registerMessageHandler( MSGID_DELETESYNCHRONIZEABLE, delSynchronizeableHandler, NULL ); 60 61 } 61 62 … … 121 122 122 123 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 */ 133 bool 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 */ 166 void NetworkGameManager::removeSynchronizeable( int uniqueId ) 167 { 168 } 123 169 124 170 125 171 126 172 173
Note: See TracChangeset
for help on using the changeset viewer.