Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6683 in orxonox.OLD for branches


Ignore:
Timestamp:
Jan 24, 2006, 11:21:02 PM (19 years ago)
Author:
patrick
Message:

newtork: singleplayer does work again

Location:
branches/network/src
Files:
2 edited

Legend:

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

    r6678 r6683  
    2020#include "network_stream.h"
    2121#include "netdefs.h"
     22
     23#include "state.h"
    2224
    2325#include "assert.h"
     
    4345  this->bSynchronize = false;
    4446
    45   NetworkStream* nd = SharedNetworkData::getInstance()->getDefaultSyncStream();
    46   assert(nd != NULL);
    47   nd->connectSynchronizeable(*this);
    48   this->setUniqueID(SharedNetworkData::getInstance()->getNewUniqueID());
     47  if( State::isOnline())
     48  {
     49    NetworkStream* nd = SharedNetworkData::getInstance()->getDefaultSyncStream();
     50    assert(nd != NULL);
     51    nd->connectSynchronizeable(*this);
     52    this->setUniqueID(SharedNetworkData::getInstance()->getNewUniqueID());
     53  }
    4954}
    5055
  • branches/network/src/orxonox.cc

    r6658 r6683  
    5656
    5757#include "network_manager.h"
     58
     59#include "state.h"
    5860
    5961#include <string.h>
     
    276278
    277279  if( this->serverName != NULL) // we are a client
     280  {
    278281    NetworkManager::getInstance()->establishConnection(this->serverName, port);
     282    State::setOnline(true);
     283  }
    279284  else if( this->port > 0) {    // we are a server
    280285    NetworkManager::getInstance()->createServer(port);
     286    State::setOnline(true);
    281287  }
    282288  return 0;
Note: See TracChangeset for help on using the changeset viewer.