Changeset 1767 for code/trunk/src
- Timestamp:
- Sep 11, 2008, 2:31:14 PM (16 years ago)
- Location:
- code/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/network/Client.cc
r1752 r1767 100 100 Synchronisable::setClient(true); 101 101 isConnected=client_connection.createConnection(); 102 if(isConnected){ 103 // COUT(3) << "sending connectrequest" << std::endl; 104 // if(!client_connection.addPacket(pck_gen.generateConnectRequest()) || !client_connection.sendPackets()) 105 // COUT(1) << "could not send connection request !!!!!!!!!" << std::endl; 106 }else 102 if(!isConnected) 107 103 COUT(1) << "could not create connection laber" << std::endl; 108 104 return isConnected; -
code/trunk/src/network/GamestateClient.cc
r1763 r1767 76 76 bool b = saveShipCache(); 77 77 packet::Gamestate *processed = processGamestate(tempGamestate_); 78 assert(processed); 78 if(!processed) 79 return GAMESTATEID_INITIAL; 80 // assert(processed); 79 81 //successfully loaded data from gamestate. now save gamestate for diff and delete the old gs 80 82 tempGamestate_=0; 81 83 gamestateMap_[processed->getID()]=processed; 82 last_diff_ = processed->getBaseID(); 83 last_gamestate_ = processed->getID(); 84 last_diff_ = processed->getID(); 84 85 if(b) 85 86 loadShipCache(); … … 103 104 packet::Gamestate *GamestateClient::getGamestate(){ 104 105 packet::Gamestate *gs = new packet::Gamestate(); 105 gs->collectData( GAMESTATEID_INITIAL);106 gs->collectData(0); 106 107 return gs; 107 108 } … … 133 134 if(myShip_==NULL){ 134 135 myShip_ = orxonox::SpaceShip::getLocalShip(); 136 // COUT(2) << "myShip_: " << myShip_ << " getLocalShip(): " << orxonox::SpaceShip::getLocalShip() << std::endl; 135 137 if(!myShip_) 136 138 return false; … … 151 153 152 154 bool GamestateClient::loadShipCache(){ 155 myShip_=orxonox::SpaceShip::getLocalShip(); //TODO: remove this (only a hack) 153 156 if(myShip_ && shipCache_){ 157 assert(myShip_->getIdentifier()); 154 158 unsigned char *temp = shipCache_; 155 159 myShip_->updateData(temp, 0x2); … … 165 169 if(gs->isDiffed()){ 166 170 packet::Gamestate *base = gamestateMap_[gs->getBaseID()]; 167 assert(base); 171 if(!base) 172 return 0; 173 // assert(base); //TODO: fix this 168 174 packet::Gamestate *undiffed = gs->undiff(base); 169 175 delete gs; -
code/trunk/src/network/packet/Gamestate.cc
r1763 r1767 144 144 return false; 145 145 it=orxonox::ObjectList<Synchronisable>::end(); 146 }else{ 147 if(! it->updateData(mem, mode)) 148 { 149 COUT(1) << "We couldn't update objectID: " \ 150 << objectID << "; classID: " << classID << std::endl; 151 } 146 152 } 147 153 } else -
code/trunk/src/orxonox/objects/SpaceShip.cc
r1758 r1767 77 77 for(it = ObjectList<SpaceShip>::begin(); it; ++it){ 78 78 assert(it->isA(Class(SpaceShip))); 79 if( (it)->myShip_ || (network::Host::running() && network::Host::getShipID()==(it)->objectID) ) 79 if( (it)->myShip_ || (network::Host::running() && network::Host::getShipID()==(it)->objectID) ){ 80 // COUT(1) << "^^^^^^^^^^ myShip_:" << *it << " classname: " << (*it)->getIdentifier()->getName() << " objectid: " << (*it)->objectID << std::endl; 80 81 return *it; 82 } 81 83 } 82 return 0;83 84 return 0; 84 85 } … … 167 168 if(!myShip_){ 168 169 if(network::Host::running()) 169 COUT(3) << "this id: " << this->objectID << " myShipID: " << network::Host::getShipID() << std::endl;170 // COUT(3) << "this id: " << this->objectID << " myShipID: " << network::Host::getShipID() << std::endl; 170 171 if(network::Host::running() && objectID == network::Host::getShipID()){ 171 172 if(!network::Host::isServer())
Note: See TracChangeset
for help on using the changeset viewer.