Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 10, 2010, 3:35:39 PM (13 years ago)
Author:
smerkli
Message:

added comments, lua function (to be tested) and various implementation bits

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/masterserver/src/libraries/network/WANDiscovery.h

    r7630 r7631  
    3333#include "packet/ServerInformation.h"
    3434#include "util/Singleton.h"
     35#include "MasterServerComm.h"
    3536
    3637#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"
    3745
    3846// tolua_begin
     
    4654    friend class Singleton<WANDiscovery>;
    4755    public:
     56      /** constructor */
    4857      WANDiscovery();
     58
     59      /** destructor */
    4960      ~WANDiscovery();
     61
     62      /** ask server for server list  */
    5063      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       */
    5170      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       */
    5277      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
    5484     
    5585    private:
     86      /** Singleton pointer */
    5687      static WANDiscovery* singletonPtr_s;
    57       ENetHost* host_;
     88
     89      /** Master server communications object */
     90      MasterServerComm msc;
     91
     92      /** game server list */
    5893      std::vector<packet::ServerInformation> servers_;
     94
    5995  }; // tolua_export
    6096
Note: See TracChangeset for help on using the changeset viewer.