Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/network/proxy/network_settings.h @ 9457

Last change on this file since 9457 was 9406, checked in by bensch, 18 years ago

orxonox/trunk: merged the proxy back

merged with commandsvn merge -r9346:HEAD https://svn.orxonox.net/orxonox/branches/proxy .

no conflicts

File size: 1.7 KB
Line 
1/*!
2 * @file proxy_settings.h
3 *  some shared data from the proxy settings
4 */
5
6#ifndef _NETWORK_SETTINGS_H
7#define _NETWORK_SETTINGS_H
8
9#include "base_object.h"
10#include "netdefs.h"
11
12#include "debug.h"
13#include "ip.h"
14
15#include <vector>
16
17
18class NetworkStream;
19class Synchronizeable;
20class TiXmlElement;
21
22
23/* and here is the class itsself*/
24class NetworkSettings : public BaseObject
25{
26
27  public:
28    inline static NetworkSettings* getInstance() { if (!NetworkSettings::singletonRef) NetworkSettings::singletonRef = new NetworkSettings();
29      return NetworkSettings::singletonRef; }
30    virtual ~NetworkSettings();
31
32    void loadData();
33
34    void loadNetworkSettings(const TiXmlElement* root);
35
36    /** @param number: sets the max number of players */
37    inline void setMaxPlayer(int number) { this->maxPlayer = number; }
38    /** @returns teh max number of players */
39    int getMaxPlayer() { return this->maxPlayer; }
40
41    void setMasterAddr(const std::string& masterAddr);
42    /** @returns the address of the master server read from the network config file */
43    inline IP getMasterAddr() { return this->masterServer; }
44
45    void setProxyAddr(const std::string& proxyAddr);
46    /** @returns the list of proxy servers from the init file */
47    inline std::vector<IPaddress*>* getProxyList() { return &this->proxies; }
48
49
50  private:
51    NetworkSettings();
52
53
54  private:
55    static NetworkSettings*        singletonRef;            //!< Pointer to the only instance of this Class
56    int                          maxPlayer;               //!< maximal number of players
57    std::vector<IPaddress*>      proxies;                 //!< all registered proxies
58    IP                           masterServer;            //!< master server ip address
59
60};
61
62
63
64#endif /* _NETWORK_SETTINGS_H */
Note: See TracBrowser for help on using the repository browser.