Changeset 9398 in orxonox.OLD
- Timestamp:
- Jul 23, 2006, 11:43:27 PM (18 years ago)
- Location:
- branches/proxy/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/network_manager.cc
r9396 r9398 126 126 int NetworkManager::createProxyServer(unsigned int port) 127 127 { 128 // init the proxy settings data do this before everything else is done here129 NetworkSettings::getInstance()->loadData();130 131 128 // create the network stream 132 129 this->networkStream = new NetworkStream(NET_PROXY_SERVER_ACTIVE); -
branches/proxy/src/lib/network/proxy/network_settings.cc
r9397 r9398 17 17 18 18 #include "network_settings.h" 19 19 20 #include "netdefs.h" 21 #include "shared_network_data.h" 20 22 21 23 #include "loading/resource_manager.h" … … 38 40 // suggest a good standard max players value 39 41 this->maxPlayer = 10; 42 43 this->loadData(); 40 44 } 41 45 … … 82 86 83 87 this->loadNetworkSettings( root); 88 89 // set the new unique id offset 90 SharedNetworkData::getInstance()->setNewUniqueID( this->maxPlayer + 2); 84 91 } 85 92 … … 120 127 } 121 128 129 122 130 /** 123 131 * sets the proxy address to … … 126 134 void NetworkSettings::setProxyAddr(const std::string& proxyAddr) 127 135 { 136 137 if( !SharedNetworkData::getInstance()->isMasterServer()) 138 return; 139 128 140 IPaddress *ip = new IPaddress; 129 141 -
branches/proxy/src/lib/network/shared_network_data.cc
r9396 r9398 40 40 // setUniqueID( maxCon+2 ) because we need one id for every handshake 41 41 // and one for handshake to reject client maxCon+1 42 this->newUniqueID = NetworkSettings::getInstance()->getMaxPlayer() +2;42 this->newUniqueID = 2; 43 43 } 44 44 -
branches/proxy/src/lib/network/shared_network_data.h
r9396 r9398 29 29 /** @returns the next uniqueID free for an object */ 30 30 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; } 31 33 32 34 /** @returns true is this node is a master server */ -
branches/proxy/src/orxonox.cc
r9396 r9398 58 58 59 59 #include "network_manager.h" 60 #include "shared_network_data.h" 60 61 61 62 #include "state.h" … … 308 309 { 309 310 State::setOnline(true); 311 SharedNetworkData::getInstance()->setNodeType(NET_CLIENT); 310 312 NetworkManager::getInstance()->createClient(this->serverName, port); 311 313 } … … 313 315 { // we are a master server 314 316 State::setOnline(true); 317 SharedNetworkData::getInstance()->setNodeType(NET_MASTER_SERVER); 318 315 319 NetworkManager::getInstance()->createMasterServer(port); 316 320 } … … 318 322 { // we are a proxy server 319 323 State::setOnline(true); 324 SharedNetworkData::getInstance()->setNodeType(NET_PROXY_SERVER_ACTIVE); 320 325 NetworkManager::getInstance()->createProxyServer(port); 321 326 }
Note: See TracChangeset
for help on using the changeset viewer.