Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/proxy/src/lib/network/proxy/proxy_settings.cc @ 9297

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

proxy servers registered correctly

File size: 1.4 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11### File Specific:
12   main-programmer: Patrick Boenzli
13*/
14
15
16#define DEBUG_MODULE_NETWORK
17
18#include "proxy_settings.h"
19#include "netdefs.h"
20
21#include "loading/load_param.h"
22
23
24using namespace std;
25
26
27ProxySettings* ProxySettings::singletonRef = NULL;
28
29/**
30 * Standard constructor
31 */
32ProxySettings::ProxySettings()
33{
34  /* set the class id for the base object */
35  this->setClassID(CL_PROXY_SETTINGS, "ProxySettings");
36}
37
38
39/**
40 * Standard destructor
41 */
42ProxySettings::~ProxySettings()
43{
44  ProxySettings::singletonRef = NULL;
45}
46
47
48
49/**
50 * load the proxy settings
51 * @param root: the root element of the xml elemnts
52 */
53void ProxySettings::loadProxySettings(const TiXmlElement* root)
54{
55
56  LoadParam(root, "max-player", this, ProxySettings, setMaxPlayer);
57
58  LoadParam(root, "proxy-addr", this, ProxySettings, setProxyAddr);
59}
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
Note: See TracBrowser for help on using the repository browser.