Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 8, 2009, 12:58:47 AM (16 years ago)
Author:
dafrick
Message:

Reverted to revision 2906 (because I'm too stupid to merge correctly, 2nd try will follow shortly. ;))

Location:
code/branches/questsystem5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem5

  • code/branches/questsystem5/src/orxonox/gamestates/GSDedicated.cc

    r2907 r2908  
    3030#include "GSDedicated.h"
    3131
    32 #include "core/Clock.h"
    3332#include "core/CommandLine.h"
    34 #include "core/Game.h"
    35 #include "core/GameMode.h"
     33#include "core/Core.h"
    3634#include "core/Iterator.h"
    3735#include "network/Server.h"
     
    4139namespace orxonox
    4240{
    43     AddGameState(GSDedicated, "dedicated");
    44 
    45     GSDedicated::GSDedicated(const std::string& name)
    46         : GameState(name)
     41    GSDedicated::GSDedicated()
     42        : GameState<GSRoot>("dedicated")
    4743        , server_(0)
    4844        , timeSinceLastUpdate_(0)
     
    5450    }
    5551
    56     void GSDedicated::activate()
     52    void GSDedicated::enter()
    5753    {
    58         GameMode::setHasServer(true);
     54        Core::setHasServer(true);
    5955
    6056        this->server_ = new Server(CommandLine::getValue("port"));
    6157        COUT(0) << "Loading scene in server mode" << std::endl;
    6258
     59        GSLevel::enter(0);
     60
    6361        server_->open();
    6462    }
    6563
    66     void GSDedicated::deactivate()
     64    void GSDedicated::leave()
    6765    {
     66        GSLevel::leave();
     67
    6868        this->server_->close();
    6969        delete this->server_;
    7070
    71         GameMode::setHasServer(false);
     71        Core::setHasServer(false);
    7272    }
    7373
    74     void GSDedicated::update(const Clock& time)
     74    void GSDedicated::ticked(const Clock& time)
    7575    {
    7676//        static float startTime = time.getSecondsPrecise();
     
    8282//            COUT(0) << "estimated ticks/sec: " << nrOfTicks/(time.getSecondsPrecise()-startTime) << endl;
    8383            timeSinceLastUpdate_ -= static_cast<unsigned int>(timeSinceLastUpdate_ / NETWORK_PERIOD) * NETWORK_PERIOD;
    84             server_->update(time);
     84            GSLevel::ticked(time);
     85            server_->tick(time.getDeltaTime());
     86            this->tickChild(time);
    8587        }
    8688        else
Note: See TracChangeset for help on using the changeset viewer.