diff options
author | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-08-19 15:48:57 +0000 |
---|---|---|
committer | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-08-19 15:48:57 +0000 |
commit | 73c06082f78f6ba79e40bf66c531d5ff99082fee (patch) | |
tree | adf94e026ce531dc63c690ac3f16fff1dc30ed6d /src/login/login.c | |
parent | db6e4aaaeea4e7053e17576db730def8b3cd4fd9 (diff) | |
download | hercules-73c06082f78f6ba79e40bf66c531d5ff99082fee.tar.gz hercules-73c06082f78f6ba79e40bf66c531d5ff99082fee.tar.bz2 hercules-73c06082f78f6ba79e40bf66c531d5ff99082fee.tar.xz hercules-73c06082f78f6ba79e40bf66c531d5ff99082fee.zip |
* Added global sql settings 'sql.*' to inter_athena.conf.
* Made account, ipban and loginlog use the global sql settings when the hostname is empty.
* Commented 'ipban.sql.*' and 'account.sql.*' so they default to the global settings.
* Removed deprecated settings 'case_sensitive' and 'add_to_unlimited_account' from in login_athena.conf.
* Made inter_athena.conf be imported from login_athena.conf instead of being handled separate.
* Changed ipban to get the failed login attempts of an ip from loginlog (respects if loginlog is enabled or not).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13092 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login/login.c')
-rw-r--r-- | src/login/login.c | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/src/login/login.c b/src/login/login.c index d458a8b88..c92c8a970 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -1572,9 +1572,7 @@ int login_config_read(const char* cfgName) else if(!strcmpi(w1, "import")) login_config_read(w2); else - if( ipban_config_read(w1, w2) ) - continue; - else if(!strcmpi(w1, "account.engine")) + if(!strcmpi(w1, "account.engine")) safestrncpy(login_config.account_engine, w2, sizeof(login_config.account_engine)); else {// try the account engines @@ -1585,6 +1583,9 @@ int login_config_read(const char* cfgName) if( db && db->set_property(db, w1, w2) ) break; } + // try others + ipban_config_read(w1, w2); + loginlog_config_read(w1, w2); } } fclose(fp); @@ -1592,36 +1593,6 @@ int login_config_read(const char* cfgName) return 0; } -//----------------------------------- -// Reading interserver configuration file -//----------------------------------- -void inter_config_read(const char* cfgName) -{ - char line[1024], w1[1024], w2[1024]; - FILE* fp = fopen(cfgName, "r"); - if(fp == NULL) { - ShowError("file not found: %s\n", cfgName); - return; - } - ShowInfo("reading configuration file %s...\n", cfgName); - while(fgets(line, sizeof(line), fp)) - { - if (line[0] == '/' && line[1] == '/') - continue; - if (sscanf(line, "%[^:]: %[^\r\n]", w1, w2) < 2) - continue; - - // settings common for multiple components - ipban_config_read(w1,w2); - loginlog_config_read(w1,w2); - - if (!strcmpi(w1, "import")) - inter_config_read(w2); - } - fclose(fp); - ShowInfo("Done reading %s.\n", cfgName); -} - /// Get the engine selected in the config settings. /// Updates the config setting with the selected engine if 'auto'. static AccountDB* get_account_engine(void) @@ -1712,7 +1683,6 @@ int do_init(int argc, char** argv) login_set_defaults(); login_config_read((argc > 1) ? argv[1] : LOGIN_CONF_NAME); login_lan_config_read((argc > 2) ? argv[2] : LAN_CONF_NAME); - inter_config_read(INTER_CONF_NAME); srand((unsigned int)time(NULL)); |