Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 10, 2008, 3:36:36 PM (16 years ago)
Author:
scheusso
Message:

changes in trafficcontrol:

  • configvalue for targetsize (size of each gamestate)
Location:
code/branches/presentation/src/network
Files:
6 edited

Legend:

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

    r2381 r2382  
    5656  GamestateManager::GamestateManager() {
    5757    id_=0;
     58    trafficControl_ = new TrafficControl();
    5859  }
    5960
    6061  GamestateManager::~GamestateManager() {
     62    delete trafficControl_;
    6163  }
    6264
  • code/branches/presentation/src/network/GamestateManager.h

    r2171 r2382  
    4343#include "NetworkPrereqs.h"
    4444#include "GamestateHandler.h"
     45#include "TrafficControl.h"
    4546#include <map>
    4647
     
    8990    std::map<unsigned int, packet::Gamestate*> gamestateQueue;
    9091    packet::Gamestate *reference;
     92    TrafficControl *trafficControl_;
    9193    unsigned int id_;
    9294  };
  • code/branches/presentation/src/network/TrafficControl.cc

    r2381 r2382  
    3030
    3131#include "synchronisable/Synchronisable.h"
     32#include "core/ConfigValueIncludes.h"
    3233
    3334#include <cassert>
     
    6768        TrafficControl::TrafficControl()
    6869        {
     70    RegisterRootObject(TrafficControl);
    6971          assert(instance_==0);
    7072          instance_=this;
    71     targetSize = 1000;//5000bytes
     73//     targetSize = 2500;//5000bytes
     74    SetConfigValue ( targetSize, 28000./25. );
    7275        }
    7376       
     
    127130          return;
    128131        }
     132 
     133  TrafficControl *TrafficControl::getInstance()
     134  {
     135    assert(instance_);
     136    return instance_;
     137  }
    129138       
    130139        void TrafficControl::ack(unsigned int clientID, unsigned int gamestateID)
     
    347356   
    348357    //now we check, that the creator of an object always exists on a client
    349     printList(list, clientID);
     358//     printList(list, clientID);
    350359    std::list<obj>::iterator itcreator;
    351360    for(itvec = list->begin(); itvec != list->end(); itvec++)
     
    356365    //now the cutting, work the same obj out in processobjectlist and copiedlist, compression rate muss noch festgelegt werden.
    357366    cut(list, targetSize);
    358     printList(list, clientID);
     367//     printList(list, clientID);
    359368    //diese Funktion updateClientList muss noch gemacht werden
    360369    updateClientListTemp(list);
  • code/branches/presentation/src/network/TrafficControl.h

    r2381 r2382  
    3737#include <algorithm>
    3838#include "util/Integers.h"
     39#include "core/OrxonoxClass.h"
    3940
    4041namespace orxonox {
     
    7879*
    7980*/
    80 class TrafficControl{
     81class TrafficControl : public OrxonoxClass{
    8182  private:
    8283
     
    153154    *Elements of struct i are therefore: *list[i].objID
    154155    */
     156    static TrafficControl *getInstance();
    155157    void processObjectList(unsigned int clientID, unsigned int gamestateID, std::list<obj>* list); //gets a pointer to the list (containing objectIDs) and sorts it
    156158    //done
  • code/branches/presentation/src/network/packet/Gamestate.cc

    r2371 r2382  
    4949
    5050#define PACKET_FLAG_GAMESTATE  ENET_PACKET_FLAG_RELIABLE
    51  
    52 TrafficControl Gamestate::trafficControl_;
    5351
    5452Gamestate::Gamestate()
     
    362360
    363361  //call TrafficControl
    364   trafficControl_.processObjectList( clientID, HEADER->id, &dataMap_ );
     362  TrafficControl::getInstance()->processObjectList( clientID, HEADER->id, &dataMap_ );
    365363 
    366364  //copy in the zeros
  • code/branches/presentation/src/network/packet/Gamestate.h

    r2371 r2382  
    9595    void removeObject(ObjectListIterator<Synchronisable> &it);
    9696    std::list<obj> dataMap_;
    97     static TrafficControl trafficControl_;
     97//     static TrafficControl *trafficControl_;
    9898};
    9999
Note: See TracChangeset for help on using the changeset viewer.