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());
|
unsigned previousPlayerId = GetPlayerId(session->GetPlayerData()->GetName());
|
||||||
if (previousPlayerId != 0 && previousPlayerId != session->GetPlayerData()->GetUniqueId()) {
|
if (previousPlayerId != 0 && previousPlayerId != session->GetPlayerData()->GetUniqueId()) {
|
||||||
#ifdef POKERTH_OFFICIAL_SERVER
|
#ifdef POKERTH_OFFICIAL_SERVER
|
||||||
// If so, and this is a login server, disconnect the already connected player.
|
// 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);
|
InternalRemovePlayer(previousPlayerId, ERR_NET_PLAYER_NAME_IN_USE);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
// If this is a server without password protection, close this new session and return.
|
// If this is a server without password protection, close this new session and return.
|
||||||
SessionError(session, ERR_NET_PLAYER_NAME_IN_USE);
|
SessionError(session, ERR_NET_PLAYER_NAME_IN_USE);
|
||||||
|
|||||||
@@ -390,6 +390,7 @@ SessionData::GetPlayerData()
|
|||||||
string
|
string
|
||||||
SessionData::GetRemoteIPAddressFromSocket() const
|
SessionData::GetRemoteIPAddressFromSocket() const
|
||||||
{
|
{
|
||||||
|
boost::mutex::scoped_lock lock(m_dataMutex);
|
||||||
string ipAddress;
|
string ipAddress;
|
||||||
if (m_socket) {
|
if (m_socket) {
|
||||||
boost::system::error_code errCode;
|
boost::system::error_code errCode;
|
||||||
|
|||||||
Reference in New Issue
Block a user