limit guest logins - ip check done
This commit is contained in:
@@ -1006,6 +1006,12 @@ void
|
||||
ServerLobbyThread::HandleNetPacketInit(boost::shared_ptr<SessionData> session, const InitMessage &initMessage)
|
||||
{
|
||||
LOG_VERBOSE("Received init for session #" << session->GetId() << ".");
|
||||
|
||||
// @XXX: debug tests
|
||||
if(m_sessionManager.IsGuestConnectedMultiple(session->GetClientAddr())){
|
||||
LOG_ERROR("Guest with IP " << session->GetClientAddr() << " already connected! Should be declined!");
|
||||
}
|
||||
// @XXX: end debug tests
|
||||
|
||||
// Before any other processing, perform some denial of service and
|
||||
// brute force attack prevention by checking whether the user recently sent an
|
||||
@@ -1057,6 +1063,11 @@ ServerLobbyThread::HandleNetPacketInit(boost::shared_ptr<SessionData> session, c
|
||||
validGuest = true;
|
||||
noAuth = true;
|
||||
}
|
||||
// @XXX: check if a guest session with same ip is already connected - decline if true
|
||||
if(m_sessionManager.IsGuestConnectedMultiple(session->GetClientAddr())){
|
||||
LOG_ERROR("Guest with IP " << session->GetClientAddr() << " already connected! Decline!");
|
||||
validGuest = false;
|
||||
}
|
||||
}
|
||||
if (!validGuest) {
|
||||
SessionError(session, ERR_NET_INVALID_PLAYER_NAME);
|
||||
|
||||
Reference in New Issue
Block a user