Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/proxy/src/lib/network/proxy/network_settings.h @ 9396

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

committing my weekends work: 2100 lines :D

  • proxy server now accepts and synchronizes clients like a master server
  • network manager got different network setup interface
  • network stream got different constructure scheme
  • permissions checking and algorithm extended and changed
  • starting ability to connect to multiple network nodes at the same time
  • some very much smaller changes here and there
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.