diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-11-20 10:10:11 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-11-20 10:10:11 +0000 |
commit | 5035131dab63fd4667cb3267a5d447866843c334 (patch) | |
tree | 45636de84f8e32b11eda09092bce09f601852632 /src/login | |
parent | 103e1e4f80071d6b66963424403214e3221b16c1 (diff) | |
download | hercules-5035131dab63fd4667cb3267a5d447866843c334.tar.gz hercules-5035131dab63fd4667cb3267a5d447866843c334.tar.bz2 hercules-5035131dab63fd4667cb3267a5d447866843c334.tar.xz hercules-5035131dab63fd4667cb3267a5d447866843c334.zip |
* Fixed login-server account engine initialization not getting checked, whether it succeeds or not (bugreport:4361, since r12700, related r13000).
- Failure to retrieve account engine and initializing it is now considered fatal and causes the server to exit immediately.
- Fixed two data type inconsistencies, while being at it.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14476 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/login.c | 16 | ||||
-rw-r--r-- | src/login/login.h | 2 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/login/login.c b/src/login/login.c index 59a110348..e888d21f6 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -577,7 +577,7 @@ int parse_fromchar(int fd) struct mmo_account acc; int account_id = RFIFOL(fd,2); - int state = RFIFOL(fd,6); + unsigned int state = RFIFOL(fd,6); RFIFOSKIP(fd,10); if( !accounts->load_num(accounts, &acc, account_id) ) @@ -1543,7 +1543,7 @@ int login_config_read(const char* cfgName) else if(!strcmpi(w1, "check_client_version")) login_config.check_client_version = (bool)config_switch(w2); else if(!strcmpi(w1, "client_version_to_connect")) - login_config.client_version_to_connect = atoi(w2); + login_config.client_version_to_connect = strtoul(w2, NULL, 10); else if(!strcmpi(w1, "use_MD5_passwords")) login_config.use_md5_passwds = (bool)config_switch(w2); else if(!strcmpi(w1, "min_level_to_connect")) @@ -1723,14 +1723,18 @@ int do_init(int argc, char** argv) accounts = get_account_engine(); if( accounts == NULL ) { - ShowError("do_init: account engine '%s' not found.\n", login_config.account_engine); - runflag = 0; - return 1; + ShowFatalError("do_init: account engine '%s' not found.\n", login_config.account_engine); + exit(EXIT_FAILURE); } else { ShowInfo("Using account engine '%s'.\n", login_config.account_engine); - accounts->init(accounts); + + if(!accounts->init(accounts)) + { + ShowFatalError("do_init: Failed to initialize account engine '%s'.\n", login_config.account_engine); + exit(EXIT_FAILURE); + } } if( login_config.console ) diff --git a/src/login/login.h b/src/login/login.h index 2e5af3b5e..807caaed6 100644 --- a/src/login/login.h +++ b/src/login/login.h @@ -58,7 +58,7 @@ struct Login_Config { bool use_md5_passwds; // work with password hashes instead of plaintext passwords? int min_level_to_connect; // minimum level of player/GM (0: player, 1-99: GM) to connect bool check_client_version; // check the clientversion set in the clientinfo ? - int client_version_to_connect; // the client version needed to connect (if checking is enabled) + uint32 client_version_to_connect; // the client version needed to connect (if checking is enabled) bool admin_state; // is ladmin support enabled? char admin_pass[24]; // security password for ladmin |