Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 9, 2008, 7:11:53 PM (16 years ago)
Author:
landauf
Message:

Split up LevelManager into LevelManager and PlayerManager where LevelManager handles all levels and is only active on the server, while PlayerManager handles client connections and passes new players to the LevelManager (if running on a server). If running on a client, PlayerManager just maps PlayerInfos with clientIDs.

Also added a small hack in Level.cc to show the ChatOverlay on clients.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/orxonox/LevelManager.h

    r2112 r2168  
    3636#include <cassert>
    3737
    38 #include "network/ClientConnectionListener.h"
    39 
    4038namespace orxonox
    4139{
    42     class _OrxonoxExport LevelManager : public ClientConnectionListener
     40    class _OrxonoxExport LevelManager
    4341    {
    4442        public:
     
    5048            Level* getActiveLevel();
    5149
    52             PlayerInfo* getClient(unsigned int clientID) const;
    53             inline const std::map<unsigned int, PlayerInfo*>& getClients() const
    54                 { return this->clients_; }
    55 
     50            static LevelManager* getInstancePtr() { return singletonRef_s; }
    5651            static LevelManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
    5752
     
    5954            LevelManager(const LevelManager&);
    6055
    61             void clientConnected(unsigned int clientID);
    62             void clientDisconnected(unsigned int clientID);
    63 
    6456            void activateNextLevel();
    6557
    6658            std::list<Level*> levels_s;
    67             std::map<unsigned int, PlayerInfo*> clients_;
    68 
    6959            static LevelManager* singletonRef_s;
    7060    };
Note: See TracChangeset for help on using the changeset viewer.