Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/proxy/src/lib/network/proxy/proxy_settings.h @ 9301

Last change on this file since 9301 was 9301, checked in by patrick, 18 years ago

fixed a segfault.

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