Changeset 6301 in orxonox.OLD for branches/network/src/lib
- Timestamp:
- Dec 26, 2005, 12:47:14 PM (19 years ago)
- Location:
- branches/network/src/lib/network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_game_manager.cc
r6275 r6301 50 50 51 51 newUniqueID = MAX_CONNECTIONS + 2; 52 53 hasRequestedWorld = false; 52 54 } 53 55 … … 73 75 byte b; 74 76 75 while ( i<length -1)77 while ( i<length ) 76 78 { 77 79 b = data[i++]; … … 135 137 } 136 138 139 if ( b == REQUEST_ENTITY_LIST ) 140 { 141 PRINTF(0)("sending THE list\n"); 142 sendEntityList( sender ); 143 continue; 144 } 145 137 146 //if we get her something with data is wrong 138 147 PRINTF(1)("Data is not in the right format! i=%d\n", i); … … 143 152 int NetworkGameManager::readBytes(byte* data, int maxLength, int * reciever) 144 153 { 154 if ( !isServer() && !hasRequestedWorld ) 155 { 156 SYNCHELP_WRITE_BEGIN(); 157 byte b = REQUEST_ENTITY_LIST; 158 SYNCHELP_WRITE_BYTE( b ); 159 hasRequestedWorld = true; 160 return SYNCHELP_WRITE_N; 161 } 145 162 for ( int i = 0; i<outBuffer.size(); i++ ) 146 163 { -
branches/network/src/lib/network/network_game_manager.h
r6273 r6301 31 31 * //REQUEST_CREATE_LIST: NUMBER, [UNIQUE_ID][0..NUMBER] 32 32 * 33 * REQUEST_ENTITY_LIST: //request the whole world :D 33 34 * REQUEST_SYNC: UNIQUE_ID 34 35 * //REQUEST_SYNC_LIST: NUMBER, [UNIQUE_ID][0..NUMBER] … … 46 47 REQUEST_REMOVE, 47 48 REQUEST_SYNC, 48 YOU_ARE_ENTITY 49 YOU_ARE_ENTITY, 50 REQUEST_ENTITY_LIST 49 51 }; 50 52 … … 122 124 123 125 int newUniqueID; 126 bool hasRequestedWorld; 124 127 }; 125 128 -
branches/network/src/lib/network/network_protocol.cc
r6298 r6301 97 97 PRINTF(5)("extract Header\n"); 98 98 //Test if received data can contain a header 99 if (length < headerLength)99 if (length < 2*INTSIZE) 100 100 { 101 101 PRINTF(1)("Received data is to short; it can't contain a header!\n"); -
branches/network/src/lib/network/network_stream.cc
r6297 r6301 187 187 else 188 188 { 189 this->networkGameManager->sendEntityList( i );189 //this->networkGameManager->sendEntityList( i ); 190 190 } 191 191 PRINT(0)("handshake finished id=%d\n", handshakes[i]->getNetworkGameManagerId()); … … 232 232 if ( header->synchronizeableID < this->maxConnections+2 ) 233 233 { 234 PRINTF(0)("RESET UNIQUEID TO 0\n");234 if ( !isServer() ) PRINTF(0)("RESET UNIQUEID TO 0\n"); 235 235 header->synchronizeableID = 0; 236 236 } 237 237 else 238 238 { 239 PRINTF(0)("UNIQUEID=%d\n", header->synchronizeableID);239 if ( !isServer() ) PRINTF(0)("UNIQUEID=%d\n", header->synchronizeableID); 240 240 } 241 241
Note: See TracChangeset
for help on using the changeset viewer.