Don't let a websocket login kick a normal login.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user