mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-21 14:50:26 -08:00
force users to log out their unregistered session after logging in with a new registered account
This commit is contained in:
@@ -46,8 +46,11 @@ AuthenticationResult Server::loginUser(Server_ProtocolHandler *session, QString
|
||||
|
||||
if (authState == PasswordRight) {
|
||||
Server_ProtocolHandler *oldSession = users.value(name);
|
||||
if (oldSession)
|
||||
if (oldSession) {
|
||||
if (!(oldSession->getUserInfo()->getUserLevel() & ServerInfo_User::IsRegistered))
|
||||
return WouldOverwriteOldSession;
|
||||
delete oldSession; // ~Server_ProtocolHandler() will call Server::removeClient
|
||||
}
|
||||
} else if (authState == UnknownUser) {
|
||||
// Change user name so that no two users have the same names,
|
||||
// don't interfere with registered user names though.
|
||||
|
||||
Reference in New Issue
Block a user