Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1485


Ignore:
Timestamp:
May 29, 2008, 7:29:36 PM (16 years ago)
Author:
scheusso
Message:

a spaceship removes its hud point now when it's being destructed …

Location:
code/branches/network/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/Server.cc

    r1483 r1485  
    5858 
    5959#define MAX_FAILURES 20;
    60  
     60#define NETWORK_FREQUENCY 30
    6161 
    6262  /**
     
    6565  */
    6666  Server::Server() {
     67    timeSinceLastUpdate_=0;
    6768    packet_gen = PacketGenerator();
    6869    clients = new ClientInformation(true);
     
    7273 
    7374  Server::Server(int port){
     75    timeSinceLastUpdate_=0;
    7476    packet_gen = PacketGenerator();
    7577    clients = new ClientInformation(true);
     
    8486  */
    8587  Server::Server(int port, std::string bindAddress) {
     88    timeSinceLastUpdate_=0;
    8689    packet_gen = PacketGenerator();
    8790    clients = new ClientInformation();
     
    9699  */
    97100  Server::Server(int port, const char *bindAddress) {
     101    timeSinceLastUpdate_=0;
    98102    packet_gen = PacketGenerator();
    99103    clients = new ClientInformation();
     
    157161  void Server::tick(float time) {
    158162    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
    162171    return;
    163172  }
  • code/branches/network/src/network/Server.h

    r1409 r1485  
    8787
    8888    ClientInformation *clients;
     89    float timeSinceLastUpdate_;
    8990  };
    9091
  • code/branches/network/src/orxonox/hud/HUD.cc

    r1463 r1485  
    192192    }
    193193
    194     void HUD::removeRadarObject(SceneNode* node){
     194    void HUD::removeRadarObject(Ogre::SceneNode* node){
     195      COUT(3) << "blabla" << std::endl;
    195196        for(std::set<RadarObject*>::iterator it=roSet.begin(); it!=roSet.end(); it++){
    196197            if((*it)->getNode() == node) {
  • code/branches/network/src/orxonox/objects/SpaceShip.cc

    r1484 r1485  
    143143        if (this->cam_)
    144144          delete this->cam_;
     145        if (!Identifier::isCreatingHierarchy() && !myShip_ && &HUD::getSingleton()!=NULL)
     146          //remove the radar object
     147          HUD::getSingleton().removeRadarObject(this->getNode());
    145148    }
    146149
Note: See TracChangeset for help on using the changeset viewer.