Orxonox  0.0.5 Codename: Arcturus
WANDiscovery.h
Go to the documentation of this file.
1 /*
2  * ORXONOX - the hottest 3D action shooter ever to exist > www.orxonox.net <
3  *
4  *
5  * License notice:
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the Free
9  * Software Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc., 51
19  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  * Author:
22  * Sandro 'smerkli' Merkli
23  * Co-authors:
24  * Oliver Scheuss (original)
25  *
26  */
27 
28 #ifndef _WANDiscovery_H__
29 #define _WANDiscovery_H__
30 
31 #include "NetworkPrereqs.h"
35 #include "MasterServerComm.h"
36 #include "MasterServerProtocol.h"
37 #include <OgreStringConverter.h>
38 
39 #include <vector>
40 
41 #define WANDISC_MAXTRIES 5
42 
43 // tolua_begin
44 namespace orxonox
45 {
46 
48 // tolua_end
49  : public Configurable
50  { // tolua_export
51  public:
53  WANDiscovery(); // tolua_export
54 
56  ~WANDiscovery();
57 
63  { return this->msaddress; }
64 
66  void discover(); // tolua_export
67 
73  std::string getServerListItemName( unsigned int index ); // tolua_export
74 
80  std::string getServerListItemIP( unsigned int index ); // tolua_export
81 
87  std::string getServerListItemRTT( unsigned int index ); // tolua_export
88 
94  std::string getServerListItemPlayerNumber( unsigned int index ); // tolua_export
95 
96  /* todo: might make this private and use getter/setter methods
97  * at some later time.
98  */
100  std::vector<packet::ServerInformation> servers_;
101 
103  void setConfigValues();
104 
107 
108  int rhandler( char *addr, ENetEvent *ev );
109 
110  private:
113 
114  }; // tolua_export
115 
116 } // tolua_export
117 
118 #endif // _WANDiscovery_H__
Shared library macros, enums, constants and forward declarations for the network library ...
Definition: MasterServerComm.h:43
::std::string string
Definition: gtest-port.h:756
This is the base class of all objects which may contain config values.
Definition: Configurable.h:47
Definition: WANDiscovery.h:47
MasterServerComm msc
Master server communications object.
Definition: WANDiscovery.h:106
An ENet event as returned by enet_host_service().
Definition: enet.h:416
std::vector< packet::ServerInformation > servers_
game server list
Definition: WANDiscovery.h:100
std::string getMSAddress()
Definition: WANDiscovery.h:62
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
#define _NetworkExport
Definition: NetworkPrereqs.h:59
Declaration of Configurable, the base class of all objects which may contain config values...
std::string msaddress
master server address
Definition: WANDiscovery.h:112
Definition of macros and functions for config-values.