Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 18, 2008, 10:58:46 PM (16 years ago)
Author:
landauf
Message:

did some first (and very unfinished) steps to deal with different players on server and client

Location:
code/branches/objecthierarchy/src/orxonox
Files:
15 added
9 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/orxonox/CMakeLists.txt

    r1916 r1940  
    4242  tools/WindowEventListener.cc
    4343
     44  objects/worldentities/WorldEntity.cc
     45  objects/worldentities/PositionableEntity.cc
    4446#  objects/Backlight.cc
    4547  objects/Camera.cc
     
    5052  objects/RadarViewable.cc
    5153  objects/Tickable.cc
     54
     55  objects/infos/Info.cc
     56  objects/infos/LevelInfo.cc
     57  objects/infos/PlayerInfo.cc
     58
     59  objects/gametypes/Gametype.cc
    5260
    5361  tolua/tolua_bind.cc
  • code/branches/objecthierarchy/src/orxonox/OrxonoxPrereqs.h

    r1916 r1940  
    8181
    8282    // objects
     83    class WorldEntity;
     84    class PositionableEntity;
     85    class MovableEntity;
     86    class ControllableEntity;
     87
    8388    class Backlight;
    8489    class Camera;
    8590    class ParticleSpawner;
     91
     92    class Info;
     93    class LevelInfo;
     94    class PlayerInfo;
     95
     96    class Gametype;
    8697
    8798    // tools
  • code/branches/objecthierarchy/src/orxonox/Settings.cc

    r1907 r1940  
    5252        , bHasServer_(false)
    5353        , bIsClient_(false)
     54        , bIsStandalone_(false)
     55        , bIsMaster_(false)
    5456    {
    5557        RegisterRootObject(Settings);
  • code/branches/objecthierarchy/src/orxonox/Settings.h

    r1907 r1940  
    5454        friend class GSClient;
    5555        friend class GSDedicated;
     56        friend class GSStandalone;
    5657
    5758    public:
     
    6566        static bool hasServer()     { assert(singletonRef_s); return singletonRef_s->bHasServer_; }
    6667        static bool isClient()      { assert(singletonRef_s); return singletonRef_s->bIsClient_; }
     68        static bool isStandalone()  { assert(singletonRef_s); return singletonRef_s->bIsStandalone_; }
     69        static bool isMaster()      { assert(singletonRef_s); return singletonRef_s->bIsMaster_; }
    6770
    6871    private:
    6972        // GSRoot has access to these
    70         static void setShowsGraphics(bool val) { assert(singletonRef_s); singletonRef_s->bShowsGraphics_ = val; }
    71         static void setHasServer    (bool val) { assert(singletonRef_s); singletonRef_s->bHasServer_     = val; }
    72         static void setIsClient     (bool val) { assert(singletonRef_s); singletonRef_s->bIsClient_      = val; }
     73        static void setShowsGraphics(bool val) { assert(singletonRef_s); singletonRef_s->bShowsGraphics_ = val; singletonRef_s->updateIsMaster(); }
     74        static void setHasServer    (bool val) { assert(singletonRef_s); singletonRef_s->bHasServer_     = val; singletonRef_s->updateIsMaster(); }
     75        static void setIsClient     (bool val) { assert(singletonRef_s); singletonRef_s->bIsClient_      = val; singletonRef_s->updateIsMaster(); }
     76        static void setIsStandalone (bool val) { assert(singletonRef_s); singletonRef_s->bIsStandalone_  = val; singletonRef_s->updateIsMaster(); }
     77        static void updateIsMaster  ()         { assert(singletonRef_s); singletonRef_s->bIsMaster_ = (singletonRef_s->bHasServer_ || singletonRef_s->bIsStandalone_); }
    7378
    7479        Settings();
     
    8590        bool bHasServer_;                                      //!< global variable that tells whether this is a server
    8691        bool bIsClient_;
     92        bool bIsStandalone_;
     93        bool bIsMaster_;
    8794
    8895        std::string dataPath_;                                 //!< Path to the game data
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSClient.cc

    r1907 r1940  
    5151    void GSClient::enter()
    5252    {
    53         Settings::_getInstance().bIsClient_ = true;
     53        Settings::_getInstance().setIsClient(true);
    5454
    5555        GSLevel::enter();
     
    8181        GSLevel::leave();
    8282
    83         Settings::_getInstance().bIsClient_ = false;
     83        Settings::_getInstance().setIsClient(false);
    8484    }
    8585
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSDedicated.cc

    r1790 r1940  
    5757    void GSDedicated::enter()
    5858    {
    59         Settings::_getInstance().bHasServer_ = true;
     59        Settings::_getInstance().setHasServer(true);
    6060
    6161        // create Ogre SceneManager for the level
     
    9797        Ogre::Root::getSingleton().destroySceneManager(this->sceneManager_);
    9898
    99         Settings::_getInstance().bHasServer_ = false;
     99        Settings::_getInstance().setHasServer(false);
    100100    }
    101101
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.cc

    r1891 r1940  
    101101    void GSGraphics::enter()
    102102    {
    103         Settings::_getInstance().bShowsGraphics_ = true;
     103        Settings::_getInstance().setShowsGraphics(true);
    104104
    105105        // initialise graphics engine. Doesn't load the render window yet!
     
    196196        delete graphicsEngine_;
    197197
    198         Settings::_getInstance().bShowsGraphics_ = false;
     198        Settings::_getInstance().setShowsGraphics(false);
    199199    }
    200200
     
    221221        this->console_->tick(dt);
    222222        this->tickChild(time);
    223        
     223
    224224        unsigned long long timeAfterTick = time.getRealMicroseconds();
    225225
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSServer.cc

    r1910 r1940  
    5252    void GSServer::enter()
    5353    {
    54         Settings::_getInstance().bHasServer_ = true;
     54        Settings::_getInstance().setHasServer(true);
    5555
    5656        GSLevel::enter();
     
    8585
    8686        GSLevel::leave();
    87        
    88         Settings::_getInstance().bHasServer_ = false;
     87
     88        Settings::_getInstance().setHasServer(false);
    8989    }
    9090
  • code/branches/objecthierarchy/src/orxonox/gamestates/GSStandalone.cc

    r1755 r1940  
    3232#include "core/input/InputManager.h"
    3333#include "core/ConsoleCommand.h"
     34#include "Settings.h"
    3435
    3536namespace orxonox
     
    5758        // level is loaded: we can start capturing the input
    5859        InputManager::getInstance().requestEnterState("game");
     60
     61        Settings::_getInstance().setIsStandalone(true);
    5962    }
    6063
     
    6871
    6972        GSLevel::leave();
     73
     74        Settings::_getInstance().setIsStandalone(false);
    7075    }
    7176
Note: See TracChangeset for help on using the changeset viewer.