Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1361


Ignore:
Timestamp:
May 22, 2008, 2:09:33 PM (17 years ago)
Author:
scheusso
Message:

reverted some changes from previous version

Location:
code/branches/merge/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • code/branches/merge/src/network/ClientInformation.cc

    r1355 r1361  
    5151    preve=0;
    5252    nexte=0;
    53     partialGamestateID_=GAMESTATEID_INITIAL-1;
    5453    this->head_=false;
    5554    synched_=false;
     
    6059    preve=0;
    6160    nexte=0;
    62     partialGamestateID_=GAMESTATEID_INITIAL-1;
    6361    this->head_=head;
    6462    synched_=false;
     
    161159    return true;
    162160  }
    163  
    164   bool ClientInformation::setPartialGamestateID(int id){
    165     boost::recursive_mutex::scoped_lock lock(mutex_);
    166     if(!this)
    167       return false;
    168     partialGamestateID_=id;
    169     return true;
    170   }
    171161
    172162  int ClientInformation::getID() {
     
    213203    if(this)
    214204      return gamestateID_;
    215     else
    216       return -1;
    217   }
    218  
    219   int ClientInformation::getPartialGamestateID() {
    220     boost::recursive_mutex::scoped_lock lock(mutex_);
    221     if(this)
    222       return partialGamestateID_;
    223205    else
    224206      return -1;
  • code/branches/merge/src/network/ClientInformation.h

    r1355 r1361  
    7070    bool setPeer(ENetPeer *peer);
    7171    bool setGamestateID(int id);
    72     bool setPartialGamestateID(int id);
    7372    inline void setShipID(int id){ShipID_=id;}
    7473   
     
    7776    int getID();
    7877    int getGamestateID();
    79     int getPartialGamestateID();
    8078    ENetPeer *getPeer();
    8179    bool getHead();
     
    109107    int clientID_;
    110108    int gamestateID_;
    111     int partialGamestateID_;
    112109    int ShipID_;   // this is the unique objectID
    113110    bool synched_;
  • code/branches/merge/src/network/ConnectionManager.cc

    r1355 r1361  
    193193          addClient(event);
    194194          //this is a workaround to ensure thread safety
     195          /*if(!addFakeConnectRequest(&event))
     196            COUT(3) << "Problem pushing fakeconnectRequest to queue" << std::endl;*/
    195197          COUT(5) << "Con.Man: connection event has occured" << std::endl;
    196198          break;
     
    208210          break;
    209211        case ENET_EVENT_TYPE_NONE:
    210           receiverThread_->yield();
    211212          break;
    212213      }
  • code/branches/merge/src/network/GameStateClient.cc

    r1355 r1361  
    4747    COUT(5) << "this: " << this << std::endl;
    4848    last_diff_=0;
    49     last_gamestate_=GAMESTATEID_INITIAL-1;
    5049  }
    5150
     
    5756    printGameStateMap();
    5857    GameState *gs, *reference;
    59     /*if(compstate->id<last_gamestate_){
    60       // network packets got messed up
    61       COUT(3) << "received an obsolete gamestate" << std::endl;
    62       return false;
    63     }*/
    6458    if(compstate->diffed && compstate->base_id!=GAMESTATEID_INITIAL){
    6559      std::map<int, GameState*>::iterator it = gameStateMap.find(compstate->base_id);
     
    8377        COUT(4) << "adding decoded gs with id: " << gs->id << " diffed from: " << gs->base_id << std::endl;
    8478        last_diff_=gs->base_id;
    85         //last_gamestate_=gs->id;
    8679        return true;
    8780      }else{
     
    156149          Synchronisable *no = dynamic_cast<Synchronisable *>(id->fabricate());
    157150          COUT(4) << "loadsnapshot: classid: " << sync.classID << " objectID: " << sync.objectID << " length: " << sync.length << std::endl;
    158           if(!no){
    159             COUT(2) << "coudl not frabricate classid: " << sync.classID << " objectID: " << sync.objectID << " identifier: " << id << std::endl;
    160             break;
    161           }
    162151          no->objectID=sync.objectID;
    163152          no->classID=sync.classID;
  • code/branches/merge/src/network/GameStateClient.h

    r1355 r1361  
    7171
    7272    int           last_diff_;
    73     int           last_gamestate_;
    7473    std::map<int, GameState *> gameStateMap;
    7574   
  • code/branches/merge/src/network/GameStateManager.cc

    r1355 r1361  
    221221    orxonox::Iterator<Synchronisable> it=orxonox::ObjectList<Synchronisable>::start();
    222222    syncData sync;
    223     /*ClientInformation *client = head_->findClient(clientID);
    224     if(client)
    225       if(client->getPartialGamestateID()>state->id){
    226         COUT(3) << "we received an obsolete partial gamestate" << std::endl;
    227         return false;
    228       }
    229     else;*/
    230         //what should we do now ??
    231223    // loop as long as we have some data ;)
    232224    while(data < state->data+state->size){
     
    276268      ++it;
    277269    }
    278     //client->setPartialGamestateID(state->id);
     270   
    279271    return true;
    280272  }
     
    436428      return;
    437429    int curid = temp->getGamestateID();
    438     if(curid > gamestateID)
    439       // the network packets got messed up
    440       return;
    441430    COUT(4) << "acking gamestate " << gamestateID << " for clientid: " << clientID << " curid: " << curid << std::endl;
    442431    // decrease usage of gamestate and save it
  • code/branches/merge/src/network/PacketManager.h

    r1355 r1361  
    5858    PacketGenerator();
    5959    //call one of this functions out of an instance of PacketGenerator to create a packet
    60     ENetPacket* acknowledgement( int state, int reliable = 0 ); // we do not want reliability
     60//    ENetPacket* acknowledgement( int state, int reliable = 0 );
     61    ENetPacket* acknowledgement( int state, int reliable = ENET_PACKET_FLAG_RELIABLE );
    6162    ENetPacket* command( int dataLength, void *data, int reliable = ENET_PACKET_FLAG_RELIABLE );
    6263    ENetPacket* mousem( double x, double y, int reliable = ENET_PACKET_FLAG_RELIABLE );
    6364    ENetPacket* keystrike( char press, int reliable = ENET_PACKET_FLAG_RELIABLE );
    6465    ENetPacket* chatMessage( const char* message, int reliable = ENET_PACKET_FLAG_RELIABLE );
    65     ENetPacket* gstate( GameStateCompressed *states, int reliable = 0 ); // we do not want reliability of gamestates
     66    ENetPacket* gstate( GameStateCompressed *states, int reliable = ENET_PACKET_FLAG_RELIABLE );
     67//    ENetPacket* gstate( GameStateCompressed *states, int reliable = 0 );
    6668    ENetPacket* clid( int classid, std::string classname, int reliable = ENET_PACKET_FLAG_RELIABLE );
    6769    ENetPacket* generateWelcome( int clientID,int shipID, bool allowed, int reliable = ENET_PACKET_FLAG_RELIABLE );
  • code/branches/merge/src/network/Synchronisable.cc

    r1355 r1361  
    156156    if(classID==0)
    157157      COUT(3) << "classid 0 " << this->getIdentifier()->getName() << std::endl;
    158     this->classID=this->getIdentifier()->getNetworkID();
     158    classID=this->getIdentifier()->getNetworkID();
    159159    std::list<synchronisableVariable *>::iterator i;
    160160    syncData retVal;
  • code/branches/merge/src/orxonox/objects/WorldEntity.cc

    r1355 r1361  
    156156      registerVar( (void*) &(this->getAcceleration().y), sizeof(this->getAcceleration().y), network::DATA, 0x3);
    157157      registerVar( (void*) &(this->getAcceleration().z), sizeof(this->getAcceleration().z), network::DATA, 0x3);
    158       registerVar( (void*) &(this->getMomentum()), sizeof(this->getMomentum()), network::DATA);
     158      registerVar( (void*) &(this->getMomentum()), sizeof(this->getMomentum()), network::DATA, 0x3);
    159159    }
    160160
Note: See TracChangeset for help on using the changeset viewer.