- Timestamp:
- Jan 24, 2006, 1:36:11 PM (19 years ago)
- Location:
- branches/network/src/lib/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_game_manager.cc
r6662 r6665 84 84 if ( isServer() ) 85 85 { 86 if ( b == REQUEST_CREATE )86 if ( b == NET_REQUEST_CREATE ) 87 87 { 88 88 if ( !handleRequestCreate( i, data, length, sender ) ) … … 90 90 continue; 91 91 } 92 if ( b == REQUEST_REMOVE )92 if ( b == NET_REQUEST_REMOVE ) 93 93 { 94 94 if ( !handleRequestRemove( i, data, length, sender ) ) … … 99 99 else 100 100 { 101 if ( b == CREATE_ENTITY )101 if ( b == NET_CREATE_ENTITY ) 102 102 { 103 103 PRINTF(0)("CREATE_ENTITY\n"); … … 106 106 continue; 107 107 } 108 if ( b == REMOVE_ENTITY )108 if ( b == NET_REMOVE_ENTITY ) 109 109 { 110 110 if ( !handleRemoveEntity( i, data, length, sender ) ) … … 112 112 continue; 113 113 } 114 if ( b == CREATE_ENTITY_LIST )114 if ( b == NET_CREATE_ENTITY_LIST ) 115 115 { 116 116 if ( !handleCreateEntityList( i, data, length, sender ) ) … … 118 118 continue; 119 119 } 120 if ( b == REMOVE_ENTITY_LIST )120 if ( b == NET_REMOVE_ENTITY_LIST ) 121 121 { 122 122 if ( !handleRemoveEntityList( i, data, length, sender ) ) … … 124 124 continue; 125 125 } 126 if ( b == YOU_ARE_ENTITY )126 if ( b == NET_YOU_ARE_ENTITY ) 127 127 { 128 128 if ( !handleYouAreEntity( i, data, length, sender ) ) … … 132 132 } 133 133 134 if ( b == REQUEST_ENTITY_LIST )134 if ( b == NET_REQUEST_ENTITY_LIST ) 135 135 { 136 136 sendEntityList( sender ); … … 138 138 } 139 139 140 if ( b == REQUEST_SYNC )140 if ( b == NET_REQUEST_SYNC ) 141 141 { 142 142 if ( !handleRequestSync( i, data, length, sender ) ) … … 261 261 } 262 262 else 263 263 264 { 264 265 PRINTF(1)("This node is not a server and cannot create id %x\n", element->Value()); … … 298 299 continue; 299 300 300 if ( !writeToClientBuffer( outBuffer[i], (byte) REQUEST_CREATE ) )301 if ( !writeToClientBuffer( outBuffer[i], (byte)NET_REQUEST_CREATE ) ) 301 302 return; 302 303 if ( !writeToClientBuffer( outBuffer[i], (int)classID ) ) … … 316 317 continue; 317 318 318 if ( !writeToClientBuffer( outBuffer[i], (byte) REQUEST_REMOVE ) )319 if ( !writeToClientBuffer( outBuffer[i], (byte)NET_REQUEST_REMOVE ) ) 319 320 return; 320 321 if ( !writeToClientBuffer( outBuffer[i], uniqueID ) ) … … 335 336 continue; 336 337 337 if ( !writeToClientBuffer( outBuffer[i], (byte) CREATE_ENTITY ) )338 if ( !writeToClientBuffer( outBuffer[i], (byte)NET_CREATE_ENTITY ) ) 338 339 return -1; 339 340 if ( !writeToClientBuffer( outBuffer[i], (int)classID ) ) … … 362 363 continue; 363 364 364 if ( !writeToClientBuffer( outBuffer[i], (byte) REMOVE_ENTITY ) )365 if ( !writeToClientBuffer( outBuffer[i], (byte)NET_REMOVE_ENTITY ) ) 365 366 return; 366 367 if ( !writeToClientBuffer( outBuffer[i], uniqueID ) ) … … 397 398 e = this->networkStream->getSyncEnd(); 398 399 399 if ( !writeToClientBuffer( outBuffer[userID], (byte) CREATE_ENTITY_LIST ) )400 if ( !writeToClientBuffer( outBuffer[userID], (byte)NET_CREATE_ENTITY_LIST ) ) 400 401 return; 401 402 … … 485 486 s->setUniqueID( uniqueID ); 486 487 s->setOwner( owner ); 488 s->setSynchronized(true); 487 489 //this->networkStream->connectSynchronizeable( *s ); 488 490 if ( !isServer() ) -
branches/network/src/lib/network/network_game_manager.h
r6634 r6665 19 19 * protocol definition 20 20 * 21 * CREATE_ENTITY: CLASS_ID, UNIQUE_ID, OWNER22 * REMOVE_ENTITY: UNIQUE_ID21 * CREATE_ENTITY: >> CLASS_ID, UNIQUE_ID, OWNER 22 * REMOVE_ENTITY: >> UNIQUE_ID 23 23 * 24 * CREATE_ENTITY_LIST: NUMBER, [CLASS_ID, UNIQUE_ID, OWNER][0..NUMBER]25 * REMOVE_ENTITY_LIST: NUMBER, [UNIQUE_ID][0..NUMBER]24 * CREATE_ENTITY_LIST: >> NUMBER, [CLASS_ID, UNIQUE_ID, OWNER][0..NUMBER] 25 * REMOVE_ENTITY_LIST: >> NUMBER, [UNIQUE_ID][0..NUMBER] 26 26 * 27 * REQUEST_CREATE: CLASS_ID 28 * REQUEST_REMOVE: UNIQUE_ID 27 * REQUEST_CREATE: >> CLASS_ID 28 * << [Sync Info] 29 * REQUEST_REMOVE: >> UNIQUE_ID 30 * << [Sync Info] 29 31 * 30 32 * //REQUEST_CREATE_LIST: NUMBER, [CLASS_ID][0..NUMBER] … … 32 34 * 33 35 * REQUEST_ENTITY_LIST: //request the whole world :D 34 * REQUEST_SYNC: UNIQUE_ID 36 * REQUEST_SYNC: >> UNIQUE_ID 37 * << [Sync Info] 35 38 * //REQUEST_SYNC_LIST: NUMBER, [UNIQUE_ID][0..NUMBER] 36 39 * 37 * YOU_ARE_ENTITY: UNIQUE_ID 40 * YOU_ARE_ENTITY: >> UNIQUE_ID 41 * 42 * REQUEST_PNODE_PATH >> UNIQUE_ID_START UNIQUE_ID_STOP 43 * << UNIQUE_ID_1 UNIQUE_ID_2 UNIQUE_ID_3 ... UNIQUE_ID_N 38 44 * 39 45 */ 40 46 41 47 typedef enum NetworkGameManagerProtocol{ 42 CREATE_ENTITY = 0, 43 REMOVE_ENTITY, 44 CREATE_ENTITY_LIST, 45 REMOVE_ENTITY_LIST, 46 REQUEST_CREATE, 47 REQUEST_REMOVE, 48 REQUEST_SYNC, 49 YOU_ARE_ENTITY, 50 REQUEST_ENTITY_LIST 48 NET_CREATE_ENTITY = 0, 49 NET_REMOVE_ENTITY, 50 NET_CREATE_ENTITY_LIST, 51 NET_REMOVE_ENTITY_LIST, 52 NET_REQUEST_CREATE, 53 NET_REQUEST_REMOVE, 54 NET_REQUEST_SYNC, 55 NET_YOU_ARE_ENTITY, 56 NET_REQUEST_ENTITY_LIST, 57 NET_REQUEST_PNODE_PATH, 58 59 NET_NUMBER 51 60 }; 52 61 -
branches/network/src/lib/network/network_manager.cc
r6662 r6665 163 163 if( static_cast<NetworkStream*>(*stream)->isActive()) 164 164 static_cast<NetworkStream*>(*stream)->processData(); 165 166 165 } 167 168 166 } 169 167
Note: See TracChangeset
for help on using the changeset viewer.