Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9297 in orxonox.OLD


Ignore:
Timestamp:
Jul 14, 2006, 4:28:54 PM (18 years ago)
Author:
patrick
Message:

proxy servers registered correctly

Location:
branches/proxy/src/lib/network/proxy
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/proxy/proxy_settings.cc

    r9296 r9297  
    1818#include "proxy_settings.h"
    1919#include "netdefs.h"
     20
     21#include "loading/load_param.h"
    2022
    2123
     
    5153void ProxySettings::loadProxySettings(const TiXmlElement* root)
    5254{
     55
     56  LoadParam(root, "max-player", this, ProxySettings, setMaxPlayer);
     57
     58  LoadParam(root, "proxy-addr", this, ProxySettings, setProxyAddr);
    5359}
     60
     61
     62/**
     63 * sets the proxy address to
     64 *  @param proxyAddr: the proxy address
     65 */
     66void ProxySettings::setProxyAddr(const std::string& proxyAddr)
     67{
     68  IPaddress *ip = new IPaddress;
     69
     70  SDLNet_ResolveHost( ip, proxyAddr.c_str(), 9999 );
     71
     72  this->proxies.push_back(ip);
     73}
     74
     75
     76
     77
     78
     79
     80
  • branches/proxy/src/lib/network/proxy/proxy_settings.h

    r9296 r9297  
    99#include "base_object.h"
    1010#include "netdefs.h"
     11
     12#include <vector>
    1113
    1214
     
    2729    void loadProxySettings(const TiXmlElement* root);
    2830
     31    inline void setMaxPlayer(int number) { this->maxPlayer = number; }
     32    void setProxyAddr(const std::string& proxyAddr);
     33
    2934
    3035  private:
     
    3641    static ProxySettings*       singletonRef;            //!< Pointer to the only instance of this Class
    3742
     43    int                         maxPlayer;               //!< maximal number of players
     44
     45    std::vector<IPaddress*>      proxies;                 //!< all registered proxies
     46
    3847};
    3948
Note: See TracChangeset for help on using the changeset viewer.