Adding stuff for server list (choosing a server). Might not compile (untested yet).

This commit is contained in:
lotodore
2009-04-05 11:19:50 +00:00
parent 725d71e154
commit 009249e41a
6 changed files with 162 additions and 19 deletions
+11
View File
@@ -24,6 +24,7 @@
#include <core/thread.h>
#include <net/senderinterface.h>
#include <guiinterface.h>
#include <serverdata.h>
#include <playerdata.h>
#include <gamedata.h>
#include <string>
@@ -74,6 +75,8 @@ public:
void SendAskKickPlayer(unsigned playerId);
void SendVoteKick(bool doKick);
ServerInfo GetServerInfo(unsigned serverId) const;
GameInfo GetGameInfo(unsigned gameId) const;
PlayerInfo GetPlayerInfo(unsigned playerId) const;
bool GetPlayerIdFromName(const std::string &playerName, unsigned &playerId) const;
@@ -89,6 +92,7 @@ protected:
typedef std::list<boost::shared_ptr<NetPacket> > NetPacketList;
typedef std::map<unsigned, PlayerInfo> PlayerInfoMap;
typedef std::map<unsigned, boost::shared_ptr<AvatarData> > AvatarDataMap;
typedef std::map<unsigned, ServerInfo> ServerInfoMap;
// Main function of the thread.
virtual void Main();
@@ -147,6 +151,10 @@ protected:
void RemoveDisconnectedPlayers();
void AddServerInfo(unsigned serverId, const ServerInfo &info);
void ClearServerInfoMap();
void UseServer(unsigned serverId);
unsigned GetGameIdByName(const std::string &name) const;
void AddGameInfo(unsigned gameId, const GameInfo &info);
void UpdateGameInfoMode(unsigned gameId, GameMode mode);
@@ -188,6 +196,9 @@ private:
StartData m_startData;
PlayerDataList m_playerDataList;
ServerInfoMap m_serverInfoMap;
mutable boost::mutex m_serverInfoMapMutex;
GameInfoMap m_gameInfoMap;
mutable boost::mutex m_gameInfoMapMutex;