- Timestamp:
- Dec 19, 2010, 2:27:06 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network5/src/libraries/network/packet/Gamestate.cc
r7759 r7777 36 36 #include "network/synchronisable/Synchronisable.h" 37 37 #include "network/GamestateHandler.h" 38 #include "network/Host.h" 38 39 39 40 namespace orxonox { … … 44 45 45 46 // #define PACKET_FLAG_GAMESTATE PacketFlag::Unsequenced 46 //#define PACKET_FLAG_GAMESTATE 047 #define PACKET_FLAG_GAMESTATE PacketFlag::Reliable47 #define PACKET_FLAG_GAMESTATE 0 48 // #define PACKET_FLAG_GAMESTATE PacketFlag::Reliable 48 49 49 50 inline bool memzero( uint8_t* data, uint32_t datalength) … … 138 139 assert(0); // if we don't use multithreading this part shouldn't be neccessary 139 140 // start allocate additional memory 140 COUT(3) << "G .St.Man: need additional memory" << std::endl;141 COUT(3) << "Gamestate: need additional memory" << std::endl; 141 142 ObjectList<Synchronisable>::iterator temp = it; 142 143 uint32_t addsize=tempsize; … … 165 166 //stop write gamestate header 166 167 167 COUT(5) << "G .ST.Man: Gamestate size: " << currentsize << std::endl;168 COUT(5) << "G .ST.Man: 'estimated' (and corrected) Gamestate size: " << size << std::endl;168 COUT(5) << "Gamestate: Gamestate size: " << currentsize << std::endl; 169 COUT(5) << "Gamestate: 'estimated' (and corrected) Gamestate size: " << size << std::endl; 169 170 return true; 170 171 } … … 173 174 bool Gamestate::spreadData(uint8_t mode) 174 175 { 175 COUT( 4) << "processing gamestate with id " << header_.getID() << endl;176 COUT(5) << "processing gamestate with id " << header_.getID() << endl; 176 177 assert(data_); 177 178 assert(!header_.isCompressed()); … … 204 205 } 205 206 } 207 assert(mem-data_ == GamestateHeader::getSize()+header_.getDataSize()); 208 206 209 // In debug mode, check first, whether there are no duplicate objectIDs 207 210 #ifndef NDEBUG … … 269 272 270 273 271 bool Gamestate::process( )272 { 273 return GamestateHandler::addGamestate(this, getClientID());274 bool Gamestate::process(orxonox::Host* host) 275 { 276 return host->addGamestate(this, getPeerID()); 274 277 } 275 278 … … 585 588 586 589 587 Gamestate *g = new Gamestate(newData, get ClientID());590 Gamestate *g = new Gamestate(newData, getPeerID()); 588 591 (g->header_) = header_; 589 592 g->header_.setBaseID( base->getID() ); … … 757 760 758 761 759 uint32_t Gamestate::calcGamestateSize( int32_t id, uint8_t mode)762 uint32_t Gamestate::calcGamestateSize(uint32_t id, uint8_t mode) 760 763 { 761 764 uint32_t size = 0;
Note: See TracChangeset
for help on using the changeset viewer.