summaryrefslogtreecommitdiff
path: root/src/char_sql
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-18 10:04:41 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-18 10:04:41 +0000
commita625c96cd44bc95bdc1d8bc9e2143372fb28c56e (patch)
tree05a59ba3c1d92b5daac7aa25e9bd2fd5ad1f63d4 /src/char_sql
parent712ea2e956dbaae6f23229e0c7634cd95a14fe9d (diff)
downloadhercules-a625c96cd44bc95bdc1d8bc9e2143372fb28c56e.tar.gz
hercules-a625c96cd44bc95bdc1d8bc9e2143372fb28c56e.tar.bz2
hercules-a625c96cd44bc95bdc1d8bc9e2143372fb28c56e.tar.xz
hercules-a625c96cd44bc95bdc1d8bc9e2143372fb28c56e.zip
* Don't log SQL char actions if log_char is not enabled in char_athena.conf
* Updated shop_exp's calculation to give more exp * Some item and mob DB updates * Added Einbech/Einbroch warps git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1249 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r--src/char_sql/char.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 65e388e3e..78467b579 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -1143,17 +1143,19 @@ int make_new_char_sql(int fd, unsigned char *dat) {
// check individual stat value
for(i = 24; i <= 29; i++) {
if (dat[i] < 1 || dat[i] > 9) {
- printf("fail (aid: %d), stats error(bot cheat?!)\n", sd->account_id);
+ printf("fail (aid: %d), stats error(bot cheat?!)\n", sd->account_id);
return -2;
}
}
- // char.log to charlog
- sprintf(tmp_sql,"INSERT INTO `%s` (`time`, `char_msg`,`account_id`,`char_num`,`name`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`hair`,`hair_color`)"
- "VALUES (NOW(), '%s', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
- charlog_db,"make new char error", sd->account_id, dat[30], dat, dat[24], dat[25], dat[26], dat[27], dat[28], dat[29], dat[33], dat[31]);
- //query
- mysql_query(&mysql_handle, tmp_sql);
+ if (log_char) {
+ // char.log to charlog
+ sprintf(tmp_sql,"INSERT INTO `%s` (`time`, `char_msg`,`account_id`,`char_num`,`name`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`hair`,`hair_color`)"
+ "VALUES (NOW(), '%s', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
+ charlog_db,"make new char error", sd->account_id, dat[30], dat, dat[24], dat[25], dat[26], dat[27], dat[28], dat[29], dat[33], dat[31]);
+ //query
+ mysql_query(&mysql_handle, tmp_sql);
+ }
//printf("make new char error %d-%d %s %d, %d, %d, %d, %d, %d %d, %d" RETCODE,
// fd, dat[30], dat, dat[24], dat[25], dat[26], dat[27], dat[28], dat[29], dat[33], dat[31]);
@@ -1161,13 +1163,15 @@ int make_new_char_sql(int fd, unsigned char *dat) {
return -2;
}
- // char.log to charlog
- sprintf(tmp_sql,"INSERT INTO `%s`(`time`, `char_msg`,`account_id`,`char_num`,`name`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`hair`,`hair_color`)"
- "VALUES (NOW(), '%s', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
- charlog_db,"make new char", sd->account_id, dat[30], dat, dat[24], dat[25], dat[26], dat[27], dat[28], dat[29], dat[33], dat[31]);
- //query
- if (mysql_query(&mysql_handle, tmp_sql)) {
- printf("fail(log error), SQL error: %s\n", mysql_error(&mysql_handle));
+ if (log_char) {
+ // char.log to charlog
+ sprintf(tmp_sql,"INSERT INTO `%s`(`time`, `char_msg`,`account_id`,`char_num`,`name`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`hair`,`hair_color`)"
+ "VALUES (NOW(), '%s', '%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
+ charlog_db,"make new char", sd->account_id, dat[30], dat, dat[24], dat[25], dat[26], dat[27], dat[28], dat[29], dat[33], dat[31]);
+ //query
+ if (mysql_query(&mysql_handle, tmp_sql)) {
+ printf("fail(log error), SQL error: %s\n", mysql_error(&mysql_handle));
+ }
}
//printf("make new char %d-%d %s %d, %d, %d, %d, %d, %d - %d, %d" RETCODE,
// fd, dat[30], dat, dat[24], dat[25], dat[26], dat[27], dat[28], dat[29], dat[33], dat[31]);
@@ -2534,11 +2538,13 @@ int parse_char(int fd) {
break;
}
- sprintf(tmp_sql,"INSERT INTO `%s`(`time`, `account_id`,`char_num`,`name`) VALUES (NOW(), '%d', '%d', '%s')",
- charlog_db, sd->account_id, RFIFOB(fd, 2), char_dat[0].name);
- //query
- if(mysql_query(&mysql_handle, tmp_sql)) {
- printf("DB server Error - %s\n", mysql_error(&mysql_handle));
+ if (log_char) {
+ sprintf(tmp_sql,"INSERT INTO `%s`(`time`, `account_id`,`char_num`,`name`) VALUES (NOW(), '%d', '%d', '%s')",
+ charlog_db, sd->account_id, RFIFOB(fd, 2), char_dat[0].name);
+ //query
+ if(mysql_query(&mysql_handle, tmp_sql)) {
+ printf("DB server Error - %s\n", mysql_error(&mysql_handle));
+ }
}
printf("(\033[1;64m%d\033[0m) char selected (\033[1;32m%d\033[0m) \033[1;32m%s\033[0m" RETCODE, sd->account_id, RFIFOB(fd, 2), char_dat[0].name);