Changeset 7825
- Timestamp:
- Dec 29, 2010, 11:41:51 PM (14 years ago)
- Location:
- code/branches/network6/src/libraries/network
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network6/src/libraries/network/ClientConnection.cc
r7823 r7825 42 42 43 43 ClientConnection::ClientConnection(): 44 Connection(NETWORK_PEER_ID_SERVER), 44 45 established_(false), 45 46 server_(NULL) -
code/branches/network6/src/libraries/network/Connection.cc
r7824 r7825 43 43 const boost::posix_time::millisec NETWORK_COMMUNICATION_THREAD_WAIT_TIME(20); 44 44 45 Connection::Connection( ):46 host_(0), bCommunicationThreadRunning_(false), nextPeerID_( NETWORK_PEER_ID_SERVER+1)45 Connection::Connection(uint32_t firstPeerID): 46 host_(0), bCommunicationThreadRunning_(false), nextPeerID_(firstPeerID) 47 47 { 48 48 enet_initialize(); -
code/branches/network6/src/libraries/network/Connection.h
r7823 r7825 105 105 106 106 protected: 107 Connection( );107 Connection(uint32_t firstPeerID = NETWORK_PEER_ID_SERVER+1); 108 108 109 109 void startCommunicationThread(); -
code/branches/network6/src/libraries/network/GamestateManager.cc
r7801 r7825 149 149 newID = ++id_; 150 150 else 151 { 152 assert(peerMap_.size()!=0); 151 153 newID = peerMap_[NETWORK_PEER_ID_SERVER].lastProcessedGamestateID; 154 } 152 155 153 156 if(!currentGamestate_->collectData(newID, gsMode)){ //we have no data to send … … 172 175 continue; 173 176 } 174 COUT( 4) << "client id: " << peerIt->first << std::endl;177 COUT(5) << "client id: " << peerIt->first << std::endl; 175 178 COUT(5) << "Server: doing gamestate gamestate preparation" << std::endl; 176 179 int peerID = peerIt->first; //get client id … … 244 247 // assert(b); 245 248 clock.capture(); 246 COUT( 4) << "diff and compress time: " << clock.getDeltaTime() << endl;249 COUT(5) << "diff and compress time: " << clock.getDeltaTime() << endl; 247 250 // COUT(5) << "sending gamestate with id " << gs->getID(); 248 251 // if(gamestate->isDiffed()) -
code/branches/network6/src/libraries/network/packet/Gamestate.cc
r7801 r7825 107 107 uint32_t size = calcGamestateSize(id, mode); 108 108 109 COUT( 4) << "G.ST.Man: producing gamestate with id: " << id << std::endl;109 COUT(5) << "G.ST.Man: producing gamestate with id: " << id << std::endl; 110 110 if(size==0) 111 111 return false; -
code/branches/network6/src/libraries/network/synchronisable/Synchronisable.cc
r7801 r7825 295 295 * @param mem pointer to the bytestream 296 296 * @param mode same as in getData 297 * @param forceCallback FIXME - add doc!297 * @param forceCallback this makes updateData call each callback 298 298 * @return true/false 299 299 */ … … 372 372 * This function determines, wheter the object should be saved to the bytestream (according to its syncmode/direction) 373 373 * @param id gamestate id 374 * @param mode FIXME - add doc!374 * @param mode Synchronisation mode (toclient, toserver or bidirectional) 375 375 * @return true/false 376 376 */ 377 377 bool Synchronisable::doSync(int32_t id, uint8_t mode) 378 378 { 379 if(mode==0x0) 380 mode=state_; 379 // if(mode==0x0) 380 // mode=state_; 381 assert(mode!=0x0); 381 382 return ( (this->objectMode_ & mode)!=0 && (!syncList_.empty() ) ); 382 383 }
Note: See TracChangeset
for help on using the changeset viewer.