Rework login credential functions

This commit is contained in:
KimLS
2016-10-31 21:19:48 -07:00
parent 7f7a4b0f2d
commit d8da52796b
17 changed files with 297 additions and 387 deletions
+9 -33
View File
@@ -67,6 +67,15 @@ int main()
if (server.config->GetVariable("options", "dump_packets_out").compare("TRUE") == 0)
server.options.DumpOutPackets(true);
if (server.config->GetVariable("security", "allow_token_login").compare("TRUE") == 0)
server.options.AllowTokenLogin(true);
if (server.config->GetVariable("security", "allow_password_login").compare("FALSE") == 0)
server.options.AllowPasswordLogin(false);
if (server.config->GetVariable("options", "auto_create_accounts").compare("TRUE") == 0)
server.options.AutoCreateAccounts(true);
std::string mode = server.config->GetVariable("security", "mode");
if (mode.size() > 0)
server.options.EncryptionMode(atoi(mode.c_str()));
@@ -127,24 +136,6 @@ int main()
return 1;
}
#if WIN32
//initialize our encryption.
Log.Out(Logs::General, Logs::Login_Server, "Encryption Initialize.");
server.eq_crypto = new Encryption();
if (server.eq_crypto->LoadCrypto(server.config->GetVariable("security", "plugin"))) {
Log.Out(Logs::General, Logs::Login_Server, "Encryption Loaded Successfully.");
}
else {
//We can't run without encryption, cleanup and exit.
Log.Out(Logs::General, Logs::Error, "Encryption Failed to Load.");
Log.Out(Logs::General, Logs::Login_Server, "Database System Shutdown.");
delete server.db;
Log.Out(Logs::General, Logs::Login_Server, "Config System Shutdown.");
delete server.config;
return 1;
}
#endif
//create our server manager.
Log.Out(Logs::General, Logs::Login_Server, "Server Manager Initialize.");
server.server_manager = new ServerManager();
@@ -152,11 +143,6 @@ int main()
//We can't run without a server manager, cleanup and exit.
Log.Out(Logs::General, Logs::Error, "Server Manager Failed to Start.");
#ifdef WIN32
Log.Out(Logs::General, Logs::Login_Server, "Encryption System Shutdown.");
delete server.eq_crypto;
#endif
Log.Out(Logs::General, Logs::Login_Server, "Database System Shutdown.");
delete server.db;
Log.Out(Logs::General, Logs::Login_Server, "Config System Shutdown.");
@@ -173,11 +159,6 @@ int main()
Log.Out(Logs::General, Logs::Login_Server, "Server Manager Shutdown.");
delete server.server_manager;
#ifdef WIN32
Log.Out(Logs::General, Logs::Login_Server, "Encryption System Shutdown.");
delete server.eq_crypto;
#endif
Log.Out(Logs::General, Logs::Login_Server, "Database System Shutdown.");
delete server.db;
Log.Out(Logs::General, Logs::Login_Server, "Config System Shutdown.");
@@ -207,11 +188,6 @@ int main()
Log.Out(Logs::General, Logs::Login_Server, "Server Manager Shutdown.");
delete server.server_manager;
#ifdef WIN32
Log.Out(Logs::General, Logs::Login_Server, "Encryption System Shutdown.");
delete server.eq_crypto;
#endif
Log.Out(Logs::General, Logs::Login_Server, "Database System Shutdown.");
delete server.db;
Log.Out(Logs::General, Logs::Login_Server, "Config System Shutdown.");