diff options
author | Haru <haru@dotalux.com> | 2013-09-22 09:56:48 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2013-09-22 09:56:48 +0200 |
commit | 469102135fd5429a4225afe378bed3e82dc81d31 (patch) | |
tree | 281e2f661c9affe3870669b4faceb173c96e674f /src/char/inter.c | |
parent | beaf3a26a60d5b0429a577b7d58232957d4483e7 (diff) | |
download | hercules-469102135fd5429a4225afe378bed3e82dc81d31.tar.gz hercules-469102135fd5429a4225afe378bed3e82dc81d31.tar.bz2 hercules-469102135fd5429a4225afe378bed3e82dc81d31.tar.xz hercules-469102135fd5429a4225afe378bed3e82dc81d31.zip |
Corrected various hardcoded database table names
- Added an elemental_db setting to inter-server.conf (elemental table)
- Switched an instance of hardcoded `ipbanlist` to use the ipban_table
setting; thanks to Takkun, related to issue #135
- Switched two instances of hardcoded `char` to use the char_db setting
- Added a TODO notice about the usage of the login table (on a side
note, hardcoded) from the login server (related to issue #142)
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char/inter.c')
-rw-r--r-- | src/char/inter.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/char/inter.c b/src/char/inter.c index 1ff2bca61..4eb4f0c0a 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -451,7 +451,7 @@ void mapif_parse_accinfo(int fd) { account_id = atoi(query); if (account_id < START_ACCOUNT_NUM) { // is string - if ( SQL_ERROR == SQL->Query(sql_handle, "SELECT `account_id`,`name`,`class`,`base_level`,`job_level`,`online` FROM `char` WHERE `name` LIKE '%s' LIMIT 10", query_esq) + if ( SQL_ERROR == SQL->Query(sql_handle, "SELECT `account_id`,`name`,`class`,`base_level`,`job_level`,`online` FROM `%s` WHERE `name` LIKE '%s' LIMIT 10", char_db, query_esq) || SQL->NumRows(sql_handle) == 0 ) { if( SQL->NumRows(sql_handle) == 0 ) { inter_to_fd(fd, u_fd, aid, "No matches were found for your criteria, '%s'",query); @@ -493,6 +493,7 @@ void mapif_parse_accinfo(int fd) { char userid[NAME_LENGTH], user_pass[NAME_LENGTH], email[40], last_ip[20], lastlogin[30], pincode[5], birthdate[11]; short level = -1; int logincount = 0,state = 0; + // FIXME: No, this doesn't really look right. We can't, and shouldn't, access the login table from the char server. if ( SQL_ERROR == SQL->Query(sql_handle, "SELECT `userid`, `user_pass`, `email`, `last_ip`, `group_id`, `lastlogin`, `logincount`, `state`,`pincode`,`birthdate` FROM `login` WHERE `account_id` = '%d' LIMIT 1", account_id) || SQL->NumRows(sql_handle) == 0 ) { if( SQL->NumRows(sql_handle) == 0 ) { @@ -536,7 +537,7 @@ void mapif_parse_accinfo(int fd) { inter_to_fd(fd, u_fd, aid, "-- Character Details --" ); - if ( SQL_ERROR == SQL->Query(sql_handle, "SELECT `char_id`, `name`, `char_num`, `class`, `base_level`, `job_level`, `online` FROM `char` WHERE `account_id` = '%d' ORDER BY `char_num` LIMIT %d", account_id, MAX_CHARS) + if ( SQL_ERROR == SQL->Query(sql_handle, "SELECT `char_id`, `name`, `char_num`, `class`, `base_level`, `job_level`, `online` FROM `%s` WHERE `account_id` = '%d' ORDER BY `char_num` LIMIT %d", char_db, account_id, MAX_CHARS) || SQL->NumRows(sql_handle) == 0 ) { if( SQL->NumRows(sql_handle) == 0 ) |