Changeset 9494 in orxonox.OLD for trunk/src/lib/network/proxy
- Timestamp:
- Jul 27, 2006, 10:44:28 AM (18 years ago)
- Location:
- trunk/src/lib/network/proxy
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/network/proxy/network_settings.cc
r9406 r9494 40 40 // suggest a good standard max players value 41 41 this->maxPlayer = 10; 42 43 // this->loadData();44 42 } 45 43 … … 53 51 54 52 // remove all unused proxy data again 55 for( int i = 0; i < this->proxies.size(); i++)53 for(unsigned int i = 0; i < this->proxies.size(); i++) 56 54 { 57 IP address*ip = this->proxies.back();55 IP ip = this->proxies.back(); 58 56 this->proxies.pop_back(); 59 delete ip;60 57 } 61 58 } … … 104 101 105 102 LoadParam(root, "max-player", this, NetworkSettings, setMaxPlayer); 103 LoadParam(root, "max-player-saturation", this, NetworkSettings, setMaxPlayerSaturation); 106 104 107 105 … … 140 138 return; 141 139 142 IPaddress *ip = new IPaddress; 143 144 SDLNet_ResolveHost( ip, proxyAddr.c_str(), 9999 ); 145 146 this->proxies.push_back(ip); 140 this->proxies.push_back(IP(proxyAddr, 9999)); 147 141 } 148 142 -
trunk/src/lib/network/proxy/network_settings.h
r9406 r9494 37 37 inline void setMaxPlayer(int number) { this->maxPlayer = number; } 38 38 /** @returns teh max number of players */ 39 int getMaxPlayer() { return this->maxPlayer; } 39 int getMaxPlayer() const { return this->maxPlayer; } 40 /** sets the @param saturation: a threshold in percente when the proxy servers should be activated to be able to redirect the clients */ 41 inline void setMaxPlayerSaturation(float saturation) { this->maxPlayerSaturation = saturation; } 42 40 43 41 44 void setMasterAddr(const std::string& masterAddr); 42 45 /** @returns the address of the master server read from the network config file */ 43 inline IP getMasterAddr(){ return this->masterServer; }46 inline const IP& getMasterAddr() const { return this->masterServer; } 44 47 45 48 void setProxyAddr(const std::string& proxyAddr); 46 49 /** @returns the list of proxy servers from the init file */ 47 inline std::vector<IP address*>* getProxyList() { return &this->proxies; }50 inline std::vector<IP>* getProxyList() { return &this->proxies; } 48 51 49 52 … … 53 56 54 57 private: 55 static NetworkSettings* singletonRef; //!< Pointer to the only instance of this Class 58 static NetworkSettings* singletonRef; //!< Pointer to the only instance of this Class 59 56 60 int maxPlayer; //!< maximal number of players 57 std::vector<IPaddress*> proxies; //!< all registered proxies 61 float maxPlayerSaturation; //!< the saturation level from where on the proxy server should be activated 62 63 std::vector<IP> proxies; //!< all registered proxies 58 64 IP masterServer; //!< master server ip address 59 65
Note: See TracChangeset
for help on using the changeset viewer.