Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 28, 2009, 2:55:47 AM (15 years ago)
Author:
landauf
Message:

Changes in ClientConnectionListener:

  • Added static functions for connect/disconnect which notify all instances
  • getConnectedClients() also returned client "0" which is the ID of the server. This is important for the PlayerManager, but other classes (like for example TrafficControl) don't use getConnectedClients(), so I assumed I can safely remove this line. The 0-client gets now connected and disconnected in GSLevel (which also creates and destroys the PlayerManager). If the 0-client is also needed by other classes, I suggest moving it into the network.

The instance of HumanPlayer is now deleted if GSLevel gets deactivated. This also destroys the default HUD.

Location:
code/branches/core5/src/orxonox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/orxonox/LevelManager.cc

    r5738 r5820  
    3939#include "PlayerManager.h"
    4040#include "Level.h"
    41 #include "infos/HumanPlayer.h"
    4241
    4342namespace orxonox
  • code/branches/core5/src/orxonox/PlayerManager.cc

    r5801 r5820  
    7474        if (GameMode::isMaster())
    7575        {
    76             COUT(3) << "client disconnected" << std::endl;
     76            if (clientID != 0)
     77                COUT(3) << "client disconnected" << std::endl;
    7778
    7879            // remove from clients-map
  • code/branches/core5/src/orxonox/PlayerManager.h

    r3370 r5820  
    5050                { return this->clients_; }
    5151
    52         private:
    5352            void clientConnected(unsigned int clientID);
    5453            void clientDisconnected(unsigned int clientID);
    5554
     55        private:
    5656            std::map<unsigned int, PlayerInfo*> clients_;
    5757
Note: See TracChangeset for help on using the changeset viewer.