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:
lotodore
2008-04-19 11:48:09 +00:00
parent 17a7a19298
commit 7a157b682a
10 changed files with 380 additions and 11 deletions
+45
View File
@@ -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
{