Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6230 in orxonox.OLD for branches/network/src


Ignore:
Timestamp:
Dec 21, 2005, 2:59:06 PM (19 years ago)
Author:
patrick
Message:

network bla

Location:
branches/network/src/lib/network
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/network_game_manager.cc

    r6219 r6230  
    3030/* using namespace std is default, this needs to be here */
    3131using namespace std;
     32
     33NetworkManager* NetworkManager::singletonRef = NULL;
    3234
    3335/*!
  • branches/network/src/lib/network/network_game_manager.h

    r6219 r6230  
    6161{
    6262  public:
    63     NetworkGameManager();
    6463    ~NetworkGameManager();
     64
     65    static NetworkGameManager* NetworkGameManager::getInstance() { if (!NetworkGameManager::singletonRef) NetworkGameManager::singletonRef = new NetworkGameManager(); return NetworkGameManager::singletonRef; }
    6566
    6667    virtual void writeBytes(const byte* data, int length, int sender);
     
    7879
    7980  private:
     81    NetworkGameManager();
     82
    8083    void requestCreateEntity(ClassID classID);
    8184    void executeCreateEntity(ClassID classID, int uniqueID = 0, int owner = 0);
     
    109112    std::vector<clientBuffer>     outBuffer;
    110113    clientBuffer                  allOutBuffer;
     114    static NetworkGameManager*    singletonRef;
    111115
    112116    int                           newUniqueID;
  • branches/network/src/lib/network/network_stream.cc

    r6220 r6230  
    7878  this->handshakes.push_back( NULL );
    7979  this->bActive = true;
    80   this->networkGameManager = new NetworkGameManager();
     80  this->networkGameManager = NetworkGameManager::getInstance();
    8181  // setUniqueID( maxCon+2 ) because we need one id for every handshake
    8282  // and one for handshake to reject client maxCon+1
     
    181181            myHostId = NetworkManager::getInstance()->getHostID();
    182182
    183             this->networkGameManager = new NetworkGameManager();
     183            this->networkGameManager = NetworkGameManager::getInstance();
    184184            this->networkGameManager->setUniqueID( handshakes[i]->getNetworkGameManagerId() );
    185185            this->connectSynchronizeable( *(this->networkGameManager) );
Note: See TracChangeset for help on using the changeset viewer.