Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 8, 2009, 12:58:47 AM (15 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/GSClient.cc

    r2907 r2908  
    3131
    3232#include "core/input/InputManager.h"
    33 #include "core/Clock.h"
    3433#include "core/CommandLine.h"
    35 #include "core/Game.h"
    36 #include "core/GameMode.h"
     34#include "core/Core.h"
    3735#include "network/Client.h"
    3836
    3937namespace orxonox
    4038{
    41     AddGameState(GSClient, "client");
    42 
    4339    SetCommandLineArgument(ip, "127.0.0.1").information("#.#.#.#");
    4440
    45     GSClient::GSClient(const std::string& name)
    46         : GameState(name)
     41    GSClient::GSClient()
     42        : GameState<GSGraphics>("client")
    4743        , client_(0)
    4844    {
     
    5349    }
    5450
    55     void GSClient::activate()
     51    void GSClient::enter()
    5652    {
    57         GameMode::setIsClient(true);
     53        Core::setIsClient(true);
    5854
    5955        this->client_ = new Client(CommandLine::getValue("ip").getString(), CommandLine::getValue("port"));
     
    6258            ThrowException(InitialisationFailed, "Could not establish connection with server.");
    6359
    64         client_->update(Game::getInstance().getGameClock());
     60        GSLevel::enter(this->getParent()->getViewport());
     61
     62        client_->tick(0);
    6563    }
    6664
    67     void GSClient::deactivate()
     65    void GSClient::leave()
    6866    {
     67        GSLevel::leave();
     68
    6969        client_->closeConnection();
    7070
     
    7272        delete this->client_;
    7373
    74         GameMode::setIsClient(false);
     74        Core::setIsClient(false);
    7575    }
    7676
    77     void GSClient::update(const Clock& time)
     77    void GSClient::ticked(const Clock& time)
    7878    {
    79         client_->update(time);
     79        GSLevel::ticked(time);
     80        client_->tick(time.getDeltaTime());
     81
     82        this->tickChild(time);
    8083    }
    8184}
Note: See TracChangeset for help on using the changeset viewer.