Last change
on this file since 9388 was
9388,
checked in by patrick, 18 years ago
|
working on loading proxy config file from a seperate file
|
File size:
1.4 KB
|
Line | |
---|
1 | /*! |
---|
2 | * @file proxy_settings.h |
---|
3 | * some shared data from the proxy settings |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _PROXY_SETTINGS_H |
---|
7 | #define _PROXY_SETTINGS_H |
---|
8 | |
---|
9 | #include "base_object.h" |
---|
10 | #include "netdefs.h" |
---|
11 | |
---|
12 | #include "debug.h" |
---|
13 | |
---|
14 | #include <vector> |
---|
15 | |
---|
16 | |
---|
17 | class NetworkStream; |
---|
18 | class Synchronizeable; |
---|
19 | class TiXmlElement; |
---|
20 | |
---|
21 | |
---|
22 | /* and here is the class itsself*/ |
---|
23 | class ProxySettings : public BaseObject |
---|
24 | { |
---|
25 | |
---|
26 | public: |
---|
27 | inline static ProxySettings* getInstance() { if (!ProxySettings::singletonRef) ProxySettings::singletonRef = new ProxySettings(); |
---|
28 | return ProxySettings::singletonRef; } |
---|
29 | virtual ~ProxySettings(); |
---|
30 | |
---|
31 | void loadProxySettings(const TiXmlElement* root); |
---|
32 | |
---|
33 | /** @param number: sets the max number of players */ |
---|
34 | inline void setMaxPlayer(int number) { this->maxPlayer = number; PRINTF(0)("maxplayers set to %i\n\n\n", number);} |
---|
35 | /** @returns teh max number of players */ |
---|
36 | int getMaxPlayer() { return this->maxPlayer; } |
---|
37 | void setProxyAddr(const std::string& proxyAddr); |
---|
38 | |
---|
39 | /** @returns the list of proxy servers from the init file */ |
---|
40 | inline std::vector<IPaddress*>* getProxyList() { return &this->proxies; } |
---|
41 | |
---|
42 | |
---|
43 | private: |
---|
44 | ProxySettings(); |
---|
45 | |
---|
46 | |
---|
47 | private: |
---|
48 | static ProxySettings* singletonRef; //!< Pointer to the only instance of this Class |
---|
49 | int maxPlayer; //!< maximal number of players |
---|
50 | std::vector<IPaddress*> proxies; //!< all registered proxies |
---|
51 | |
---|
52 | }; |
---|
53 | |
---|
54 | |
---|
55 | |
---|
56 | #endif /* _PROXY_SETTINGS_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.