Rewrote the code which handles leaving of players during the network game. Some bug is still remaining.

This commit is contained in:
lotodore
2007-06-15 10:38:41 +00:00
parent a7598a20eb
commit e19f6c7471
8 changed files with 110 additions and 50 deletions
+4 -1
View File
@@ -106,15 +106,18 @@ protected:
void InternalKickPlayer(const std::string playerName);
SessionWrapper GetSession(SOCKET sock) const;
SessionWrapper GetSession(const std::string playerName) const;
SessionWrapper GetSessionByPlayerName(const std::string playerName) const;
SessionWrapper GetSessionByUniquePlayerId(unsigned uniqueId) const;
void AddSession(boost::shared_ptr<SessionData> sessionData); // new Sessions have no player data
void SessionError(SessionWrapper session, int errorCode);
void RejectNewConnection(boost::shared_ptr<ConnectData> connData);
void CloseSessionDelayed(SessionWrapper session);
void RemoveNotEstablishedSessions();
void RemoveDisconnectedPlayers();
size_t GetCurNumberOfPlayers() const;
bool IsPlayerConnected(const std::string &playerName) const;
bool IsPlayerConnected(unsigned uniquePlayerId) const;
void SetSessionPlayerData(boost::shared_ptr<SessionData> sessionData, boost::shared_ptr<PlayerData> playerData);
PlayerDataList GetPlayerDataList() const;