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 <vector> |
---|
13 | |
---|
14 | |
---|
15 | class NetworkStream; |
---|
16 | class Synchronizeable; |
---|
17 | class TiXmlElement; |
---|
18 | |
---|
19 | |
---|
20 | /* and here is the class itsself*/ |
---|
21 | class ProxySettings : public BaseObject |
---|
22 | { |
---|
23 | |
---|
24 | public: |
---|
25 | inline static ProxySettings* getInstance() { if (!ProxySettings::singletonRef) ProxySettings::singletonRef = new ProxySettings(); |
---|
26 | return ProxySettings::singletonRef; } |
---|
27 | virtual ~ProxySettings(); |
---|
28 | |
---|
29 | void loadProxySettings(const TiXmlElement* root); |
---|
30 | |
---|
31 | /** @param number: sets the max number of players */ |
---|
32 | inline void setMaxPlayer(int number) { this->maxPlayer = number; } |
---|
33 | /** @returns teh max number of players */ |
---|
34 | int getMaxPlayer() { return this->maxPlayer; } |
---|
35 | void setProxyAddr(const std::string& proxyAddr); |
---|
36 | |
---|
37 | /** @returns the list of proxy servers from the init file */ |
---|
38 | inline std::vector<IPaddress*>* getProxyList() { return &this->proxies; } |
---|
39 | |
---|
40 | |
---|
41 | private: |
---|
42 | ProxySettings(); |
---|
43 | |
---|
44 | |
---|
45 | private: |
---|
46 | |
---|
47 | static ProxySettings* singletonRef; //!< Pointer to the only instance of this Class |
---|
48 | |
---|
49 | int maxPlayer; //!< maximal number of players |
---|
50 | |
---|
51 | std::vector<IPaddress*> proxies; //!< all registered proxies |
---|
52 | |
---|
53 | }; |
---|
54 | |
---|
55 | |
---|
56 | |
---|
57 | #endif /* _PROXY_SETTINGS_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.