- Timestamp:
- May 11, 2006, 8:05:17 AM (19 years ago)
- Location:
- branches/network/src/lib/network
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/handshake.cc
r7565 r7591 79 79 return; 80 80 } 81 else 82 localState.completed = true; 81 83 } 82 84 … … 90 92 return; 91 93 } 94 else 95 localState.completed = true; 92 96 } 93 97 -
branches/network/src/lib/network/handshake.h
r7565 r7591 34 34 inline bool completed(){ return localState.completed != 0 && remoteState.completed != 0; } 35 35 inline bool ok(){ return localState.error == 0 && remoteState.error == 0; } 36 inline int getHostId(){ return localState.hostId; }37 inline int getNetworkGameManagerId(){ return localState.networkManagerId; }38 inline void doReject( std::string reason ){ remoteState.error = 1; remoteState.errorString = "the server rejected your connection ["+ reason +"]"; }36 inline int getHostId(){ return remoteState.hostId; } 37 inline int getNetworkGameManagerId(){ return remoteState.networkManagerId; } 38 inline void doReject( std::string reason ){ localState.error = 1; localState.errorString = "the server rejected your connection ["+ reason +"]"; } 39 39 40 40 virtual void varChangeHandler( std::list<int> & id ); -
branches/network/src/lib/network/network_stream.cc
r7578 r7591 142 142 peers[0].handshake = hs; 143 143 // peers[0].handshake->setSynchronized( true ); 144 this->connectSynchronizeable(*hs);144 //this->connectSynchronizeable(*hs); 145 145 //this->connectSynchronizeable(*hs); 146 146 PRINTF(0)("NetworkStream: Handshake created: %s\n", hs->getName()); … … 508 508 { 509 509 Synchronizeable & sync = **it; 510 510 511 511 if ( !sync.beSynchronized() || sync.getUniqueID() < 0 ) 512 512 continue; … … 515 515 if ( peer->second.handshake && sync.getLeafClassID() != CL_HANDSHAKE ) 516 516 continue; 517 518 PRINTF(0)("syncing: id:%d name:%s\n", sync.getUniqueID(), sync.getClassName()); 519 517 518 if ( isServer() && sync.getLeafClassID() == CL_HANDSHAKE && sync.getUniqueID() != peer->second.userId ) 519 continue; 520 520 521 assert( offset + INTSIZE <= UDP_PACKET_SIZE ); 521 522 … … 644 645 } 645 646 } 646 647 647 offset += sync->setStateDiff( peer->second.userId, buf+offset, length-offset, state, fromState ); 648 648 } -
branches/network/src/lib/network/synchronizeable.cc
r7578 r7591 126 126 while ( it != sentStates[userId].end() && (*it)->stateId < fromStateId ) 127 127 it++; 128 ///FIXED: altered begin() -> end() 129 if ( it != sentStates[userId]. end() )128 129 if ( it != sentStates[userId].begin() ) 130 130 { 131 131 for ( StateHistory::iterator it2 = sentStates[userId].begin(); it2 != it; it2++ ) … … 209 209 210 210 sentStates[userId].push_back( stateTo ); 211 212 assert( i == neededSize ); 211 213 212 214 //write diff to data … … 229 231 * @param stateId id of current state 230 232 * @param fromStateId id of the base state id 231 * @return true on success233 * @return number bytes read 232 234 * @todo check for permissions 233 235 */ 234 boolSynchronizeable::setStateDiff( int userId, byte* data, int length, int stateId, int fromStateId )236 int Synchronizeable::setStateDiff( int userId, byte* data, int length, int stateId, int fromStateId ) 235 237 { 236 238 //make sure this user has his history … … 309 311 this->varChangeHandler( changes ); 310 312 311 return length;313 return i; 312 314 } 313 315 -
branches/network/src/lib/network/synchronizeable.h
r7565 r7591 63 63 64 64 int getStateDiff( int userId, byte* data, int maxLength, int stateId, int fromStateId, int priorityTH ); 65 boolsetStateDiff( int userId, byte* data, int length, int stateId, int fromStateId );65 int setStateDiff( int userId, byte* data, int length, int stateId, int fromStateId ); 66 66 67 67 void registerVar( SynchronizeableVar * var );
Note: See TracChangeset
for help on using the changeset viewer.