The client now downloads a zipped server list file from pokerth.net. This is parsed and the first server entry is used for now. Error handling still missing. boost::iostreams now required.
This commit is contained in:
@@ -33,6 +33,7 @@ class ClientCallback;
|
||||
class ResolverThread;
|
||||
class Game;
|
||||
class NetPacket;
|
||||
class DownloadHelper;
|
||||
|
||||
class ClientState
|
||||
{
|
||||
@@ -105,6 +106,50 @@ private:
|
||||
ResolverThread *m_resolver;
|
||||
};
|
||||
|
||||
// State: Start download of the server list.
|
||||
class ClientStateStartServerListDownload : public ClientState
|
||||
{
|
||||
public:
|
||||
// Access the state singleton.
|
||||
static ClientStateStartServerListDownload &Instance();
|
||||
|
||||
virtual ~ClientStateStartServerListDownload();
|
||||
|
||||
// Initiate the name resolution.
|
||||
virtual int Process(ClientThread &client);
|
||||
|
||||
protected:
|
||||
|
||||
// Protected constructor - this is a singleton.
|
||||
ClientStateStartServerListDownload();
|
||||
};
|
||||
|
||||
// State: Downloading the server list.
|
||||
class ClientStateDownloadingServerList : public ClientState
|
||||
{
|
||||
public:
|
||||
// Access the state singleton.
|
||||
static ClientStateDownloadingServerList &Instance();
|
||||
|
||||
virtual ~ClientStateDownloadingServerList();
|
||||
|
||||
void SetDownloadHelper(DownloadHelper *helper);
|
||||
|
||||
// Poll for the completion of the download.
|
||||
virtual int Process(ClientThread &client);
|
||||
|
||||
protected:
|
||||
|
||||
// Protected constructor - this is a singleton.
|
||||
ClientStateDownloadingServerList();
|
||||
|
||||
void Cleanup();
|
||||
|
||||
private:
|
||||
|
||||
DownloadHelper *m_downloadHelper;
|
||||
};
|
||||
|
||||
// State: Initiate server connection.
|
||||
class ClientStateStartConnect : public ClientState
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user