- Timestamp:
- Nov 10, 2010, 3:35:39 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/masterserver/src/libraries/network/WANDiscovery.h
r7630 r7631 33 33 #include "packet/ServerInformation.h" 34 34 #include "util/Singleton.h" 35 #include "MasterServerComm.h" 35 36 36 37 #include <vector> 38 39 /* master server address (to be moved elsewhere later) */ 40 #define MS_ADDRESS "localhost" 41 42 /* protocol (to be moved elsewhere later) */ 43 #define MSPROTO_CLIENT "CL " 44 #define MSPROTO_REQ_LIST "REQ:LIST" 37 45 38 46 // tolua_begin … … 46 54 friend class Singleton<WANDiscovery>; 47 55 public: 56 /** constructor */ 48 57 WANDiscovery(); 58 59 /** destructor */ 49 60 ~WANDiscovery(); 61 62 /** ask server for server list */ 50 63 void discover(); // tolua_export 64 65 /** \param index Index to get the name of 66 * \return The name of the server 67 * 68 * Get the name of the server at index index. 69 */ 51 70 std::string getServerListItemName( unsigned int index ); // tolua_export 71 72 /** \param index Index to get the IP of 73 * \return The IP of the server 74 * 75 * Get the IP of the server at index index. 76 */ 52 77 std::string getServerListItemIP( unsigned int index ); // tolua_export 53 static WANDiscovery& getInstance(){ return Singleton<WANDiscovery>::getInstance(); } // tolua_export 78 79 /** \return an instance of WANDiscovery 80 * 81 * Create and return an instance of WANDiscovery. 82 */ 83 static WANDiscovery& getInstance() { return Singleton<WANDiscovery>::getInstance(); } // tolua_export 54 84 55 85 private: 86 /** Singleton pointer */ 56 87 static WANDiscovery* singletonPtr_s; 57 ENetHost* host_; 88 89 /** Master server communications object */ 90 MasterServerComm msc; 91 92 /** game server list */ 58 93 std::vector<packet::ServerInformation> servers_; 94 59 95 }; // tolua_export 60 96
Note: See TracChangeset
for help on using the changeset viewer.