summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-11-14 18:41:07 +0100
committerGitHub <noreply@github.com>2018-11-14 18:41:07 +0100
commit639af795caf86f9f30770b5d1d2e9164876deb1f (patch)
tree35d822bc1c3577eaeef0e1cd6c59ded894caf263
parent3a6892f5c82a71e689450c50da57f6752defcd84 (diff)
parent612fa0db4f0310abde19c946a0c6d4291139a1f5 (diff)
downloadhercules-639af795caf86f9f30770b5d1d2e9164876deb1f.tar.gz
hercules-639af795caf86f9f30770b5d1d2e9164876deb1f.tar.bz2
hercules-639af795caf86f9f30770b5d1d2e9164876deb1f.tar.xz
hercules-639af795caf86f9f30770b5d1d2e9164876deb1f.zip
Merge pull request #2320 from MishimaHaruna/improve-charlog
Add relevant data to the charlog
-rw-r--r--sql-files/main.sql2
-rw-r--r--src/char/char.c32
2 files changed, 28 insertions, 6 deletions
diff --git a/sql-files/main.sql b/sql-files/main.sql
index d918d4a35..37bfaf0ec 100644
--- a/sql-files/main.sql
+++ b/sql-files/main.sql
@@ -293,7 +293,7 @@ CREATE TABLE IF NOT EXISTS `charlog` (
`str` INT(11) UNSIGNED NOT NULL DEFAULT '0',
`agi` INT(11) UNSIGNED NOT NULL DEFAULT '0',
`vit` INT(11) UNSIGNED NOT NULL DEFAULT '0',
- `INT` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+ `int` INT(11) UNSIGNED NOT NULL DEFAULT '0',
`dex` INT(11) UNSIGNED NOT NULL DEFAULT '0',
`luk` INT(11) UNSIGNED NOT NULL DEFAULT '0',
`hair` TINYINT(4) NOT NULL DEFAULT '0',
diff --git a/src/char/char.c b/src/char/char.c
index 18269aeaf..8c3618887 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -1548,9 +1548,20 @@ static int char_rename_char_sql(struct char_session_data *sd, int char_id)
// log change
if (chr->enable_logs) {
if (SQL_ERROR == SQL->Query(inter->sql_handle,
- "INSERT INTO `%s` (`time`, `char_msg`,`account_id`,`char_id`,`char_num`,`name`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`hair`,`hair_color`)"
- "VALUES (NOW(), '%s', '%d', '%d', '%d', '%s', '0', '0', '0', '0', '0', '0', '0', '0')",
- charlog_db, "change char name", sd->account_id, char_dat.char_id, char_dat.slot, esc_name))
+ "INSERT INTO `%s` ("
+ " `time`, `char_msg`, `account_id`, `char_id`, `char_num`, `class`, `name`,"
+ " `str`, `agi`, `vit`, `int`, `dex`, `luk`,"
+ " `hair`, `hair_color`"
+ ") VALUES ("
+ " NOW(), 'change char name', '%d', '%d', '%d', '%d', '%s',"
+ " '%d', '%d', '%d', '%d', '%d', '%d',"
+ " '%d', '%d'"
+ ")",
+ charlog_db,
+ sd->account_id, char_dat.char_id, char_dat.slot, char_dat.class, esc_name,
+ char_dat.str, char_dat.agi, char_dat.vit, char_dat.int_, char_dat.dex, char_dat.luk,
+ char_dat.hair, char_dat.hair_color
+ ))
Sql_ShowDebug(inter->sql_handle);
}
@@ -4566,8 +4577,19 @@ static void char_parse_char_select(int fd, struct char_session_data *sd, uint32
// FIXME: Why are we re-escaping the name if it was already escaped in rename/make_new_char? [Panikon]
SQL->EscapeStringLen(inter->sql_handle, esc_name, char_dat.name, strnlen(char_dat.name, NAME_LENGTH));
if (SQL_ERROR == SQL->Query(inter->sql_handle,
- "INSERT INTO `%s`(`time`, `account_id`, `char_id`, `char_num`, `name`) VALUES (NOW(), '%d', '%d', '%d', '%s')",
- charlog_db, sd->account_id, cd->char_id, slot, esc_name))
+ "INSERT INTO `%s`("
+ " `time`, `char_msg`, `account_id`, `char_id`, `char_num`, `class`, `name`,"
+ " `str`, `agi`, `vit`, `int`, `dex`, `luk`,"
+ " `hair`, `hair_color`"
+ ") VALUES ("
+ " NOW(), 'char select', '%d', '%d', '%d', '%d', '%s',"
+ " '%d', '%d', '%d', '%d', '%d', '%d',"
+ " '%d', '%d')",
+ charlog_db,
+ sd->account_id, cd->char_id, slot, char_dat.class, esc_name,
+ char_dat.str, char_dat.agi, char_dat.vit, char_dat.int_, char_dat.dex, char_dat.luk,
+ char_dat.hair, char_dat.hair_color
+ ))
Sql_ShowDebug(inter->sql_handle);
}
ShowInfo("Selected char: (Account %d: %d - %s)\n", sd->account_id, slot, char_dat.name);