Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 13, 2009, 5:05:17 PM (15 years ago)
Author:
dafrick
Message:

Hopefully merged trunk successfully into pickup branch.

Location:
code/branches/pickup
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup

  • code/branches/pickup/src/libraries/network/ClientConnectionListener.cc

    r5781 r5935  
    3333#include "ClientInformation.h"
    3434
    35 namespace orxonox{
     35namespace orxonox
     36{
     37    ClientConnectionListener::ClientConnectionListener()
     38    {
     39        RegisterRootObject(ClientConnectionListener);
     40    }
    3641
    37   ClientConnectionListener::ClientConnectionListener()
    38   {
    39     RegisterRootObject(ClientConnectionListener);
    40   }
     42    void ClientConnectionListener::broadcastClientConnected(unsigned int clientID)
     43    {
     44        for (ObjectList<ClientConnectionListener>::iterator it = ObjectList<ClientConnectionListener>::begin(); it != ObjectList<ClientConnectionListener>::end(); ++it)
     45            it->clientConnected(clientID);
     46    }
     47   
     48    void ClientConnectionListener::broadcastClientDisconnected(unsigned int clientID)
     49    {
     50        for (ObjectList<ClientConnectionListener>::iterator it = ObjectList<ClientConnectionListener>::begin(); it != ObjectList<ClientConnectionListener>::end(); ++it)
     51            it->clientDisconnected(clientID);
     52    }
    4153
    42   void ClientConnectionListener::getConnectedClients(){
    43     if(GameMode::showsGraphics())
    44       this->clientConnected(0); //server client id
    45     ClientInformation *client = ClientInformation::getBegin();
    46     while(client){
    47       this->clientConnected(client->getID());
    48       client=client->next();
     54    void ClientConnectionListener::getConnectedClients()
     55    {
     56        ClientInformation* client = ClientInformation::getBegin();
     57        while (client)
     58        {
     59            this->clientConnected(client->getID());
     60            client = client->next();
     61        }
    4962    }
    50   }
    51 
    5263}
    5364
Note: See TracChangeset for help on using the changeset viewer.