Changeset 8024 in orxonox.OLD for branches/network
- Timestamp:
- May 31, 2006, 2:04:13 PM (18 years ago)
- Location:
- branches/network/src
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/message_manager.h
r7984 r8024 28 28 enum MessageId 29 29 { 30 TESTMESSAGEID = 1 30 TESTMESSAGEID = 1, 31 MSGID_DELETESYNCHRONIZEABLE 31 32 }; 32 33 -
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 -
branches/network/src/lib/network/network_game_manager.h
r7984 r8024 52 52 53 53 54 bool signalNewPlayer(int userId); 55 bool signalLeftPlayer(int userID); 54 bool signalNewPlayer( int userId ); 55 bool signalLeftPlayer( int userID ); 56 57 void removeSynchronizeable( int uniqueId ); 56 58 57 59 … … 59 61 NetworkGameManager(); 60 62 61 static bool youAreHandler(MessageId messageId, byte * data, int dataLength, void * someData, int userId );63 static bool delSynchronizeableHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId ); 62 64 63 65 static NetworkGameManager* singletonRef; -
branches/network/src/util/signal_handler.cc
r7461 r8024 81 81 assert( pid != -1 ); 82 82 83 83 84 if ( pid == 0 ) 84 85 { 85 86 getInstance()->dontCatch(); 86 87 87 88 sleep(2); 88 89 89 90 90 return; … … 92 92 else 93 93 { 94 getInstance()->dontCatch(); 94 95 if ( getInstance()->type == GDB_RUN_WRITE_TO_FILE && fork() == 0 ) 95 96 {
Note: See TracChangeset
for help on using the changeset viewer.