Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9398 in orxonox.OLD


Ignore:
Timestamp:
Jul 23, 2006, 11:43:27 PM (18 years ago)
Author:
patrick
Message:

new settings init

Location:
branches/proxy/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/network_manager.cc

    r9396 r9398  
    126126int NetworkManager::createProxyServer(unsigned int port)
    127127{
    128   // init the proxy settings data do this before everything else is done here
    129   NetworkSettings::getInstance()->loadData();
    130 
    131128  // create the network stream
    132129  this->networkStream = new NetworkStream(NET_PROXY_SERVER_ACTIVE);
  • branches/proxy/src/lib/network/proxy/network_settings.cc

    r9397 r9398  
    1717
    1818#include "network_settings.h"
     19
    1920#include "netdefs.h"
     21#include "shared_network_data.h"
    2022
    2123#include "loading/resource_manager.h"
     
    3840  // suggest a good standard max players value
    3941  this->maxPlayer = 10;
     42
     43  this->loadData();
    4044}
    4145
     
    8286
    8387  this->loadNetworkSettings( root);
     88
     89  // set the new unique id offset
     90  SharedNetworkData::getInstance()->setNewUniqueID( this->maxPlayer + 2);
    8491}
    8592
     
    120127}
    121128
     129
    122130/**
    123131 * sets the proxy address to
     
    126134void NetworkSettings::setProxyAddr(const std::string& proxyAddr)
    127135{
     136
     137  if( !SharedNetworkData::getInstance()->isMasterServer())
     138    return;
     139
    128140  IPaddress *ip = new IPaddress;
    129141
  • branches/proxy/src/lib/network/shared_network_data.cc

    r9396 r9398  
    4040  // setUniqueID( maxCon+2 ) because we need one id for every handshake
    4141  // and one for handshake to reject client maxCon+1
    42   this->newUniqueID = NetworkSettings::getInstance()->getMaxPlayer() + 2;
     42  this->newUniqueID = 2;
    4343}
    4444
  • branches/proxy/src/lib/network/shared_network_data.h

    r9396 r9398  
    2929    /** @returns the next uniqueID free for an object */
    3030    inline int getNewUniqueID() { return ( this->nodeType != NET_CLIENT)?this->newUniqueID++:-1; }
     31    /** sets the @param newUniqueID: the new offset for the next unique id */
     32    inline void setNewUniqueID(int newUniqueID) { this->newUniqueID = newUniqueID; }
    3133
    3234    /** @returns true is this node is a master server */
  • branches/proxy/src/orxonox.cc

    r9396 r9398  
    5858
    5959#include "network_manager.h"
     60#include "shared_network_data.h"
    6061
    6162#include "state.h"
     
    308309  {
    309310    State::setOnline(true);
     311    SharedNetworkData::getInstance()->setNodeType(NET_CLIENT);
    310312    NetworkManager::getInstance()->createClient(this->serverName, port);
    311313  }
     
    313315  {    // we are a master server
    314316    State::setOnline(true);
     317    SharedNetworkData::getInstance()->setNodeType(NET_MASTER_SERVER);
     318
    315319    NetworkManager::getInstance()->createMasterServer(port);
    316320  }
     
    318322  {    // we are a proxy server
    319323    State::setOnline(true);
     324    SharedNetworkData::getInstance()->setNodeType(NET_PROXY_SERVER_ACTIVE);
    320325    NetworkManager::getInstance()->createProxyServer(port);
    321326  }
Note: See TracChangeset for help on using the changeset viewer.