summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/char/char.c80
-rw-r--r--src/char/char.h9
-rw-r--r--src/char/int_elemental.c4
-rw-r--r--src/char/int_guild.c28
-rw-r--r--src/char/int_homun.c4
-rw-r--r--src/char/int_mercenary.c4
-rw-r--r--src/char/int_party.c6
-rw-r--r--src/char/int_pet.c6
-rw-r--r--src/char/inter.c5
-rw-r--r--src/char/inter.h3
10 files changed, 75 insertions, 74 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 2851d3eba..571aad566 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -110,9 +110,6 @@ char char_reg_num_db[32] = "char_reg_num_db";
struct char_interface char_s;
struct char_interface *chr;
-// show loading/saving messages
-int save_log = 1;
-
char db_path[1024] = "db";
char wisp_server_name[NAME_LENGTH] = "Server";
@@ -123,7 +120,7 @@ char char_ip_str[128];
char bind_ip_str[128];
uint32 bind_ip = INADDR_ANY;
int char_maintenance_min_group_id = 0;
-bool char_new = true;
+bool enable_char_creation = true; ///< Whether to allow character creation.
bool name_ignoring_case = false; // Allow or not identical name for characters but with a different case by [Yor]
int char_name_option = 0; // Option to know which letters/symbols are authorized in the name of a character (0: all, 1: only those in char_name_letters, 2: all EXCEPT those in char_name_letters) by [Yor]
@@ -131,13 +128,9 @@ char unknown_char_name[NAME_LENGTH] = "Unknown"; // Name to use when the request
#define TRIM_CHARS "\255\xA0\032\t\x0A\x0D " //The following characters are trimmed regardless because they cause confusion and problems on the servers. [Skotlex]
char char_name_letters[1024] = ""; // list of letters/symbols allowed (or not) in a character name. by [Yor]
-int char_del_level = 0; //From which level u can delete character [Lupus]
+int char_del_level = 0; ///< From which level you can delete character [Lupus]
int char_del_delay = 86400;
-
-int log_char = 1; // logging char or not [devil]
-int log_inter = 1; // logging inter or not [devil]
-
-int char_aegis_delete = 0; // Verify if char is in guild/party or char and reacts as Aegis does (doesn't allow deletion), see chr->delete2_req for more information
+bool char_aegis_delete = false; ///< Verify if char is in guild/party or char and reacts as Aegis does (disallow deletion), @see chr->delete2_req.
int max_connect_user = -1;
int gm_allow_group = -1;
@@ -690,7 +683,7 @@ int char_mmo_char_tosql(int char_id, struct mmo_charstatus* p)
#endif
StrBuf->Destroy(&buf);
- if (save_status[0]!='\0' && save_log)
+ if (chr->show_save_log && save_status[0] != '\0')
ShowInfo("Saved char %d - %s:%s.\n", char_id, p->name, save_status);
if (!errors)
memcpy(cp, p, sizeof(struct mmo_charstatus));
@@ -1043,7 +1036,8 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
memset(p, 0, sizeof(struct mmo_charstatus));
- if (save_log) ShowInfo("Char load request (%d)\n", char_id);
+ if (chr->show_save_log)
+ ShowInfo("Char load request (%d)\n", char_id);
stmt = SQL->StmtMalloc(inter->sql_handle);
if( stmt == NULL )
@@ -1336,7 +1330,8 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
if( SQL_SUCCESS == SQL->StmtNextRow(stmt) )
strcat(t_msg, " accdata");
- if (save_log) ShowInfo("Loaded char (%d - %s): %s\n", char_id, p->name, t_msg); //ok. all data load successfully!
+ if (chr->show_save_log)
+ ShowInfo("Loaded char (%d - %s): %s\n", char_id, p->name, t_msg); //ok. all data load successfully!
SQL->StmtFree(stmt);
StrBuf->Destroy(&buf);
@@ -1463,12 +1458,11 @@ int char_rename_char_sql(struct char_session_data *sd, int char_id)
memset(sd->new_name,0,sizeof(sd->new_name));
// log change
- if( log_char )
- {
- 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) )
+ 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))
Sql_ShowDebug(inter->sql_handle);
}
@@ -1606,10 +1600,11 @@ int char_make_new_char_sql(struct char_session_data *sd, const char *name_, int
return -2;
// Validation success, log result
- if (log_char) {
- 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', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
- charlog_db, "make new char", sd->account_id, char_id, slot, esc_name, str, agi, vit, int_, dex, luk, hair_style, hair_color) )
+ 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', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
+ charlog_db, "make new char", sd->account_id, char_id, slot, esc_name, str, agi, vit, int_, dex, luk, hair_style, hair_color))
Sql_ShowDebug(inter->sql_handle);
}
@@ -1804,13 +1799,13 @@ int char_delete_char_sql(int char_id)
#endif
/* delete character */
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `char_id`='%d'", char_db, char_id) )
+ if (SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `char_id`='%d'", char_db, char_id)) {
Sql_ShowDebug(inter->sql_handle);
- else if( log_char ) {
- if( SQL_ERROR == SQL->Query(inter->sql_handle,
- "INSERT INTO `%s`(`time`, `account_id`, `char_id`, `char_num`, `char_msg`, `name`)"
- " VALUES (NOW(), '%d', '%d', '%d', 'Deleted character', '%s')",
- charlog_db, account_id, char_id, 0, esc_name) )
+ } else if (chr->enable_logs) {
+ if (SQL_ERROR == SQL->Query(inter->sql_handle,
+ "INSERT INTO `%s`(`time`, `account_id`, `char_id`, `char_num`, `char_msg`, `name`)"
+ " VALUES (NOW(), '%d', '%d', '%d', 'Deleted character', '%s')",
+ charlog_db, account_id, char_id, 0, esc_name))
Sql_ShowDebug(inter->sql_handle);
}
@@ -2015,7 +2010,7 @@ int char_mmo_char_send_characters(int fd, struct char_session_data* sd)
#if PACKETVER >= 20100413
offset += 3;
#endif
- if (save_log)
+ if (chr->show_save_log)
ShowInfo("Loading Char Data ("CL_BOLD"%d"CL_RESET")\n",sd->account_id);
j = 24 + offset; // offset
@@ -4516,13 +4511,13 @@ void char_parse_char_select(int fd, struct char_session_data* sd, uint32 ipl)
if( cd->sex == 99 )
cd->sex = sd->sex;
- if (log_char) {
+ if (chr->enable_logs) {
char esc_name[NAME_LENGTH*2+1];
// 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) )
+ 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))
Sql_ShowDebug(inter->sql_handle);
}
ShowInfo("Selected char: (Account %d: %d - %s)\n", sd->account_id, slot, char_dat.name);
@@ -4615,7 +4610,7 @@ void char_parse_char_create_new_char(int fd, struct char_session_data* sd) __att
void char_parse_char_create_new_char(int fd, struct char_session_data* sd)
{
int result;
- if( !char_new ) {
+ if (!enable_char_creation) {
//turn character creation on/off [Kevin]
result = -2;
} else {
@@ -5525,7 +5520,7 @@ int char_config_read(const char* cfgName)
} else if (strcmpi(w1, "char_server_type") == 0) {
chr->server_type = atoi(w2);
} else if (strcmpi(w1, "char_new") == 0) {
- char_new = (bool)atoi(w2);
+ enable_char_creation = atoi(w2) ? true : false;
} else if (strcmpi(w1, "char_new_display") == 0) {
chr->new_display = atoi(w2);
} else if (strcmpi(w1, "max_connect_user") == 0) {
@@ -5539,7 +5534,7 @@ int char_config_read(const char* cfgName)
if (autosave_interval <= 0)
autosave_interval = DEFAULT_AUTOSAVE_INTERVAL;
} else if (strcmpi(w1, "save_log") == 0) {
- save_log = config_switch(w2);
+ chr->show_save_log = config_switch(w2) ? true : false;
}
#ifdef RENEWAL
else if (strcmpi(w1, "start_point_re") == 0) {
@@ -5596,8 +5591,8 @@ int char_config_read(const char* cfgName)
start_zeny = atoi(w2);
if (start_zeny < 0)
start_zeny = 0;
- } else if(strcmpi(w1,"log_char")==0) {
- log_char = atoi(w2); //log char or not [devil]
+ } else if(strcmpi(w1,"log_char") == 0) {
+ chr->enable_logs = atoi(w2) ? true : false;
} else if (strcmpi(w1, "unknown_char_name") == 0) {
safestrncpy(unknown_char_name, w2, sizeof(unknown_char_name));
unknown_char_name[NAME_LENGTH-1] = '\0';
@@ -5612,7 +5607,7 @@ int char_config_read(const char* cfgName)
} else if (strcmpi(w1, "char_del_delay") == 0) {
char_del_delay = atoi(w2);
} else if (strcmpi(w1, "char_aegis_delete") == 0) {
- char_aegis_delete = atoi(w2);
+ char_aegis_delete = atoi(w2) ? true : false;
} else if(strcmpi(w1,"db_path")==0) {
safestrncpy(db_path, w2, sizeof(db_path));
} else if (strcmpi(w1, "fame_list_alchemist") == 0) {
@@ -5947,6 +5942,9 @@ void char_defaults(void)
chr->server_type = 0;
chr->new_display = 0;
+ chr->show_save_log = true;
+ chr->enable_logs = true;
+
chr->waiting_disconnect = char_waiting_disconnect;
chr->delete_char_sql = char_delete_char_sql;
chr->create_online_char_data = char_create_online_char_data;
diff --git a/src/char/char.h b/src/char/char.h
index a0cfb3bd7..b94226859 100644
--- a/src/char/char.h
+++ b/src/char/char.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -110,13 +110,16 @@ struct char_interface {
uint32 ip;
uint16 port;
int server_type;
- int new_display;
+ int16 new_display; ///< Display 'New' in the server list.
char *CHAR_CONF_NAME;
char *NET_CONF_NAME; ///< Network config filename
char *SQL_CONF_NAME;
char *INTER_CONF_NAME;
+ bool show_save_log; ///< Show loading/saving messages.
+ bool enable_logs; ///< Whether to log char server operations.
+
int (*waiting_disconnect) (int tid, int64 tick, int id, intptr_t data);
int (*delete_char_sql) (int char_id);
struct DBData (*create_online_char_data) (union DBKey key, va_list args);
@@ -282,7 +285,6 @@ extern int char_name_option;
extern char char_name_letters[];
extern bool char_gm_read;
extern int autosave_interval;
-extern int save_log;
extern char db_path[];
extern char char_db[256];
extern char scdata_db[256];
@@ -318,7 +320,6 @@ extern char char_reg_str_db[32];
extern char char_reg_num_db[32];
extern int guild_exp_rate;
-extern int log_inter;
void char_load_defaults(void);
void char_defaults(void);
diff --git a/src/char/int_elemental.c b/src/char/int_elemental.c
index c25cfa5c8..aed25febd 100644
--- a/src/char/int_elemental.c
+++ b/src/char/int_elemental.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -128,7 +128,7 @@ bool mapif_elemental_load(int ele_id, int char_id, struct s_elemental *ele) {
SQL->GetData(inter->sql_handle, 13, &data, NULL); ele->hit = atoi(data);
SQL->GetData(inter->sql_handle, 14, &data, NULL); ele->life_time = atoi(data);
SQL->FreeResult(inter->sql_handle);
- if( save_log )
+ if (chr->show_save_log)
ShowInfo("Elemental loaded (%d - %d).\n", ele->elemental_id, ele->char_id);
return true;
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index d2507a2f9..dcc1ed7cb 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -83,9 +83,9 @@ int inter_guild_save_timer(int tid, int64 tick, int id, intptr_t data) {
state++;
}
- if( g->save_flag == GS_REMOVE )
- {// Nothing to save, guild is ready for removal.
- if (save_log)
+ if (g->save_flag == GS_REMOVE) {
+ // Nothing to save, guild is ready for removal.
+ if (chr->show_save_log)
ShowInfo("Guild Unloaded (%d - %s)\n", g->guild_id, g->name);
db_remove(inter_guild->guild_db, key);
}
@@ -337,8 +337,8 @@ int inter_guild_tosql(struct guild *g,int flag)
}
}
- if (save_log)
- ShowInfo("Saved guild (%d - %s):%s\n",g->guild_id,g->name,t_info);
+ if (chr->show_save_log)
+ ShowInfo("Saved guild (%d - %s):%s\n", g->guild_id, g->name, t_info);
return 1;
}
@@ -525,7 +525,7 @@ struct guild * inter_guild_fromsql(int guild_id)
idb_put(inter_guild->guild_db, guild_id, g); //Add to cache
g->save_flag |= GS_REMOVE; //But set it to be removed, in case it is not needed for long.
- if (save_log)
+ if (chr->show_save_log)
ShowInfo("Guild loaded (%d - %s)\n", guild_id, g->name);
return g;
@@ -548,7 +548,7 @@ int inter_guild_castle_tosql(struct guild_castle *gc)
if (SQL_ERROR == SQL->QueryStr(inter->sql_handle, StrBuf->Value(&buf)))
Sql_ShowDebug(inter->sql_handle);
- else if(save_log)
+ else if (chr->show_save_log)
ShowInfo("Saved guild castle (%d)\n", gc->castle_id);
StrBuf->Destroy(&buf);
@@ -600,7 +600,7 @@ struct guild_castle* inter_guild_castle_fromsql(int castle_id)
idb_put(inter_guild->castle_db, castle_id, gc);
- if (save_log)
+ if (chr->show_save_log)
ShowInfo("Loaded guild castle (%d - guild %d)\n", castle_id, gc->guild_id);
return gc;
@@ -1233,9 +1233,9 @@ int mapif_parse_CreateGuild(int fd, int account_id, const char *name, const stru
mapif->guild_created(fd,account_id,g);
mapif->guild_info(fd,g);
- if(log_inter)
+ if (inter->enable_logs)
inter->log("guild %s (id=%d) created by master %s (id=%d)\n",
- name, g->guild_id, master->name, master->account_id );
+ name, g->guild_id, master->name, master->account_id);
return 0;
}
@@ -1442,8 +1442,8 @@ int mapif_parse_BreakGuild(int fd, int guild_id)
mapif->guild_broken(guild_id,0);
- if(log_inter)
- inter->log("guild %s (id=%d) broken\n",g->name,guild_id);
+ if (inter->enable_logs)
+ inter->log("guild %s (id=%d) broken\n", g->name, guild_id);
//Remove the guild from memory. [Skotlex]
idb_remove(inter_guild->guild_db, guild_id);
@@ -1821,7 +1821,7 @@ int mapif_parse_GuildCastleDataSave(int fd, int castle_id, int index, int value)
switch (index) {
case 1:
- if (log_inter && gc->guild_id != value) {
+ if (inter->enable_logs && gc->guild_id != value) {
int gid = (value) ? value : gc->guild_id;
struct guild *g = idb_get(inter_guild->guild_db, gid);
inter->log("guild %s (id=%d) %s castle id=%d\n",
diff --git a/src/char/int_homun.c b/src/char/int_homun.c
index 90643699c..04f4c8f21 100644
--- a/src/char/int_homun.c
+++ b/src/char/int_homun.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -262,7 +262,7 @@ bool mapif_homunculus_load(int homun_id, struct s_homunculus* hd)
}
SQL->FreeResult(inter->sql_handle);
- if( save_log )
+ if (chr->show_save_log)
ShowInfo("Homunculus loaded (%d - %s).\n", hd->hom_id, hd->name);
return true;
diff --git a/src/char/int_mercenary.c b/src/char/int_mercenary.c
index 0bc3c0909..f96e45a50 100644
--- a/src/char/int_mercenary.c
+++ b/src/char/int_mercenary.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -168,7 +168,7 @@ bool mapif_mercenary_load(int merc_id, int char_id, struct s_mercenary *merc)
SQL->GetData(inter->sql_handle, 3, &data, NULL); merc->kill_count = atoi(data);
SQL->GetData(inter->sql_handle, 4, &data, NULL); merc->life_time = atoi(data);
SQL->FreeResult(inter->sql_handle);
- if( save_log )
+ if (chr->show_save_log)
ShowInfo("Mercenary loaded (%d - %d).\n", merc->mercenary_id, merc->char_id);
return true;
diff --git a/src/char/int_party.c b/src/char/int_party.c
index 684d846d4..e2be9f3ca 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -190,7 +190,7 @@ int inter_party_tosql(struct party *p, int flag, int index)
Sql_ShowDebug(inter->sql_handle);
}
- if( save_log )
+ if (chr->show_save_log)
ShowInfo("Party Saved (%d - %s)\n", party_id, p->name);
return 1;
}
@@ -257,7 +257,7 @@ struct party_data *inter_party_fromsql(int party_id)
}
SQL->FreeResult(inter->sql_handle);
- if( save_log )
+ if (chr->show_save_log)
ShowInfo("Party loaded (%d - %s).\n", party_id, p->party.name);
//Add party to memory.
CREATE(p, struct party_data, 1);
diff --git a/src/char/int_pet.c b/src/char/int_pet.c
index eb9bda8d0..489b10e3e 100644
--- a/src/char/int_pet.c
+++ b/src/char/int_pet.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -85,7 +85,7 @@ int inter_pet_tosql(const struct s_pet *p)
pet_id = p->pet_id;
}
- if (save_log)
+ if (chr->show_save_log)
ShowInfo("Pet saved %d - %s.\n", pet_id, p->name);
return pet_id;
@@ -130,7 +130,7 @@ int inter_pet_fromsql(int pet_id, struct s_pet* p)
p->hungry = cap_value(p->hungry, 0, 100);
p->intimate = cap_value(p->intimate, 0, 1000);
- if( save_log )
+ if (chr->show_save_log)
ShowInfo("Pet loaded (%d - %s).\n", pet_id, p->name);
}
return 0;
diff --git a/src/char/inter.c b/src/char/inter.c
index 5fb35e6aa..d1b885eed 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -826,7 +826,7 @@ static int inter_config_read(const char* cfgName)
} else if(!strcmpi(w1,"party_share_level"))
party_share_level = atoi(w2);
else if(!strcmpi(w1,"log_inter"))
- log_inter = atoi(w2);
+ inter->enable_logs = atoi(w2) ? true : false;
else if(!strcmpi(w1,"import"))
inter->config_read(w2);
}
@@ -1364,6 +1364,7 @@ void inter_defaults(void)
{
inter = &inter_s;
+ inter->enable_logs = true;
inter->sql_handle = NULL;
inter->msg_txt = inter_msg_txt;
diff --git a/src/char/inter.h b/src/char/inter.h
index 4e8d113ce..db50fd645 100644
--- a/src/char/inter.h
+++ b/src/char/inter.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -33,6 +33,7 @@ struct Sql; // common/sql.h
* inter interface
**/
struct inter_interface {
+ bool enable_logs; ///< Whether to log inter-server operations.
struct Sql *sql_handle;
const char* (*msg_txt) (int msg_number);
bool (*msg_config_read) (const char *cfg_name, bool allow_override);