Changeset 9532 in orxonox.OLD for branches/proxy
- Timestamp:
- Jul 27, 2006, 10:16:34 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/network_stream.cc
r9531 r9532 799 799 assert( offset + INTSIZE <= UDP_PACKET_SIZE ); 800 800 801 // server fakes uniqueid == 0 for handshake 801 // server fakes uniqueid == 0 for handshake synchronizeable 802 802 if ( ( SharedNetworkData::getInstance()->isMasterServer() || 803 803 SharedNetworkData::getInstance()->isProxyServerActive() && peer->second.isClient() ) && 804 804 sync.getUniqueID() <= SharedNetworkData::getInstance()->getMaxPlayer() + 1) // plus one to handle one client more than the max to redirect it 805 n = Converter::intToByteArray( 0, buf + offset, UDP_PACKET_SIZE - offset );805 n = Converter::intToByteArray( SharedNetworkData::getInstance()->getHostID()*1000, buf + offset, UDP_PACKET_SIZE - offset ); 806 806 else 807 807 n = Converter::intToByteArray( sync.getUniqueID(), buf + offset, UDP_PACKET_SIZE - offset ); … … 936 936 while ( offset + 2 * INTSIZE < length ) 937 937 { 938 // read the unique id of the sync 938 939 assert( offset > 0 ); 939 940 assert( Converter::byteArrayToInt( buf + offset, &uniqueId ) == INTSIZE ); 940 941 offset += INTSIZE; 941 942 943 // read the data length 942 944 assert( Converter::byteArrayToInt( buf + offset, &syncDataLength ) == INTSIZE ); 943 945 offset += INTSIZE; … … 951 953 for ( SynchronizeableList::iterator it = synchronizeables.begin(); it != synchronizeables.end(); it++ ) 952 954 { 953 // client thinks his handshake has id 0!!!!! 954 if ( (*it)->getUniqueID() == uniqueId || ( uniqueId == 0 && (*it)->getUniqueID() == peer->second.userId ) ) 955 // client thinks his handshake has a special id: hostId * 1000 (host id of this server) 956 if ( (*it)->getUniqueID() == uniqueId || 957 ( uniqueId == 0 && (*it)->getUniqueID() == peer->second.userId ) ) 955 958 { 956 959 sync = *it;
Note: See TracChangeset
for help on using the changeset viewer.