diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-20 21:28:44 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-20 21:28:44 +0000 |
commit | d63bfea2a4c95f34b3373dab2d1425d72ea227df (patch) | |
tree | 105847d717682fefb7e4737661010ac703a2bd72 /src/login_sql/login.c | |
parent | 0d8bcc88e3a5d621b5e483b8af1eff7958f0fe79 (diff) | |
download | hercules-d63bfea2a4c95f34b3373dab2d1425d72ea227df.tar.gz hercules-d63bfea2a4c95f34b3373dab2d1425d72ea227df.tar.bz2 hercules-d63bfea2a4c95f34b3373dab2d1425d72ea227df.tar.xz hercules-d63bfea2a4c95f34b3373dab2d1425d72ea227df.zip |
- Play-dead and Basilica now do block Gospel
- Map SQL server will no longer ignore the gm-list packets received from char.
- Login-SQL server will not free the current GM listing if the SQL reading of it failed.
- Login-SQL will now read for the GM list ALL accounts with level above 0, not just those with level above min_gm_level (just like the TXT server does)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5349 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login_sql/login.c')
-rw-r--r-- | src/login_sql/login.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/login_sql/login.c b/src/login_sql/login.c index ca27c0036..9bbad06dc 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -122,7 +122,6 @@ char login_db_level[256] = "level"; char reg_db[256] = "global_reg_value";
-int lowest_gm_level;
struct gm_account *gm_account_db;
int GM_num;
char tmpsql[65535], tmp_sql[65535];
@@ -203,15 +202,20 @@ void read_gm_account(void) { MYSQL_RES* sql_res ;
MYSQL_ROW sql_row;
- if (gm_account_db != NULL)
- aFree(gm_account_db);
- GM_num = 0;
-
- sprintf(tmp_sql, "SELECT `%s`,`%s` FROM `%s` WHERE `%s`>='%d'",login_db_account_id,login_db_level,login_db,login_db_level,lowest_gm_level);
+ sprintf(tmp_sql, "SELECT `%s`,`%s` FROM `%s` WHERE `%s`> '0'",login_db_account_id,login_db_level,login_db,login_db_level);
if (mysql_query(&mysql_handle, tmp_sql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ return; //Failed to read GM list!
+ }
+
+ if (gm_account_db != NULL)
+ {
+ aFree(gm_account_db);
+ gm_account_db = NULL;
}
+ GM_num = 0;
+
sql_res = mysql_store_result(&mysql_handle);
if (sql_res) {
gm_account_db = (struct gm_account*)aCalloc((size_t)mysql_num_rows(sql_res), sizeof(struct gm_account));
@@ -2146,9 +2150,6 @@ void sql_config_read(const char *cfgName){ /* Kalaspuff, to get login_db */ else if (strcmpi(w1, "loginlog_db") == 0) {
strcpy(loginlog_db, w2);
}
- else if (strcmpi(w1, "lowest_gm_level") == 0) {
- lowest_gm_level = atoi(w2);
- }
else if (strcmpi(w1, "reg_db") == 0) {
strcpy(reg_db, w2);
}
|