issue 1253 - prevent multiple logins with same username
This commit is contained in:
@@ -201,6 +201,7 @@ bool cServer::InitServer(cIniFile & a_SettingsIni, bool a_ShouldAuth)
|
||||
m_Description = a_SettingsIni.GetValueSet("Server", "Description", "MCServer - in C++!");
|
||||
m_MaxPlayers = a_SettingsIni.GetValueSetI("Server", "MaxPlayers", 100);
|
||||
m_bIsHardcore = a_SettingsIni.GetValueSetB("Server", "HardcoreEnabled", false);
|
||||
m_bAllowMultiLogin = a_SettingsIni.GetValueSetB("Server", "AllowMultiLogin", false);
|
||||
m_PlayerCount = 0;
|
||||
m_PlayerCountDiff = 0;
|
||||
|
||||
@@ -303,6 +304,22 @@ int cServer::GetNumPlayers(void) const
|
||||
|
||||
|
||||
|
||||
std::list<std::string> cServer::GetUsernames()
|
||||
{
|
||||
std::list<std::string> usernames;
|
||||
cCSLock Lock(m_CSClients);
|
||||
for (ClientList::iterator itr = m_Clients.begin(); itr != m_Clients.end(); ++itr)
|
||||
{
|
||||
std::string username = (*itr)->GetUsername();
|
||||
usernames.insert(usernames.begin(),username);
|
||||
}
|
||||
return usernames;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cServer::PrepareKeys(void)
|
||||
{
|
||||
LOGD("Generating protocol encryption keypair...");
|
||||
|
||||
Reference in New Issue
Block a user