Changeset 9388 in orxonox.OLD for branches/proxy/src/lib
- Timestamp:
- Jul 21, 2006, 2:40:01 PM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/proxy/proxy_settings.cc
r9387 r9388 19 19 #include "netdefs.h" 20 20 21 #include "loading/resource_manager.h" 21 22 #include "loading/load_param.h" 22 23 … … 34 35 /* set the class id for the base object */ 35 36 this->setClassID(CL_PROXY_SETTINGS, "ProxySettings"); 37 36 38 // suggest a good standard max players value 37 39 this->maxPlayer = 10; 40 41 PRINTF(0)("\n\n\n\n"); 42 43 std::string fileName = ResourceManager::getInstance()->getDataDir(); 44 fileName += "configs/proxy_settings.conf"; 45 46 47 PRINTF(0)("trying file %s\n", fileName.c_str()); 48 TiXmlDocument doc(fileName); 49 if( !doc.LoadFile(fileName)) 50 { 51 PRINTF(0)("Loading file %s failed for Proxy Settings.\n", fileName.c_str()); 52 return; 53 } 54 const TiXmlElement* root = doc.RootElement(); 55 56 if( strcmp( root->Value(), "ProxySettings")) 57 { 58 // report an error 59 PRINTF(0)("Specified XML File is not an orxonox proxy settings file (ProxySettings element missing)\n"); 60 return; 61 } 62 LoadParamXML(root, "ProxySettings", this, ProxySettings, loadProxySettings); 38 63 } 39 64 … … 63 88 void ProxySettings::loadProxySettings(const TiXmlElement* root) 64 89 { 65 90 PRINTF(0)("lalalallalala\n\n"); 66 91 LoadParam(root, "max-player", this, ProxySettings, setMaxPlayer); 67 92 … … 69 94 { 70 95 element->ToText(); 71 // PER-PARTICLE-ATTRIBUTES:72 96 LoadParam(root, "proxy-addr", this, ProxySettings, setProxyAddr); 73 97 } -
branches/proxy/src/lib/network/proxy/proxy_settings.h
r9347 r9388 9 9 #include "base_object.h" 10 10 #include "netdefs.h" 11 12 #include "debug.h" 11 13 12 14 #include <vector> … … 30 32 31 33 /** @param number: sets the max number of players */ 32 inline void setMaxPlayer(int number) { this->maxPlayer = number; }34 inline void setMaxPlayer(int number) { this->maxPlayer = number; PRINTF(0)("maxplayers set to %i\n\n\n", number);} 33 35 /** @returns teh max number of players */ 34 36 int getMaxPlayer() { return this->maxPlayer; } -
branches/proxy/src/lib/network/shared_network_data.cc
r9387 r9388 38 38 39 39 // if( State::isOnline()) 40 //this->newUniqueID = ProxySettings::getInstance()->getMaxPlayer() + 2;40 this->newUniqueID = ProxySettings::getInstance()->getMaxPlayer() + 2; 41 41 // else 42 this->newUniqueID = NET_MAX_CONNECTIONS + 2;42 // this->newUniqueID = NET_MAX_CONNECTIONS + 2; 43 43 this->nodeType = NET_CLIENT; 44 44 } -
branches/proxy/src/lib/network/shared_network_data.h
r9387 r9388 40 40 41 41 /** @returns the maximum number of players for this server */ 42 inline int getMaxPlayer() { return /*ProxySettings::getInstance()->getMaxPlayer()*/NET_MAX_CONNECTIONS; }42 inline int getMaxPlayer() { return ProxySettings::getInstance()->getMaxPlayer(); } 43 43 44 44 /** @returns the hostID of the node */
Note: See TracChangeset
for help on using the changeset viewer.