Changeset 2382 for code/branches/presentation
- Timestamp:
- Dec 10, 2008, 3:36:36 PM (16 years ago)
- Location:
- code/branches/presentation/src/network
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/network/GamestateManager.cc
r2381 r2382 56 56 GamestateManager::GamestateManager() { 57 57 id_=0; 58 trafficControl_ = new TrafficControl(); 58 59 } 59 60 60 61 GamestateManager::~GamestateManager() { 62 delete trafficControl_; 61 63 } 62 64 -
code/branches/presentation/src/network/GamestateManager.h
r2171 r2382 43 43 #include "NetworkPrereqs.h" 44 44 #include "GamestateHandler.h" 45 #include "TrafficControl.h" 45 46 #include <map> 46 47 … … 89 90 std::map<unsigned int, packet::Gamestate*> gamestateQueue; 90 91 packet::Gamestate *reference; 92 TrafficControl *trafficControl_; 91 93 unsigned int id_; 92 94 }; -
code/branches/presentation/src/network/TrafficControl.cc
r2381 r2382 30 30 31 31 #include "synchronisable/Synchronisable.h" 32 #include "core/ConfigValueIncludes.h" 32 33 33 34 #include <cassert> … … 67 68 TrafficControl::TrafficControl() 68 69 { 70 RegisterRootObject(TrafficControl); 69 71 assert(instance_==0); 70 72 instance_=this; 71 targetSize = 1000;//5000bytes 73 // targetSize = 2500;//5000bytes 74 SetConfigValue ( targetSize, 28000./25. ); 72 75 } 73 76 … … 127 130 return; 128 131 } 132 133 TrafficControl *TrafficControl::getInstance() 134 { 135 assert(instance_); 136 return instance_; 137 } 129 138 130 139 void TrafficControl::ack(unsigned int clientID, unsigned int gamestateID) … … 347 356 348 357 //now we check, that the creator of an object always exists on a client 349 printList(list, clientID);358 // printList(list, clientID); 350 359 std::list<obj>::iterator itcreator; 351 360 for(itvec = list->begin(); itvec != list->end(); itvec++) … … 356 365 //now the cutting, work the same obj out in processobjectlist and copiedlist, compression rate muss noch festgelegt werden. 357 366 cut(list, targetSize); 358 printList(list, clientID);367 // printList(list, clientID); 359 368 //diese Funktion updateClientList muss noch gemacht werden 360 369 updateClientListTemp(list); -
code/branches/presentation/src/network/TrafficControl.h
r2381 r2382 37 37 #include <algorithm> 38 38 #include "util/Integers.h" 39 #include "core/OrxonoxClass.h" 39 40 40 41 namespace orxonox { … … 78 79 * 79 80 */ 80 class TrafficControl {81 class TrafficControl : public OrxonoxClass{ 81 82 private: 82 83 … … 153 154 *Elements of struct i are therefore: *list[i].objID 154 155 */ 156 static TrafficControl *getInstance(); 155 157 void processObjectList(unsigned int clientID, unsigned int gamestateID, std::list<obj>* list); //gets a pointer to the list (containing objectIDs) and sorts it 156 158 //done -
code/branches/presentation/src/network/packet/Gamestate.cc
r2371 r2382 49 49 50 50 #define PACKET_FLAG_GAMESTATE ENET_PACKET_FLAG_RELIABLE 51 52 TrafficControl Gamestate::trafficControl_;53 51 54 52 Gamestate::Gamestate() … … 362 360 363 361 //call TrafficControl 364 trafficControl_.processObjectList( clientID, HEADER->id, &dataMap_ );362 TrafficControl::getInstance()->processObjectList( clientID, HEADER->id, &dataMap_ ); 365 363 366 364 //copy in the zeros -
code/branches/presentation/src/network/packet/Gamestate.h
r2371 r2382 95 95 void removeObject(ObjectListIterator<Synchronisable> &it); 96 96 std::list<obj> dataMap_; 97 static TrafficControltrafficControl_;97 // static TrafficControl *trafficControl_; 98 98 }; 99 99
Note: See TracChangeset
for help on using the changeset viewer.