Changeset 1485 for code/branches/network/src
- Timestamp:
- May 29, 2008, 7:29:36 PM (16 years ago)
- Location:
- code/branches/network/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/Server.cc
r1483 r1485 58 58 59 59 #define MAX_FAILURES 20; 60 60 #define NETWORK_FREQUENCY 30 61 61 62 62 /** … … 65 65 */ 66 66 Server::Server() { 67 timeSinceLastUpdate_=0; 67 68 packet_gen = PacketGenerator(); 68 69 clients = new ClientInformation(true); … … 72 73 73 74 Server::Server(int port){ 75 timeSinceLastUpdate_=0; 74 76 packet_gen = PacketGenerator(); 75 77 clients = new ClientInformation(true); … … 84 86 */ 85 87 Server::Server(int port, std::string bindAddress) { 88 timeSinceLastUpdate_=0; 86 89 packet_gen = PacketGenerator(); 87 90 clients = new ClientInformation(); … … 96 99 */ 97 100 Server::Server(int port, const char *bindAddress) { 101 timeSinceLastUpdate_=0; 98 102 packet_gen = PacketGenerator(); 99 103 clients = new ClientInformation(); … … 157 161 void Server::tick(float time) { 158 162 processQueue(); 159 gamestates->processGameStates(); 160 updateGamestate(); 161 usleep(5000); // TODO remove 163 //this steers our network frequency 164 timeSinceLastUpdate_+=time; 165 if(timeSinceLastUpdate_>=(1./NETWORK_FREQUENCY)){ 166 timeSinceLastUpdate_-=(1./NETWORK_FREQUENCY); 167 gamestates->processGameStates(); 168 updateGamestate(); 169 } 170 // usleep(5000); // TODO remove 162 171 return; 163 172 } -
code/branches/network/src/network/Server.h
r1409 r1485 87 87 88 88 ClientInformation *clients; 89 float timeSinceLastUpdate_; 89 90 }; 90 91 -
code/branches/network/src/orxonox/hud/HUD.cc
r1463 r1485 192 192 } 193 193 194 void HUD::removeRadarObject(SceneNode* node){ 194 void HUD::removeRadarObject(Ogre::SceneNode* node){ 195 COUT(3) << "blabla" << std::endl; 195 196 for(std::set<RadarObject*>::iterator it=roSet.begin(); it!=roSet.end(); it++){ 196 197 if((*it)->getNode() == node) { -
code/branches/network/src/orxonox/objects/SpaceShip.cc
r1484 r1485 143 143 if (this->cam_) 144 144 delete this->cam_; 145 if (!Identifier::isCreatingHierarchy() && !myShip_ && &HUD::getSingleton()!=NULL) 146 //remove the radar object 147 HUD::getSingleton().removeRadarObject(this->getNode()); 145 148 } 146 149
Note: See TracChangeset
for help on using the changeset viewer.