Don't let a websocket login kick a normal login.

This commit is contained in:
lotodore
2014-02-15 23:15:27 +01:00
parent 4ddc972d73
commit 3cbb365c61
2 changed files with 10 additions and 2 deletions
+9 -2
View File
@@ -1685,8 +1685,15 @@ ServerLobbyThread::EstablishSession(boost::shared_ptr<SessionData> session)
unsigned previousPlayerId = GetPlayerId(session->GetPlayerData()->GetName());
if (previousPlayerId != 0 && previousPlayerId != session->GetPlayerData()->GetUniqueId()) {
#ifdef POKERTH_OFFICIAL_SERVER
// If so, and this is a login server, disconnect the already connected player.
InternalRemovePlayer(previousPlayerId, ERR_NET_PLAYER_NAME_IN_USE);
// If this is a login server with a websocket connection, decline connection.
if (session->GetWebData()) {
SessionError(session, ERR_NET_PLAYER_NAME_IN_USE);
return;
}
else {
// If this is not a websocket connection, disconnect the already connected player.
InternalRemovePlayer(previousPlayerId, ERR_NET_PLAYER_NAME_IN_USE);
}
#else
// If this is a server without password protection, close this new session and return.
SessionError(session, ERR_NET_PLAYER_NAME_IN_USE);
+1
View File
@@ -390,6 +390,7 @@ SessionData::GetPlayerData()
string
SessionData::GetRemoteIPAddressFromSocket() const
{
boost::mutex::scoped_lock lock(m_dataMutex);
string ipAddress;
if (m_socket) {
boost::system::error_code errCode;