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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/libraries/network/ClientConnectionListener.h

    r5738 r5820  
    3333#include "core/OrxonoxClass.h"
    3434
    35 namespace orxonox{
     35namespace orxonox
     36{
     37    class _NetworkExport ClientConnectionListener : virtual public OrxonoxClass
     38    {
     39        public:
     40            ClientConnectionListener();
     41            virtual ~ClientConnectionListener() {}
     42           
     43            static void broadcastClientConnected(unsigned int clientID);
     44            static void broadcastClientDisconnected(unsigned int clientID);
    3645
    37   class _NetworkExport ClientConnectionListener : virtual public OrxonoxClass
    38   {
    39     friend class Server;
     46            virtual void clientConnected(unsigned int clientID) = 0;
     47            virtual void clientDisconnected(unsigned int clientID) = 0;
    4048
    41   public:
    42     ClientConnectionListener();
    43     virtual ~ClientConnectionListener() {}
    44 
    45     void getConnectedClients();
    46 
    47   protected:
    48     virtual void clientConnected(unsigned int clientID) = 0;
    49     virtual void clientDisconnected(unsigned int clientID) = 0;
    50   };
    51 
     49        protected:
     50            void getConnectedClients();
     51    };
    5252}
    5353
Note: See TracChangeset for help on using the changeset viewer.