summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorVincent <vincent.leung60@gmail.com>2014-12-08 09:45:29 +0100
committerVincent <vincent.leung60@gmail.com>2014-12-08 09:45:29 +0100
commit6de07d4a39096f19c075695824aa87a1907e4edc (patch)
treedc054c1be5c63b9b2303c208e8c8ad83eb37fcee /src/ClientHandle.cpp
parentremoved last space in handlehandshake (diff)
downloadcuberite-6de07d4a39096f19c075695824aa87a1907e4edc.tar
cuberite-6de07d4a39096f19c075695824aa87a1907e4edc.tar.gz
cuberite-6de07d4a39096f19c075695824aa87a1907e4edc.tar.bz2
cuberite-6de07d4a39096f19c075695824aa87a1907e4edc.tar.lz
cuberite-6de07d4a39096f19c075695824aa87a1907e4edc.tar.xz
cuberite-6de07d4a39096f19c075695824aa87a1907e4edc.tar.zst
cuberite-6de07d4a39096f19c075695824aa87a1907e4edc.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 4031fa1df..6f7bd1faf 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -1788,19 +1788,14 @@ void cClientHandle::HandleKeepAlive(int a_KeepAliveID)
-bool cClientHandle::CheckMultiLogin(void)
+bool cClientHandle::CheckMultiLogin(const AString & a_Username)
{
if (!(cRoot::Get()->GetServer()->IsAllowMultiLogin()))
{
- std::list<AString> usernamesServer = cRoot::Get()->GetServer()->GetUsernames();
-
- for (auto item : usernamesServer)
+ if (cRoot::Get()->GetServer()->IsPlayerInQueue(a_Username))
{
- if ((item).compare(a_Username) == 0)
- {
Kick("A player of the username is already logged in");
return false;
- }
}
class cCallback :
@@ -1837,7 +1832,7 @@ bool cClientHandle::HandleHandshake(const AString & a_Username)
}
}
- return CheckMultiLogin();
+ return CheckMultiLogin(a_Username);
}