Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Merging of the current QuestSystem branch.

Location:
code/branches/questsystem5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem5

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

    r2662 r2907  
    3030#include "GSDedicated.h"
    3131
     32#include "core/Clock.h"
    3233#include "core/CommandLine.h"
    33 #include "core/Core.h"
     34#include "core/Game.h"
     35#include "core/GameMode.h"
    3436#include "core/Iterator.h"
    3537#include "network/Server.h"
     
    3941namespace orxonox
    4042{
    41     GSDedicated::GSDedicated()
    42         : GameState<GSRoot>("dedicated")
     43    AddGameState(GSDedicated, "dedicated");
     44
     45    GSDedicated::GSDedicated(const std::string& name)
     46        : GameState(name)
    4347        , server_(0)
    4448        , timeSinceLastUpdate_(0)
     
    5054    }
    5155
    52     void GSDedicated::enter()
     56    void GSDedicated::activate()
    5357    {
    54         Core::setHasServer(true);
     58        GameMode::setHasServer(true);
    5559
    5660        this->server_ = new Server(CommandLine::getValue("port"));
    5761        COUT(0) << "Loading scene in server mode" << std::endl;
    5862
    59         GSLevel::enter(0);
    60 
    6163        server_->open();
    6264    }
    6365
    64     void GSDedicated::leave()
     66    void GSDedicated::deactivate()
    6567    {
    66         GSLevel::leave();
    67 
    6868        this->server_->close();
    6969        delete this->server_;
    7070
    71         Core::setHasServer(false);
     71        GameMode::setHasServer(false);
    7272    }
    7373
    74     void GSDedicated::ticked(const Clock& time)
     74    void GSDedicated::update(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             GSLevel::ticked(time);
    85             server_->tick(time.getDeltaTime());
    86             this->tickChild(time);
     84            server_->update(time);
    8785        }
    8886        else
Note: See TracChangeset for help on using the changeset viewer.