Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 24, 2008, 11:00:30 PM (16 years ago)
Author:
scheusso
Message:

first success: client clones the servers universe and displays it with quite good performance

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network3/src/network/Client.cc

    r1168 r1184  
    4444namespace network
    4545{
     46  Client* Client::_sClient = 0;
     47 
     48  Client* Client::createSingleton(){
     49    if(!_sClient)
     50      _sClient = new Client();
     51    return _sClient;
     52  }
     53 
     54  Client* Client::createSingleton(std::string address, int port){
     55    if(!_sClient)
     56      _sClient = new Client(address, port);
     57    return _sClient;
     58  }
     59 
     60  Client* Client::createSingleton(const char *address, int port){
     61    if(!_sClient)
     62      _sClient = new Client(address, port);
     63    return _sClient;
     64  }
     65 
     66  void Client::destroySingleton(){
     67    if(_sClient){
     68      delete _sClient;
     69      _sClient = 0;
     70    }
     71  }
     72 
     73  Client* Client::getSingleton(){
     74    return _sClient;
     75  }
     76 
    4677  /**
    4778  * Constructor for the Client class
     
    71102  }
    72103
     104  Client::~Client(){
     105    if(isConnected)
     106      closeConnection();
     107  }
     108 
    73109  /**
    74110  * Establish the Connection to the Server
Note: See TracChangeset for help on using the changeset viewer.