Changeset 2413 for code/branches
- Timestamp:
- Dec 11, 2008, 11:09:01 PM (16 years ago)
- Location:
- code/branches/presentation/src/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/network/TrafficControl.cc
r2387 r2413 68 68 TrafficControl::TrafficControl() 69 69 { 70 Register RootObject(TrafficControl);70 RegisterObject(TrafficControl); 71 71 assert(instance_==0); 72 72 instance_=this; 73 // targetSize = 2500;//5000bytes 74 SetConfigValue ( targetSize, 28000./25. ); 73 this->setConfigValues(); 75 74 } 76 75 … … 88 87 *Definition of public members 89 88 */ 89 90 void TrafficControl::setConfigValues() 91 { 92 SetConfigValue ( targetSize, 5000 ); 93 } 90 94 91 95 /** … … 261 265 else 262 266 { 263 //COUT(0) << "cut" << endl;267 COUT(0) << "cut" << endl; 264 268 clientListPerm_[currentClientID][(*itvec).objID].objValueSched += SCHED_PRIORITY_OFFSET; // NOTE: SCHED_PRIORITY_OFFSET is negative 265 269 // ittemp = itvec; … … 399 403 } 400 404 401 void TrafficControl:: priRemoveClient(int clientID)405 void TrafficControl::clientDisconnected(unsigned int clientID) 402 406 { 403 407 assert(clientListTemp_.find(clientID) != clientListTemp_.end() ); … … 405 409 clientListTemp_.erase(clientListTemp_.find(clientID)); 406 410 clientListPerm_.erase(clientListPerm_.find(clientID)); 407 }408 void TrafficControl::pubRemoveClient(int clientID)409 {410 priRemoveClient(clientID);411 411 } 412 412 -
code/branches/presentation/src/network/TrafficControl.h
r2387 r2413 38 38 #include "util/Integers.h" 39 39 #include "core/OrxonoxClass.h" 40 #include "network/ClientConnectionListener.h" 40 41 41 42 namespace orxonox { … … 79 80 * 80 81 */ 81 class TrafficControl : public OrxonoxClass{82 class TrafficControl : public ClientConnectionListener { 82 83 private: 83 84 … … 141 142 void evaluateList(unsigned int clientID, std::list<obj> *list);//done 142 143 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 144 149 145 150 protected: … … 155 160 *Elements of struct i are therefore: *list[i].objID 156 161 */ 162 void setConfigValues(); 157 163 static TrafficControl *getInstance(); 158 164 void processObjectList(unsigned int clientID, unsigned int gamestateID, std::list<obj>* list); //gets a pointer to the list (containing objectIDs) and sorts it … … 166 172 void printList(std::list<obj> *list, unsigned int clientID); 167 173 void fixCreatorDependencies(std::list<obj>::iterator it, std::list<obj> *list, unsigned int clientID); 168 void pubRemoveClient(int clientID);169 174 }; 170 175
Note: See TracChangeset
for help on using the changeset viewer.