Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 11, 2008, 11:09:01 PM (16 years ago)
Author:
scheusso
Message:

trafficControl working now, but further tweaking in diff and priorities is needed

Location:
code/branches/presentation/src/network
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/network/TrafficControl.cc

    r2387 r2413  
    6868        TrafficControl::TrafficControl()
    6969        {
    70     RegisterRootObject(TrafficControl);
     70    RegisterObject(TrafficControl);
    7171          assert(instance_==0);
    7272          instance_=this;
    73 //     targetSize = 2500;//5000bytes
    74     SetConfigValue ( targetSize, 28000./25. );
     73    this->setConfigValues();
    7574        }
    7675       
     
    8887*Definition of public members
    8988*/
     89
     90  void TrafficControl::setConfigValues()
     91  {
     92    SetConfigValue ( targetSize, 5000 );
     93  }
    9094
    9195  /**
     
    261265      else
    262266      {
    263 //         COUT(0) << "cut" << endl;
     267        COUT(0) << "cut" << endl;
    264268        clientListPerm_[currentClientID][(*itvec).objID].objValueSched += SCHED_PRIORITY_OFFSET; // NOTE: SCHED_PRIORITY_OFFSET is negative
    265269//         ittemp = itvec;
     
    399403  }
    400404 
    401   void TrafficControl::priRemoveClient(int clientID)
     405  void TrafficControl::clientDisconnected(unsigned int clientID)
    402406  {
    403407    assert(clientListTemp_.find(clientID) != clientListTemp_.end() );
     
    405409    clientListTemp_.erase(clientListTemp_.find(clientID));
    406410    clientListPerm_.erase(clientListPerm_.find(clientID));
    407   }
    408   void TrafficControl::pubRemoveClient(int clientID)
    409   {
    410     priRemoveClient(clientID);
    411411  }
    412412
  • code/branches/presentation/src/network/TrafficControl.h

    r2387 r2413  
    3838#include "util/Integers.h"
    3939#include "core/OrxonoxClass.h"
     40#include "network/ClientConnectionListener.h"
    4041
    4142namespace orxonox {
     
    7980*
    8081*/
    81 class TrafficControl : public OrxonoxClass{
     82class TrafficControl : public ClientConnectionListener {
    8283  private:
    8384
     
    141142    void evaluateList(unsigned int clientID, std::list<obj> *list);//done   
    142143    void ack(unsigned int clientID, unsigned int gamestateID);  // this function gets called when the server receives an ack from the client
    143     void priRemoveClient(int clientID);
     144   
     145    //ClientConnectionListener functions
     146    virtual void clientConnected(unsigned int clientID){};
     147    virtual void clientDisconnected(unsigned int clientID);
     148
    144149 
    145150  protected:
     
    155160    *Elements of struct i are therefore: *list[i].objID
    156161    */
     162    void setConfigValues();
    157163    static TrafficControl *getInstance();
    158164    void processObjectList(unsigned int clientID, unsigned int gamestateID, std::list<obj>* list); //gets a pointer to the list (containing objectIDs) and sorts it
     
    166172    void printList(std::list<obj> *list, unsigned int clientID);
    167173    void fixCreatorDependencies(std::list<obj>::iterator it, std::list<obj> *list, unsigned int clientID);
    168     void pubRemoveClient(int clientID);
    169174};
    170175
Note: See TracChangeset for help on using the changeset viewer.