diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-08-20 16:27:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-20 16:27:11 +0300 |
commit | af77eec4f736f989703f81df903a1a7c971fa659 (patch) | |
tree | ecadc9763347f1c6a04507f714e58f37f778533a | |
parent | 68947c86d5fe3eb2686c9b3393e3db0df083bb11 (diff) | |
parent | 9e02b4ed69ce857e3bda57c7f1d3b2457559c534 (diff) | |
download | hercules-af77eec4f736f989703f81df903a1a7c971fa659.tar.gz hercules-af77eec4f736f989703f81df903a1a7c971fa659.tar.bz2 hercules-af77eec4f736f989703f81df903a1a7c971fa659.tar.xz hercules-af77eec4f736f989703f81df903a1a7c971fa659.zip |
Merge pull request #1399 from HerculesWS/settings_libconfig
Ported the configuration to libconfig format
140 files changed, 9547 insertions, 5396 deletions
diff --git a/.gitignore b/.gitignore index d3c4fe51a..8957156d3 100644 --- a/.gitignore +++ b/.gitignore @@ -59,7 +59,8 @@ Thumbs.db /cache/ # /conf/ -/conf/import +/conf/import/*.conf +/conf/import/msg_conf.txt # /log/ /log/*.log diff --git a/conf/atcommand.conf b/conf/atcommand.conf index df4972067..175286eb0 100644 --- a/conf/atcommand.conf +++ b/conf/atcommand.conf @@ -68,5 +68,5 @@ nolog: { /* Commands help file */ help: { - @include "conf/help.txt" + @include "conf/map/help.txt" } diff --git a/conf/battle.conf b/conf/battle.conf deleted file mode 100644 index 1eddfae35..000000000 --- a/conf/battle.conf +++ /dev/null @@ -1,61 +0,0 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -// Splitted up into multiple files by Skotlex. -//-------------------------------------------------------------- - -//General battle-related settings. -import: conf/battle/battle.conf - -//Settings specific to the client. -import: conf/battle/client.conf - -//General drop-related configs. -import: conf/battle/drops.conf - -//Experience rates, exp penalties, stats and max level settings. -import: conf/battle/exp.conf - -//GM levels, atcommands and hack-related configs. -import: conf/battle/gm.conf - -//Guild and WoE settings -import: conf/battle/guild.conf - -//Battleground settings -import: conf/battle/battleground.conf - -//Item/card-specific and crafting related options. -import: conf/battle/items.conf - -//Mob related configuration -import: conf/battle/monster.conf - -//Party related configuration -import: conf/battle/party.conf - -//Pet related configuration -import: conf/battle/pet.conf - -//Homunc related configuration -import: conf/battle/homunc.conf - -//Player specific settings -import: conf/battle/player.conf - -//Skill related settings -import: conf/battle/skill.conf - -//Status change related settings -import: conf/battle/status.conf - -//Feature control (on/off) settings -import: conf/battle/feature.conf - -// Anything else that didn't fit anywhere else. -// Includes duel, day/night, mute/manner, log settings. -import: conf/battle/misc.conf - -//Your custom config goes here. -import: conf/import/battle_conf.txt diff --git a/conf/battle/battleground.conf b/conf/battle/battleground.conf deleted file mode 100644 index b4c0b2fbd..000000000 --- a/conf/battle/battleground.conf +++ /dev/null @@ -1,17 +0,0 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) -// Note 2: Value is in percents (100 means 100%) -// Note 3: Value is a bit field. If no description is given, -// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun) -//-------------------------------------------------------------- - -// Flee penalty on BG grounds. -// NOTE: It's %, not absolute, so 20 is -20% of your total flee -bg_flee_penalty: 20 - -// Interval before updating the bg-member map mini-dots (milliseconds) -bg_update_interval: 1000 diff --git a/conf/battle/feature.conf b/conf/battle/feature.conf deleted file mode 100644 index 000bc318b..000000000 --- a/conf/battle/feature.conf +++ /dev/null @@ -1,34 +0,0 @@ -//-------------------------------------------------------------- -// Hercules Feature Configuration File -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) -// Note 2: Value is in percents (100 means 100%) -// Note 3: Value is a bit field. If no description is given, -// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun) -//-------------------------------------------------------------- - -// Buying store (Note 1) -// Requires: 2010-04-27aRagexeRE or later -feature.buying_store: on - -// Search stores (Note 1) -// Requires: 2010-08-03aRagexeRE or later -feature.search_stores: on - -// Atcommand suggestions (Note 1) -// If one type incomplete atcommand, it will suggest the complete ones. -feature.atcommand_suggestions: off - -// Banking (Note 1) -// Requires: 2013-07-24aRagexe or later -feature.banking: on - -// Auction (Note 1) -// Feature became unstable on clients 2012 onwards (exact date not known), -// it has been fixed on clients 2013-05-15 onwards however. -feature.auction: off - -// Roulette (Note 1) -// Requires: 2014-10-22bRagexe or later -// Off by default while test version is out; enable at your own risk -- the mean dev. -feature.roulette: off diff --git a/conf/battle/gm.conf b/conf/battle/gm.conf deleted file mode 100644 index dc70bc6ca..000000000 --- a/conf/battle/gm.conf +++ /dev/null @@ -1,42 +0,0 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) -// Note 2: Value is in percents (100 means 100%) -//-------------------------------------------------------------- - -// The maximum quantity of monsters that can be summoned per GM command (0 denotes an unlimited quantity) -atcommand_spawn_quantity_limit: 100 - -// Maximum number of slave-clones that can be have by using the @slaveclone at command. (0 denotes unlimited quantity) -atcommand_slave_clone_limit: 25 - -// If 'no', commands require exact player name. If 'yes', entering a partial -// name will work, as long as there's only one match from all players in the -// current map server. -partial_name_scan: yes - -// (@) @allstats/@str/@agi/@vit/@int/@dex/@luk -// allow gms to bypass the maximum stat parameter? ( if yes gm stats can go up to 32k ) default: no -atcommand_max_stat_bypass: no - -// Ban people that try trade dupe. -// Duration of the ban, in minutes (default: 5). To disable the ban, set 0. -ban_hack_trade: 5 - -// requires RENEWAL_DROP to be enabled (src/map/config/renewal.h) -// modifies @mobinfo to display the users' real drop rate as per renewal_drop formula -// modifies @iteminfo to not display the minimum item drop rate (since it can't tell the mob level) -atcommand_mobinfo_type: 0 - -// Ignore warpable area configuration. -// Set the minimum group id to ignore invalid cells when warping. -// Default group is 2. Use 100 to disable this setting. -gm_ignore_warpable_area: 2 - -// Should atcommands trigger level up events for NPCs? (Note 1) -// This option is for @baselevelup and @joblevelup -// Default: no -atcommand_levelup_events: no diff --git a/conf/battle/guild.conf b/conf/battle/guild.conf deleted file mode 100644 index 59fc78c51..000000000 --- a/conf/battle/guild.conf +++ /dev/null @@ -1,50 +0,0 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) -// Note 2: Value is in percents (100 means 100%) -//-------------------------------------------------------------- - -// When making a guild, an Emperium is consumed? (Note 1) -guild_emperium_check: yes - -// Maximum tax limit on a guild member. -guild_exp_limit: 50 - -// Maximum castles one guild can own (0 = unlimited) -guild_max_castles: 0 - -// Restart guild skills cooldown by relog? (Note 1) -// When "no", you relog with the same cooldown remaining as from when you -// logged out, "yes" restarts the cooldown upon login to its full duration. -guild_skill_relog_delay: no - -// Damage adjustments for WOE battles against defending Guild monsters (Note 2) -castle_defense_rate: 100 - -// Flee penalty on gvg grounds. Official value is 20 (Note 2) -// NOTE: It's %, not absolute, so 20 is -20% of your total flee -gvg_flee_penalty: 20 - -// Can the 'Glory of Guild' skill be learnt in the Guild window, -// and does changing emblems require it? (Note 1) -// P.S: This skill is not implemented on official servers -require_glory_guild: no - -// Limit Guild alliances. Value is 0 to 3. -// If you want to change this value, clear the guild alliance table. -// Default is 3 -max_guild_alliance: 3 - -// When to re-display the guild notice -// Upon teleporting (regardless of changing maps): 2 (official) -// Upon changing maps: 1 -// Do not re-display: 0 (disabled) -guild_notice_changemap: 2 - -// Can guild members invite/expel members inside guild castles in WoE/GvG? (Note 1) -// default: no -guild_castle_invite: no -guild_castle_expulsion: no diff --git a/conf/battle/homunc.conf b/conf/battle/homunc.conf deleted file mode 100644 index a33eab8ea..000000000 --- a/conf/battle/homunc.conf +++ /dev/null @@ -1,45 +0,0 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) -// Note 2: Value is in percents (100 means 100%) -// Note 3: Value is a bit field. If no description is given, -// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun) -//-------------------------------------------------------------- - -// Homunculus setting (Note 3) -// Activates various 'quirks' that makes them behave unlike normal characters. -// 0x001: Can't be targetted by support skills (except for their master) -// 0x004: Mobs will always go after them instead of players until attacked -// 0x008: Copy their master's speed on spawn/map-change -// 0x010: They display luk/3+1 instead of their actual critical in the -// stat window (by default they don't crit) -// 0x020: Their Min-Matk is always the same as their max -// 0x040: Skill re-use delay is reset when they are vaporized. -hom_setting: 0x1D - -// The rate a homunculus will get friendly by feeding it. (Note 2) -homunculus_friendly_rate: 100 - -// Can you name a homunculus more then once? (Note 1) -hom_rename: no - -// Intimacy needed to use Evolved Vanilmirth's Bio Explosion -hvan_explosion_intimate: 45000 - -// Show stat growth to the owner when an Homunculus levels up -homunculus_show_growth: yes - -// Does autoloot work, when a monster is killed by homunculus only? -homunculus_autoloot: yes - -// Should homunculi Vaporize when Master dies? -homunculus_auto_vapor: yes - -// Max level for regular Homunculus -homunculus_max_level: 99 - -// Max level for Homunculus S -homunculus_S_max_level: 150 diff --git a/conf/battle/status.conf b/conf/battle/status.conf deleted file mode 100644 index 172706817..000000000 --- a/conf/battle/status.conf +++ /dev/null @@ -1,24 +0,0 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) -// Note 2: Value is in percents (100 means 100%) -// Note 3: Value is a bit field. If no description is given, -// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun) -//-------------------------------------------------------------- - -// Should skill casting be canceled when inflicted by curse/stun/sleep/etc (includes silence) (Note 3)? -status_cast_cancel: 0 - -// Adjustment for the natural rate of resistance from status changes. -// If 50, status defense is halved, and you need twice as much stats to block -// them (eg: 200 vit to completely block stun) -pc_status_def_rate: 100 -mob_status_def_rate: 100 - -// Maximum resistance to status changes. (100 = 100%) -// NOTE: Cards and equipment can go over this limit, so it only applies to natural resist. -pc_max_status_def: 100 -mob_max_status_def: 100 diff --git a/conf/char-server.conf b/conf/char-server.conf deleted file mode 100644 index eb2b9a63d..000000000 --- a/conf/char-server.conf +++ /dev/null @@ -1,188 +0,0 @@ -// Character Server configuration file. - -// Note: "Comments" are all text on the right side of a double slash "//" -// Whatever text is commented will not be parsed by the servers, and serves -// only as information/reference. - -// Server Communication username and password. -userid: s1 -passwd: p1 - -// Server name, use alternative character such as ASCII 160 for spaces. -// NOTE: Do not use spaces or any of these characters which are not allowed in -// Windows filenames \/:*?"<>| -// ... or else guild emblems won't work client-side! -server_name: Hercules - -// Wisp name for server: used to send wisp from server to players (between 4 to 23 characters) -wisp_server_name: Server - -// Login Server IP -// The character server connects to the login server using this IP address. -// NOTE: This is useful when you are running behind a firewall or are on -// a machine with multiple interfaces. -//login_ip: 127.0.0.1 - -// The character server listens on the interface with this IP address. -// NOTE: This allows you to run multiple servers on multiple interfaces -// while using the same ports for each server. -//bind_ip: 127.0.0.1 - -// Login Server Port -login_port: 6900 - -// Character Server IP -// The IP address which clients will use to connect. -// Set this to what your server's public IP address is. -//char_ip: 127.0.0.1 - -// Character Server Port -char_port: 6121 - -//Time-stamp format which will be printed before all messages. -//Can at most be 20 characters long. -//Common formats: -// %I:%M:%S %p (hour:minute:second 12 hour, AM/PM format) -// %H:%M:%S (hour:minute:second, 24 hour format) -// %d/%b/%Y (day/Month/year) -//For full format information, consult the strftime() manual. -//timestamp_format: [%d/%b %H:%M] - -//If redirected output contains escape sequences (color codes) -stdout_with_ansisequence: no - -//Makes server output more silent by ommitting certain types of messages: -//1: Hide Information messages -//2: Hide Status messages -//4: Hide Notice Messages -//8: Hide Warning Messages -//16: Hide Error and SQL Error messages. -//32: Hide Debug Messages -//Example: "console_silent: 7" Hides information, status and notice messages (1+2+4) -console_silent: 0 - -// Type of server. -// No functional side effects at the moment. -// Displayed next to the server name in the client. -// 0=normal, 1=maintenance, 2=over 18, 3=paying, 4=F2P -char_server_type: 0 - -// Minimum Group ID to join char server when it is on char_server_type 1 (maintenance) -char_maintenance_min_group_id: 99 - -// Enable or disable creation of new characters. -// Now it is actually supported [Kevin] -char_new: 1 - -// Display (New) in the server list. -char_new_display: 0 - -// Maximum users able to connect to the server. -// Set to 0 to disable users to log-in. (-1 means unlimited) -max_connect_user: -1 - -// Group ID that is allowed to bypass the server limit of users. -// Default: -1 = nobody (there are no groups with ID < 0) -// See: conf/groups.conf -gm_allow_group: -1 - -// How often should the server save all files? (In seconds) -// Note: Applies to all data files on TXT servers. -// On SQL servers, it applies to guilds (character save interval is defined on the map config) -autosave_time: 60 - -// Display information on the console whenever characters/guilds/parties/pets are loaded/saved? -save_log: yes - -// Start point, Map name followed by coordinates (x,y) -start_point_re: iz_int,97,90 -start_point_pre: new_1-1,53,111 - -// Starting items for new characters -// Format is: id1,quantity1,stackable1,idN,quantityN,stackableN -// stackable: -// 0 - Not stackable (weapon, armor, egg, pet armor) -// 1 - Stackable -start_items: 1201,1,0,2301,1,0 - -// Starting zeny for new characters -start_zeny: 0 - -// Size for the fame-lists -fame_list_alchemist: 10 -fame_list_blacksmith: 10 -fame_list_taekwon: 10 - -// Guild earned exp modifier. -// Adjusts taxed exp before adding it to the guild's exp. For example, if set -// to 200, the guild receives double the player's taxed exp. -guild_exp_rate: 100 - -// Name used for unknown characters -unknown_char_name: Unknown - -// To log the character server? -log_char: 1 - -// Allow or not identical name for characters but with a different case (upper/lower): -// example: Test-test-TEST-TesT; Value: 0 not allowed (default), 1 allowed -name_ignoring_case: no - -// Manage possible letters/symbol in the name of charater. Control character (0x00-0x1f) are never accepted. Possible values are: -// NOTE: Applies to character, party and guild names. -// 0: no restriction (default) -// 1: only letters/symbols in 'char_name_letters' option. -// 2: Letters/symbols in 'char_name_letters' option are forbidden. All others are possibles. -char_name_option: 1 - -// Set the letters/symbols that you want use with the 'char_name_option' option. -// Note: Don't add spaces unless you mean to add 'space' to the list. -char_name_letters: abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 - -// Restrict character deletion by BaseLevel -// 0: no restriction (players can delete characters of any level) -// -X: you can't delete chars with BaseLevel <= X -// Y: you can't delete chars with BaseLevel >= Y -// e.g. char_del_level: 80 (players can't delete characters with 80+ BaseLevel) -char_del_level: 0 - -// Amount of time in seconds by which the character deletion is delayed. -// Default: 86400 (24 hours) -// NOTE: Requires client 2010-08-03aragexeRE or newer. -char_del_delay: 86400 - -// Block deletion if character is inside a guild or a party? (BOOL) -// default: 0 official: 1 -// !!This check is imposed by Aegis to avoid dead entries in databases and _is_not_needed_ as we clear data properly!! -char_aegis_delete: 0 - -// What folder the DB files are in (item_db.conf, etc.) -db_path: db - -//================================================================== -// Pincode system -//================================================================== - -// A window is opened before you can select your character and you will have to enter a pincode by using only your mouse -// NOTE: Requires client 2011-03-09aragexeRE or newer. -// 0: disabled -// 1: enabled -pincode_enabled: 1 - -// Request Pincode only on login or on everytime char select is accessed? -// 0: only on login (default) -// 1: everytime the char select window is accessed -pincode_charselect: 0 - -// How often does a user have to change his pincode? -// Default: 0 -// 0: never -// X: every X minutes -pincode_changetime: 0 - -// How often can a user enter the wrong password? -// Default: 3 -// NOTE: The maximum on clientside is 3 -pincode_maxtry: 3 - -import: conf/import/char_conf.txt diff --git a/conf/char/char-server.conf b/conf/char/char-server.conf new file mode 100644 index 000000000..4c6ef0348 --- /dev/null +++ b/conf/char/char-server.conf @@ -0,0 +1,234 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Character Server configuration file. +//========================================================================= + +char_configuration: { + @include "conf/global/console.conf" + @include "conf/global/sql_connection.conf" + + // Server name, use alternative character such as ASCII 160 for spaces. + // NOTE: Do not use spaces or any of these characters which are not allowed in + // Windows filenames \/:*?"<>| + // ... or else guild emblems won't work client-side! + server_name: "Hercules" + + // Wisp name for server: used to send wisp from server to players (between 4 to 23 characters) + wisp_server_name: "Server" + + // Guild earned exp modifier. + // Adjusts taxed exp before adding it to the guild's exp. For example, + // if set to 200, the guild receives double the player's taxed exp. + guild_exp_rate: 100 + + // Information related to inter-server behavior + inter: { + // Server Communication username and password. + userid: "s1" + passwd: "p1" + // Login Server IP + // The character server connects to the login server using this IP address. + // NOTE: This is useful when you are running behind a firewall or are on + // a machine with multiple interfaces. + //login_ip: "127.0.0.1" + + // The character server listens on the interface with this IP address. + // NOTE: This allows you to run multiple servers on multiple interfaces + // while using the same ports for each server. + //bind_ip: "127.0.0.1" + + // Login Server Port + login_port: 6900 + + // Character Server IP + // The IP address which clients will use to connect. + // Set this to what your server's public IP address is. + //char_ip: "127.0.0.1" + + // Character Server Port + char_port: 6121 + } + + // Connection permission + permission: { + // Enable or disable creation of new characters. + enable_char_creation: true + + // Display (New) in the server list. + display_new: false + + // Maximum users able to connect to the server. + // Set to 0 to disable users to log-in. (-1 means unlimited) + max_connect_user: -1 + + // Group ID that is allowed to bypass the server limit of users. + // Default: -1 = nobody (there are no groups with ID < 0) + // See: conf/groups.conf + gm_allow_group: -1 + + // Type of server. + // No functional side effects at the moment. + // Displayed next to the server name in the client. + // 0=normal, 1=maintenance, 2=over 18, 3=paying, 4=F2P + server_type: 0 + + // Minimum Group ID to join char server when it is on char_server_type 1 (maintenance) + maintenance_min_group_id: 99 + } + + // Player-related configuration + player: { + new: { + // Start point (Renewal) + start_point_re: { + map: "iz_int" + x: 97 + y: 90 + } + // Start point (Pre-Renewal) + start_point_pre: { + map: "new_1-1" + x: 53 + y: 111 + } + + // Starting items for new characters + //{ + // id: Item id + // amount: Item amount + // loc: Item position, same as in item_db if you want the item to be equipped, otherwise 0 (optional) + // stackable: Is stackable? (not stackable item types: weapon, armor, egg, pet armor) + //}, + start_items: ( + { + id: 1201 // Knife + amount: 1 + loc: 2 + stackable: false + }, + { + id: 2301 // Cotton_Shirt + amount: 1 + loc: 16 + stackable: false + }, + ) + + // Starting zeny + zeny: 0 + } + + // Character name configuration + name: { + // Name used for unknown characters + unknown_char_name: "Unknown" + + // Allow or not identical name for characters but with a different case (upper/lower): + // example: Test-test-TEST-TesT; Value: 0 not allowed (default), 1 allowed + name_ignoring_case: false + + // Manage possible letters/symbol in the name of charater. Control character (0x00-0x1f) are never accepted. Possible values are: + // NOTE: Applies to character, party and guild names. + // 0: no restriction (default) + // 1: only letters/symbols in 'name_letters' option. + // 2: Letters/symbols in 'name_letters' option are forbidden. All others are possibles. + name_option: 1 + + // Set the letters/symbols that you want use with the 'char_name_option' option. + // Note: Don't add spaces unless you mean to add 'space' to the list. + name_letters: "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" + } + + deletion: { + // Restrict character deletion by BaseLevel + // 0: no restriction (players can delete characters of any level) + // -X: you can't delete chars with BaseLevel <= X + // Y: you can't delete chars with BaseLevel >= Y + // e.g. char_del_level: 80 (players can't delete characters with 80+ BaseLevel) + level: 0 + + // Amount of time in seconds by which the character deletion is delayed. + // Default: 86400 (24 hours) + // NOTE: Requires client 2010-08-03aragexeRE or newer. + delay: 86400 + + // Block deletion if character is inside a guild or a party? (BOOL) + // default: false official: true + // !!This check is imposed by Aegis to avoid dead entries in databases and _is_not_needed_ as we clear data properly!! + use_aegis_delete: false + } + + // Size for the fame-lists + fame: { + alchemist: 10 + blacksmith: 10 + taekwon: 10 + } + } + + database: { + // How often should server save all guild related information? (character save interval is defined on the map config) + // (in seconds) + autosave_time: 60 + + // What folder the DB files are in (abra_db.txt, etc.) + db_path: "db" + + // To log the character server? + log_char: true + } + + //================================================================== + // Pincode system + //================================================================== + pincode: { + // A window is opened before you can select your character and you will have to enter a pincode by using only your mouse + // NOTE: Requires client 2011-03-09aragexeRE or newer. + // 0: disabled + // 1: enabled + enabled: true + + // Request Pincode only on login or on everytime char select is accessed? + // 0: only on login (default) + // 1: everytime the char select window is accessed + request: 0 + + // How often does a user have to change his pincode? + // Default: 0 + // 0: never + // X: every X minutes + change_time: 0 + + // How often can a user enter the wrong password? + // Default: 3 + // Maximum allowed by clientside: 3 + max_tries: 3 + } + +} + +import: "conf/import/char-server.conf" diff --git a/conf/common/inter-server.conf b/conf/common/inter-server.conf new file mode 100644 index 000000000..888d4ad80 --- /dev/null +++ b/conf/common/inter-server.conf @@ -0,0 +1,122 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Hercules Inter Server configuration file. +//========================================================================= +// Settings that are shared by more than one of the main servers +//========================================================================= + +inter_configuration: { + // Level range for sharing within a party + party_share_level: 15 // FIXME: Split RE and pre-RE + + // Log configuration + log: { + // Log Inter Connections, etc.? + log_inter: true + + // Inter Log Filename + inter_log_filename: "log/inter.log" + + // Log database SQL connection + @include "conf/global/sql_connection.conf" + } + + mysql_reconnect: { + // == MySQL Reconnect Settings + // =========================== + // - mysql_reconnect_type + // - 1: when mysql disconnects during runtime, the server tries to reconnect mysql_reconnect_count times and, + // -- if unsuccessful, the server is shut down + // - 2: when mysql disconnects during runtime it tries to reconnect indefinitely + type: 2 + + // - mysql_reconnect_count + // - number of reconnect attempts the server should do when the database disconnects during runtime + // - only used when mysql_reconnect_type is 1 + count: 1 + } + + // ALL MySQL Database Table names + // DO NOT CHANGE ANYTHING BEYOND THIS LINE UNLESS YOU KNOW YOUR DATABASE DAMN WELL + // this is meant for people who KNOW their stuff, and for some reason want to change their + // database layout. [CLOWNISIUS] + database_names: { + account_db: "login" + login_db: "loginlog" + ipban_table: "ipbanlist" + char_db: "char" + interlog_db: "interlog" + ragsrvinfo_db: "ragsrvinfo" + registry: { + acc_reg_num_db: "acc_reg_num_db" + acc_reg_str_db: "acc_reg_str_db" + char_reg_str_db: "char_reg_str_db" + char_reg_num_db: "char_reg_num_db" + + global_acc_reg_num_db: "global_acc_reg_num_db" + global_acc_reg_str_db: "global_acc_reg_str_db" + } + pc: { + hotkey_db: "hotkey" + scdata_db: "sc_data" + cart_db: "cart_inventory" + inventory_db: "inventory" + charlog_db: "charlog" + storage_db: "storage" + skill_db: "skill" + memo_db: "memo" + party_db: "party" + pet_db: "pet" + friend_db: "friends" + mail_db: "mail" + auction_db: "auction" + quest_db: "quest" + homunculus_db: "homunculus" + skill_homunculus_db: "skill_homunculus" + mercenary_db: "mercenary" + mercenary_owner_db: "mercenary_owner" + elemental_db: "elemental" + account_data_db: "account_data" + } + guild: { + main_db: "guild" + alliance_db: "guild_alliance" + castle_db: "guild_castle" + expulsion_db: "guild_expulsion" + member_db: "guild_member" + skill_db: "guild_skill" + position_db: "guild_position" + storage_db: "guild_storage" + } + mapreg_db: "mapreg" + autotrade_merchants_db: "autotrade_merchants" + autotrade_data_db: "autotrade_data" + npc_market_data_db: "npc_market_data" + } +} + +import: "conf/import/inter-server.conf" diff --git a/conf/common/socket.conf b/conf/common/socket.conf new file mode 100644 index 000000000..0dd5386cb --- /dev/null +++ b/conf/common/socket.conf @@ -0,0 +1,106 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Hercules Sockets configuration file +//========================================================================= + +socket_configuration: { + // How long can a socket stall before closing the connection (in seconds)? + stall_time: 60 + + // Display debug reports (When something goes wrong during the report, the report is saved.) + debug: false + + // Linux/Epoll: Maxmimum Events per cycle + // Default Value: + // (Maxmimum Supported Connections)/2 + // NOTE: this controls the maximum collected socket-events per-cycle (call to epoll_wait()) + // for example settings this to 32 will allow up to 32 events (incomming data/new connections + // per server-cycle. + // NOTE: Recommended Settings is at least half the maxmimum supported connections + // Settings this to a lower value, may cause lags/delays + // Depending on available CPU Time + // NOTE: This Setting is only available on Linux when build using EPoll as event dispatcher! + // + //epoll_maxevents: 1024 + + // Maximum allowed size for clients packets in bytes. + // Default Values: + // 24576 (Clients < 20131223) + // 65535 (Clients >= 20131223) + // NOTE: To reduce the size of reported packets, lower the values of defines, which + // have been customized, such as MAX_STORAGE, MAX_GUILD_STORAGE or MAX_CART. + // NOTE: Do not modify this setting, unless the client has been modified to support + // larger packets. The client will crash, when it receives larger packets. + //socket_max_client_packet: 65535 + + //----- IP Rules Settings ----- + ip_rules: { + // If IP's are checked when connecting. + // This also enables DDoS protection. + enable: true + + // Order of the checks + // deny,allow : Checks deny rules, then allow rules. Allows if no rules match. + // allow,deny : Checks allow rules, then deny rules. Allows if no rules match. + // mutual-failure : Allows only if an allow rule matches and no deny rules match. + // (default is deny,allow) + order: "deny,allow" + + // IP rules + // allow : Accepts connections from the ip range (even if flagged as DDoS) + // deny : Rejects connections from the ip range + // The rules are processed in order, the first matching rule of each list (allow and deny) is used + allow_list: ( + //"127.0.0.1", + //"192.168.0.0/16", + //"10.0.0.0/255.0.0.0", + //"all", + ) + deny_list: ( + //"127.0.0.1", + ) + } + + //---- DDoS Protection Settings ---- + // If ddos.count connection request are made within ddos.interval ms, it assumes it's a DDoS attack + ddos: { + // Consecutive attempts interval (msec) + // (default is 3000 msecs, 3 seconds) + interval: 3000 //ddos_interval + + // Consecutive attempts trigger + // (default is 5 attemps) + count: 5 //ddos_count + + // The time interval after which the threat of DDoS is assumed to be gone (ms) + // After this amount of time, the DDoS restrictions are lifted. + // (default is 600000ms, 10min) + autoreset: 600000 //ddos_autoreset + } +} + +import: "conf/import/socket.conf" diff --git a/conf/global/console.conf b/conf/global/console.conf new file mode 100644 index 000000000..21ee46bd0 --- /dev/null +++ b/conf/global/console.conf @@ -0,0 +1,67 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Server Console configuration file. +//========================================================================= +// This file affects how ALL server consoles work, unless explictly defined +// so in the server configuration file (See doc/global_configuration.txt +// for more information). +//========================================================================= + +console: { + //Time-stamp format which will be printed before all messages. + //Can at most be 20 characters long. + //Common formats: + // %I:%M:%S %p (hour:minute:second 12 hour, AM/PM format) + // %H:%M:%S (hour:minute:second, 24 hour format) + // %d/%b/%Y (day/Month/year) + //For full format information, consult the strftime() manual. + //timestamp_format: "[%d/%b %H:%M]" + + //If redirected output contains escape sequences (color codes) + stdout_with_ansisequence: false + + //Makes server output more silent by omitting certain types of messages: + //1: Hide Information messages + //2: Hide Status messages + //4: Hide Notice Messages + //8: Hide Warning Messages + //16: Hide Error and SQL Error messages. + //32: Hide Debug Messages + //Example: "console_silent: 7" Hides information, status and notice messages (1+2+4) + console_silent: 0 + + // [CHAR] Display information on the console whenever characters/guilds/parties/pets are loaded/saved? + save_log: true + + // [MAP] Makes server log selected message types to a file in the /log/ folder + //1: Log Warning Messages + //2: Log Error and SQL Error messages. + //4: Log Debug Messages + //Example: "console_msg_log: 7" logs all 3 kinds + //Messages logged by this overrides console_silent setting + console_msg_log: 0 +} diff --git a/conf/global/sql_connection.conf b/conf/global/sql_connection.conf new file mode 100644 index 000000000..60fea5656 --- /dev/null +++ b/conf/global/sql_connection.conf @@ -0,0 +1,52 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= SQL connection configuration file. +//========================================================================= +// This file affects how ALL server sql connections work, unless explictly +// defined so in the server configuration file (See +// doc/global_configuration.txt for more information). +//========================================================================= + +sql_connection: { + // [INTER] You can specify the codepage to use in your mySQL tables here. + // (Note that this feature requires MySQL 4.1+) + //default_codepage: "" + + // [LOGIN] Is `userid` in account_db case sensitive? + //case_sensitive: false + + // For IPs, ideally under linux, you want to use localhost instead of 127.0.0.1. + // Under windows, you want to use 127.0.0.1. If you see a message like + // "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)" + // and you have localhost, switch it to 127.0.0.1 + db_hostname: "127.0.0.1" + db_port: 3306 + db_username: "ragnarok" + db_password: "ragnarok" + db_database: "ragnarok" + //codepage:"" +} diff --git a/conf/import-tmpl/battle.conf b/conf/import-tmpl/battle.conf new file mode 100644 index 000000000..4080eed72 --- /dev/null +++ b/conf/import-tmpl/battle.conf @@ -0,0 +1,32 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Battle local configuration file. +//========================================================================= + +battle_configuration: { + // See conf/map/battle.conf for details +} diff --git a/conf/import-tmpl/battle_conf.txt b/conf/import-tmpl/battle_conf.txt deleted file mode 100644 index e69de29bb..000000000 --- a/conf/import-tmpl/battle_conf.txt +++ /dev/null diff --git a/conf/import-tmpl/char-server.conf b/conf/import-tmpl/char-server.conf new file mode 100644 index 000000000..6bfb308b5 --- /dev/null +++ b/conf/import-tmpl/char-server.conf @@ -0,0 +1,32 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Character Server local configuration file. +//========================================================================= + +char_configuration: { + // See conf/char/char-server.conf for details +} diff --git a/conf/import-tmpl/char_conf.txt b/conf/import-tmpl/char_conf.txt deleted file mode 100644 index e69de29bb..000000000 --- a/conf/import-tmpl/char_conf.txt +++ /dev/null diff --git a/conf/import-tmpl/inter-server.conf b/conf/import-tmpl/inter-server.conf new file mode 100644 index 000000000..243dda4ea --- /dev/null +++ b/conf/import-tmpl/inter-server.conf @@ -0,0 +1,32 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Hercules Inter Server local configuration file. +//========================================================================= + +inter_configuration: { + // See conf/common/inter-server.conf +} diff --git a/conf/import-tmpl/inter_conf.txt b/conf/import-tmpl/inter_conf.txt deleted file mode 100644 index e69de29bb..000000000 --- a/conf/import-tmpl/inter_conf.txt +++ /dev/null diff --git a/conf/import-tmpl/log_conf.txt b/conf/import-tmpl/log_conf.txt deleted file mode 100644 index e69de29bb..000000000 --- a/conf/import-tmpl/log_conf.txt +++ /dev/null diff --git a/conf/import-tmpl/login-server.conf b/conf/import-tmpl/login-server.conf new file mode 100644 index 000000000..feadef976 --- /dev/null +++ b/conf/import-tmpl/login-server.conf @@ -0,0 +1,32 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Login Server local configuration file. +//========================================================================= + +login_configuration: { + // See conf/login/login-server.conf for details +} diff --git a/conf/import-tmpl/login_conf.txt b/conf/import-tmpl/login_conf.txt deleted file mode 100644 index e69de29bb..000000000 --- a/conf/import-tmpl/login_conf.txt +++ /dev/null diff --git a/conf/import-tmpl/logs.conf b/conf/import-tmpl/logs.conf new file mode 100644 index 000000000..99e666d96 --- /dev/null +++ b/conf/import-tmpl/logs.conf @@ -0,0 +1,32 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Hercules Log local configuration file. +//========================================================================= + +map_log: { + // See conf/map/logs.conf for details +} diff --git a/conf/import-tmpl/map-server.conf b/conf/import-tmpl/map-server.conf new file mode 100644 index 000000000..2c9b16531 --- /dev/null +++ b/conf/import-tmpl/map-server.conf @@ -0,0 +1,32 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Map Server local configuration file. +//========================================================================= + +map_configuration: { + // See conf/map/map-server.conf for details +} diff --git a/conf/import-tmpl/map_conf.txt b/conf/import-tmpl/map_conf.txt deleted file mode 100644 index e69de29bb..000000000 --- a/conf/import-tmpl/map_conf.txt +++ /dev/null diff --git a/conf/import-tmpl/packet_conf.txt b/conf/import-tmpl/packet_conf.txt deleted file mode 100644 index e69de29bb..000000000 --- a/conf/import-tmpl/packet_conf.txt +++ /dev/null diff --git a/conf/import-tmpl/script.conf b/conf/import-tmpl/script.conf new file mode 100644 index 000000000..b354b2bf6 --- /dev/null +++ b/conf/import-tmpl/script.conf @@ -0,0 +1,32 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Hercules Script local configuration file. +//========================================================================= + +script_configuration: { + // See conf/map/script.conf for details +} diff --git a/conf/import-tmpl/script_conf.txt b/conf/import-tmpl/script_conf.txt deleted file mode 100644 index e69de29bb..000000000 --- a/conf/import-tmpl/script_conf.txt +++ /dev/null diff --git a/conf/import-tmpl/socket.conf b/conf/import-tmpl/socket.conf new file mode 100644 index 000000000..04d0a40c4 --- /dev/null +++ b/conf/import-tmpl/socket.conf @@ -0,0 +1,32 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Hercules Sockets local configuration file +//========================================================================= + +socket_configuration: { + // See conf/common/socket.conf for details. +} diff --git a/conf/inter-server.conf b/conf/inter-server.conf deleted file mode 100644 index 704d5fc12..000000000 --- a/conf/inter-server.conf +++ /dev/null @@ -1,125 +0,0 @@ -// Hercules InterServer (settings shared/used by more than 1 server) configuration. - -// Options for both versions - -// Log Inter Connections, etc.? -log_inter: 1 - -// Inter Log Filename -inter_log_filename: log/inter.log - -// Level range for sharing within a party -party_share_level: 15 - -// SQL version options only - -// You can specify the codepage to use in your mySQL tables here. -// (Note that this feature requires MySQL 4.1+) -//default_codepage: - - -// For IPs, ideally under linux, you want to use localhost instead of 127.0.0.1 -// Under windows, you want to use 127.0.0.1. If you see a message like -// "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)" -// and you have localhost, switch it to 127.0.0.1 - -// Global SQL settings -// overridden by local settings when the hostname is defined there -// (currently only the login-server reads/obeys these settings) -sql.db_hostname: 127.0.0.1 -sql.db_port: 3306 -sql.db_username: ragnarok -sql.db_password: ragnarok -sql.db_database: ragnarok -sql.codepage: - -// MySQL Character SQL server -char_server_ip: 127.0.0.1 -char_server_port: 3306 -char_server_id: ragnarok -char_server_pw: ragnarok -char_server_db: ragnarok - -// MySQL Map SQL Server -map_server_ip: 127.0.0.1 -map_server_port: 3306 -map_server_id: ragnarok -map_server_pw: ragnarok -map_server_db: ragnarok - -// MySQL Log SQL Database -log_db_ip: 127.0.0.1 -log_db_port: 3306 -log_db_id: ragnarok -log_db_pw: ragnarok -log_db_db: ragnarok -log_codepage: -log_login_db: loginlog - -// == MySQL Reconnect Settings -// =========================== -// - mysql_reconnect_type -// - 1: when mysql disconnects during runtime, the server tries to reconnect mysql_reconnect_count times and, -// -- if unsuccessful, the server is shut down -// - 2: when mysql disconnects during runtime it tries to reconnect indefinitely -mysql_reconnect_type:2 -// - mysql_reconnect_count -// - number of reconnect attempts the server should do when the database disconnects during runtime -// - only used when mysql_reconnect_type is 1 -mysql_reconnect_count:1 - -// DO NOT CHANGE ANYTHING BEYOND THIS LINE UNLESS YOU KNOW YOUR DATABASE DAMN WELL -// this is meant for people who KNOW their stuff, and for some reason want to change their -// database layout. [CLOWNISIUS] - -// ALL MySQL Database Table names - -//Shared -interreg_db: interreg -global_acc_reg_num_db: global_acc_reg_num_db -global_acc_reg_str_db: global_acc_reg_str_db - -// Char Database Tables -char_db: char -hotkey_db: hotkey -scdata_db: sc_data -cart_db: cart_inventory -inventory_db: inventory -charlog_db: charlog -storage_db: storage -skill_db: skill -interlog_db: interlog -memo_db: memo -guild_db: guild -guild_alliance_db: guild_alliance -guild_castle_db: guild_castle -guild_expulsion_db: guild_expulsion -guild_member_db: guild_member -guild_skill_db: guild_skill -guild_position_db: guild_position -guild_storage_db: guild_storage -party_db: party -pet_db: pet -friend_db: friends -mail_db: mail -auction_db: auction -quest_db: quest -homunculus_db: homunculus -skill_homunculus_db: skill_homunculus -mercenary_db: mercenary -mercenary_owner_db: mercenary_owner -ragsrvinfo_db: ragsrvinfo -elemental_db: elemental -account_data_db: account_data -acc_reg_num_db: acc_reg_num_db -acc_reg_str_db: acc_reg_str_db -char_reg_str_db: char_reg_str_db -char_reg_num_db: char_reg_num_db - -// Map Database Tables -mapreg_db: mapreg -autotrade_merchants_db: autotrade_merchants -autotrade_data_db: autotrade_data -npc_market_data_db: npc_market_data - -import: conf/import/inter_conf.txt diff --git a/conf/login-server.conf b/conf/login-server.conf deleted file mode 100644 index 620fae327..000000000 --- a/conf/login-server.conf +++ /dev/null @@ -1,156 +0,0 @@ -// Hercules Login Server configuration file. -// Translated by Peter Kieser <pfak@telus.net> - -// Note: "Comments" are all text on the right side of a double slash "//" -// Whatever text is commented will not be parsed by the servers, and serves -// only as information/reference. - -// The login server listens on the interface with this IP address. -// NOTE: This allows you to run multiple servers on multiple interfaces -// while using the same ports for each server. -//bind_ip: 127.0.0.1 - -// Login Server Port -login_port: 6900 - -//Time-stamp format which will be printed before all messages. -//Can at most be 20 characters long. -//Common formats: -// %I:%M:%S %p (hour:minute:second 12 hour, AM/PM format) -// %H:%M:%S (hour:minute:second, 24 hour format) -// %d/%b/%Y (day/Month/year) -//For full format information, consult the strftime() manual. -//timestamp_format: [%d/%b %H:%M] - -//If redirected output contains escape sequences (color codes) -stdout_with_ansisequence: no - -//Makes server output more silent by omitting certain types of messages: -//1: Hide Information messages -//2: Hide Status messages -//4: Hide Notice Messages -//8: Hide Warning Messages -//16: Hide Error and SQL Error messages. -//32: Hide Debug Messages -//Example: "console_silent: 7" Hides information, status and notice messages (1+2+4) -console_silent: 0 - -// Can you use _M/_F to make new accounts on the server? -new_account: yes - -//If new_account is enabled, minimum length to userid and passwords should be 4? -//Must be 'Yes' unless your client uses both 'Disable 4 LetterUserID/Password' Diffs -new_acc_length_limit: yes - -// Account registration flood protection system -// allowed_regs is the number of registrations allowed in time_allowed (in seconds) -allowed_regs: 1 -time_allowed: 10 - -// To log the login server? -// NOTE: The login-sql server needs the login logs to enable dynamic pass failure bans. -log_login: yes - -// Indicate how to display date in logs, to players, etc. -date_format: %Y-%m-%d %H:%M:%S - -// Required account group id to connect to server. -// -1: disabled -// 0 or more: group id -group_id_to_connect: -1 - -// Minimum account group id required to connect to server. -// Will not function if group_id_to_connect config is enabled. -// -1: disabled -// 0 or more: group id -min_group_id_to_connect: -1 - -// Starting additional sec from now for the limited time at creation of account -// -1: new account are created with UNlimited time (default value) -// 0 or more: new accounts was created by addition of the value (in sec) to the actual time (to set first limited time) -start_limited_time: -1 - -// Check The clientversion set in the clientinfo ? -check_client_version: no - -// What version we would allow to connect? (if the options above is enabled..) -client_version_to_connect: 20 - -// Store passwords as MD5 hashes instead of plaintext ? -// NOTE: Will not work with clients that use <passwordencrypt> -use_MD5_passwords: no - -// Ipban features (SQL only) -ipban.enable: yes -//ipban.sql.db_hostname: 127.0.0.1 -//ipban.sql.db_port: 3306 -//ipban.sql.db_username: ragnarok -//ipban.sql.db_password: ragnarok -//ipban.sql.db_database: ragnarok -//ipban.sql.codepage: -//ipban.sql.ipban_table: ipbanlist -// Dynamic password failure ipban system -ipban.dynamic_pass_failure_ban: yes -ipban.dynamic_pass_failure_ban_interval: 5 -ipban.dynamic_pass_failure_ban_limit: 7 -ipban.dynamic_pass_failure_ban_duration: 5 - -// Interval (in seconds) to clean up expired IP bans. 0 = disabled. default = 60. -// NOTE: Even if this is disabled, expired IP bans will be cleaned up on login server start/stop. -// Players will still be able to login if an ipban entry exists but the expiration time has already passed. -ipban_cleanup_interval: 60 - -// Interval (in minutes) to execute a DNS/IP update. Disabled by default. -// Enable it if your server uses a dynamic IP which changes with time. -//ip_sync_interval: 10 - -// DNS Blacklist Blocking -// If enabled, each incoming connection will be tested against the blacklists -// on the specified dnsbl_servers (comma-separated list) -use_dnsbl: no -dnsbl_servers: bl.blocklist.de, socks.dnsbl.sorbs.net -// Here are some free DNS Blacklist Services: http://en.wikipedia.org/wiki/Comparison_of_DNS_blacklists -//============================================================================== -// dnsbl_servers Description -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -// bl.blocklist.de IP-Addresses who attack other servers/honeypots over SSH, FTP, IMAP, etc. -// ircbl.ahbl.org AHBL (open proxies, compromised machines, comment spammers) -// safe.dnsbl.sorbs.net All zones in dnsbl.sorbs.net except "recent" and "escalations" -// sbl-xbl.spamhaus.org Spamhaus blacklist (spammers, open proxies) -// socks.dnsbl.sorbs.net Open SOCKS proxy servers -// tor.ahbl.org Current tor relay and exit nodes - - -// Account data storage configuration -// SQL -//account.sql.db_hostname: 127.0.0.1 -//account.sql.db_port: 3306 -//account.sql.db_username: ragnarok -//account.sql.db_password: ragnarok -//account.sql.db_database: ragnarok -//account.sql.codepage: -//account.sql.case_sensitive: no -//account.sql.account_db: login -//account.sql.accreg_db: global_reg_value - -// Client MD5 hash check -// If turned on, the login server will check if the client's hash matches -// the value below, and will not connect tampered clients. -// Note: see doc/md5_hashcheck.txt for more details. -client_hash_check: off - -// Client MD5 hashes -// The client with the specified hash can be used to log in by players with -// a group_id equal to or greater than the given value. -// If you specify 'disabled' as hash, players with a group_id greater than or -// equal to the given value will be able to log in regardless of hash (and even -// if their client does not send a hash at all.) -// Format: group_id, hash -// Note: see doc/md5_hashcheck.txt for more details. -//client_hash: 0, 113e195e6c051bb1cfb12a644bb084c5 -//client_hash: 10, cb1ea78023d337c38e8ba5124e2338ae -//client_hash: 99, disabled - - -import: conf/inter-server.conf -import: conf/import/login_conf.txt diff --git a/conf/login/login-server.conf b/conf/login/login-server.conf new file mode 100644 index 000000000..71928e3d0 --- /dev/null +++ b/conf/login/login-server.conf @@ -0,0 +1,187 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Login Server configuration file. +//========================================================================= + +login_configuration: { + // Login-server's console configuration + @include "conf/global/console.conf" + + inter: { + // The login server listens on the interface with this IP address. + // NOTE: This allows you to run multiple servers on multiple interfaces + // while using the same ports for each server. + //bind_ip: "127.0.0.1" + + // Login Server Port + login_port: 6900 + + // Interval (in minutes) to execute a DNS/IP update. Disabled by default. + // Enable it if your server uses a dynamic IP which changes with time. + //ip_sync_interval: 10 + } + + log: { + // To log the login server? + // NOTE: The login-sql server needs the login logs to enable dynamic pass failure bans. + log_login: true + + // Indicate how to display date in logs, to players, etc. + date_format: "%Y-%m-%d %H:%M:%S" + } + + // Account engine configuration + account: { + // Can you use _M/_F to make new accounts on the server? + new_account: true + + //If new_account is enabled, minimum length to userid and passwords should be 4? + //Must be 'true' unless your client uses both 'Disable 4 LetterUserID/Password' Diffs + new_acc_length_limit: true + + // Account registration flood protection system + // allowed_regs is the number of registrations allowed in time_allowed (in seconds) + allowed_regs: 1 + time_allowed: 10 + + // Starting additional sec from now for the limited time at creation of account + // -1: new account are created with UNlimited time (default value) + // 0 or more: new accounts was created by addition of the value (in sec) to the actual time (to set first limited time) + start_limited_time: -1 + + // Store passwords as MD5 hashes instead of plaintext ? + // NOTE: Will not work with clients that use <passwordencrypt> + use_MD5_passwords: false + + // Account data engine storage configuration + @include "conf/global/sql_connection.conf" + + //================================================================== + // IP banning system + //================================================================== + ipban: { + enabled: true + + // Interval (in seconds) to clean up expired IP bans. 0 = disabled. default = 60. + // NOTE: Even if this is disabled, expired IP bans will be cleaned up on login server start/stop. + // Players will still be able to login if an ipban entry exists but the expiration time has already passed. + cleanup_interval: 60 + + // SQL connection settings + @include "conf/global/sql_connection.conf" + + // Dynamic password failure ipban system + dynamic_pass_failure: { + enabled: true + + // Interval in minutes between failed tries + // Only failed tries between this interval will be accounted when banning + ban_interval: 5 + + // How many failures before adding a temporary ban entry? + ban_limit: 7 + + // Duration of the ban in minutes + ban_duration: 5 + } + } // login_configuration.account.ipban + } // login_configuration.account + + permission: { + // Required account group id to connect to server. + // -1: disabled + // 0 or more: group id + group_id_to_connect: -1 + + // Minimum account group id required to connect to server. + // Will not function if group_id_to_connect config is enabled. + // -1: disabled + // 0 or more: group id + min_group_id_to_connect: -1 + + // Check The clientversion set in the clientinfo ? + check_client_version: false + + // What version we would allow to connect? (if check_client_version is enabled) + client_version_to_connect: 20 + + //================================================================== + // Client hash checking system + //================================================================== + // Note: see doc/md5_hashcheck.txt for more details. + hash: { + // Client MD5 hash check + // If turned on, the login server will check if the client's hash matches + // the value below, and will not connect tampered clients. + enabled: false + + // Client MD5 hashes + // The client with the specified hash can be used to log in by players with + // a group_id equal to or greater than the given value. + // If you specify 'disabled' as hash, players with a group_id greater than or + // equal to the given value will be able to log in regardless of hash (and even + // if their client does not send a hash at all.) + MD5_hashes: ( + //{ + // group_id: group id + // hash: client hash + //}, + //{ + // group_id: 0 + // hash: "113e195e6c051bb1cfb12a644bb084c5" + //}, + //{ + // group_id: 10 + // hash: "cb1ea78023d337c38e8ba5124e2338ae" + //}, + //{ + // group_id: 99 + // hash: "disabled" + //}, + ) + } // login_configuration.permission.hash + + DNS_blacklist: { + // DNS Blacklist Blocking + // If enabled, each incoming connection will be tested against the blacklists + // on the specified dnsbl_servers + enabled: false + + dnsbl_servers: ( + // Here are some free DNS Blacklist Services: http://en.wikipedia.org/wiki/Comparison_of_DNS_blacklists + "bl.blocklist.de", // IP-Addresses who attack other servers/honeypots over SSH, FTP, IMAP, etc. + //"ircbl.ahbl.org", // AHBL (open proxies, compromised machines, comment spammers) + //"safe.dnsbl.sorbs.net", // All zones in dnsbl.sorbs.net except "recent" and "escalations" + //"sbl-xbl.spamhaus.org", // Spamhaus blacklist (spammers, open proxies) + "socks.dnsbl.sorbs.net", // Open SOCKS proxy servers + //"tor.ahbl.org", // Current tor relay and exit nodes + ) + } // login_configuration.DNS_blacklist + } // login_configuration.permission +} + +import: "conf/import/login-server.conf" diff --git a/conf/logs.conf b/conf/logs.conf deleted file mode 100644 index 6933e84fe..000000000 --- a/conf/logs.conf +++ /dev/null @@ -1,134 +0,0 @@ -//-------------------------------------------------------------- -// Hercules Log Configuration File -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) -// Note 2: Value is in percents (100 means 100%) -// Note 3: Value is a bit field. If no description is given, -// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun) -//-------------------------------------------------------------- - -// Enable Logs? (Note 3) -// 0x00000 - Don't log at all -// 0x00001 - (T) Log trades -// 0x00002 - (V) Log vending transactions -// 0x00004 - (P) Log items drop/picked by players -// 0x00008 - (L) Log items drop/looted by monsters -// 0x00010 - (S) Log NPC transactions (buy/sell) -// 0x00020 - (N) Log Script transactions (items deleted/acquired through quests) -// 0x00040 - (D) Log items stolen from mobs (Steal/Gank) -// 0x00080 - (C) Log player-used items (consumables/pet&hom&merc food/items used for skills&attacks) -// 0x00100 - (O) Log produced/ingredient items -// 0x00200 - (U) Log MVP prize items -// 0x00400 - (A) Log player created/deleted items (through @/# commands) -// 0x00800 - (R) Log items placed/retrieved from storage. -// 0x01000 - (G) Log items placed/retrieved from guild storage. -// 0x02000 - (E) Log mail system transactions. -// 0x04000 - (I) Log auction system transactions. -// 0x08000 - (B) Log buying store transactions -// 0x20000 - (K) Log account bank transactions -// 0x10000 - (X) Log all other transactions (rentals expiring/inserting cards/items removed by item_check/ -// rings deleted by divorce/pet egg (un)hatching/pet armor (un)equipping/Weapon Refine skill/Remove Trap skill) -// Example: Log trades+vending+script items+created items: 1+2+32+1024 = 1059 -// Please note that moving items from inventory to cart and back is not logged by design. -enable_logs: 0xFFFFF - -// Use MySQL Logs? [SQL Version Only] (Note 1) -sql_logs: yes - -// LOGGING FILTERS -// ============================================================= -// if any condition is true then the item will be logged -// 0 = Don't log at all -// 1 = Log any item -// Advanced Filter Bits by item type: || -// 0002 - Healing items (0) -// 0004 - Etc Items(3) + Arrows (10) -// 0008 - Usable Items(2) + Lures,Scrolls(11) + Usable Cash Items(18) -// 0016 - Weapon(4) -// 0032 - Shields,Armor,Headgears,Accessories,etc(5) -// 0064 - Cards(6) -// 0128 - Pet Accessories(8) + Eggs(7) (well, monsters don't drop 'em but we'll use the same system for ALL logs) -// 0256 - Log expensive items ( >= price_items_log) -// 0512 - Log big amount of items ( >= amount_items_log) -// 1024 - Log refined items (if their refine >= refine_items_log ) -// 2048 - Log rare items (if their drop chance <= rare_items_log ) - -// Examples: (log filters) -// log_filter: 1 = logs ANY items -// log_filter: 2 = logs only HEALING items -// log_filter: 4 = logs only Etc Items and Arrows -// log_filter: 64 = logs only Cards -// log_filter: 322 = logs only Healing items, Cards and those items which price is >= price_items_log -// log_filter: 4080 = logs all items (including all rare, big amount) exept healing, etc, arrows and useble ones -log_filter: 1 - -// Log Items which Refine >= refine_items_log -refine_items_log: 5 -// Log Items whith min drop rate <= rare_items_log -// 1 = 0.01%, 100 = 1% drop chance, etc -rare_items_log: 100 -// don't log it if the current item buy price < price_items_log -price_items_log: 1000 -// don't log it if the current item amount < amount_items_log -amount_items_log: 100 -//============================================================= - -// Log Dead Branch Usage (Note 1) -log_branch: no - -// Track Zeny Changes -// Filter settings -// 0 - don't log; 1 - log any zeny changes; 2.....1000000 - minimal absolute logging zeny value -log_zeny: 0 - -// Log MVP Monster Drops (Note 1) -// Outdated. Use Pick_Log instead. But this log could be useful to keep track slayed MVPs -log_mvpdrop: no - -// Log AtCommands & Charcommands (Note 1) -// Only commands issued by player groups ('conf/groups.conf') with -// 'log_commands' setting set to 'true' will be logged. -log_commands: yes - -// Log NPC 'logmes' commands (Note 1) -log_npc: no - -// Log CHAT (Global, Whisper, Party, Guild, Main chat) (Note 3) -// LOGGING FILTERS -// ============================================================= -// 0 = Don't log at all -// 1 - Log Global messages -// 2 - Log Whisper messages -// 4 - Log Party messages -// 8 - Log Guild messages -// 16 - Log Main chat messages -// Example: -// log_chat: 5 = logs both Whisper & Party messages -// log_chat: 8 = logs only Guild messages -// log_chat: 31 = logs everything -log_chat: 0 - -// Disable chat logging when WoE is running? (Note 1) -log_chat_woe_disable: no - -// Logging files/tables -// Following settings specify where to log to. If 'sql_logs' is -// enabled, SQL tables are assumed, otherwise flat files. - -// log_gm_db: log/atcommandlog.log -// log_branch_db: log/branchlog.log -// log_chat_db: log/chatlog.log -// log_mvpdrop_db: log/mvplog.log -// log_npc_db: log/npclog.log -// log_pick_db: log/picklog.log -// log_zeny_db: log/zenylog.log - -log_gm_db: atcommandlog -log_branch_db: branchlog -log_chat_db: chatlog -log_mvpdrop_db: mvplog -log_npc_db: npclog -log_pick_db: picklog -log_zeny_db: zenylog - -import: conf/import/log_conf.txt diff --git a/conf/map-server.conf b/conf/map-server.conf deleted file mode 100644 index d0749e85e..000000000 --- a/conf/map-server.conf +++ /dev/null @@ -1,119 +0,0 @@ -//-------------------------------------------------------------- -// Hercules Map-Server Configuration File -//-------------------------------------------------------------- - -// Note: "Comments" are all text on the right side of a double slash "//" -// Whatever text is commented will not be parsed by the servers, and serves -// only as information/reference. - -//-------------------------------------------------------------- -// Configuration Info -//-------------------------------------------------------------- -// Interserver communication passwords, set in account.txt (or equiv.) -userid: s1 -passwd: p1 - -// Character Server IP -// The map server connects to the character server using this IP address. -// NOTE: This is useful when you are running behind a firewall or are on -// a machine with multiple interfaces. -//char_ip: 127.0.0.1 - -// The map server listens on the interface with this IP address. -// NOTE: This allows you to run multiple servers on multiple interfaces -// while using the same ports for each server. -//bind_ip: 127.0.0.1 - -// Character Server Port -char_port: 6121 - -// Map Server IP -// The IP address which clients will use to connect. -// Set this to what your server's public IP address is. -//map_ip: 127.0.0.1 - -// Map Server Port -map_port: 5121 - -//Time-stamp format which will be printed before all messages. -//Can at most be 20 characters long. -//Common formats: -// %I:%M:%S %p (hour:minute:second 12 hour, AM/PM format) -// %H:%M:%S (hour:minute:second, 24 hour format) -// %d/%b/%Y (day/Month/year) -//For full format information, consult the strftime() manual. -//timestamp_format: [%d/%b %H:%M] - -//If redirected output contains escape sequences (color codes) -stdout_with_ansisequence: no - -//Makes server log selected message types to a file in the /log/ folder -//1: Log Warning Messages -//2: Log Error and SQL Error messages. -//4: Log Debug Messages -//Example: "console_msg_log: 7" logs all 3 kinds -//Messages logged by this overrides console_silent setting -console_msg_log: 0 - -//Makes server output more silent by omitting certain types of messages: -//1: Hide Information messages -//2: Hide Status messages -//4: Hide Notice Messages -//8: Hide Warning Messages -//16: Hide Error and SQL Error messages. -//32: Hide Debug Messages -//Example: "console_silent: 7" Hides information, status and notice messages (1+2+4) -console_silent: 0 - -//Where should all database data be read from? -db_path: db - -// Enable the @guildspy and @partyspy at commands? -// Note that enabling them decreases packet sending performance. -enable_spy: no - -// Read map data from GATs and RSWs in GRF files or a data directory -// as referenced by grf-files.txt rather than from the mapcache? -use_grf: no - -// Database autosave time -// All characters are saved on this time in seconds (example: -// autosave of 60 secs with 60 characters online -> one char is saved every -// second) -autosave_time: 300 - -// Min database save intervals (in ms) -// Prevent saving characters faster than at this rate (prevents char-server -// save-load getting too high as character-count increases) -minsave_time: 100 - -// Apart from the autosave_time, players will also get saved when involved -// in the following (add as needed): -// 1: After every successful trade -// 2: After every vending transaction -// 4: After closing storage/guild storage. -// 8: After hatching/returning to egg a pet. -// 16: After successfully sending a mail with attachment -// 32: After successfully submitting an item for auction -// 64: After successfully get/delete/complete a quest -// 128: After every buying store transaction -// 256: After every bank transaction (deposit/withdraw) -// NOTE: These settings decrease the chance of dupes/lost items when there's a -// server crash at the expense of increasing the map/char server lag. If your -// server rarely crashes, but experiences interserver lag, you may want to set -// these off. -save_settings: 511 - -//When employing more than one language (see db/translations.conf), -//this setting is used as a fallback -default_language: English - -// When @help or @h is typed when you are a gm, this is displayed for helping new gms understand gm commands. -help_txt: conf/help.txt -help2_txt: conf/help2.txt -charhelp_txt: conf/charhelp.txt - -// Maps: -import: conf/maps.conf - -import: conf/import/map_conf.txt diff --git a/conf/map/battle.conf b/conf/map/battle.conf new file mode 100644 index 000000000..f17748fb6 --- /dev/null +++ b/conf/map/battle.conf @@ -0,0 +1,87 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Battle Configuration File +//========================================================================= + +battle_configuration: { + // General battle-related settings. + @include "conf/map/battle/battle.conf" + + // Settings specific to the client. + @include "conf/map/battle/client.conf" + + // General drop-related configs. + @include "conf/map/battle/drops.conf" + + // Experience rates, exp penalties, stats and max level settings. + @include "conf/map/battle/exp.conf" + + // GM levels, atcommands and hack-related configs. + @include "conf/map/battle/gm.conf" + + // Guild and WoE settings + @include "conf/map/battle/guild.conf" + + // Battleground settings + @include "conf/map/battle/battleground.conf" + + // Item/card-specific and crafting related options. + @include "conf/map/battle/items.conf" + + // Mob related configuration + @include "conf/map/battle/monster.conf" + + // Party related configuration + @include "conf/map/battle/party.conf" + + // Pet related configuration + @include "conf/map/battle/pet.conf" + + // Homunc related configuration + @include "conf/map/battle/homunc.conf" + + // Player specific settings + @include "conf/map/battle/player.conf" + + // Skill related settings + @include "conf/map/battle/skill.conf" + + // Status change related settings + @include "conf/map/battle/status.conf" + + // Feature control (on/off) settings + @include "conf/map/battle/feature.conf" + + // Anything else that didn't fit anywhere else. + // Includes duel, day/night, mute/manner, log settings. + @include "conf/map/battle/misc.conf" + + // Your custom config goes here. + @include "conf/import/battle.conf" +} + +import: "conf/import/battle.conf" diff --git a/conf/battle/battle.conf b/conf/map/battle/battle.conf index 8c9447ccb..2e73a0aa8 100644 --- a/conf/battle/battle.conf +++ b/conf/map/battle/battle.conf @@ -1,13 +1,36 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (Battle) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) // Note 2: Value is in percents (100 means 100%) // Note 3: Value is a bit field. If no description is given, // assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun, 16: Mercenary) -//-------------------------------------------------------------- +//========================================================================= // Who should have a baseatk value (makes str affect damage)? (Note 3) enable_baseatk: 9 @@ -24,7 +47,7 @@ mob_critical_rate: 100 critical_rate: 100 // Should normal attacks give you a walk delay? (Note 3) -// If no, characters can move as soon as they start an attack (attack animation +// If false, characters can move as soon as they start an attack (attack animation // or walk animation may be omitted client-side, causing cropped attacks or // monsters that teleport to you) // Otherwise, the delay is equal to the 'attack animation' (amotion) @@ -44,7 +67,7 @@ damage_walk_delay_rate: 100 multihit_delay: 80 // Damaged delay rate for players (Note 2) -// (Setting to no/0 will be like always endure) +// (Setting to false/0 will be like always endure) player_damage_delay_rate: 100 // Should race or element be used to consider someone undead? @@ -55,7 +78,7 @@ undead_detect_type: 0 // Does HP recover if hit by an attribute that's same as your own? (Note 1) // (Will not work in Renewal) -attribute_recover: no +attribute_recover: false // What is the minimum and maximum hitrate of normal attacks? min_hitrate: 5 @@ -131,8 +154,8 @@ equip_self_break_rate: 100 equip_skill_break_rate: 100 // Do weapon attacks have a attack speed delay before actual damage is applied? (Note 1) -// NOTE: The official setting is yes, even thought it degrades performance a bit. -delay_battle_damage: yes +// NOTE: The official setting is true, even thought it degrades performance a bit. +delay_battle_damage: true // Are arrows/ammo consumed when used on a bow/gun? // 0 = No @@ -143,15 +166,15 @@ delay_battle_damage: yes arrow_decrement: 1 // Should the item script bonus 'Autospell' check for range/obstacles before casting? -// Official behavior is "no", setting this to "yes" will make skills use their defined +// Official behavior is false, setting this to true will make skills use their defined // range. For example, Sonic Blow requires a 2 cell distance before autocasting is allowed. // This setting also affects autospellwhenhit. -autospell_check_range: no +autospell_check_range: false // If both the attacker and the target are on the same tile, should the target be knocked back to the left? -// Official behavior is "yes", setting this to "no" will knock the target back behind the attacker. -knockback_left: yes +// Official behavior is true, setting this to false will knock the target back behind the attacker. +knockback_left: true // Should the target be able of dodging damage by snapping away to the edge of the screen? -// Official behavior is "no" -snap_dodge: no +// Official behavior is false +snap_dodge: false diff --git a/conf/map/battle/battleground.conf b/conf/map/battle/battleground.conf new file mode 100644 index 000000000..629a664f7 --- /dev/null +++ b/conf/map/battle/battleground.conf @@ -0,0 +1,40 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (Battlegrounds) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) +// Note 2: Value is in percents (100 means 100%) +// Note 3: Value is a bit field. If no description is given, +// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun, 16: Mercenary) +//========================================================================= + +// Flee penalty on BG grounds. +// NOTE: It's %, not absolute, so 20 is -20% of your total flee +bg_flee_penalty: 20 + +// Interval before updating the bg-member map mini-dots (milliseconds) +bg_update_interval: 1000 diff --git a/conf/battle/client.conf b/conf/map/battle/client.conf index 6ca2f67e0..818db3142 100644 --- a/conf/battle/client.conf +++ b/conf/map/battle/client.conf @@ -1,13 +1,36 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (Client) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) // Note 2: Value is in percents (100 means 100%) // Note 3: Value is a bit field. If no description is given, // assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun, 16: Mercenary) -//-------------------------------------------------------------- +//========================================================================= // Whether to enable the official packet obfuscation support (good vs WPE) // 0: disabled @@ -29,10 +52,10 @@ max_cloth_color: 4 min_body_style: 0 max_body_style: 4 -// When set to yes, the damage field in packets sent from woe maps will be set +// When set to true, the damage field in packets sent from woe maps will be set // to -1, making it impossible for GMs, Bots and Hexed clients to know the // actual damage caused by attacks. (Note 1) -hide_woe_damage: yes +hide_woe_damage: true // "hair style" number that identifies pet. // NOTE: The client uses the "hair style" field in the mob packet to tell them apart from mobs. @@ -72,53 +95,53 @@ aura_lv: 99 client_limit_unit_lv: 0 // Will tuxedo and wedding dresses be shown when worn? (Note 1) -wedding_modifydisplay: no +wedding_modifydisplay: false // Save Clothes color. (This will degrade performance) (Note 1) -save_clothcolor: yes +save_clothcolor: true // Save body styles? (Note 1) // Note: Don't turn this on unless you know what your doing. // Sprites are not released officially. -save_body_style: no +save_body_style: false // Do not display cloth colors for the wedding costume? // Note: Both save_clothcolor and wedding_modifydisplay have to be enabled -// for this option to take effect. Set this to yes if your cloth palettes +// for this option to take effect. Set this to true if your cloth palettes // pack doesn't has wedding palettes (or has less than the other jobs) -wedding_ignorepalette: no +wedding_ignorepalette: false // Do not display cloth colors for the Xmas costume? -// Set this to yes if your cloth palettes pack doesn't has Xmas palettes (or has less than the other jobs) -xmas_ignorepalette: no +// Set this to true if your cloth palettes pack doesn't has Xmas palettes (or has less than the other jobs) +xmas_ignorepalette: false // Do not display cloth colors for the Summer costume? -// Set this to yes if your cloth palettes pack doesn't has Summer palettes (or has less than the other jobs) -summer_ignorepalette: no +// Set this to true if your cloth palettes pack doesn't has Summer palettes (or has less than the other jobs) +summer_ignorepalette: false // Do not display cloth colors for the Hanbok costume? -// Set this to yes if your cloth palettes pack doesn't has Hanbok palettes (or has less than the other jobs) -hanbok_ignorepalette: no +// Set this to true if your cloth palettes pack doesn't has Hanbok palettes (or has less than the other jobs) +hanbok_ignorepalette: false // Show Hercules version to users when the login? -display_version: no +display_version: false // When affected with the "Hallucination" status effect, send the effect to client? (Note 1) -// Note: Set to 'no' if the client lags due to the "Wavy" screen effect. -display_hallucination: yes +// Note: Set to false if the client lags due to the "Wavy" screen effect. +display_hallucination: true // Set this to 1 if your client supports status change timers and you want to use them // Clients from 2009 onward support this -display_status_timers: yes +display_status_timers: true // Randomizes the dice emoticon server-side, to prevent clients from forging // packets for the desired number. (Note 1) -client_reshuffle_dice: yes +client_reshuffle_dice: true // Sorts the character and guild storage before it is sent to the client. // Official servers do not sort storage. (Note 1) // NOTE: Enabling this option degrades performance. -client_sort_storage: no +client_sort_storage: false // Duration of client's self mute in minutes. // Note: Do not enable this, if you enabled commands for players, diff --git a/conf/battle/drops.conf b/conf/map/battle/drops.conf index ec122002a..547a4ae4e 100644 --- a/conf/battle/drops.conf +++ b/conf/map/battle/drops.conf @@ -1,14 +1,37 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (Drops) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) // Note 2: Value is in percents (100 means 100%) -//-------------------------------------------------------------- +//========================================================================= // If an item is dropped, does it go straight into the users inventory? (Note 1) -item_auto_get: no +item_auto_get: false // How long does it take for an item to disappear from the floor after it is dropped? (in milliseconds) flooritem_lifetime: 60000 @@ -101,11 +124,11 @@ item_drop_treasure_max: 10000 //10000 | 1.00 1.67 3.25 5.28 8.44 15.24 23.19 34.26 54.57 72.67 91.13 //20000 | 2.00 3.26 6.09 9.59 14.83 25.49 37.21 52.55 77.70 97.95 100% //50000 | 5.00 7.87 13.98 21.12 31.23 50.31 69.56 92.48 100% 100% 100% -item_logarithmic_drops: no +item_logarithmic_drops: false // Can the monster's drop rate become 0? (Note 1) -// Default: no (as in official servers). -drop_rate0item: no +// Default: false (as in official servers). +drop_rate0item: false // Makes your LUK value affect drop rates on an absolute basis. // Setting to 100 means each luk adds 0.01% chance to find items diff --git a/conf/battle/exp.conf b/conf/map/battle/exp.conf index 88c5d9c7a..3a38c1c6c 100644 --- a/conf/battle/exp.conf +++ b/conf/map/battle/exp.conf @@ -1,13 +1,36 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (Experience) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) // Note 2: Value is in percents (100 means 100%) // Note 3: The max level of classes is stored in the exp table. // See files db/exp.txt and db/exp2.txt to change them. -//-------------------------------------------------------------- +//========================================================================= // Rate at which exp. is given. (Note 2) base_exp_rate: 100 @@ -16,7 +39,7 @@ base_exp_rate: 100 job_exp_rate: 100 // Turn this on to allow a player to level up more than once from a kill. (Note 1) -multi_level_up: no +multi_level_up: false // Setting this can cap the max experience one can get per kill specified as a // % of the current exp bar. (Every 10 = 1.0%) @@ -61,7 +84,7 @@ shop_exp: 0 // PVP exp. Do players get exp in PvP maps // (Note: NOT exp from players, but from normal leveling) -pvp_exp: yes +pvp_exp: true // When a player dies, how should we penalize them? // 0 = No penalty. @@ -80,12 +103,12 @@ death_penalty_job: 100 zeny_penalty: 0 // Will display experience gained from killing a monster. (Note 1) -disp_experience: no +disp_experience: false // Will display zeny earned (from mobs, trades, etc) (Note 1) -disp_zeny: no +disp_zeny: false // Use the contents of db/statpoint.txt when doing a stats reset and leveling up? (Note 1) -// If no, an equation will be used which preserves statpoints earned/lost +// If false, an equation will be used which preserves statpoints earned/lost // through external means (ie: stat point buyers/sellers) -use_statpoint_table: yes +use_statpoint_table: true diff --git a/conf/map/battle/feature.conf b/conf/map/battle/feature.conf new file mode 100644 index 000000000..003e4c75a --- /dev/null +++ b/conf/map/battle/feature.conf @@ -0,0 +1,58 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (Feature) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) +//========================================================================= + +features: { + // Buying store (Note 1) + // Requires: 2010-04-27aRagexeRE or later + buying_store: true + + // Search stores (Note 1) + // Requires: 2010-08-03aRagexeRE or later + search_stores: true + + // Atcommand suggestions (Note 1) + // If one type incomplete atcommand, it will suggest the complete ones. + atcommand_suggestions: false + + // Banking (Note 1) + // Requires: 2013-07-24aRagexe or later + banking: true + + // Auction (Note 1) + // Feature became unstable on clients 2012 onwards (exact date not known), + // it has been fixed on clients 2013-05-15 onwards however. + auction: false + + // Roulette (Note 1) + // Requires: 2014-10-22bRagexe or later + // Disabled by default while test version is out; enable at your own risk -- the mean dev. + roulette: false +} diff --git a/conf/map/battle/gm.conf b/conf/map/battle/gm.conf new file mode 100644 index 000000000..bcc70b63b --- /dev/null +++ b/conf/map/battle/gm.conf @@ -0,0 +1,66 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (GM) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) +// Note 2: Value is in percents (100 means 100%) +//========================================================================= + +// The maximum quantity of monsters that can be summoned per GM command (0 denotes an unlimited quantity) +atcommand_spawn_quantity_limit: 100 + +// Maximum number of slave-clones that can be have by using the @slaveclone at command. (0 denotes unlimited quantity) +atcommand_slave_clone_limit: 25 + +// If false, commands require exact player name. If true, entering a partial +// name will work, as long as there's only one match from all players in the +// current map server. +partial_name_scan: true + +// (@) @allstats/@str/@agi/@vit/@int/@dex/@luk +// allow gms to bypass the maximum stat parameter? ( if true gm stats can go up to 32k ) +// default: false +atcommand_max_stat_bypass: false + +// Ban people that try trade dupe. +// Duration of the ban, in minutes (default: 5). To disable the ban, set 0. +ban_hack_trade: 5 + +// requires RENEWAL_DROP to be enabled (src/map/config/renewal.h) +// modifies @mobinfo to display the users' real drop rate as per renewal_drop formula +// modifies @iteminfo to not display the minimum item drop rate (since it can't tell the mob level) +atcommand_mobinfo_type: 0 + +// Ignore warpable area configuration. +// Set the minimum group id to ignore invalid cells when warping. +// Default group is 2. Use 100 to disable this setting. +gm_ignore_warpable_area: 2 + +// Should atcommands trigger level up events for NPCs? (Note 1) +// This option is for @baselevelup and @joblevelup +// Default: false +atcommand_levelup_events: false diff --git a/conf/map/battle/guild.conf b/conf/map/battle/guild.conf new file mode 100644 index 000000000..c8f8db8c3 --- /dev/null +++ b/conf/map/battle/guild.conf @@ -0,0 +1,73 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (Guild) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) +// Note 2: Value is in percents (100 means 100%) +//========================================================================= + +// When making a guild, an Emperium is consumed? (Note 1) +guild_emperium_check: true + +// Maximum tax limit on a guild member. +guild_exp_limit: 50 + +// Maximum castles one guild can own (0 = unlimited) +guild_max_castles: 0 + +// Restart guild skills cooldown by relog? (Note 1) +// When false, you relog with the same cooldown remaining as from when you +// logged out, true restarts the cooldown upon login to its full duration. +guild_skill_relog_delay: false + +// Damage adjustments for WOE battles against defending Guild monsters (Note 2) +castle_defense_rate: 100 + +// Flee penalty on gvg grounds. Official value is 20 (Note 2) +// NOTE: It's %, not absolute, so 20 is -20% of your total flee +gvg_flee_penalty: 20 + +// Can the 'Glory of Guild' skill be learnt in the Guild window, +// and does changing emblems require it? (Note 1) +// P.S: This skill is not implemented on official servers +require_glory_guild: false + +// Limit Guild alliances. Value is 0 to 3. +// If you want to change this value, clear the guild alliance table. +// Default is 3 +max_guild_alliance: 3 + +// When to re-display the guild notice +// Upon teleporting (regardless of changing maps): 2 (official) +// Upon changing maps: 1 +// Do not re-display: 0 (disabled) +guild_notice_changemap: 2 + +// Can guild members invite/expel members inside guild castles in WoE/GvG? (Note 1) +// default: false +guild_castle_invite: false +guild_castle_expulsion: false diff --git a/conf/map/battle/homunc.conf b/conf/map/battle/homunc.conf new file mode 100644 index 000000000..0bf2a4b98 --- /dev/null +++ b/conf/map/battle/homunc.conf @@ -0,0 +1,68 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (Homunculus) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) +// Note 2: Value is in percents (100 means 100%) +// Note 3: Value is a bit field. If no description is given, +// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun, 16: Mercenary) +//========================================================================= + +// Homunculus setting (Note 3) +// Activates various 'quirks' that makes them behave unlike normal characters. +// 0x001: Can't be targetted by support skills (except for their master) +// 0x004: Mobs will always go after them instead of players until attacked +// 0x008: Copy their master's speed on spawn/map-change +// 0x010: They display luk/3+1 instead of their actual critical in the +// stat window (by default they don't crit) +// 0x020: Their Min-Matk is always the same as their max +// 0x040: Skill re-use delay is reset when they are vaporized. +hom_setting: 0x1D + +// The rate a homunculus will get friendly by feeding it. (Note 2) +homunculus_friendly_rate: 100 + +// Can you name a homunculus more then once? (Note 1) +hom_rename: false + +// Intimacy needed to use Evolved Vanilmirth's Bio Explosion +hvan_explosion_intimate: 45000 + +// Show stat growth to the owner when an Homunculus levels up +homunculus_show_growth: true + +// Does autoloot work, when a monster is killed by homunculus only? +homunculus_autoloot: true + +// Should homunculi Vaporize when Master dies? +homunculus_auto_vapor: true + +// Max level for regular Homunculus +homunculus_max_level: 99 + +// Max level for Homunculus S +homunculus_S_max_level: 150 diff --git a/conf/battle/items.conf b/conf/map/battle/items.conf index e2358b6d6..8ff2cbb3b 100644 --- a/conf/battle/items.conf +++ b/conf/map/battle/items.conf @@ -1,20 +1,43 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (Items) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) // Note 2: Value is in percents (100 means 100%) // Note 3: Value is a bit field. If no description is given, -// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun) -//-------------------------------------------------------------- +// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun, 16: Mercenary) +//========================================================================= // The highest value at which an item can be sold via the merchant vend skill. (in zeny) vending_max_value: 1000000000 // Whether to allow buying from vending chars that are at their max. zeny limit. -// If set to yes, the rest of the zeny above the char's capacity will disappear. -vending_over_max: yes +// If set to true, the rest of the zeny above the char's capacity will disappear. +vending_over_max: true // Tax to apply to all vending transactions (eg: 10000 = 100%, 50 = 0.50%) // When a tax is applied, the item's full price is charged to the buyer, but @@ -22,7 +45,7 @@ vending_over_max: yes vending_tax: 200 // Show the buyer's name when successfully vended an item -buyer_name: yes +buyer_name: true // Forging success rate. (Note 2) weapon_produce_rate: 100 @@ -40,23 +63,23 @@ potion_produce_rate: 100 produce_item_name_input: 0x03 // Is a monster summoned via dead branch aggressive? (Note 1) -dead_branch_active: yes +dead_branch_active: true // Should summoned monsters check the player's base level? (dead branches) (Note 1) -// On officials this is no - monsters summoned from dead/bloody branches can be ANY level. -// Change to 'yes' to only summon monsters less than or equal to the player's base level. -random_monster_checklv: no +// On officials this is false - monsters summoned from dead/bloody branches can be ANY level. +// Change to true to only summon monsters less than or equal to the player's base level. +random_monster_checklv: false // Can any player equip any item regardless of the gender restrictions // NOTE: Wedding Rings and Whips/Musical Instruments will check gender regardless of setting. -ignore_items_gender: yes +ignore_items_gender: true // Item check? (Note 1) // On map change it will check for items not tagged as "available" and // auto-delete them from inventory/cart. // NOTE: An item is not available if it was not loaded from the item_db or you // specify it as unavailable in db/item_avail.txt -item_check: no +item_check: false // How much time must pass between item uses? // Only affects the delay between using items, prevents healing item abuse. Recommended ~500 ms @@ -74,18 +97,16 @@ gtb_sc_immunity: 50 // Enable autospell card effects to stack? // NOTE: Different cards that grant the same skill will both // always work independently of each other regardless of setting. -autospell_stacking: no +autospell_stacking: false // Will disabled consumables (disabled by map_zone_db.conf) be consumed when trying to use them? -// 1 (official): yes -// 0: no -item_restricted_consumption_type: 1 +// Default: true (official) +item_restricted_consumption_type: true // Enable all NPC to allow changing of equipments while interacting? (Note 1) // Script commands 'enable_items/disable_items' will not be override. (see doc/script_commands.txt) -// 1 : yes(official) -// 0 : no -item_enabled_npc: 1 +// Default: true (official) +item_enabled_npc: true // Unequip the equipments that has disabled by map_zone_db.conf ? // 0 : disabled equipments and cards are nullify (official) diff --git a/conf/battle/misc.conf b/conf/map/battle/misc.conf index a3c6ed26a..bc97b716a 100644 --- a/conf/battle/misc.conf +++ b/conf/map/battle/misc.conf @@ -1,13 +1,36 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (Misc) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) // Note 2: Value is in percents (100 means 100%) // Note 3: Value is a bit field. If no description is given, -// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun) -//-------------------------------------------------------------- +// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun, 16: Mercenary) +//========================================================================= // PK Server Mode. // Turns entire server pvp(excluding towns). @@ -17,7 +40,7 @@ // There is a nopvp.txt for setting up maps not to have pk on in this mode. // Novices cannot be attacked and cannot attack. // Normal pvp counter and rank display are disabled as well. -// Note: If pk_mode is set to 2 instead of 1 (yes), players will receive a +// Note: If pk_mode is set to 2 instead of 1, players will receive a // manner penalty of 5 each time they kill another player (see manner_system // config to adjust how this will affect players) pk_mode: 0 @@ -39,22 +62,22 @@ pk_min_level: 55 // players to let them attack each other. 0 disables said limit. pk_level_range: 0 -// Display skill usage in console? (for debug only) (default: off) (Note 3) -skill_log: off +// Display skill usage in console? (for debug only) (default: false) (Note 3) +skill_log: false -// Display battle log? (for debug only) (default: off) (Note 1) -battle_log: off +// Display battle log? (for debug only) (default: false) (Note 1) +battle_log: false -// Display other stuff? (for debug only) (default: off) (Note 1) -etc_log: off +// Display other stuff? (for debug only) (default: false) (Note 1) +etc_log: false -// Do you want to debug warp points? If set to yes, warp points will appear as flags.(Note 1) +// Do you want to debug warp points? If set to true, warp points will appear as flags.(Note 1) // It will also run on start-up a warp-check to print out which warp points lead directly on // top of on-touch npcs (which can lead to infinite loopback warping situations) -warp_point_debug: no +warp_point_debug: false -// Choose if server begin with night (yes) or day (no) -night_at_start: no +// Choose if server begin with night (true) or day (false) +night_at_start: false // Define duration in msec of the day (default: 7200000 = 2 hours) // Set to 0 to disable day cycle (but not @day GM command). @@ -67,22 +90,22 @@ day_duration: 0 night_duration: 0 // Using duel on pvp-maps -duel_allow_pvp: no +duel_allow_pvp: false // Using duel on gvg-maps -duel_allow_gvg: no +duel_allow_gvg: false // Allow using teleport/warp when dueling -duel_allow_teleport: no +duel_allow_teleport: false // Autoleave duel when die -duel_autoleave_when_die: yes +duel_autoleave_when_die: true // Delay between using @duel in minutes duel_time_interval: 60 // Restrict duel usage to same map -duel_only_on_same_map: no +duel_only_on_same_map: false // Determines max number of characters that can stack within a single cell. // Official - Only affects the walking routines of characters, including monsters. @@ -94,14 +117,14 @@ duel_only_on_same_map: no official_cell_stack_limit: 1 custom_cell_stack_limit: 1 -// If 0 while walking not check occupied cells -// If 1 while walking check occupied cells -check_occupied_cells: 1 +// If false while walking not check occupied cells +// If true while walking check occupied cells +check_occupied_cells: true // Allow autotrade only in map with autotrade flag? -// Set this to "no" will allow autotrade where no "autotrade" mapflag is set -// Set this to "yes" to only allow autotrade on maps with "autotrade" mapflag -at_mapflag: no +// Set this to "false" will allow autotrade where no "autotrade" mapflag is set +// Set this to "true" to only allow autotrade on maps with "autotrade" mapflag +at_mapflag: false // Set this to the amount of minutes autotrade chars will be kicked from the server. at_timeout: 0 @@ -120,8 +143,8 @@ searchstore_querydelay: 10 searchstore_maxresults: 30 // Whether or not gaining and loosing of cash points is displayed (Note 1). -// Default: no -cashshop_show_points: no +// Default: false +cashshop_show_points: false // Whether or not mail box status is displayed upon login. // Default: 0 @@ -131,20 +154,20 @@ cashshop_show_points: no mail_show_status: 0 // Is monster transformation disabled during Guild Wars? -// If set to yes, monster transforming is automatically removed/disabled when entering castles during WoE times -mon_trans_disable_in_gvg: no +// If set to true, monster transforming is automatically removed/disabled when entering castles during WoE times +mon_trans_disable_in_gvg: false // Whether AegisName and SpriteName lookups are case sensitive -// Default: yes (as in official servers) -// When this is set to yes, item and monster lookups through atcommands and +// Default: true (as in official servers) +// When this is set to true, item and monster lookups through atcommands and // script commands will match AegisNames and SpriteNames only when the case // matches. Display name lookups are not affected by this setting. // Example: Given the two items: // - { Id: 553, AegisName: "Bun", Name: "Bao" } // - { Id: 6115, AegisName: "Bun_", Name: "Bun" } -// query when 'yes' when 'no' +// query when true when false // @item bun # 6115 # 553 // @item Bun # 553 # 553 // @item Bao # 553 # 553 // @item Bun_ # 6115 # 6115 -case_sensitive_aegisnames: yes +case_sensitive_aegisnames: true diff --git a/conf/battle/monster.conf b/conf/map/battle/monster.conf index 23087ec78..48e476161 100644 --- a/conf/battle/monster.conf +++ b/conf/map/battle/monster.conf @@ -1,13 +1,36 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (Monster) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) // Note 2: Value is in percents (100 means 100%) // Note 3: Value is a bit field. If no description is given, -// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun) -//-------------------------------------------------------------- +// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun, 16: Mercenary) +//========================================================================= // The HP rate of MVPs. (Note 2) mvp_hp_rate: 100 @@ -82,7 +105,7 @@ view_range_rate: 100 chase_range_rate: 100 // Allow monsters to be aggresive and attack first? (Note 1) -monster_active_enable: yes +monster_active_enable: true // Should the mob_db names override the mob names specified in the spawn files? // 0: No @@ -90,8 +113,8 @@ monster_active_enable: yes // 2: always use the mob_db JName column (original Kro mob name) override_mob_names: 0 -// Monster damage delay rate (Note 1) -// Setting to no/0 is like they always have endure. +// Monster damage delay rate (Note 2) +// Setting to 0 is like they always have endure. monster_damage_delay_rate: 100 // Looting monster actions. @@ -129,9 +152,9 @@ boss_spawn_delay: 100 no_spawn_on_player: 0 // Should spawn coordinates in the mob-spawn files be ignored? (Note 1) -// If set to yes, all monsters will have a random respawn spot across the whole +// If set to true, all monsters will have a random respawn spot across the whole // map regardless of what the mob-spawn file says. -force_random_spawn: no +force_random_spawn: false // Do summon slaves inherit the passive/aggressive traits of their master? // 0: No, retain original mode. @@ -151,20 +174,20 @@ slaves_inherit_speed: 3 // Will summoned monsters (alchemists, or @summon'ed monsters) attack cause a // chance of triggering the master's autospell cards? (Note 1) -summons_trigger_autospells: yes +summons_trigger_autospells: true // When a mob is attacked by another monster, will the mob retaliate against the master of said mob instead of the mob itself? // NOTE: Summoned mobs are both those acquired via @summon and summoned by Alchemists -retaliate_to_master: yes +retaliate_to_master: true // Whether mobs should change target temporarily when a skill triggers a counter mob skill (Note 1) -// eg: Mob attacks player B, and player A casts a skill C. If set to yes and the +// eg: Mob attacks player B, and player A casts a skill C. If set to true and the // mob has a skill that is triggered by skill C, then A will be the target of // the skill, otherwise B will be targetted by the reaction skill. -mob_changetarget_byskill: no +mob_changetarget_byskill: false // If monster's class is changed will it fully recover HP? (Note 1) -monster_class_change_full_recover: yes +monster_class_change_full_recover: true // Display some mob info next to their name? (add as needed) // (does not works on guardian or Emperium) @@ -174,20 +197,20 @@ monster_class_change_full_recover: yes show_mob_info: 0 // Zeny from mobs -zeny_from_mobs: no +zeny_from_mobs: false // Monsters level up (monster will level up each time a player is killed and they will grow stronger) // Exp rate is calculated ((monster level-original monster level)*(exp*(mobs_level_up_exp rate/100))) // NOTE: Does not apply to WoE Guardians. -mobs_level_up: no +mobs_level_up: false mobs_level_up_exp_rate: 1 // Dynamic Mobs Options // Use dynamic mobs? (recommended for small-medium sized servers) -dynamic_mobs: yes +dynamic_mobs: true // Remove Mobs even if they are hurt -mob_remove_damaged: yes +mob_remove_damaged: true // Delay before removing mobs from empty maps (default 5 min = 300 secs) mob_remove_delay: 300000 @@ -205,21 +228,21 @@ mob_npc_event_type: 1 ksprotection: 0 // Should MVP slaves retain their target when summoned back to their master? -mob_slave_keep_target: yes +mob_slave_keep_target: true // Whether or not to spawn the mvp tomb. // See http://irowiki.org/wiki/MVP#Gravestone -mvp_tomb_enabled: yes +mvp_tomb_enabled: true // Show hp bar on monsters? (Default: yes) // NOTE: only works on client 2012-04-04aRagexeRE onwards -show_monster_hp_bar: yes +show_monster_hp_bar: true // Whether or not the size of specially summoned mobs influences experience, drop rates, // and stats. The rates will be doubled for large mobs, and halved for small ones. // This is only invoked under the 'monster' command, @monsterbig, and @monstersmall. (Note 1) -// Default: no -mob_size_influence: no +// Default: false +mob_size_influence: false // How should a monster be trapped by an icewall casted directly on it? // On official servers, monsters can only leave an icewall to the west and south. If their target is north or east of diff --git a/conf/battle/party.conf b/conf/map/battle/party.conf index 72a22b94a..07a0bdaea 100644 --- a/conf/battle/party.conf +++ b/conf/map/battle/party.conf @@ -1,14 +1,37 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (Party) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) // Note 2: Value is in percents (100 means 100%) -//-------------------------------------------------------------- +//========================================================================= // If someone steals (gank/steal skills), show name in party? (Note 1) -show_steal_in_same_party: no +show_steal_in_same_party: false // Interval before updating the party-member map mini-dots (milliseconds) party_update_interval: 1000 @@ -20,14 +43,14 @@ party_hp_mode: 0 // When 'Party Share' item sharing is enabled in a party, // announce in the party which party-member received the item and what's he received? (Note 1) -show_party_share_picker: yes +show_party_share_picker: true // What types of items are going to be announced when 'show_party_share_picker' is active? // 1: IT_HEALING, 2: IT_UNKNOWN, 4: IT_USABLE, 8: IT_ETC, // 16: IT_WEAPON, 32: IT_ARMOR, 64: IT_CARD, 128: IT_PETEGG, // 256: IT_PETARMOR, 512: IT_UNKNOWN2, 1024: IT_AMMO, 2048: IT_DELAYCONSUME // 262144: IT_CASH -show_picker.item_type: 112 +show_picker_item_type: 112 // Method of distribution when item party share is enabled in a party: // 0: Normal (item goes to a random party member) @@ -37,11 +60,11 @@ show_picker.item_type: 112 party_item_share_type: 0 // Is exp/item sharing disabled for idle members in the party? -// Set to no, or the amount of seconds (NOT milliseconds) that need to pass before considering +// Set to 0, or the amount of seconds (NOT milliseconds) that need to pass before considering // a character idle. // Characters in a chat/vending are always considered idle. // A character's idle status is reset upon item use/skill use/attack (auto attack counts too)/movement. -idle_no_share: no +idle_no_share: 0 // Give additional experience bonus per party-member involved on even-share parties (excluding yourself)? // ex. If set to 10, an even-share party of 5 people will receive +40% exp (4 members * 10% exp): @@ -50,4 +73,4 @@ party_even_share_bonus: 0 // Display party name regardless if player is in a guild. // Official servers do not display party name unless the user is in a guild. (Note 1) -display_party_name: no +display_party_name: false diff --git a/conf/battle/pet.conf b/conf/map/battle/pet.conf index 594184b35..6dfe5076c 100644 --- a/conf/battle/pet.conf +++ b/conf/map/battle/pet.conf @@ -1,19 +1,42 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (Pet) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) // Note 2: Value is in percents (100 means 100%) // Note 3: Value is a bit field. If no description is given, -// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun) -//-------------------------------------------------------------- +// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun, 16: Mercenary) +//========================================================================= // Rate for catching pets (Note 2) pet_catch_rate: 100 // Can you name a pet more then once? (Note 1) -pet_rename: no +pet_rename: false // The rate a pet will get friendly by feeding it. (Note 2) pet_friendly_rate: 100 @@ -26,13 +49,13 @@ pet_hungry_delay_rate: 100 pet_hungry_friendly_decrease: 5 // Does the pet need its equipment before it does its skill? (Note 1) -pet_equip_required: yes +pet_equip_required: true // When the master attacks a monster, whether or not the pet will also attack. (Note 1) -pet_attack_support: no +pet_attack_support: false // When the master receives damage from the monster, whether or not the pet attacks back. (Note 1) -pet_damage_support: no +pet_damage_support: false // Minimum intimacy necessary for a pet to support their master. Default is 900 // (intimacy goes from 0 to 1000). At this minimum, support rate is 50% of pet's normal value. @@ -45,14 +68,14 @@ pet_equip_min_friendly: 900 // Whether or not the pet's will use skills. (Note 1) // Note: Offensive pet skills need at least pet_attack_support or // pet_damage_support to work (they trigger while the pet is attacking). -pet_status_support: no +pet_status_support: false // Rate at which a pet will support it's owner in battle. (Note 2) // Affects pet_attack_support & pet_damage_support. pet_support_rate: 100 // Does the pets owner receive exp from the pets damage? -pet_attack_exp_to_master: no +pet_attack_exp_to_master: false // The rate exp. is gained from the pet attacking monsters pet_attack_exp_rate: 100 @@ -72,6 +95,6 @@ pet_max_atk1: 500 pet_max_atk2: 1000 // Are pets disabled during Guild Wars? -// If set to yes, pets are automatically returned to egg when entering castles during WoE times +// If set to true, pets are automatically returned to egg when entering castles during WoE times // and hatching is forbidden within as well. -pet_disable_in_gvg: no +pet_disable_in_gvg: false diff --git a/conf/battle/player.conf b/conf/map/battle/player.conf index 9168a6320..e478a92a1 100644 --- a/conf/battle/player.conf +++ b/conf/map/battle/player.conf @@ -1,12 +1,35 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (Player) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) // Note 2: Value is in percents (100 means 100%) // Note 3: Value is a bit field. -//-------------------------------------------------------------- +//========================================================================= // Players' maximum HP rate? (Default is 100) hp_rate: 100 @@ -15,8 +38,8 @@ hp_rate: 100 sp_rate: 100 // Whether or not cards and attributes of the left hand are applied to the right hand attack (Note 1) -// (It is 'yes' on official servers) -left_cardfix_to_right: yes +// (It is true on official servers) +left_cardfix_to_right: true // The amount of HP a player will respawn with, 0 is default. // (Unit is in percentage of total HP, 100 is full heal of HP, 0 is respawn with 1HP total.) @@ -27,23 +50,23 @@ restart_hp_rate: 0 restart_sp_rate: 0 // Can a normal player by-pass the skill tree? (Note 1) -player_skillfree: no +player_skillfree: false -// When set to yes, forces skill points gained from 1st class to be put into 1st class +// When set to true, forces skill points gained from 1st class to be put into 1st class // skills, and forces novice skill points to be put into the basic skill. (Note 1) -player_skillup_limit: yes +player_skillup_limit: true // Quest skills can be learned? (Note 1) -// Setting this to yes can open an exploit on your server! -quest_skill_learn: no +// Setting this to true can open an exploit on your server! +quest_skill_learn: false // When skills are reset, quest skills are reset as well? (Note 1) -// Setting this to yes can open an exploit on your server! -// NOTE: If you have quest_skill_learn set to yes, quest skills are always reset. -quest_skill_reset: no +// Setting this to true can open an exploit on your server! +// NOTE: If you have quest_skill_learn set to true, quest skills are always reset. +quest_skill_reset: false // You must have basic skills to be able to sit, trade, form a party or create a chatroom? (Note 1) -basic_skill_check: yes +basic_skill_check: true // When teleporting, or spawning to a map, how long before a monster sees you if you don't move? (time is in milliseconds) // That is, when you go to a map and don't move, how long before the monsters will notice you. @@ -115,22 +138,23 @@ max_cart_weight: 8000 prevent_logout: 10000 // Display the drained hp/sp values from normal attacks? (Ie: Hunter Fly card) -show_hp_sp_drain: no +show_hp_sp_drain: false // Display the gained hp/sp values from killing mobs? (Ie: Sky Deleter Card) -show_hp_sp_gain: yes +show_hp_sp_gain: true -// Show the critical bonus for katar class weapon in player status window? -// On official server, the critical bonus from katar class weapon isn't display. (Default: no) -show_katar_crit_bonus: no +// Show the critical bonus for katar class weapon in player status window? On +// official server, the critical bonus from katar class weapon isn't display. +// (Default: false) +show_katar_crit_bonus: false // If set, when A accepts B as a friend, B will also be added to A's friend // list, otherwise, only A appears in B's friend list. // NOTE: this setting only enables friend auto-adding; auto-deletion does not work yet -friend_auto_add: yes +friend_auto_add: true // Are simultaneous trade/party/guild invite requests automatically rejected? -invite_request_check: yes +invite_request_check: true // Players' will drop a 'Skull' when killed? // 0 = Disabled @@ -157,7 +181,7 @@ min_npc_vendchat_distance: 3 // If min_npc_vendchat_distance is enabled, // can players vend/chat room nearby hidden npc? (Ie: FAKE_NPC/HIDDEN_WARP_NPC) -vendchat_near_hiddennpc: no +vendchat_near_hiddennpc: false // Super Novice's fury is enabled to increments of 10%, such as at 10.0%, 20.0% - 80.0%, 90.0% // Changing snovice_call_type config to 1 enables its use at 0%, for maxed super novices. @@ -182,10 +206,10 @@ idletime_criteria: 0x1F // Can players get ATK/DEF from refinements on costume/shadow equips? // Default: yes (Official behavior not known) -costume_refine_def: yes -shadow_refine_def: yes -shadow_refine_atk: yes +costume_refine_def: true +shadow_refine_def: true +shadow_refine_atk: true // Keep player facing direction after warping? -// Default: no (on official servers players always faces north) -player_warp_keep_direction: yes +// Default: false (on official servers players always faces north) +player_warp_keep_direction: true diff --git a/conf/battle/skill.conf b/conf/map/battle/skill.conf index 7622968f8..8d7c9df44 100644 --- a/conf/battle/skill.conf +++ b/conf/map/battle/skill.conf @@ -1,13 +1,36 @@ -//-------------------------------------------------------------- -// Hercules Battle Configuration File -// Originally Translated by Peter Kieser <pfak@telus.net> -// Made in to plainer English by Ancyker -//-------------------------------------------------------------- -// Note 1: Value is a config switch (on/off, yes/no or 1/0) +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (Skill) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) // Note 2: Value is in percents (100 means 100%) // Note 3: Value is a bit field. If no description is given, // assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun, 16: Mercenary) -//-------------------------------------------------------------- +//========================================================================= // The rate of time it takes to cast a spell (Note 2, 0 = No casting time) casting_rate: 100 @@ -17,8 +40,8 @@ delay_rate: 100 // Does the delay time depend on the caster's DEX and/or AGI? (Note 1) // Note: On Official servers, neither Dex nor Agi affect delay time -delay_dependon_dex: no -delay_dependon_agi: no +delay_dependon_dex: false +delay_dependon_agi: false // Minimum allowed delay for ANY skills after casting (in milliseconds) (Note 1) // Note: Setting this to anything above 0 can stop speedhacks. @@ -52,7 +75,7 @@ vcast_stat_scale: 530 skill_amotion_leniency: 90 // Will normal attacks be able to ignore the delay after skills? (Note 1) -skill_delay_attack_enable: yes +skill_delay_attack_enable: true // Range added to skills after their cast time finishes. // Decides how far away the target can walk away after the skill began casting before the skill fails. @@ -60,7 +83,7 @@ skill_delay_attack_enable: yes skill_add_range: 0 // If the target moves out of range while casting, do we take the items and SP for the skill anyway? (Note 1) -skill_out_range_consume: no +skill_out_range_consume: false // Does the distance between caster and target define if the skill is a ranged skill? (Note 3) // If set, when the distance between caster and target is greater than 3 the skill is considered long-range, otherwise it's a melee range. @@ -74,9 +97,9 @@ skillrange_by_distance: 14 skillrange_from_weapon: 0 // Should a check on the caster's status be performed in all skill attacks? -// When set to yes, meteors, storm gust and any other ground skills will have +// When set to true, meteors, storm gust and any other ground skills will have // no effect while the caster is unable to fight (eg: stunned). -skill_caster_check: yes +skill_caster_check: true // Should ground placed skills be removed as soon as the caster dies? (Note 3) clear_skills_on_death: 0 @@ -84,10 +107,10 @@ clear_skills_on_death: 0 // Should ground placed skills be removed when the caster changes maps? (Note 3) clear_skills_on_warp: 15 -//Setting this to YES will override the target mode of ground-based skills with the flag 0x01 to "No Enemies" -//The two skills affected by default are Pneuma and Safety Wall (if set to yes, those two skills will not protect everyone, but only allies) +//Setting this to true will override the target mode of ground-based skills with the flag 0x01 to "No Enemies" +//The two skills affected by default are Pneuma and Safety Wall (if set to true, those two skills will not protect everyone, but only allies) //See db/skill_unit_db.txt for more info. -defunit_not_enemy: no +defunit_not_enemy: false // Do skills do at least 'hits' damage when they don't miss/are blocked? //(for example, will firebolts always do "number of bolts" damage versus plants?) @@ -112,7 +135,7 @@ skill_reiteration: 0 skill_nofootset: 1 // Should traps (hunter traps + quagmire) change their target to "all" inside gvg/pvp grounds? (Note 3) -// Default on official servers: yes for player-traps +// Default on official servers: true for player-traps gvg_traps_target_all: 1 // Some traps settings (add as necessary): @@ -136,7 +159,7 @@ song_timer_reset: 0 // Whether placed down skills will check walls (Note 1) // (Makes it so that Storm Gust/Lord of Vermillion/etc when cast next to a wall, won't hit on the other side) -skill_wall_check: yes +skill_wall_check: true // When cloaking, Whether the wall is checked or not. (Note 1) // Note: When the skill does not checks for walls, you will always be considered @@ -161,7 +184,7 @@ land_skill_limit: 9 display_skill_fail: 0 // Can a player in chat room (in-game), be warped by a warp portal? (Note 1) -chat_warpportal: no +chat_warpportal: false // What should the wizard's "Sense" skill display on the defense fields? // 0: Do not show defense @@ -176,9 +199,9 @@ sense_type: 1 finger_offensive_type: 0 // Grandcross Settings (Don't mess with these) -// If set to no, hit interval is increased based on the amount of mobs standing on the same cell +// If set to false, hit interval is increased based on the amount of mobs standing on the same cell // (means that when there's stacked mobs in the same cell, they won't receive all hits) -gx_allhit: no +gx_allhit: false // Grandcross display type (Default 1) // 0: Yellow character @@ -188,8 +211,8 @@ gx_disptype: 1 // Max Level Difference for Devotion devotion_level_difference: 10 -// If no than you can use the ensemble skills alone. (Note 1) -player_skill_partner_check: yes +// If false than you can use the ensemble skills alone. (Note 1) +player_skill_partner_check: true // Remove trap type // 0 = Aegis system : Returns 1 'Trap' item @@ -197,7 +220,7 @@ player_skill_partner_check: yes skill_removetrap_type: 0 // Does using bow to do a backstab give a 50% damage penalty? (Note 1) -backstab_bow_penalty: yes +backstab_bow_penalty: true // How many times you could try to steal from a mob. // Note: It helps to avoid stealing exploit on monsters with few rare items @@ -212,7 +235,7 @@ skill_steal_max_tries: 0 copyskill_restrict: 2 // Does Berserk/Frenzy cancel other self-buffs when used? -berserk_cancels_buffs: no +berserk_cancels_buffs: false // Level and Strength of "MVP heal". When someone casts a heal of this level or // above, the heal formula is bypassed and this value is used instead. @@ -243,13 +266,13 @@ guild_aura: 31 // Allows players to skip menu when casting Teleport level 1 // Menu contains two options. "Random" and "Cancel" -skip_teleport_lv1_menu: no +skip_teleport_lv1_menu: false // Allow use of SG skills without proper day (Sun/Moon/Star) ? -allow_skill_without_day: no +allow_skill_without_day: false // Allow use of ES-type magic on players? -allow_es_magic_player: no +allow_es_magic_player: false // Miracle of the Sun, Moon and Stars skill ratio (100% = 10000) sg_miracle_skill_ratio: 2 @@ -267,17 +290,17 @@ skill_add_heal_rate: 7 // Whether the damage of EarthQuake with a single target on screen is able to be reflected. // Note: On official server, EQ is reflectable when there is only one target on the screen, // which might be an exploit to hunt the MVPs. -eq_single_target_reflectable: yes +eq_single_target_reflectable: true // On official server, you will receive damage from Reflection and some Tarot Card even in invincible status. // When this setting is enabled, it allows you to immune to all kinds of damage, including those stated previous. // (The number will show but no actual damage will be done) -invincible.nodamage: no +invincible_nodamage: false // Dancing Weapon Switch // On official server, a fix is in place that prevents the switching of weapons to cancel songs. -// Default: yes -dancing_weaponswitch_fix: yes +// Default: true +dancing_weaponswitch_fix: true // Skill Trap Type (GvG) // 0: (official) Traps in GvG only make player stop moving after its walk path is complete, and it activates other traps on the way. @@ -300,4 +323,4 @@ bowling_bash_area: 0 // edges will be away from SG. Knockback direction can also be influenced by Ganbantein and Land Protector. If you // punch a hole into SG it will for example create a "suck in" effect. // If you disable this setting, the knockback direction will be completely random (eAthena style). -stormgust_knockback: yes +stormgust_knockback: true diff --git a/conf/map/battle/status.conf b/conf/map/battle/status.conf new file mode 100644 index 000000000..37b2e013d --- /dev/null +++ b/conf/map/battle/status.conf @@ -0,0 +1,47 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +// Battle (Status) Configuration File +//========================================================================= +// Note 1: Value is a config switch (true/false) +// Note 2: Value is in percents (100 means 100%) +// Note 3: Value is a bit field. If no description is given, +// assume unit types (1: Pc, 2: Mob, 4: Pet, 8: Homun, 16: Mercenary) +//========================================================================= + +// Should skill casting be canceled when inflicted by curse/stun/sleep/etc (includes silence) (Note 3)? +status_cast_cancel: 0 + +// Adjustment for the natural rate of resistance from status changes. +// If 50, status defense is halved, and you need twice as much stats to block +// them (eg: 200 vit to completely block stun) +pc_status_def_rate: 100 +mob_status_def_rate: 100 + +// Maximum resistance to status changes. (100 = 100%) +// NOTE: Cards and equipment can go over this limit, so it only applies to natural resist. +pc_max_status_def: 100 +mob_max_status_def: 100 diff --git a/conf/charhelp.txt b/conf/map/charhelp.txt index e3acddbb4..e3acddbb4 100644 --- a/conf/charhelp.txt +++ b/conf/map/charhelp.txt diff --git a/conf/help.txt b/conf/map/help.txt index a65c7de70..a65c7de70 100644 --- a/conf/help.txt +++ b/conf/map/help.txt diff --git a/conf/map/logs.conf b/conf/map/logs.conf new file mode 100644 index 000000000..aa4e16e95 --- /dev/null +++ b/conf/map/logs.conf @@ -0,0 +1,172 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Hercules Log configuration file. +//========================================================================= +// Note 1: Value is a config switch (on/off, yes/no or 1/0) +// Note 2: Value is in percents (100 means 100%) +// Note 3: Value is a bit field. If no description is given, assume unit +// types (1: Pc, 2: Mob, 4: Pet, 8: Homun) +//========================================================================= + +map_log: { + // Enable Logs? (Note 3) + // 0x00000 - Don't log at all + // 0x00001 - (T) Log trades + // 0x00002 - (V) Log vending transactions + // 0x00004 - (P) Log items drop/picked by players + // 0x00008 - (L) Log items drop/looted by monsters + // 0x00010 - (S) Log NPC transactions (buy/sell) + // 0x00020 - (N) Log Script transactions (items deleted/acquired through quests) + // 0x00040 - (D) Log items stolen from mobs (Steal/Gank) + // 0x00080 - (C) Log player-used items (consumables/pet&hom&merc food/items used for skills&attacks) + // 0x00100 - (O) Log produced/ingredient items + // 0x00200 - (U) Log MVP prize items + // 0x00400 - (A) Log player created/deleted items (through @/# commands) + // 0x00800 - (R) Log items placed/retrieved from storage. + // 0x01000 - (G) Log items placed/retrieved from guild storage. + // 0x02000 - (E) Log mail system transactions. + // 0x04000 - (I) Log auction system transactions. + // 0x08000 - (B) Log buying store transactions + // 0x20000 - (K) Log account bank transactions + // 0x10000 - (X) Log all other transactions (rentals expiring/inserting cards/items removed by item_check/ + // rings deleted by divorce/pet egg (un)hatching/pet armor (un)equipping/Weapon Refine skill/Remove Trap skill) + // Example: Log trades+vending+script items+created items: 1+2+32+1024 = 1059 + // Please note that moving items from inventory to cart and back is not logged by design. + enable: 0xFFFFF + + // Logging files/tables + // Following settings specify where to log to. If 'use_sql' is + // true, SQL tables are assumed, otherwise flat files. + database: { + // Use MySQL Logs? (Note 1) + use_sql: true + + // Flat files + // log_gm_db: "log/atcommandlog.log" + // log_branch_db: "log/branchlog.log" + // log_chat_db: "log/chatlog.log" + // log_mvpdrop_db: "log/mvplog.log" + // log_npc_db: "log/npclog.log" + // log_pick_db: "log/picklog.log" + // log_zeny_db: "log/zenylog.log" + // SQL tables + log_gm_db: "atcommandlog" + log_branch_db: "branchlog" + log_chat_db: "chatlog" + log_mvpdrop_db: "mvplog" + log_npc_db: "npclog" + log_pick_db: "picklog" + log_zeny_db: "zenylog" + } + + // Log Dead Branch Usage (Note 1) + log_branch: false + + // Track Zeny Changes + // Filter settings + // 0 - don't log; 1 - log any zeny changes; 2.....1000000 - minimal absolute logging zeny value + log_zeny: 0 + + // Log MVP Monster Drops (Note 1) + // Outdated. Use Pick_Log instead. But this log could be useful to keep track slayed MVPs + log_mvpdrop: false + + // Log AtCommands & Charcommands (Note 1) + // Only commands issued by player groups ('conf/groups.conf') with + // 'log_commands' setting set to 'true' will be logged. + log_commands: true + + // Log NPC 'logmes' commands (Note 1) + log_npc: false + + // Logging filters + filter: { + item: { + // Filters + // if any condition is true then the item will be logged + // 0 = Don't log at all + // 1 = Log any item + // Advanced Filter Bits by item type: || + // 0x002 - Healing items (0) + // 0x004 - Etc Items(3) + Arrows (10) + // 0x008 - Usable Items(2) + Lures,Scrolls(11) + Usable Cash Items(18) + // 0x010 - Weapon(4) + // 0x020 - Shields,Armor,Headgears,Accessories,etc(5) + // 0x040 - Cards(6) + // 0x080 - Pet Accessories(8) + Eggs(7) (well, monsters don't drop 'em but we'll use the same system for ALL logs) + // 0x100 - Log expensive items ( >= price_items_log) + // 0x200 - Log big amount of items ( >= amount_items_log) + // 0x400 - Log refined items (if their refine >= refine_items_log ) + // 0x800 - Log rare items (if their drop chance <= rare_items_log ) + // Examples: (log filters) + // log_filter: 1 = logs ANY items + // log_filter: 0x2 = logs only HEALING items + // log_filter: 0x4 = logs only Etc Items and Arrows + // log_filter: 0x40 = logs only Cards + // log_filter: 0x142 = logs only Healing items, Cards and those items which price is >= price_items_log + // log_filter: 0xff0 = logs all items (including all rare, big amount) except healing, etc, arrows and useble ones + log_filter: 1 + + // Log Items which Refine >= refine_items_log + refine_items_log: 5 + + // Log Items whith min drop rate <= rare_items_log + // 1 = 0.01%, 100 = 1% drop chance, etc + rare_items_log: 100 + + // don't log it if the current item buy price < price_items_log + price_items_log: 1000 + + // don't log it if the current item amount < amount_items_log + amount_items_log: 100 + } // item + + chat: { + // Log CHAT (Global, Whisper, Party, Guild, Main chat) (Note 3) + // LOGGING FILTERS + // ============================================================= + // 0x00 = Don't log at all + // 0x01 - Log Global messages + // 0x02 - Log Whisper messages + // 0x04 - Log Party messages + // 0x08 - Log Guild messages + // 0x10 - Log Main chat messages + // Example: + // log_chat: 0x5 = logs both Whisper & Party messages + // log_chat: 0x8 = logs only Guild messages + // log_chat: 0x1f = logs everything + // FIXME: This isn't fully functional, as of now it's only checking + // if the log is active or not [Panikon] + log_chat: 0x1f + + // Disable chat logging when WoE is running? (Note 1) + log_chat_woe_disable: false + } // chat + } // filter +} + +import: "conf/import/logs.conf" diff --git a/conf/map/map-server.conf b/conf/map/map-server.conf new file mode 100644 index 000000000..b489e948b --- /dev/null +++ b/conf/map/map-server.conf @@ -0,0 +1,117 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Map Server Configuration File +//========================================================================= + +map_configuration: { + @include "conf/global/console.conf" + @include "conf/global/sql_connection.conf" + + // map_list and map_removed + @include "conf/map/maps.conf" + + // When @help or @h is typed when you are a gm, this is displayed for helping new gms understand gm commands. + help_txt: "conf/map/help.txt" + charhelp_txt: "conf/map/charhelp.txt" + + // Enable the @guildspy and @partyspy at commands? + // Note that enabling them decreases packet sending performance. + enable_spy: false + + // Read map data from GATs and RSWs in GRF files or a data directory + // as referenced by grf-files.txt rather than from the mapcache? + use_grf: false + + // When employing more than one language (see db/translations.conf), + // this setting is used as a fallback + default_language: "English" + + // Information related to inter-server behavior + inter: { + // Interserver communication passwords, set in the login server database + userid: "s1" + passwd: "p1" + + // Character Server IP + // The map server connects to the character server using this IP address. + // NOTE: This is useful when you are running behind a firewall or are on + // a machine with multiple interfaces. + //char_ip: "127.0.0.1" + + // The map server listens on the interface with this IP address. + // NOTE: This allows you to run multiple servers on multiple interfaces + // while using the same ports for each server. + //bind_ip: "127.0.0.1" + + // Character Server Port + char_port: 6121 + + // Map Server IP + // The IP address which clients will use to connect. + // Set this to what your server's public IP address is. + //map_ip: "127.0.0.1" + + // Map Server Port + map_port: 5121 + } + + database: { + // Where should all database data be read from? + db_path: "db" + + // Database autosave time + // All characters are saved on this time in seconds (example: + // autosave of 60 secs with 60 characters online -> one char is + // saved every second) + autosave_time: 300 + + // Min database save intervals (in ms) + // Prevent saving characters faster than at this rate (prevents + // char-server save-load getting too high as character-count + // increases) + minsave_time: 100 + + // Apart from the autosave_time, players will also get saved + // when involved in the following (add as needed): + // 0x001: After every successful trade + // 0x002: After every vending transaction + // 0x004: After closing storage/guild storage. + // 0x008: After hatching/returning to egg a pet. + // 0x010: After successfully sending a mail with attachment + // 0x020: After successfully submitting an item for auction + // 0x040: After successfully get/delete/complete a quest + // 0x080: After every buying store transaction + // 0x100: After every bank transaction (deposit/withdraw) + // NOTE: These settings decrease the chance of dupes/lost items + // when there's a server crash at the expense of increasing the + // map/char server lag. If your server rarely crashes, but + // experiences interserver lag, you may want to set these off. + save_settings: 0x1ff + } +} + +import: "conf/import/map-server.conf" diff --git a/conf/map/maps.conf b/conf/map/maps.conf new file mode 100644 index 000000000..dc4798354 --- /dev/null +++ b/conf/map/maps.conf @@ -0,0 +1,1252 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Hercules map configuration file. +//========================================================================= +// Used to know which maps are currently being supported by Hercules +//========================================================================= + +// Maps that are in map_list but are not supported by your server +map_removed: ( + //"mapname", +) + +// Added maps +map_list: ( + //------------------------- Normal Maps --------------------------- + "alb_ship", + "alb2trea", + "alberta", + "alberta_in", + "alde_dun01", + "alde_dun02", + "alde_dun03", + "alde_dun04", + "aldeba_in", + "aldebaran", + "anthell01", + "anthell02", + "arena_room", + "c_tower1", + "c_tower2", + "c_tower3", + "c_tower4", + //"force_map1", + //"force_map2", + //"force_map3", + "force_1-1", + "force_2-1", + "force_3-1", + "force_4-1", + "force_5-1", + "force_1-2", + "force_2-2", + "force_3-2", + "force_1-3", + "force_2-3", + "force_3-3", + "gef_dun00", + "gef_dun01", + "gef_dun02", + "gef_dun03", + "gef_fild00", + "gef_fild01", + "gef_fild02", + "gef_fild03", + "gef_fild04", + "gef_fild05", + "gef_fild06", + "gef_fild07", + "gef_fild08", + "gef_fild09", + "gef_fild10", + "gef_fild11", + "gef_fild12", + "gef_fild13", + "gef_fild14", + "gef_tower", + "geffen", + "geffen_in", + "gl_cas01", + "gl_cas02", + "gl_church", + "gl_chyard", + "gl_dun01", + "gl_dun02", + "gl_in01", + "gl_knt01", + "gl_knt02", + "gl_prison", + "gl_prison1", + "gl_sew01", + "gl_sew02", + "gl_sew03", + "gl_sew04", + "gl_step", + "glast_01", + //"hunter_1-1", + //"hunter_2-1", + //"hunter_3-1", + "in_hunter", + "in_moc_16", + "in_orcs01", + "in_sphinx1", + "in_sphinx2", + "in_sphinx3", + "in_sphinx4", + "in_sphinx5", + "iz_dun00", + "iz_dun01", + "iz_dun02", + "iz_dun03", + "iz_dun04", + "izlu2dun", + "izlude", + "izlude_in", + "job_thief1", + //"knight_1-1", + //"knight_2-1", + //"knight_3-1", + "mjo_dun01", + "mjo_dun02", + "mjo_dun03", + "mjolnir_01", + "mjolnir_02", + "mjolnir_03", + "mjolnir_04", + "mjolnir_05", + "mjolnir_06", + "mjolnir_07", + "mjolnir_08", + "mjolnir_09", + "mjolnir_10", + "mjolnir_11", + "mjolnir_12", + "moc_castle", + "moc_fild01", + "moc_fild02", + "moc_fild03", + //"moc_fild04", + //"moc_fild05", + //"moc_fild06", + "moc_fild07", + //"moc_fild08", + //"moc_fild09", + //"moc_fild10", + "moc_fild11", + "moc_fild12", + "moc_fild13", + //"moc_fild14", + //"moc_fild15", + "moc_fild16", + "moc_fild17", + "moc_fild18", + "moc_fild19", + "moc_pryd01", + "moc_pryd02", + "moc_pryd03", + "moc_pryd04", + "moc_pryd05", + "moc_pryd06", + "moc_prydb1", + "moc_ruins", + "monk_in", + "morocc", + "morocc_in", + "new_zone01", + "new_zone02", + "new_zone03", + "new_zone04", + "new_1-1", + "new_1-2", + "new_1-3", + "new_1-4", + "new_2-1", + "new_2-2", + "new_2-3", + "new_2-4", + "new_3-1", + "new_3-2", + "new_3-3", + "new_3-4", + "new_4-1", + "new_4-2", + "new_4-3", + "new_4-4", + "new_5-1", + "new_5-2", + "new_5-3", + "new_5-4", + "orcsdun01", + "orcsdun02", + //"ordeal_a00", + //"ordeal_a02", + "ordeal_1-1", + "ordeal_1-2", + //"ordeal_1-3", + //"ordeal_1-4", + "ordeal_2-1", + "ordeal_2-2", + //"ordeal_2-3", + //"ordeal_2-4", + "ordeal_3-1", + "ordeal_3-2", + //"ordeal_3-3", + //"ordeal_3-4", + "pay_arche", + "pay_dun00", + "pay_dun01", + "pay_dun02", + "pay_dun03", + "pay_dun04", + "pay_fild01", + "pay_fild02", + "pay_fild03", + "pay_fild04", + "pay_fild05", + "pay_fild06", + "pay_fild07", + "pay_fild08", + "pay_fild09", + "pay_fild10", + "pay_fild11", + //"priest_1-1", + //"priest_2-1", + //"priest_3-1", + "prontera", + "prt_are_in", + "prt_are01", + "prt_castle", + "prt_church", + "prt_fild00", + "prt_fild01", + "prt_fild02", + "prt_fild03", + "prt_fild04", + "prt_fild05", + "prt_fild06", + "prt_fild07", + "prt_fild08", + "prt_fild09", + "prt_fild10", + "prt_fild11", + "prt_in", + "prt_maze01", + "prt_maze02", + "prt_maze03", + "prt_monk", + "prt_sewb1", + "prt_sewb2", + "prt_sewb3", + "prt_sewb4", + "pvp_room", + "pvp_2vs2", + "pvp_c_room", + "pvp_n_1-1", + "pvp_n_1-2", + "pvp_n_1-3", + "pvp_n_1-4", + "pvp_n_1-5", + "pvp_n_2-1", + "pvp_n_2-2", + "pvp_n_2-3", + "pvp_n_2-4", + "pvp_n_2-5", + "pvp_n_3-1", + "pvp_n_3-2", + "pvp_n_3-3", + "pvp_n_3-4", + "pvp_n_3-5", + "pvp_n_4-1", + "pvp_n_4-2", + "pvp_n_4-3", + "pvp_n_4-4", + "pvp_n_4-5", + "pvp_n_5-1", + "pvp_n_5-2", + "pvp_n_5-3", + "pvp_n_5-4", + "pvp_n_5-5", + "pvp_n_6-1", + "pvp_n_6-2", + "pvp_n_6-3", + "pvp_n_6-4", + "pvp_n_6-5", + "pvp_n_7-1", + "pvp_n_7-2", + "pvp_n_7-3", + "pvp_n_7-4", + "pvp_n_7-5", + "pvp_n_8-1", + "pvp_n_8-2", + "pvp_n_8-3", + "pvp_n_8-4", + "pvp_n_8-5", + "pvp_n_room", + "pvp_y_1-1", + "pvp_y_1-2", + "pvp_y_1-3", + "pvp_y_1-4", + "pvp_y_1-5", + "pvp_y_2-1", + "pvp_y_2-2", + "pvp_y_2-3", + "pvp_y_2-4", + "pvp_y_2-5", + "pvp_y_3-1", + "pvp_y_3-2", + "pvp_y_3-3", + "pvp_y_3-4", + "pvp_y_3-5", + "pvp_y_4-1", + "pvp_y_4-2", + "pvp_y_4-3", + "pvp_y_4-4", + "pvp_y_4-5", + "pvp_y_5-1", + "pvp_y_5-2", + "pvp_y_5-3", + "pvp_y_5-4", + "pvp_y_5-5", + "pvp_y_6-1", + "pvp_y_6-2", + "pvp_y_6-3", + "pvp_y_6-4", + "pvp_y_6-5", + "pvp_y_7-1", + "pvp_y_7-2", + "pvp_y_7-3", + "pvp_y_7-4", + "pvp_y_7-5", + "pvp_y_8-1", + "pvp_y_8-2", + "pvp_y_8-3", + "pvp_y_8-4", + "pvp_y_8-5", + "pvp_y_room", + "sword_1-1", + "sword_2-1", + "sword_3-1", + "treasure01", + "treasure02", + //"wizard_1-1", + //"wizard_2-1", + //"wizard_3-1", + "xmas", + "xmas_dun01", + "xmas_dun02", + "xmas_fild01", + "xmas_in", + + //---Ep3.0 Comodo --- + "beach_dun", + "beach_dun2", + "beach_dun3", + "cmd_fild01", + "cmd_fild02", + "cmd_fild03", + "cmd_fild04", + "cmd_fild05", + "cmd_fild06", + "cmd_fild07", + "cmd_fild08", + "cmd_fild09", + "cmd_in01", + "cmd_in02", + "comodo", + + //---EP3.1 Quiz Revolution --- + "quiz_00", + "quiz_01", + "g_room1-1", + "g_room1-2", + "g_room1-3", + "g_room2", + + //--- Ep4.0 Turtle Island --- + "tur_dun01", + "tur_dun02", + "tur_dun03", + "tur_dun04", + "tur_dun05", + "tur_dun06", + + //--- Ep4.1 The War of Emperium --- + "alde_gld", + "aldeg_cas01", + "aldeg_cas02", + "aldeg_cas03", + "aldeg_cas04", + "aldeg_cas05", + "gefg_cas01", + "gefg_cas02", + "gefg_cas03", + "gefg_cas04", + "gefg_cas05", + "gld_dun01", + "gld_dun02", + "gld_dun03", + "gld_dun04", + "guild_room", + "guild_vs1", + "guild_vs2", + "guild_vs3", + "guild_vs4", + "guild_vs5", + "guild_vs1-1", + "guild_vs1-2", + "guild_vs1-3", + "guild_vs1-4", + "guild_vs2-1", + "guild_vs2-2", + //"job_hunter", + "job_hunte", + //"job_knight", + "job_knt", + //"job_priest", + "job_prist", + "job_sword1", + //"job_wizard", + "job_wiz", + "pay_gld", + "payg_cas01", + "payg_cas02", + "payg_cas03", + "payg_cas04", + "payg_cas05", + "prt_gld", + "prtg_cas01", + "prtg_cas02", + "prtg_cas03", + "prtg_cas04", + "prtg_cas05", + + //--- Ep5.0 Juno --- + "alde_alche", + "in_rogue", + "job_cru", + "job_duncer", + "job_monk", + "job_sage", + "mag_dun01", + "mag_dun02", + "monk_test", + "quiz_test", + "yuno", + "yuno_fild01", + "yuno_fild02", + "yuno_fild03", + "yuno_fild04", + "yuno_in01", + "yuno_in02", + "yuno_in03", + "yuno_in04", + "yuno_in05", + + //--- Ep6.0 - Amatsu --- + // Requires: kRO 08-10-03 or newer + // or kRO Sakray 09-09-03 or newer + "ama_dun01", + "ama_dun02", + "ama_dun03", + "ama_fild01", + "ama_in01", + "ama_in02", + "ama_test", + "amatsu", + + //--- Ep6.1 - Kunlun --- + "gon_dun01", + "gon_dun02", + "gon_dun03", + "gon_fild01", + "gon_in", + "gon_test", + "gonryun", + "sec_in01", + "sec_in02", + "sec_pri", + + //--- Ep6.2 - Umbala --- + // Requires: kRO 01-27-04 or newer + // or kRO Sakray 12-02-03 or newer + // or Akaru's SuperGRF 1.22 or newer + "umbala", + "um_dun01", + "um_dun02", + "um_fild01", + "um_fild02", + "um_fild03", + "um_fild04", + "um_in", + + //--- Ep6.3 - Niflheim --- + // Requires: kRO 02-23-04 or newer + // or kRO Sakray 01-09-04 or newer + // or Akaru's SuperGRF 1.32 or newer + "niflheim", + "nif_fild01", + "nif_fild02", + "nif_in", + "yggdrasil01", + + //--- Ep6.4 - Valkyrie --- + // Requires: kRO ??-??-04 or newer + // or kRO Sakray 02-03-04 or newer + // or Akaru's SuperGRF 1.34 or newer + "valkyrie", + "himinn", + + //--- Ep6.5 - Louyang --- + // Requires kRO Sakray 03-30 or newer + //(Akaru's SuperGRF required version: 1.52) + "lou_in01", + "lou_in02", + "lou_dun03", + "lou_dun02", + "lou_dun01", + "lou_fild01", + "louyang", + + //--- Ep6.6 - Novice Guild Siege --- + //Requires kRO Sakray 04-07 or newer + //(Akaru's SuperGRF required version: 1.53) + //"siege_test", + "n_castle", + "nguild_gef", + "nguild_prt", + "nguild_pay", + "nguild_alde", + + //--- Ep6.7 - Jawaii --- + //Requires kRO Sakray 06-22 or newer + //(Akaru's SuperGRF required version: 1.63) + "jawaii", + "jawaii_in", + + // --- Ep6.8 - Geffenia --- + // Requires kRO Sakray 07-13 or newer + // (Akaru's SuperGRF required version: 1.64) + "gefenia01", + "gefenia02", + "gefenia03", + "gefenia04", + + // --- Ep6.9 - New Payon --- + // Requires kRO Sakray 09-03 + "payon", + "payon_in01", + "payon_in02", + "payon_in03", + //same names as old maps except that payon_in03 got added + + // --- Ep? - Ayothaya --- + // Requires kRO Sakray 09-21 + // -- 2004-10-19sdata_k.gpf -- + "ayothaya", + "ayo_in01", + "ayo_in02", + "ayo_fild01", + "ayo_fild02", + "ayo_dun01", + "ayo_dun02", + + // --- God item quests maps --- + // -- 2004-10-12sdata_k3.gpf -- + "que_god01", + "que_god02", + + // --- Ep? - Schwarzwald Republic --- + // -- 2004-12-28sdata_k.gpf -- + "yuno_fild05", + "yuno_fild07", + "yuno_fild08", + "yuno_fild09", + "yuno_fild11", + "yuno_fild12", + + // --- Turbo Track Arena --- + // -- 2005-03-08sdata_k.gpf -- + "alde_tt02", + "turbo_n_1", + "turbo_n_4", + "turbo_n_8", + "turbo_n_16", + "turbo_e_4", + "turbo_e_8", + "turbo_e_16", + "turbo_room", + + // --- Einbroch/Einbech --- + // -- 2005-03-15sdata_k.gpf -- + "airplane", + "airport", + "einbech", + "einbroch", + "ein_dun01", + "ein_dun02", + "ein_fild06", + "ein_fild07", + "ein_fild08", + "ein_fild09", + "ein_fild10", + "ein_in01", + "que_sign01", + "que_sign02", + + // --- Einbroch and Lightalzen --- + // -- 2005-05-10sdata_k.gpf -- + "ein_fild03", + "ein_fild04", + "lhz_fild02", + "lhz_fild03", + + // --- Lighthalzen and Juperos Dungeon --- + // -- 2005-06-14sdata_k.gpf -- + "yuno_pre", + "lhz_fild01", + "lighthalzen", + "lhz_in01", + "lhz_in02", + "lhz_in03", + "lhz_que01", + "lhz_dun01", + "lhz_dun02", + "lhz_dun03", + "lhz_cube", + "juperos_01", + "juperos_02", + "jupe_area1", + "jupe_area2", + "jupe_core", + "jupe_ele", + "jupe_ele_r", + "jupe_gate", + + // --- Lighthalzen & Juno Airport --- + // -- resnametable clones of airport and airplane -- + "y_airport", + "lhz_airport", + "airplane_01", + + // --- Juperos Dungeon --- + // -- 2005-06-28sdata_k.gpf -- + "jupe_cave", + + // --- Quiz Revolution --- + // -- 2005-08-02sdata_k.gpf -- + "quiz_02", + + // --- Hugel Field --- + // -- 2005-08-23sdata_k.gpf -- + "hu_fild07", + "hu_fild05", + "hu_fild04", + "hu_fild01", + "yuno_fild06", + + // --- Star Knight And Soul Linker Job Change Maps --- + // -- 2005-08-23sdata_k.gpf -- + "job_soul", + "job_star", + + // --- Abyss Lake, Thanatos Tower -- + // -- 2005-09-13sdata_k.gpf - 2005-09-13sdata_k6.gpf -- + "que_job01", + "que_job02", + "que_job03", + "abyss_01", + "abyss_02", + "abyss_03", + "thana_step", + "thana_boss", + "tha_scene01", + "tha_t01", + "tha_t02", + "tha_t03", + "tha_t04", + "tha_t07", + "tha_t05", + "tha_t06", + "tha_t08", + + // --- Thanatos Tower --- + // -- 2005-09-21sdata_k.gpf -- ", + "tha_t09", + "tha_t10", + "tha_t11", + "tha_t12", + + // --- Auction Market --- + // -- 2005-11-29sdata_k.gpf -- + "auction_01", + "auction_02", + + // ??? + // -- 2005-12-06gdata_k.gpf -- + "alde_tt03", + + // --- Garden City Hugel / Kiehl --- + // -- 2005-12-20sdata_k.gpf -- + "hugel", + "hu_in01", + "que_bingo", + "que_hugel", + "p_track01", + "p_track02", + "odin_tem01", + "odin_tem02", + "odin_tem03", + "hu_fild02", + "hu_fild03", + "hu_fild06", + "ein_fild01", + "ein_fild02", + "ein_fild05", + "yuno_fild10", + "kh_kiehl02", + "kh_kiehl01", + "kh_dun02", + "kh_dun01", + "kh_mansion", + "kh_rossi", + "kh_school", + "kh_vila", + + // --- Poring Arena (?) & Gunslinger/Ninja Job Map --- + // -- 2006-03-28sdata_k.gpf -- + //"poring_c01", + //"poring_c02", + "que_ng", + + // --- Arunafeltz & Ice Dungeon --- + // -- 2006-05-30sdata_k.gpf -- + "rachel", + "ra_in01", + "ra_fild01", + "ra_fild02", + "ra_fild03", + "ra_fild04", + "ra_fild05", + "ra_fild06", + "ra_fild07", + "ra_fild08", + "ra_fild09", + "ra_fild10", + "ra_fild11", + "ra_fild12", + "ra_fild13", + "ra_san01", + "ra_san02", + "ra_san03", + "ra_san04", + "ra_san05", + "ra_temin", + "ra_temple", + "ra_temsky", + "que_rachel", + "que_san04", + "ice_dun01", + "ice_dun02", + "ice_dun03", + "ice_dun04", + + // --- Veins & Thor Dungeon --- + // -- 2006-12-19sdata_k.gpf -- + "que_thor", + "thor_camp", + "thor_v01", + "thor_v02", + "thor_v03", + "veins", + "ve_in", + "ve_in02", + "ve_fild01", + "ve_fild02", + "ve_fild03", + "ve_fild04", + "ve_fild05", + "ve_fild06", + "ve_fild07", + + // --- Nameless Island & Abbey Dungeon --- + // -- 2007-04-03sdata_k.gpf -- + "nameless_i", + "nameless_n", + "nameless_in", + "abbey01", + "abbey02", + "abbey03", + "poring_w01", + "poring_w02", + + // --- ??? --- + // -- 2007-??-?? -- + "06guild_r", + "06guild_01", + "06guild_02", + "06guild_03", + "06guild_04", + "06guild_05", + "06guild_06", + "06guild_07", + "06guild_08", + "z_agit", + "que_temsky", + "itemmall", + "bossnia_01", + "bossnia_02", + "bossnia_03", + "bossnia_04", + + // --- Moscovia --- + // -- 2007-06-??? -- + "moscovia", + "mosk_in", + "mosk_ship", + "mosk_fild01", + "mosk_fild02", + "mosk_dun01", + "mosk_dun02", + "mosk_dun03", + "mosk_que", + + // --- Episode 12: Satan Morroc & Schwarzwald Siege --- + // -- 2007-09-19sdata_k.gpf -- + "schg_cas01", + "schg_cas02", + "schg_cas03", + "schg_cas04", + "schg_cas05", + "sch_gld", + "cave", + "moc_fild20", + "moc_fild21", + "moc_fild22", + "que_ba", + "que_moc_16", + "que_moon", + + // Arunafeltz Seige + // -- 2007-10-24sdata_k.gpf -- + "arug_cas01", + "arug_cas02", + "arug_cas03", + "arug_cas04", + "arug_cas05", + "aru_gld", + + // PVP Battle Fields: Tierra Valley, and Flavius + // -- 2007-11-14sdata_k.gpf -- + "bat_room", + "bat_a01", + "bat_a02", + "bat_b01", + "bat_b02", + "que_qsch01", + "que_qsch02", + "que_qsch03", + "que_qsch04", + "que_qsch05", + "que_qaru01", + "que_qaru02", + "que_qaru03", + "que_qaru04", + "que_qaru05", + + // Endless Tower Memorial Dungeon + // -- 2007-11-28sdata_k.gpf -- + "1@cata", + "2@cata", + "e_tower", + "1@tower", + "2@tower", + "3@tower", + "4@tower", + "5@tower", + "6@tower", + + // 13.1 Another World + // -- 2008-05-28sdata_k.gpf -- + "mid_camp", + "mid_campin", + "man_fild01", + "man_fild03", + "spl_fild02", + "spl_fild03", + "moc_fild22b", + "que_dan01", + "que_dan02", + "schg_que01", + "schg_dun01", + "arug_que01", + "arug_dun01", + "1@orcs", + "2@orcs", + + // KvM Battleground + // -- 2008-??-??? -- + "bat_c01", + "bat_c02", + "bat_c03", + + // 13.2 Another World + // -- 2008-11-26 -- + "1@nyd", + "2@nyd", + "nyd_dun01", + "nyd_dun02", + "manuk", + "man_fild02", + "man_in01", + "splendide", + "spl_fild01", + "spl_in01", + "spl_in02", + + // 3rd Job Maps + // -- 2009-01-29rdata_k2.gpf -- + "job3_arch01", + "job3_arch02", + "job3_arch03", + "job3_guil01", + "job3_guil02", + "job3_guil03", + "job3_rang01", + "job3_rang02", + "job3_rune01", + "job3_rune02", + "job3_rune03", + "job3_war01", + "job3_war02", + "jupe_core2", + + // ??? + // -- 2009-05-27rdata_k.gpf -- + "moc_para01", + + // Brasilis Maps + // -- 2009-08-05rdata_k.gpf -- + "brasilis", + "bra_in01", + "bra_fild01", + "bra_dun01", + "bra_dun02", + + // ??? + // -- 2009-09-30rdata_k.gpf -- + "s_atelier", + + // 13.3 El Discastes + // -- 2009-12-09rdata_k.gpf -- + "dicastes01", + "dicastes02", + "dic_in01", + "dic_fild01", + "dic_fild02", + "dic_dun01", + "dic_dun02", + "job3_gen01", + "job3_sha01", + + // Localized Event Maps + //"evt_zombie", + //"evt_coke", + + // Unknown Maps + //"ac_sl_area", + //"ac_cl_hall", + //"ac_cl_room", + //"jp_s_dun11", + + // 14.1 Bifrost + // -- 2010-06-09rdata_x.gpf -- + "mora", + "bif_fild01", + "bif_fild02", + "1@mist", + + // Dewata + // -- 2010-09-15rdata_x.gpf -- + "dewata", + "dew_in01", + "dew_fild01", + "dew_dun01", + "dew_dun02", + + // ??? + // -- 2010-10-06rdata_x.gpf -- + "que_house_s", + + // Malangdo + // -- 2010-11-03rdata_x.gpf -- + "malangdo", + "mal_in01", + "mal_in02", + "mal_dun01", + "1@pump", + "2@pump", + "1@cash", + + // Undersea Tunnel Expansion + // -- 2010-11-10rdata_x.gpf -- + "iz_dun05", + + // ??? + // -- 2010-12-01data_x.gpf -- + "evt_mobroom", + + // ??? + "dic_dun03", + //"mjolnir_04_1", + //"evt_swar_b", + //"evt_swar_r", + //"evt_swar_s", + //"evt_swar_t", + + // Lighthalzen Dungeon F4, Wolfchev's Laboratory + // -- 2011-03-16rdata_x.gpf -- + "1@lhz", + "lhz_dun04", + "que_lhz", + + // Hall Of Abyss + // -- 2011-06-15data_x.gpf -- + "gld_dun01_2", + "gld_dun02_2", + "gld_dun03_2", + "gld_dun04_2", + "gld2_ald", + "gld2_gef", + "gld2_pay", + "gld2_prt", + + // Malaya Port + // -- 2011-08-30data_x.gpf -- + "malaya", + "ma_fild01", + "ma_fild02", + "ma_scene01", + "ma_in01", + "ma_dun01", + "1@ma_h", + "1@ma_c", + "1@ma_b", + "ma_zif01", + "ma_zif02", + "ma_zif03", + "ma_zif04", + "ma_zif05", + "ma_zif06", + "ma_zif07", + "ma_zif08", + "ma_zif09", + "job_ko", + + // 14.2 Eclage + // -- 2011-11-30data_x.gpf -- + "eclage", + "ecl_fild01", + "ecl_in01", + "ecl_in02", + "ecl_in03", + "ecl_in04", + "1@ecl", + "ecl_tdun01", + "ecl_tdun02", + "ecl_tdun03", + "ecl_tdun04", + "ecl_hub01", + "que_avan01", + + // Pyramids Basement Nightmare Mode + "moc_prydn1", + "moc_prydn2", + + // Izlude Novice Academy & Tutorial + // New Maps added 2013-02-10 + "iz_int", + "iz_int01", + "iz_int02", + "iz_int03", + "iz_int04", + "iz_ac01", + "iz_ac02", + "iz_ng01", + "treasure_n1", + "treasure_n2", + "iz_ac01_d", + "iz_ac02_d", + "iz_ac01_c", + "iz_ac02_c", + "iz_ac01_b", + "iz_ac02_b", + "iz_ac01_a", + "iz_ac02_a", + "izlude_d", + "izlude_c", + "izlude_b", + "izlude_a", + + "prt_fild08d", + "prt_fild08c", + "prt_fild08b", + "prt_fild08a", + + // War of Emperium - Third Edition (TE) + "te_prt_gld", + "te_prtcas01", + "te_prtcas02", + "te_prtcas03", + "te_prtcas04", + "te_prtcas05", + "teg_dun01", + "teg_dun02", + "te_alde_gld", + "te_aldecas1", + "te_aldecas2", + "te_aldecas3", + "te_aldecas4", + "te_aldecas5", + + // Glast Heim Memorial & Nightmare + "gl_cas02_", + "gl_chyard_", + "1@gl_k", + "2@gl_k", + + "silk_lair", + "evt_bomb", + + // Wave Mode Memorial Dungeon + "1@def01", + "1@def02", + "1@def03", + + // Heroes' Trails - Part 1 + "1@face", + "1@sara", + "1@tnm1", + "1@tnm2", + "1@tnm3", + "1@ge_st", + "1@gef", + "1@gef_in", + "1@spa", + "dali", + "dali02", + + // Episode 14.3 + "moro_vol", + "moro_cav", + "1@dth1", + "1@dth2", + "1@dth3", + "1@rev", + "1@xm_d", + "1@eom", + "1@jtb", + + // Clock Tower Nightmare Mode + "c_tower2_", + "c_tower3_", + + //------------------------- Clone Maps --------------------------- + //------------------------- Extra Maps --------------------------- + + // Ragnarok World Championship 2004 + // Requires: RWC 2004 Client + // or Akaru's SuperGRF 1.64 or newer + //"rwc01", + //"rwc02", + //"rwc03", + + // Ragnarok World Championship 2009 + // Requires: RWC 2009 Map files + //"2009rwc_f01", + //"2009rwc_01", + //"2009rwc_02", + //"2009rwc_03", + //"2009rwc_04", + + // Ragnarok World Championship 2008? + // Requires: RWC 2008 Map files? + //"2008rwc_04", + + //Christmas & Sakura Special + //Requires Akaru's SuperGRF 1.1 or newer + //"prontera_x", + //"alberta_x", + //"aldebaran_x", + //"geffen_x", + //"izlude_x", + //"prt_church_x", + //"prontera_s", + //"pay_arche_s", + + //Fenced Lutie", + //Requires Akaru's SuperGRF 1.23 or newer", + //"xmas_old", + + //Alpha Maps + //Requires adata.grf containing alpha maps and data + //"fay_vilg00", + //"fay_vilg01", + //"gef_vilg00", + //"gef_vilg01", + //"moc_dugn01", + //"moc_dugn02", + //"moc_fild01", + //"moc_fild02", + //"moc_fild03", + //"moc_fild04", + //"moc_intr00", + //"moc_intr01", + //"moc_intr02", + //"moc_intr04", + //"moc_vilg00", + //"moc_vilg01", + //"moc_vilg02", + //"probemap", + //"probemap02", + //"prt_cstl01", + //"prt_dugn00", + //"prt_dugn01", + //"prt_fild00", + //"prt_fild01", + //"prt_fild03", + //"prt_fild04", + //"prt_fild05", + //"prt_intr01", + //"prt_intr01_a", + //"prt_intr02", + //"prt_vilg00", + //"prt_vilg01", + //"prt_vilg02", + //"tank_test", + //"tank_test2", + //"test", +) //map_list diff --git a/conf/map/script.conf b/conf/map/script.conf new file mode 100644 index 000000000..78514e637 --- /dev/null +++ b/conf/map/script.conf @@ -0,0 +1,64 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Hercules Script Configuration File. +//========================================================================= + +script_configuration: { + // Specifies whether or not an error should be outputed when there's a + // mismatch between the number of provided arguments and of expected + // arguments + // Default: true + warn_func_mismatch_paramnum: true + + // Specifies whether or not each built-in function's arguments are + // checked for correct type. When a function is given an argument + // different from what it expects, a warning is thrown before the + // function is ran anyway. + // Default: true + warn_func_mismatch_argtypes: true + + // Maximum number of operations before considering a set of operations too intensive + // Defaults to 655360 + check_cmdcount: 655360 + + // Maximum number of iterations before considering a loop infinite + // Defaults to 2048 + check_gotocount: 2048 + + // Default value of the 'min' argument of the script command 'input'. + // When the 'min' argument isn't provided, this value is used instead. + // Defaults to 0. + //input_min_value: 0 + + // Default value of the 'max' argument of the script command 'input'. + // When the 'max' argument isn't provided, this value is used instead. + // Defaults to INT_MAX. + //input_max_value: 2147483647 + input_max_value: 10000000 +} + +import: "conf/import/script.conf" diff --git a/conf/maps.conf b/conf/maps.conf deleted file mode 100644 index 529afa9ce..000000000 --- a/conf/maps.conf +++ /dev/null @@ -1,1225 +0,0 @@ -//------------------------- Normal Maps --------------------------- -map: alb_ship -map: alb2trea -map: alberta -map: alberta_in -map: alde_dun01 -map: alde_dun02 -map: alde_dun03 -map: alde_dun04 -map: aldeba_in -map: aldebaran -map: anthell01 -map: anthell02 -map: arena_room -map: c_tower1 -map: c_tower2 -map: c_tower3 -map: c_tower4 -//map: force_map1 -//map: force_map2 -//map: force_map3 -map: force_1-1 -map: force_2-1 -map: force_3-1 -map: force_4-1 -map: force_5-1 -map: force_1-2 -map: force_2-2 -map: force_3-2 -map: force_1-3 -map: force_2-3 -map: force_3-3 -map: gef_dun00 -map: gef_dun01 -map: gef_dun02 -map: gef_dun03 -map: gef_fild00 -map: gef_fild01 -map: gef_fild02 -map: gef_fild03 -map: gef_fild04 -map: gef_fild05 -map: gef_fild06 -map: gef_fild07 -map: gef_fild08 -map: gef_fild09 -map: gef_fild10 -map: gef_fild11 -map: gef_fild12 -map: gef_fild13 -map: gef_fild14 -map: gef_tower -map: geffen -map: geffen_in -map: gl_cas01 -map: gl_cas02 -map: gl_church -map: gl_chyard -map: gl_dun01 -map: gl_dun02 -map: gl_in01 -map: gl_knt01 -map: gl_knt02 -map: gl_prison -map: gl_prison1 -map: gl_sew01 -map: gl_sew02 -map: gl_sew03 -map: gl_sew04 -map: gl_step -map: glast_01 -//map: hunter_1-1 -//map: hunter_2-1 -//map: hunter_3-1 -map: in_hunter -map: in_moc_16 -map: in_orcs01 -map: in_sphinx1 -map: in_sphinx2 -map: in_sphinx3 -map: in_sphinx4 -map: in_sphinx5 -map: iz_dun00 -map: iz_dun01 -map: iz_dun02 -map: iz_dun03 -map: iz_dun04 -map: izlu2dun -map: izlude -map: izlude_in -map: job_thief1 -//map: knight_1-1 -//map: knight_2-1 -//map: knight_3-1 -map: mjo_dun01 -map: mjo_dun02 -map: mjo_dun03 -map: mjolnir_01 -map: mjolnir_02 -map: mjolnir_03 -map: mjolnir_04 -map: mjolnir_05 -map: mjolnir_06 -map: mjolnir_07 -map: mjolnir_08 -map: mjolnir_09 -map: mjolnir_10 -map: mjolnir_11 -map: mjolnir_12 -map: moc_castle -map: moc_fild01 -map: moc_fild02 -map: moc_fild03 -//map: moc_fild04 -//map: moc_fild05 -//map: moc_fild06 -map: moc_fild07 -//map: moc_fild08 -//map: moc_fild09 -//map: moc_fild10 -map: moc_fild11 -map: moc_fild12 -map: moc_fild13 -//map: moc_fild14 -//map: moc_fild15 -map: moc_fild16 -map: moc_fild17 -map: moc_fild18 -map: moc_fild19 -map: moc_pryd01 -map: moc_pryd02 -map: moc_pryd03 -map: moc_pryd04 -map: moc_pryd05 -map: moc_pryd06 -map: moc_prydb1 -map: moc_ruins -map: monk_in -map: morocc -map: morocc_in -map: new_zone01 -map: new_zone02 -map: new_zone03 -map: new_zone04 -map: new_1-1 -map: new_1-2 -map: new_1-3 -map: new_1-4 -map: new_2-1 -map: new_2-2 -map: new_2-3 -map: new_2-4 -map: new_3-1 -map: new_3-2 -map: new_3-3 -map: new_3-4 -map: new_4-1 -map: new_4-2 -map: new_4-3 -map: new_4-4 -map: new_5-1 -map: new_5-2 -map: new_5-3 -map: new_5-4 -map: orcsdun01 -map: orcsdun02 -//map: ordeal_a00 -//map: ordeal_a02 -map: ordeal_1-1 -map: ordeal_1-2 -//map: ordeal_1-3 -//map: ordeal_1-4 -map: ordeal_2-1 -map: ordeal_2-2 -//map: ordeal_2-3 -//map: ordeal_2-4 -map: ordeal_3-1 -map: ordeal_3-2 -//map: ordeal_3-3 -//map: ordeal_3-4 -map: pay_arche -map: pay_dun00 -map: pay_dun01 -map: pay_dun02 -map: pay_dun03 -map: pay_dun04 -map: pay_fild01 -map: pay_fild02 -map: pay_fild03 -map: pay_fild04 -map: pay_fild05 -map: pay_fild06 -map: pay_fild07 -map: pay_fild08 -map: pay_fild09 -map: pay_fild10 -map: pay_fild11 -//map: priest_1-1 -//map: priest_2-1 -//map: priest_3-1 -map: prontera -map: prt_are_in -map: prt_are01 -map: prt_castle -map: prt_church -map: prt_fild00 -map: prt_fild01 -map: prt_fild02 -map: prt_fild03 -map: prt_fild04 -map: prt_fild05 -map: prt_fild06 -map: prt_fild07 -map: prt_fild08 -map: prt_fild09 -map: prt_fild10 -map: prt_fild11 -map: prt_in -map: prt_maze01 -map: prt_maze02 -map: prt_maze03 -map: prt_monk -map: prt_sewb1 -map: prt_sewb2 -map: prt_sewb3 -map: prt_sewb4 -map: pvp_room -map: pvp_2vs2 -map: pvp_c_room -map: pvp_n_1-1 -map: pvp_n_1-2 -map: pvp_n_1-3 -map: pvp_n_1-4 -map: pvp_n_1-5 -map: pvp_n_2-1 -map: pvp_n_2-2 -map: pvp_n_2-3 -map: pvp_n_2-4 -map: pvp_n_2-5 -map: pvp_n_3-1 -map: pvp_n_3-2 -map: pvp_n_3-3 -map: pvp_n_3-4 -map: pvp_n_3-5 -map: pvp_n_4-1 -map: pvp_n_4-2 -map: pvp_n_4-3 -map: pvp_n_4-4 -map: pvp_n_4-5 -map: pvp_n_5-1 -map: pvp_n_5-2 -map: pvp_n_5-3 -map: pvp_n_5-4 -map: pvp_n_5-5 -map: pvp_n_6-1 -map: pvp_n_6-2 -map: pvp_n_6-3 -map: pvp_n_6-4 -map: pvp_n_6-5 -map: pvp_n_7-1 -map: pvp_n_7-2 -map: pvp_n_7-3 -map: pvp_n_7-4 -map: pvp_n_7-5 -map: pvp_n_8-1 -map: pvp_n_8-2 -map: pvp_n_8-3 -map: pvp_n_8-4 -map: pvp_n_8-5 -map: pvp_n_room -map: pvp_y_1-1 -map: pvp_y_1-2 -map: pvp_y_1-3 -map: pvp_y_1-4 -map: pvp_y_1-5 -map: pvp_y_2-1 -map: pvp_y_2-2 -map: pvp_y_2-3 -map: pvp_y_2-4 -map: pvp_y_2-5 -map: pvp_y_3-1 -map: pvp_y_3-2 -map: pvp_y_3-3 -map: pvp_y_3-4 -map: pvp_y_3-5 -map: pvp_y_4-1 -map: pvp_y_4-2 -map: pvp_y_4-3 -map: pvp_y_4-4 -map: pvp_y_4-5 -map: pvp_y_5-1 -map: pvp_y_5-2 -map: pvp_y_5-3 -map: pvp_y_5-4 -map: pvp_y_5-5 -map: pvp_y_6-1 -map: pvp_y_6-2 -map: pvp_y_6-3 -map: pvp_y_6-4 -map: pvp_y_6-5 -map: pvp_y_7-1 -map: pvp_y_7-2 -map: pvp_y_7-3 -map: pvp_y_7-4 -map: pvp_y_7-5 -map: pvp_y_8-1 -map: pvp_y_8-2 -map: pvp_y_8-3 -map: pvp_y_8-4 -map: pvp_y_8-5 -map: pvp_y_room -map: sword_1-1 -map: sword_2-1 -map: sword_3-1 -map: treasure01 -map: treasure02 -//map: wizard_1-1 -//map: wizard_2-1 -//map: wizard_3-1 -map: xmas -map: xmas_dun01 -map: xmas_dun02 -map: xmas_fild01 -map: xmas_in - -//---Ep3.0 Comodo --- - -map: beach_dun -map: beach_dun2 -map: beach_dun3 -map: cmd_fild01 -map: cmd_fild02 -map: cmd_fild03 -map: cmd_fild04 -map: cmd_fild05 -map: cmd_fild06 -map: cmd_fild07 -map: cmd_fild08 -map: cmd_fild09 -map: cmd_in01 -map: cmd_in02 -map: comodo - -//---EP3.1 Quiz Revolution --- - -map: quiz_00 -map: quiz_01 -map: g_room1-1 -map: g_room1-2 -map: g_room1-3 -map: g_room2 - -//--- Ep4.0 Turtle Island --- - -map: tur_dun01 -map: tur_dun02 -map: tur_dun03 -map: tur_dun04 -map: tur_dun05 -map: tur_dun06 - -//--- Ep4.1 The War of Emperium --- - -map: alde_gld -map: aldeg_cas01 -map: aldeg_cas02 -map: aldeg_cas03 -map: aldeg_cas04 -map: aldeg_cas05 -map: gefg_cas01 -map: gefg_cas02 -map: gefg_cas03 -map: gefg_cas04 -map: gefg_cas05 -map: gld_dun01 -map: gld_dun02 -map: gld_dun03 -map: gld_dun04 -map: guild_room -map: guild_vs1 -map: guild_vs2 -map: guild_vs3 -map: guild_vs4 -map: guild_vs5 -map: guild_vs1-1 -map: guild_vs1-2 -map: guild_vs1-3 -map: guild_vs1-4 -map: guild_vs2-1 -map: guild_vs2-2 -//map: job_hunter -map: job_hunte -//map: job_knight -map: job_knt -//map: job_priest -map: job_prist -map: job_sword1 -//map: job_wizard -map: job_wiz -map: pay_gld -map: payg_cas01 -map: payg_cas02 -map: payg_cas03 -map: payg_cas04 -map: payg_cas05 -map: prt_gld -map: prtg_cas01 -map: prtg_cas02 -map: prtg_cas03 -map: prtg_cas04 -map: prtg_cas05 - - -//--- Ep5.0 Yuno --- - -map: alde_alche -map: in_rogue -map: job_cru -map: job_duncer -map: job_monk -map: job_sage -map: mag_dun01 -map: mag_dun02 -map: monk_test -map: quiz_test -map: yuno -map: yuno_fild01 -map: yuno_fild02 -map: yuno_fild03 -map: yuno_fild04 -map: yuno_in01 -map: yuno_in02 -map: yuno_in03 -map: yuno_in04 -map: yuno_in05 - -//--- Ep6.0 - Amatsu --- -// Requires: kRO 08-10-03 or newer -// or kRO Sakray 09-09-03 or newer - -map: ama_dun01 -map: ama_dun02 -map: ama_dun03 -map: ama_fild01 -map: ama_in01 -map: ama_in02 -map: ama_test -map: amatsu - -//--- Ep6.1 - Gon Ryun --- - -map: gon_dun01 -map: gon_dun02 -map: gon_dun03 -map: gon_fild01 -map: gon_in -map: gon_test -map: gonryun -map: sec_in01 -map: sec_in02 -map: sec_pri - -//--- Ep6.2 - Umbala --- -// Requires: kRO 01-27-04 or newer -// or kRO Sakray 12-02-03 or newer -// or Akaru's SuperGRF 1.22 or newer -map: umbala -map: um_dun01 -map: um_dun02 -map: um_fild01 -map: um_fild02 -map: um_fild03 -map: um_fild04 -map: um_in - -//--- Ep6.3 - Niflheim --- -// Requires: kRO 02-23-04 or newer -// or kRO Sakray 01-09-04 or newer -// or Akaru's SuperGRF 1.32 or newer -map: niflheim -map: nif_fild01 -map: nif_fild02 -map: nif_in -map: yggdrasil01 - -//--- Ep6.4 - Valkyrie --- -// Requires: kRO ??-??-04 or newer -// or kRO Sakray 02-03-04 or newer -// or Akaru's SuperGRF 1.34 or newer -map: valkyrie -map: himinn - -//--- Ep6.5 - Castle of Dragon (LouYang) --- -// Requires kRO Sakray 03-30 or newer -//(Akaru's SuperGRF required version: 1.52) -map: lou_in01 -map: lou_in02 -map: lou_dun03 -map: lou_dun02 -map: lou_dun01 -map: lou_fild01 -map: louyang - -//--- Ep6.6 - Novice Guild Siege --- -//Requires kRO Sakray 04-07 or newer -//(Akaru's SuperGRF required version: 1.53) -//map: siege_test -map: n_castle -map: nguild_gef -map: nguild_prt -map: nguild_pay -map: nguild_alde - -//--- Ep6.7 - Jawaii --- -//Requires kRO Sakray 06-22 or newer -//(Akaru's SuperGRF required version: 1.63) -map: jawaii -map: jawaii_in - -// --- Ep6.8 - Geffenia --- -// Requires kRO Sakray 07-13 or newer -// (Akaru's SuperGRF required version: 1.64) -map: gefenia01 -map: gefenia02 -map: gefenia03 -map: gefenia04 - -// --- Ep6.9 - New Payon --- -// Requires kRO Sakray 09-03 -// -- dunno -- -map: payon -map: payon_in01 -map: payon_in02 -map: payon_in03 -//same names as old maps except that payon_in03 got added - -// --- Ep? - Ayothaya --- -// Requires kRO Sakray 09-21 -// -- 2004-10-19sdata_k.gpf -- -map: ayothaya -map: ayo_in01 -map: ayo_in02 -map: ayo_fild01 -map: ayo_fild02 -map: ayo_dun01 -map: ayo_dun02 - -// --- God item quests maps --- -// -- 2004-10-12sdata_k3.gpf -- -map: que_god01 -map: que_god02 - -// --- Ep? - Schwarzwald Republic --- -// -- 2004-12-28sdata_k.gpf -- -map: yuno_fild05 -map: yuno_fild07 -map: yuno_fild08 -map: yuno_fild09 -map: yuno_fild11 -map: yuno_fild12 - -// --- Turbo Track Arena --- -// -- 2005-03-08sdata_k.gpf -- -map: alde_tt02 -map: turbo_n_1 -map: turbo_n_4 -map: turbo_n_8 -map: turbo_n_16 -map: turbo_e_4 -map: turbo_e_8 -map: turbo_e_16 -map: turbo_room - -// --- Einbroch/Einbech --- -// -- 2005-03-15sdata_k.gpf -- -map: airplane -map: airport -map: einbech -map: einbroch -map: ein_dun01 -map: ein_dun02 -map: ein_fild06 -map: ein_fild07 -map: ein_fild08 -map: ein_fild09 -map: ein_fild10 -map: ein_in01 -map: que_sign01 -map: que_sign02 - -// --- Einbroch and Lightalzen --- -// -- 2005-05-10sdata_k.gpf -- -map: ein_fild03 -map: ein_fild04 -map: lhz_fild02 -map: lhz_fild03 - -// --- Lighthalzen and Juperos Dungeon --- -// -- 2005-06-14sdata_k.gpf -- -map: yuno_pre -map: lhz_fild01 -map: lighthalzen -map: lhz_in01 -map: lhz_in02 -map: lhz_in03 -map: lhz_que01 -map: lhz_dun01 -map: lhz_dun02 -map: lhz_dun03 -map: lhz_cube -map: juperos_01 -map: juperos_02 -map: jupe_area1 -map: jupe_area2 -map: jupe_core -map: jupe_ele -map: jupe_ele_r -map: jupe_gate - -// --- Lighthalzen & Juno Airport --- -// -- resnametable clones of airport and airplane -- -map: y_airport -map: lhz_airport -map: airplane_01 - -// --- Juperos Dungeon --- -// -- 2005-06-28sdata_k.gpf -- -map: jupe_cave - -// --- Quiz Revolution --- -// -- 2005-08-02sdata_k.gpf -- -map: quiz_02 - -// --- Hugel Field --- -// -- 2005-08-23sdata_k.gpf -- -map: hu_fild07 -map: hu_fild05 -map: hu_fild04 -map: hu_fild01 -map: yuno_fild06 - -// --- Star Knight And Soul Linker Job Change Maps --- -// -- 2005-08-23sdata_k.gpf -- -map: job_soul -map: job_star - -// --- Abyss Lake, Thanatos Tower -- -// -- 2005-09-13sdata_k.gpf - 2005-09-13sdata_k6.gpf -- -map: que_job01 -map: que_job02 -map: que_job03 -map: abyss_01 -map: abyss_02 -map: abyss_03 -map: thana_step -map: thana_boss -map: tha_scene01 -map: tha_t01 -map: tha_t02 -map: tha_t03 -map: tha_t04 -map: tha_t07 -map: tha_t05 -map: tha_t06 -map: tha_t08 - -// --- Thanatos Tower --- -// -- 2005-09-21sdata_k.gpf -- -map: tha_t09 -map: tha_t10 -map: tha_t11 -map: tha_t12 - -// --- Auction Market --- -// -- 2005-11-29sdata_k.gpf -- -map: auction_01 -map: auction_02 - -// ??? -// -- 2005-12-06gdata_k.gpf -map: alde_tt03 - -// --- Garden City Hugel / Kiehl --- -// -- 2005-12-20sdata_k.gpf -- -map: hugel -map: hu_in01 -map: que_bingo -map: que_hugel -map: p_track01 -map: p_track02 -map: odin_tem01 -map: odin_tem02 -map: odin_tem03 -map: hu_fild02 -map: hu_fild03 -map: hu_fild06 -map: ein_fild01 -map: ein_fild02 -map: ein_fild05 -map: yuno_fild10 -map: kh_kiehl02 -map: kh_kiehl01 -map: kh_dun02 -map: kh_dun01 -map: kh_mansion -map: kh_rossi -map: kh_school -map: kh_vila - -// --- Poring Arena (?) & Gunslinger/Ninja Job Map --- -// -- 2006-03-28sdata_k.gpf -- -//map: poring_c01 -//map: poring_c02 -map: que_ng - -// --- Arunafeltz & Ice Dungeon --- -// -- 2006-05-30sdata_k.gpf -- -map: rachel -map: ra_in01 -map: ra_fild01 -map: ra_fild02 -map: ra_fild03 -map: ra_fild04 -map: ra_fild05 -map: ra_fild06 -map: ra_fild07 -map: ra_fild08 -map: ra_fild09 -map: ra_fild10 -map: ra_fild11 -map: ra_fild12 -map: ra_fild13 -map: ra_san01 -map: ra_san02 -map: ra_san03 -map: ra_san04 -map: ra_san05 -map: ra_temin -map: ra_temple -map: ra_temsky -map: que_rachel -map: que_san04 -map: ice_dun01 -map: ice_dun02 -map: ice_dun03 -map: ice_dun04 - -// --- Veins & Thor Dungeon --- -// -- 2006-12-19sdata_k.gpf -- -map: que_thor -map: thor_camp -map: thor_v01 -map: thor_v02 -map: thor_v03 -map: veins -map: ve_in -map: ve_in02 -map: ve_fild01 -map: ve_fild02 -map: ve_fild03 -map: ve_fild04 -map: ve_fild05 -map: ve_fild06 -map: ve_fild07 - -// --- Nameless Island & Abbey Dungeon --- -// -- 2007-04-03sdata_k.gpf -map: nameless_i -map: nameless_n -map: nameless_in -map: abbey01 -map: abbey02 -map: abbey03 -map: poring_w01 -map: poring_w02 - -// --- ??? --- -// -- 2007-??-?? -map: 06guild_r -map: 06guild_01 -map: 06guild_02 -map: 06guild_03 -map: 06guild_04 -map: 06guild_05 -map: 06guild_06 -map: 06guild_07 -map: 06guild_08 -map: z_agit -map: que_temsky -map: itemmall -map: bossnia_01 -map: bossnia_02 -map: bossnia_03 -map: bossnia_04 - -// --- Moscovia --- -// -- 2007-06-??? -map: moscovia -map: mosk_in -map: mosk_ship -map: mosk_fild01 -map: mosk_fild02 -map: mosk_dun01 -map: mosk_dun02 -map: mosk_dun03 -map: mosk_que - -// --- Episode 12: Satan Morroc & Schwaltzvalt Seige --- -// -- 2007-09-19sdata_k.gpf -map: schg_cas01 -map: schg_cas02 -map: schg_cas03 -map: schg_cas04 -map: schg_cas05 -map: sch_gld -map: cave -map: moc_fild20 -map: moc_fild21 -map: moc_fild22 -map: que_ba -map: que_moc_16 -map: que_moon - -// Arunafeltz Seige -// -- 2007-10-24sdata_k.gpf -map: arug_cas01 -map: arug_cas02 -map: arug_cas03 -map: arug_cas04 -map: arug_cas05 -map: aru_gld - -// PVP Battle Fields: Tierra Valley, and Frebeus -// -- 2007-11-14sdata_k.gpf -map: bat_room -map: bat_a01 -map: bat_a02 -map: bat_b01 -map: bat_b02 -map: que_qsch01 -map: que_qsch02 -map: que_qsch03 -map: que_qsch04 -map: que_qsch05 -map: que_qaru01 -map: que_qaru02 -map: que_qaru03 -map: que_qaru04 -map: que_qaru05 - -// Memorial Dungeon -// -- 2007-11-28sdata_k.gpf -map: 1@cata -map: 2@cata -map: e_tower -map: 1@tower -map: 2@tower -map: 3@tower -map: 4@tower -map: 5@tower -map: 6@tower - -// 13.1 Another World -// -- 2008-05-28sdata_k.gpf -map: mid_camp -map: mid_campin -map: man_fild01 -map: man_fild03 -map: spl_fild02 -map: spl_fild03 -map: moc_fild22b -map: que_dan01 -map: que_dan02 -map: schg_que01 -map: schg_dun01 -map: arug_que01 -map: arug_dun01 -map: 1@orcs -map: 2@orcs - -// Additional Battleground. -// -- 2008-??-??? -map: bat_c01 -map: bat_c02 -map: bat_c03 - -// 13.2 Another World -// -- 2008-11-26 -map: 1@nyd -map: 2@nyd -map: nyd_dun01 -map: nyd_dun02 -map: manuk -map: man_fild02 -map: man_in01 -map: splendide -map: spl_fild01 -map: spl_in01 -map: spl_in02 - -// 3rd Job Maps -// -- 2009-01-29rdata_k2.gpf -map: job3_arch01 -map: job3_arch02 -map: job3_arch03 -map: job3_guil01 -map: job3_guil02 -map: job3_guil03 -map: job3_rang01 -map: job3_rang02 -map: job3_rune01 -map: job3_rune02 -map: job3_rune03 -map: job3_war01 -map: job3_war02 -map: jupe_core2 - -// ??? -// -- 2009-05-27rdata_k.gpf -map: moc_para01 - -// Brasilis Maps -// -- 2009-08-05rdata_k.gpf -map: brasilis -map: bra_in01 -map: bra_fild01 -map: bra_dun01 -map: bra_dun02 - -// ??? -// -- 2009-09-30rdata_k.gpf -map: s_atelier - -// 13.3 El Discastes -// -- 2009-12-09rdata_k.gpf -map: dicastes01 -map: dicastes02 -map: dic_in01 -map: dic_fild01 -map: dic_fild02 -map: dic_dun01 -map: dic_dun02 -map: job3_gen01 -map: job3_sha01 - -// Localized Event Maps -//map: evt_zombie -//map: evt_coke - -// Unknown Maps -//ac_sl_area -//ac_cl_hall -//ac_cl_room -//jp_s_dun11 - -// 14.1 Bifrost -// -- 2010-06-09rdata_x.gpf -map: mora -map: bif_fild01 -map: bif_fild02 -map: 1@mist - -// Dewata Maps -// -- 2010-09-15rdata_x.gpf -map: dewata -map: dew_in01 -map: dew_fild01 -map: dew_dun01 -map: dew_dun02 - -// ??? -// -- 2010-10-06rdata_x.gpf -map: que_house_s - -// Malangdo Maps -// -- 2010-11-03rdata_x.gpf -map: malangdo -map: mal_in01 -map: mal_in02 -map: mal_dun01 -map: 1@pump -map: 2@pump -map: 1@cash - -// Undersea Tunnel Expansion -// -- 2010-11-10rdata_x.gpf -map: iz_dun05 - -// ??? -// -- 2010-12-01data_x.gpf -map: evt_mobroom - -// ??? -map: dic_dun03 -//map: mjolnir_04_1 -//map: evt_swar_b -//map: evt_swar_r -//map: evt_swar_s -//map: evt_swar_t - -// Lighthalzen Dungeon F4, Wolfchev's Laboratory -// -- 2011-03-16rdata_x.gpf -map: 1@lhz -map: lhz_dun04 -map: que_lhz - -// Hall Of Abyss -// -- 2011-06-15data_x.gpf -map: gld_dun01_2 -map: gld_dun02_2 -map: gld_dun03_2 -map: gld_dun04_2 -map: gld2_ald -map: gld2_gef -map: gld2_pay -map: gld2_prt - -// Malaya Port -// -- 2011-08-30data_x.gpf -map: malaya -map: ma_fild01 -map: ma_fild02 -map: ma_scene01 -map: ma_in01 -map: ma_dun01 -map: 1@ma_h -map: 1@ma_c -map: 1@ma_b -map: ma_zif01 -map: ma_zif02 -map: ma_zif03 -map: ma_zif04 -map: ma_zif05 -map: ma_zif06 -map: ma_zif07 -map: ma_zif08 -map: ma_zif09 -map: job_ko - -// 14.2 Eclage -// -- 2011-11-30data_x.gpf -map: eclage -map: ecl_fild01 -map: ecl_in01 -map: ecl_in02 -map: ecl_in03 -map: ecl_in04 -map: 1@ecl -map: ecl_tdun01 -map: ecl_tdun02 -map: ecl_tdun03 -map: ecl_tdun04 -map: ecl_hub01 -map: que_avan01 - -// Pyramids Basement Nightmare Mode -map: moc_prydn1 -map: moc_prydn2 - -// =============================== -// New Maps added 2013-02-10 (Thanks Streusel!) -// Credits to Baneado for reporting some -// =============================== -// Izlude Novice Academy & Tutorial -map: iz_int -map: iz_int01 -map: iz_int02 -map: iz_int03 -map: iz_int04 -map: iz_ac01 -map: iz_ac02 -map: iz_ng01 -map: treasure_n1 -map: treasure_n2 -map: iz_ac01_d -map: iz_ac02_d -map: iz_ac01_c -map: iz_ac02_c -map: iz_ac01_b -map: iz_ac02_b -map: iz_ac01_a -map: iz_ac02_a -map: izlude_d -map: izlude_c -map: izlude_b -map: izlude_a - -map: prt_fild08d -map: prt_fild08c -map: prt_fild08b -map: prt_fild08a - -// War of Emperium - Third Edition (TE) -map: te_prt_gld -map: te_prtcas01 -map: te_prtcas02 -map: te_prtcas03 -map: te_prtcas04 -map: te_prtcas05 -map: teg_dun01 -map: teg_dun02 -map: te_alde_gld -map: te_aldecas1 -map: te_aldecas2 -map: te_aldecas3 -map: te_aldecas4 -map: te_aldecas5 - -// Glast Heim Memorial & Nightmare -map: gl_cas02_ -map: gl_chyard_ -map: 1@gl_k -map: 2@gl_k - -map: silk_lair -map: evt_bomb - -// Wave Mode Memorial Dungeon -map: 1@def01 -map: 1@def02 -map: 1@def03 - -// Heroes' Trails - Part 1 -map: 1@face -map: 1@sara -map: 1@tnm1 -map: 1@tnm2 -map: 1@tnm3 -map: 1@ge_st -map: 1@gef -map: 1@gef_in -map: 1@spa -map: dali -map: dali02 - -// Episode 14.3 -map: moro_vol -map: moro_cav -map: 1@dth1 -map: 1@dth2 -map: 1@dth3 -map: 1@rev -map: 1@xm_d -map: 1@eom -map: 1@jtb - -// Clock Tower Nightmare Mode -map: c_tower2_ -map: c_tower3_ - -//------------------------- Clone Maps --------------------------- -//------------------------- Extra Maps --------------------------- - -// Ragnarok World Championship 2004 -// Requires: RWC 2004 Client -// or Akaru's SuperGRF 1.64 or newer -//map: rwc01 -//map: rwc02 -//map: rwc03 - -// Ragnarok World Championship 2009 -// Requires: RWC 2009 Map files -//map: 2009rwc_f01 -//map: 2009rwc_01 -//map: 2009rwc_02 -//map: 2009rwc_03 -//map: 2009rwc_04 - -// Ragnarok World Championship 2008? -// Requires: RWC 2008 Map files? -//map: 2008rwc_04 - -//Christmas & Sakura Special -//Requires Akaru's SuperGRF 1.1 or newer -//map: prontera_x -//map: alberta_x -//map: aldebaran_x -//map: geffen_x -//map: izlude_x -//map: prt_church_x -//map: prontera_s -//map: pay_arche_s - -//Fenced Lutie -//Requires Akaru's SuperGRF 1.23 or newer -//map: xmas_old - -//Alpha Maps -//Requires adata.grf containing alpha maps and data -//map: fay_vilg00 -//map: fay_vilg01 -//map: gef_vilg00 -//map: gef_vilg01 -//map: moc_dugn01 -//map: moc_dugn02 -//map: moc_fild01 -//map: moc_fild02 -//map: moc_fild03 -//map: moc_fild04 -//map: moc_intr00 -//map: moc_intr01 -//map: moc_intr02 -//map: moc_intr04 -//map: moc_vilg00 -//map: moc_vilg01 -//map: moc_vilg02 -//map: probemap -//map: probemap02 -//map: prt_cstl01 -//map: prt_dugn00 -//map: prt_dugn01 -//map: prt_fild00 -//map: prt_fild01 -//map: prt_fild03 -//map: prt_fild04 -//map: prt_fild05 -//map: prt_intr01 -//map: prt_intr01_a -//map: prt_intr02 -//map: prt_vilg00 -//map: prt_vilg01 -//map: prt_vilg02 -//map: tank_test -//map: tank_test2 -//map: test diff --git a/conf/packet.conf b/conf/packet.conf deleted file mode 100644 index 1780d1b4c..000000000 --- a/conf/packet.conf +++ /dev/null @@ -1,80 +0,0 @@ -//===== Hercules Sockets Configuration ======================= -//= Hercules Sockets Configuration File -//===== Translated by: ======================================= -// Davidsiaw -//============================================================ - -// Display debug reports (When something goes wrong during the report, the report is saved.) -debug: no - -// How long can a socket stall before closing the connection (in seconds)? -stall_time: 60 - -// Linux/Epoll: Maxmimum Events per cycle -// Default Value: -// (Maxmimum Supported Connections)/2 -// NOTE: this controls the maximum collected socket-events per-cycle (call to epoll_wait()) -// for example settings this to 32 will allow up to 32 events (incomming data/new connections -// per server-cycle. -// NOTE: Recommended Settings is at least half the maxmimum supported connections -// Settings this to a lower value, may cause lags/delays -// Depending on available CPU Time -// NOTE: This Setting is only available on Linux when build using EPoll as event dispatcher! -// -//epoll_maxevents: 1024 - -// Maximum allowed size for clients packets in bytes (default: 65535). -// Default Values: -// 24576 (Clients < 20131223) -// 65535 (Clients >= 20131223) -// NOTE: To reduce the size of reported packets, lower the values of defines, which -// have been customized, such as MAX_STORAGE, MAX_GUILD_STORAGE or MAX_CART. -// NOTE: Do not modify this setting, unless the client has been modified to support -// larger packets. The client will crash, when it receives larger packets. -//socket_max_client_packet: 65535 - -//----- IP Rules Settings ----- - -// If IP's are checked when connecting. -// This also enables DDoS protection. -enable_ip_rules: yes - -// Order of the checks -// deny,allow : Checks deny rules, then allow rules. Allows if no rules match. -// allow,deny : Checks allow rules, then deny rules. Allows if no rules match. -// mutual-failure : Allows only if an allow rule matches and no deny rules match. -// (default is deny,allow) - -order: deny,allow -// order: allow,deny -// order: mutual-failture - -// IP rules -// allow : Accepts connections from the ip range (even if flagged as DDoS) -// deny : Rejects connections from the ip range -// The rules are processed in order, the first matching rule of each list (allow and deny) is used - -// allow: 127.0.0.1 -// allow: 192.168.0.0/16 -// allow: 10.0.0.0/255.0.0.0 -// allow: all - -// deny: 127.0.0.1 - -//---- DDoS Protection Settings ---- -// If ddos_count connection request are made within ddos_interval msec, it assumes it's a DDoS attack - -// Consecutive attempts interval (msec) -// (default is 3000 msecs, 3 seconds) -ddos_interval: 3000 - -// Consecutive attempts trigger -// (default is 5 attemps) -ddos_count: 5 - -// The time interval after which the threat of DDoS is assumed to be gone. (msec) -// After this amount of time, the DDoS restrictions are lifted. -// (default is 600000 msecs, 10 minutes) -ddos_autoreset: 600000 - -import: conf/import/packet_conf.txt diff --git a/conf/readme.txt b/conf/readme.txt index 3323b5689..28ff254b6 100644 --- a/conf/readme.txt +++ b/conf/readme.txt @@ -9,12 +9,12 @@ How does this work? ------------------------------------------------------------------------------- Place only the settings you have changed in the import files. -For example, if you want to change a value in conf/battle/exp.conf: +For example, if you want to change a value in conf/map/battle/exp.conf: // Rate at which exp. is given. (Note 2) base_exp_rate: 700 -You could instead copy the setting into conf/import/battle_conf.txt, +You could instead copy the setting into conf/import/battle.conf, and you'll eliminate any problems updating in the future. Neat, isn't it? diff --git a/conf/script.conf b/conf/script.conf deleted file mode 100644 index 1512aa15a..000000000 --- a/conf/script.conf +++ /dev/null @@ -1,28 +0,0 @@ -//-------------------------------------------------------- -// Hercules Script Configuration File -//-------------------------------------------------------- - -warn_func_mismatch_paramnum: yes - -check_cmdcount: 655360 - -check_gotocount: 2048 - -// Default value of the 'min' argument of the script command 'input'. -// When the 'min' argument isn't provided, this value is used instead. -// Defaults to 0. -//input_min_value: 0 - -// Default value of the 'max' argument of the script command 'input'. -// When the 'max' argument isn't provided, this value is used instead. -// Defaults to INT_MAX. -//input_max_value: 2147483647 -input_max_value: 10000000 - -// Specifies whether or not each built-in function's arguments are checked for -// correct type. When a function is given an argument different from what it -// expects, a warning is thrown before the function is ran anyway. -// Default: yes -warn_func_mismatch_argtypes: yes - -import: conf/import/script_conf.txt diff --git a/doc/atcommands.txt b/doc/atcommands.txt index e8a5b0efe..fdafb6c90 100644 --- a/doc/atcommands.txt +++ b/doc/atcommands.txt @@ -79,8 +79,8 @@ Toggles the display of experience gain messages. @showzeny Toggles the display of Zeny gain messages. -Configuration for zeny being dropped by mobs is in '/conf/battle/monster.conf': -zeny_from_mobs: yes +Configuration for zeny being dropped by mobs is in 'conf/map/battle/monster.conf': +zeny_from_mobs: true --------------------------------------- @@ -905,7 +905,7 @@ Changes Kafra Points by the specified amount. @dye <default: 0-4> Changes appearance based on the given parameters. -The min/max values are set in '/conf/battle/client.conf'. +The min/max values are set in 'conf/map/battle/client.conf'. --------------------------------------- @@ -945,7 +945,7 @@ Additionally, @sizeall will change the size of all online players. @leave Duel-organizing commands. -Some options can be found in '/conf/battle/misc.conf'. +Some options can be found in 'conf/map/battle/misc.conf'. --------------------------------------- @@ -1188,7 +1188,7 @@ Changes a battle_config flag without rebooting the server. @adjgroup <group ID> Changes the group of a character (lasts until relog). -The groups are specified in '/conf/groups.conf'. +The groups are specified in 'conf/groups.conf'. --------------------------------------- @@ -1273,7 +1273,7 @@ Warps all online characters of a party to your location. Allows you to spy on any party's Party Chat. At least one member of that party must be online. -NOTE: map server needs to be configured to enable spying to use this command (enable_spy: yes) +NOTE: map server needs to be configured to enable spying to use this command (enable_spy: true) --------------------------------------- @@ -1336,7 +1336,7 @@ Warps all online characters of a guild to your location. Allows you to spy on any guild's Guild Chat. At least one member of that guild must be online. -NOTE: map server needs to be configured to enable spying to use this command (enable_spy: yes) +NOTE: map server needs to be configured to enable spying to use this command (enable_spy: true) --------------------------------------- diff --git a/doc/global_configuration.txt b/doc/global_configuration.txt new file mode 100644 index 000000000..a000a4572 --- /dev/null +++ b/doc/global_configuration.txt @@ -0,0 +1,69 @@ +//===== Hercules Documentation =============================== +//= Global configuration reference +//===== By: ================================================== +//= Panikon (Hercules Dev. Team) +//===== Current Version: ===================================== +//= 20140616 +//===== Description: ========================================= +//= Global configurations found in conf/global/ +//============================================================ + +- What are global configurations? + +Global configurations are configurations that can be shared between servers, +but can also be set independently in each server. + +- How do they work? + +They work by using an include system that is available with libconfig: + + "A configuration file may "include" the contents of another file using an + include directive. This directive has the effect of inlining the contents of + the named file at the point of inclusion. + + An include directive must appear on its own line in the input. It has the + form: + + @include "filename" + + Any backslashes or double quotes in the filename must be escaped as '\\' and + '\"', respectively." + From libconfig's documentation + +So each file that is included is actually inside each one of the main +configuration files and thus a change in the first will be a change in the +latter. +Note: the @include directive is read by the server executable, so any path +should be from were it is and NOT from where the main configuration file is! + +- How do I stop using global configurations? + +To stop using global configurations is very simple, all you have to do is copy +the contents that are inside the global configuration file and put them +_exactly_ where the include directive were in the main configuration file. + +E.g. + Find in any file: + @include "conf/global/sql_connection.conf" + Replace it with: + sql_connection: { + // [INTER] You can specify the codepage to use in your mySQL tables here. + // (Note that this feature requires MySQL 4.1+) + //default_codepage: "" + + // [LOGIN] Is `userid` in account_db case sensitive? + //case_sensitive: false + + // For IPs, ideally under linux, you want to use localhost instead of 127.0.0.1 + // Under windows, you want to use 127.0.0.1. If you see a message like + // "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)" + // and you have localhost, switch it to 127.0.0.1 + db_hostname: "127.0.0.1" + db_port: 3306 + db_username: "ragnarok" + db_password: "ragnarok" + db_database: "ragnarok" + //codepage:"" + } + If the main configuration file belongs to the map server, for instance, you + don't need to include default_codepage and case_sensitive. diff --git a/doc/map_cache.txt b/doc/map_cache.txt index 19ab92a4d..80a83662a 100644 --- a/doc/map_cache.txt +++ b/doc/map_cache.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= DracoRPG //===== Current Version: ===================================== -//= 20070724 +//= 20160820 //===== Description: ========================================= //= A complete manual for Hercules' map cache generator as //= well as a reference on the map cache format used. @@ -32,11 +32,8 @@ having slightly different maps. When building your cache, you should ensure you' The list of GRFs and/or data directory must follow the format and indication of the default file: as many "grf:" entries as you wish and optionally only one "data_dir:" entry with trailing backslash included. // comments are supported as usual. -In fact, any file with one map name per line can be used as a map list, that's why the map index list is used as a default: -we are sure it contains every map supported by the server. Anything after the map name is ignored, // comments are supported -and if the first word on the line is "map:" then the second word is used as the map name instead: that allows using -/conf/maps.conf as your map list, which is handy if you want to generate a minimal map cache for each of your multiple -map-servers. +A custom map list can be used, in order to generate a map cache file with different (or less) maps than the current Hercules +configuration. For details on the map list format, see conf/map/maps.conf. The map cache file path can point to an already existing file, as the builder adds a map only if it's not already cached. This way, you can add custom maps to the base map cache without even needing kRO Sakray maps. If you wish to rebuild the entire map cache, though, you can either provide a path to a non-existing file, or force the rebuild mode. diff --git a/doc/md5_hashcheck.txt b/doc/md5_hashcheck.txt index d9064b1ab..0153938c5 100644 --- a/doc/md5_hashcheck.txt +++ b/doc/md5_hashcheck.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= Hercules Dev Team //===== Current Version: ===================================== -//= 20140208 +//= 20160210 //===== Description: ========================================= //= This file outlines the login server's MD5 hash check. //============================================================ @@ -20,27 +20,9 @@ Please refer to your client diff tool manual for the appropriate patch tools or diffs it may have similar names.) The serverside settings for the hash check are located in -conf/login.conf: +conf/login/login.conf::login_configuration.permission.hash -// Client MD5 hash check -// If turned on, the login server will check if the client's hash matches -// the value below, and will not connect tampered clients. -// Note: see doc/md5_hashcheck.txt for more details. -client_hash_check: off - -// Client MD5 hashes -// The client with the specified hash can be used to log in by players with -// a group_id equal to or greater than the given value. -// If you specify 'disabled' as hash, players with a group_id greater than or -// equal to the given value will be able to log in regardless of hash (and even -// if their client does not send a hash at all.) -// Format: group_id, hash -// Note: see doc/md5_hashcheck.txt for more details. -client_hash: 0, 113e195e6c051bb1cfb12a644bb084c5 -client_hash: 10, cb1ea78023d337c38e8ba5124e2338ae -client_hash: 99, disabled - -To enable MD5 hash checks, set 'client_hash_check' to 'on' and add one +To enable MD5 hash checks, set 'client_hash_check' to 'true' and add one 'client_hash' entry for each client you want to use. The group_id can be any of the groups in conf/groups.conf, and it is useful in case if you want to allow GMs to use a different client diff --git a/doc/permissions.txt b/doc/permissions.txt index a656f8bcf..bc84f86b6 100644 --- a/doc/permissions.txt +++ b/doc/permissions.txt @@ -5,7 +5,7 @@ //===== Current Version: ===================================== //= 20131031 //===== Description: ========================================= -//= Player group permissions, configured in /conf/groups.conf. +//= Player group permissions, configured in conf/groups.conf. //============================================================ can_trade : Ability to trade or otherwise distribute items (drop, storage, vending etc...). diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 097cae665..e1f68916e 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -73,25 +73,30 @@ Wherever you refer to a map, use 'mapname' instead of 'mapname.gat'. Script loading structure ------------------------ -Scripts are loaded by the map server as referenced in the -'conf/map-server.conf' configuration file, but in the default -configuration, it doesn't load any script files itself. Instead, it loads -the file 'npc/scripts_main.conf' which itself contains references to other -files. The actual scripts are loaded from txt files, which are linked up -like this: +Scripts are loaded by the map server as referenced in the +'npc/(pre-)re/scripts_main.conf' configuration file. -npc: <path to a filename> +The file contains a list of scripts to be loaded (or other configuration files +to be parsed, through the @include directive), in the following format: -Any line like this, invoked, ultimately, by 'map-server.conf' will load up -the script contained in this file, which will make the script available. -No file will get loaded twice, to prevent possible errors. +npc_global_list: ( + "npc/path/to/the/script/to/load.txt", + "npc/other/file.txt", +@include "npc/other_configuration_file.conf" +) -Another configuration file option of relevance is: +Any script will only get loaded once even if specified twice, to prevent +possible errors. -delnpc: <path to a filename> +It's possible to specify scripts to exclude from loading, by inserting them +(using the same syntax) in the list available in npc/scripts_removed.conf: -This will unload a specified script filename from memory, which, while -seemingly useless, may sometimes be required. +npc_removed_list: ( + "npc/path/to/the/file/to/skip.txt", +) + +Script file format +------------------ Whenever '//' is encountered in a line upon reading, everything beyond this on that line is considered to be a comment and is ignored. This works @@ -161,7 +166,7 @@ monster database (which contains an uppercase name used to summon the monster with a GM command). Amount is the amount of monsters that will be spawned when this command is -executed, it is affected by spawn rates in 'battle.conf'. +executed, it is affected by spawn rates in 'conf/map/battle.conf'. Delay1 and delay2 control monster respawn delays - the first one is the fixed base respawn time, and the second is random variance on top of the @@ -1635,7 +1640,7 @@ receive free Zeny as a result. The command has two optional arguments and a return value. The default value of 'min' and 'max' can be set with 'input_min_value' and -'input_max_value' in script.conf. +'input_max_value' in conf/map/script.conf. For numeric inputs the value is capped to the range [min,max]. Returns 1 if the value was higher than 'max', -1 if lower than 'min' and 0 otherwise. For string inputs it returns 1 if the string was longer than 'max', -1 is @@ -3773,13 +3778,13 @@ Example 2: *basicskillcheck() -This function will return the state of the configuration option -'basic_skill_check' in 'battle.conf'. Returns 1 if the option is enabled -and 0 if it isn't. If the 'basic_skill_check' option is enabled, which it -is by default, characters must have a certain number of basic skill levels -to sit, request a trade, use emotions, etc. Making your script behave -differently depending on whether the characters must actually have the -skill to do all these things might in some cases be required. +This function will return the state of the configuration option +'basic_skill_check' in 'conf/map/battle.conf'. Returns 1 if the option is +enabled and 0 if it isn't. If the 'basic_skill_check' option is enabled, which +it is by default, characters must have a certain number of basic skill levels +to sit, request a trade, use emotions, etc. Making your script behave +differently depending on whether the characters must actually have the skill to +do all these things might in some cases be required. --------------------------------------- @@ -5064,9 +5069,9 @@ disable changing equips while running that script in particular. Note that if a different script also calls disable_items, it will override the last call (so you may want to call this command at the start of your script without assuming the effect is still in effect). -If 'item_enabled_npc' option is set to Yes in 'items.conf' all NPC are -allowing changing of equipment by default except for those have been set -with 'disable_items'. +If 'item_enabled_npc' option is set to true in 'conf/map/battle/items.conf' all +NPC are allowing changing of equipment by default except for those have been +set with 'disable_items'. --------------------------------------- @@ -5493,8 +5498,8 @@ Used in reset NPC's (duh!). This command takes off all the skill points on the invoking character, so they only have Basic Skill blanked out (lvl 0) left, and returns the points for them to spend again. Nothing else will change but the skills. -Quest skills will also reset if 'quest_skill_reset' option is set to Yes -in 'battle.conf'. If the 'quest_skill_learn' option is set in there, the +Quest skills will also reset if 'quest_skill_reset' option is set to true in +'conf/map/battle.conf'. If the 'quest_skill_learn' option is set in there, the points in the quest skills will also count towards the total. Used in reset NPC's (duh!). @@ -6969,8 +6974,8 @@ mapflag's state. *getbattleflag("<battle flag>") Sets or gets the value of the given battle flag. -Battle flags are the flags found in the battle/*.conf files and is also -used in Lupus' variable rates script. +Battle flags are the flags found in the conf/map/battle/*.conf files and is +also used in Lupus' variable rates script. Examples: @@ -7187,7 +7192,7 @@ window). It will not be displayed anywhere else. *logmes "<message>"; This command will write the message given to the map server NPC log file, -as specified in 'conf/logs.conf'. If SQL logging is enabled, the message +as specified in 'conf/map/logs.conf'. If SQL logging is enabled, the message will go to the 'npclog' table. If logs are not enabled for NPCs, nothing will happen. @@ -8290,7 +8295,7 @@ rate if the pet intimacy is at the maximum possible. The behavior modified with the above mentioned commands will only be exhibited if the pet is loyal and appropriate configuration options are -set in 'battle.conf'. +set in 'conf/map/battle.conf'. Pet scripts in the database normally run whenever a pet of that type hatches from the egg. Other commands usable in item scripts (see 'bonus') diff --git a/npc/pre-re/scripts.conf b/npc/pre-re/scripts.conf index ad6407503..d00d6ffba 100644 --- a/npc/pre-re/scripts.conf +++ b/npc/pre-re/scripts.conf @@ -9,7 +9,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 @@ -29,84 +29,84 @@ //========================================================================= //================= Airport =============================================== -npc: npc/pre-re/airports/izlude.txt +"npc/pre-re/airports/izlude.txt", //================= Cities ================================================ -npc: npc/pre-re/cities/alberta.txt -npc: npc/pre-re/cities/izlude.txt -npc: npc/pre-re/cities/jawaii.txt -npc: npc/pre-re/cities/yuno.txt +"npc/pre-re/cities/alberta.txt", +"npc/pre-re/cities/izlude.txt", +"npc/pre-re/cities/jawaii.txt", +"npc/pre-re/cities/yuno.txt", //================= Guides ================================================ -npc: npc/pre-re/guides/guides_alberta.txt -npc: npc/pre-re/guides/guides_aldebaran.txt -npc: npc/pre-re/guides/guides_amatsu.txt -npc: npc/pre-re/guides/guides_ayothaya.txt -npc: npc/pre-re/guides/guides_comodo.txt -npc: npc/pre-re/guides/guides_einbroch.txt -npc: npc/pre-re/guides/guides_geffen.txt -npc: npc/pre-re/guides/guides_gonryun.txt -npc: npc/pre-re/guides/guides_hugel.txt -npc: npc/pre-re/guides/guides_izlude.txt -npc: npc/pre-re/guides/guides_juno.txt -npc: npc/pre-re/guides/guides_lighthalzen.txt -npc: npc/pre-re/guides/guides_louyang.txt -npc: npc/pre-re/guides/guides_morroc.txt -npc: npc/pre-re/guides/guides_moscovia.txt -npc: npc/pre-re/guides/guides_niflheim.txt -npc: npc/pre-re/guides/guides_payon.txt -npc: npc/pre-re/guides/guides_prontera.txt -npc: npc/pre-re/guides/guides_rachel.txt -npc: npc/pre-re/guides/guides_umbala.txt -npc: npc/pre-re/guides/guides_veins.txt +"npc/pre-re/guides/guides_alberta.txt", +"npc/pre-re/guides/guides_aldebaran.txt", +"npc/pre-re/guides/guides_amatsu.txt", +"npc/pre-re/guides/guides_ayothaya.txt", +"npc/pre-re/guides/guides_comodo.txt", +"npc/pre-re/guides/guides_einbroch.txt", +"npc/pre-re/guides/guides_geffen.txt", +"npc/pre-re/guides/guides_gonryun.txt", +"npc/pre-re/guides/guides_hugel.txt", +"npc/pre-re/guides/guides_izlude.txt", +"npc/pre-re/guides/guides_juno.txt", +"npc/pre-re/guides/guides_lighthalzen.txt", +"npc/pre-re/guides/guides_louyang.txt", +"npc/pre-re/guides/guides_morroc.txt", +"npc/pre-re/guides/guides_moscovia.txt", +"npc/pre-re/guides/guides_niflheim.txt", +"npc/pre-re/guides/guides_payon.txt", +"npc/pre-re/guides/guides_prontera.txt", +"npc/pre-re/guides/guides_rachel.txt", +"npc/pre-re/guides/guides_umbala.txt", +"npc/pre-re/guides/guides_veins.txt", //================= Kafras & Cool Event Corp. ============================= -npc: npc/pre-re/kafras/kafras.txt +"npc/pre-re/kafras/kafras.txt", //================= Merchants ============================================= -npc: npc/pre-re/merchants/ammo_boxes.txt -npc: npc/pre-re/merchants/ammo_dealer.txt -npc: npc/pre-re/merchants/shops.txt +"npc/pre-re/merchants/ammo_boxes.txt", +"npc/pre-re/merchants/ammo_dealer.txt", +"npc/pre-re/merchants/shops.txt", //================= Others ================================================ -npc: npc/pre-re/other/bulletin_boards.txt -npc: npc/pre-re/other/mercenary_rent.txt -npc: npc/pre-re/other/pvp.txt -npc: npc/pre-re/other/msg_boards.txt -npc: npc/pre-re/other/resetskill.txt -npc: npc/pre-re/other/turbo_track.txt +"npc/pre-re/other/bulletin_boards.txt", +"npc/pre-re/other/mercenary_rent.txt", +"npc/pre-re/other/pvp.txt", +"npc/pre-re/other/msg_boards.txt", +"npc/pre-re/other/resetskill.txt", +"npc/pre-re/other/turbo_track.txt", //================= Quests ================================================ // - Repeatable EXP Quests (iRO) -------------------------------- -//npc: npc/pre-re/quests/collection/quest_alligator.txt -//npc: npc/pre-re/quests/collection/quest_caramel.txt +//"npc/pre-re/quests/collection/quest_alligator.txt", +//"npc/pre-re/quests/collection/quest_caramel.txt", // - Exploitable due to vendor selling Acorns in Moscovia -//npc: npc/pre-re/quests/collection/quest_coco.txt -//npc: npc/pre-re/quests/collection/quest_creamy.txt -//npc: npc/pre-re/quests/collection/quest_demonpungus.txt -//npc: npc/pre-re/quests/collection/quest_disguiseloliruri.txt -//npc: npc/pre-re/quests/collection/quest_dokebi.txt -//npc: npc/pre-re/quests/collection/quest_dryad.txt -//npc: npc/pre-re/quests/collection/quest_fabre.txt -//npc: npc/pre-re/quests/collection/quest_frilldora.txt +//"npc/pre-re/quests/collection/quest_coco.txt", +//"npc/pre-re/quests/collection/quest_creamy.txt", +//"npc/pre-re/quests/collection/quest_demonpungus.txt", +//"npc/pre-re/quests/collection/quest_disguiseloliruri.txt", +//"npc/pre-re/quests/collection/quest_dokebi.txt", +//"npc/pre-re/quests/collection/quest_dryad.txt", +//"npc/pre-re/quests/collection/quest_fabre.txt", +//"npc/pre-re/quests/collection/quest_frilldora.txt", // - Exploitable due to vendor selling Antelope Horns in Niflheim -//npc: npc/pre-re/quests/collection/quest_goat.txt -//npc: npc/pre-re/quests/collection/quest_golem.txt -//npc: npc/pre-re/quests/collection/quest_hode.txt -//npc: npc/pre-re/quests/collection/quest_leafcat.txt -//npc: npc/pre-re/quests/collection/quest_mantis.txt +//"npc/pre-re/quests/collection/quest_goat.txt", +//"npc/pre-re/quests/collection/quest_golem.txt", +//"npc/pre-re/quests/collection/quest_hode.txt", +//"npc/pre-re/quests/collection/quest_leafcat.txt", +//"npc/pre-re/quests/collection/quest_mantis.txt", // - Exploitable due to vendor selling Bill of Birds in Morroc -//npc: npc/pre-re/quests/collection/quest_pecopeco.txt -//npc: npc/pre-re/quests/collection/quest_pupa.txt -//npc: npc/pre-re/quests/collection/quest_zhupolong.txt +//"npc/pre-re/quests/collection/quest_pecopeco.txt", +//"npc/pre-re/quests/collection/quest_pupa.txt", +//"npc/pre-re/quests/collection/quest_zhupolong.txt", // -------------------------------------------------------------- // - Quests-Tutorials for basic classes (1st class quests) ------ -npc: npc/pre-re/quests/first_class/tu_archer.txt +"npc/pre-re/quests/first_class/tu_archer.txt", // -------------------------------------------------------------- -npc: npc/pre-re/quests/monstertamers.txt -npc: npc/pre-re/quests/mrsmile.txt -npc: npc/pre-re/quests/quests_13_1.txt -npc: npc/pre-re/quests/quests_izlude.txt -npc: npc/pre-re/quests/quests_lighthalzen.txt -npc: npc/pre-re/quests/quests_nameless.txt -npc: npc/pre-re/quests/quests_veins.txt +"npc/pre-re/quests/monstertamers.txt", +"npc/pre-re/quests/mrsmile.txt", +"npc/pre-re/quests/quests_13_1.txt", +"npc/pre-re/quests/quests_izlude.txt", +"npc/pre-re/quests/quests_lighthalzen.txt", +"npc/pre-re/quests/quests_nameless.txt", +"npc/pre-re/quests/quests_veins.txt", diff --git a/npc/pre-re/scripts_jobs.conf b/npc/pre-re/scripts_jobs.conf index bf0f46c28..139f9de48 100644 --- a/npc/pre-re/scripts_jobs.conf +++ b/npc/pre-re/scripts_jobs.conf @@ -9,7 +9,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 @@ -30,15 +30,15 @@ //================= Job Quests ============================================ // - 1-1 -npc: npc/pre-re/jobs/1-1/acolyte.txt -npc: npc/pre-re/jobs/1-1/archer.txt -npc: npc/pre-re/jobs/1-1/mage.txt -npc: npc/pre-re/jobs/1-1/merchant.txt -npc: npc/pre-re/jobs/1-1/swordman.txt -npc: npc/pre-re/jobs/1-1/thief.txt +"npc/pre-re/jobs/1-1/acolyte.txt", +"npc/pre-re/jobs/1-1/archer.txt", +"npc/pre-re/jobs/1-1/mage.txt", +"npc/pre-re/jobs/1-1/merchant.txt", +"npc/pre-re/jobs/1-1/swordman.txt", +"npc/pre-re/jobs/1-1/thief.txt", // - Novice -npc: npc/pre-re/jobs/novice/novice.txt +"npc/pre-re/jobs/novice/novice.txt", //================= Skill Quests ========================================== // - Novice -npc: npc/pre-re/quests/skills/novice_skills.txt +"npc/pre-re/quests/skills/novice_skills.txt", diff --git a/npc/pre-re/scripts_main.conf b/npc/pre-re/scripts_main.conf index 356aa7c12..9381497ec 100644 --- a/npc/pre-re/scripts_main.conf +++ b/npc/pre-re/scripts_main.conf @@ -9,7 +9,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 @@ -27,46 +27,49 @@ //========================================================================= //= Hercules Pre-Renewal Primary Scripts File //========================================================================= -// The idea of this new system is to make scripts more organized -// since the old system was rather messy with all the NPCs in one -// file. Now scripts are organized in to files arraged by type. -// Custom scripts are now in scripts_custom.conf, all other -// scripts are deemed as 'official'. You should place your NPCs -// in to scripts_custom.conf to follow the trend. -// -// Thanks, -// Ancyker and the rest of the Hercules Team -// -// Note: "Comments" are all text on the right side of a double slash "//" -// Whatever text is commented will not be parsed by the servers, and serves -// only as information/reference. +// The idea of this new system is to make scripts more organized since the old +// system was rather messy with all the NPCs in one file. Now scripts are +// organized in to files arraged by type. Custom scripts are now in +// scripts_custom.conf, all other scripts are deemed as 'official'. You should +// place your NPCs in to scripts_custom.conf to follow the trend. //========================================================================= -//================= Global Scripts Functions ============================== +//================= Disabled Scripts ====================================== +// All NPCs that you wish to remove from your loading list should be put in +// this file +@include "npc/scripts_removed.conf" + +//================= Global NPC list ======================================= +// Only files that are included here will be read by the server +npc_global_list: ( + +//- Global Scripts Functions - // Utilitarian functions used by many scripts. -npc: npc/other/Global_Functions.txt +"npc/other/Global_Functions.txt", -//================= Cash Shop Functions =================================== +//- Cash Shop Functions - // Used by cash shop items in the Item Database. -npc: npc/other/CashShop_Functions.txt +"npc/other/CashShop_Functions.txt", + +//- Common Script Files - +@include "npc/scripts.conf" +@include "npc/scripts_woe.conf" +@include "npc/scripts_jobs.conf" +@include "npc/scripts_mapflags.conf" +@include "npc/scripts_monsters.conf" +@include "npc/scripts_warps.conf" -//================= Common Script Files =================================== -import: npc/scripts.conf -import: npc/scripts_woe.conf -import: npc/scripts_jobs.conf -import: npc/scripts_mapflags.conf -import: npc/scripts_monsters.conf -import: npc/scripts_warps.conf +//- Pre-Renewal Script Files - +@include "npc/pre-re/scripts.conf" +@include "npc/pre-re/scripts_jobs.conf" +@include "npc/pre-re/scripts_monsters.conf" +@include "npc/pre-re/scripts_warps.conf" -//================= Pre-Renewal Script Files ============================== -import: npc/pre-re/scripts.conf -import: npc/pre-re/scripts_jobs.conf -import: npc/pre-re/scripts_monsters.conf -import: npc/pre-re/scripts_warps.conf +//- Development / Testing Script Files - +@include "npc/scripts_dev.conf" -//================= Development / Testing Script Files ==================== -import: npc/scripts_dev.conf +//- Custom Script Files - +// Your NPCs go in this file! +@include "npc/scripts_custom.conf" -//================= Custom Script Files =================================== -// - Your NPCs go in this file! -import: npc/scripts_custom.conf +) // npc_global_list diff --git a/npc/pre-re/scripts_monsters.conf b/npc/pre-re/scripts_monsters.conf index 8d726e8bc..83ec3cc64 100644 --- a/npc/pre-re/scripts_monsters.conf +++ b/npc/pre-re/scripts_monsters.conf @@ -9,7 +9,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 @@ -29,70 +29,70 @@ //========================================================================= //================= Misc Spawns =========================================== -npc: npc/pre-re/mobs/citycleaners.txt +"npc/pre-re/mobs/citycleaners.txt", //================= Dungeons ============================================== -npc: npc/pre-re/mobs/dungeons/abbey.txt -npc: npc/pre-re/mobs/dungeons/abyss.txt -npc: npc/pre-re/mobs/dungeons/alde_dun.txt -npc: npc/pre-re/mobs/dungeons/ama_dun.txt -npc: npc/pre-re/mobs/dungeons/anthell.txt -npc: npc/pre-re/mobs/dungeons/ayo_dun.txt -npc: npc/pre-re/mobs/dungeons/beach_dun.txt -npc: npc/pre-re/mobs/dungeons/c_tower.txt -npc: npc/pre-re/mobs/dungeons/ein_dun.txt -npc: npc/pre-re/mobs/dungeons/gef_dun.txt -npc: npc/pre-re/mobs/dungeons/gefenia.txt -npc: npc/pre-re/mobs/dungeons/glastheim.txt -npc: npc/pre-re/mobs/dungeons/gld_dun.txt -npc: npc/pre-re/mobs/dungeons/gld_dunSE.txt -npc: npc/pre-re/mobs/dungeons/gon_dun.txt -npc: npc/pre-re/mobs/dungeons/ice_dun.txt -npc: npc/pre-re/mobs/dungeons/in_sphinx.txt -npc: npc/pre-re/mobs/dungeons/iz_dun.txt -npc: npc/pre-re/mobs/dungeons/juperos.txt -npc: npc/pre-re/mobs/dungeons/kh_dun.txt -npc: npc/pre-re/mobs/dungeons/lhz_dun.txt -npc: npc/pre-re/mobs/dungeons/lou_dun.txt -npc: npc/pre-re/mobs/dungeons/mag_dun.txt -npc: npc/pre-re/mobs/dungeons/mjo_dun.txt -npc: npc/pre-re/mobs/dungeons/moc_pryd.txt -npc: npc/pre-re/mobs/dungeons/mosk_dun.txt -npc: npc/pre-re/mobs/dungeons/nyd_dun.txt -npc: npc/pre-re/mobs/dungeons/odin.txt -npc: npc/pre-re/mobs/dungeons/orcsdun.txt -npc: npc/pre-re/mobs/dungeons/pay_dun.txt -npc: npc/pre-re/mobs/dungeons/prt_maze.txt -npc: npc/pre-re/mobs/dungeons/prt_sew.txt -npc: npc/pre-re/mobs/dungeons/ra_san.txt -npc: npc/pre-re/mobs/dungeons/tha_t.txt -npc: npc/pre-re/mobs/dungeons/thor_v.txt -npc: npc/pre-re/mobs/dungeons/treasure.txt -npc: npc/pre-re/mobs/dungeons/tur_dun.txt -npc: npc/pre-re/mobs/dungeons/um_dun.txt -npc: npc/pre-re/mobs/dungeons/xmas_dun.txt -npc: npc/pre-re/mobs/dungeons/yggdrasil.txt +"npc/pre-re/mobs/dungeons/abbey.txt", +"npc/pre-re/mobs/dungeons/abyss.txt", +"npc/pre-re/mobs/dungeons/alde_dun.txt", +"npc/pre-re/mobs/dungeons/ama_dun.txt", +"npc/pre-re/mobs/dungeons/anthell.txt", +"npc/pre-re/mobs/dungeons/ayo_dun.txt", +"npc/pre-re/mobs/dungeons/beach_dun.txt", +"npc/pre-re/mobs/dungeons/c_tower.txt", +"npc/pre-re/mobs/dungeons/ein_dun.txt", +"npc/pre-re/mobs/dungeons/gef_dun.txt", +"npc/pre-re/mobs/dungeons/gefenia.txt", +"npc/pre-re/mobs/dungeons/glastheim.txt", +"npc/pre-re/mobs/dungeons/gld_dun.txt", +"npc/pre-re/mobs/dungeons/gld_dunSE.txt", +"npc/pre-re/mobs/dungeons/gon_dun.txt", +"npc/pre-re/mobs/dungeons/ice_dun.txt", +"npc/pre-re/mobs/dungeons/in_sphinx.txt", +"npc/pre-re/mobs/dungeons/iz_dun.txt", +"npc/pre-re/mobs/dungeons/juperos.txt", +"npc/pre-re/mobs/dungeons/kh_dun.txt", +"npc/pre-re/mobs/dungeons/lhz_dun.txt", +"npc/pre-re/mobs/dungeons/lou_dun.txt", +"npc/pre-re/mobs/dungeons/mag_dun.txt", +"npc/pre-re/mobs/dungeons/mjo_dun.txt", +"npc/pre-re/mobs/dungeons/moc_pryd.txt", +"npc/pre-re/mobs/dungeons/mosk_dun.txt", +"npc/pre-re/mobs/dungeons/nyd_dun.txt", +"npc/pre-re/mobs/dungeons/odin.txt", +"npc/pre-re/mobs/dungeons/orcsdun.txt", +"npc/pre-re/mobs/dungeons/pay_dun.txt", +"npc/pre-re/mobs/dungeons/prt_maze.txt", +"npc/pre-re/mobs/dungeons/prt_sew.txt", +"npc/pre-re/mobs/dungeons/ra_san.txt", +"npc/pre-re/mobs/dungeons/tha_t.txt", +"npc/pre-re/mobs/dungeons/thor_v.txt", +"npc/pre-re/mobs/dungeons/treasure.txt", +"npc/pre-re/mobs/dungeons/tur_dun.txt", +"npc/pre-re/mobs/dungeons/um_dun.txt", +"npc/pre-re/mobs/dungeons/xmas_dun.txt", +"npc/pre-re/mobs/dungeons/yggdrasil.txt", //================= Fields ================================================ -npc: npc/pre-re/mobs/fields/amatsu.txt -npc: npc/pre-re/mobs/fields/ayothaya.txt -npc: npc/pre-re/mobs/fields/comodo.txt -npc: npc/pre-re/mobs/fields/einbroch.txt -npc: npc/pre-re/mobs/fields/geffen.txt -npc: npc/pre-re/mobs/fields/gonryun.txt -npc: npc/pre-re/mobs/fields/hugel.txt -npc: npc/pre-re/mobs/fields/lighthalzen.txt -npc: npc/pre-re/mobs/fields/louyang.txt -npc: npc/pre-re/mobs/fields/lutie.txt -npc: npc/pre-re/mobs/fields/manuk.txt -npc: npc/pre-re/mobs/fields/mjolnir.txt -npc: npc/pre-re/mobs/fields/morocc.txt -npc: npc/pre-re/mobs/fields/moscovia.txt -npc: npc/pre-re/mobs/fields/niflheim.txt -npc: npc/pre-re/mobs/fields/payon.txt -npc: npc/pre-re/mobs/fields/prontera.txt -npc: npc/pre-re/mobs/fields/rachel.txt -npc: npc/pre-re/mobs/fields/splendide.txt -npc: npc/pre-re/mobs/fields/umbala.txt -npc: npc/pre-re/mobs/fields/veins.txt -npc: npc/pre-re/mobs/fields/yuno.txt +"npc/pre-re/mobs/fields/amatsu.txt", +"npc/pre-re/mobs/fields/ayothaya.txt", +"npc/pre-re/mobs/fields/comodo.txt", +"npc/pre-re/mobs/fields/einbroch.txt", +"npc/pre-re/mobs/fields/geffen.txt", +"npc/pre-re/mobs/fields/gonryun.txt", +"npc/pre-re/mobs/fields/hugel.txt", +"npc/pre-re/mobs/fields/lighthalzen.txt", +"npc/pre-re/mobs/fields/louyang.txt", +"npc/pre-re/mobs/fields/lutie.txt", +"npc/pre-re/mobs/fields/manuk.txt", +"npc/pre-re/mobs/fields/mjolnir.txt", +"npc/pre-re/mobs/fields/morocc.txt", +"npc/pre-re/mobs/fields/moscovia.txt", +"npc/pre-re/mobs/fields/niflheim.txt", +"npc/pre-re/mobs/fields/payon.txt", +"npc/pre-re/mobs/fields/prontera.txt", +"npc/pre-re/mobs/fields/rachel.txt", +"npc/pre-re/mobs/fields/splendide.txt", +"npc/pre-re/mobs/fields/umbala.txt", +"npc/pre-re/mobs/fields/veins.txt", +"npc/pre-re/mobs/fields/yuno.txt", diff --git a/npc/pre-re/scripts_warps.conf b/npc/pre-re/scripts_warps.conf index 472a0e6da..2e4c65027 100644 --- a/npc/pre-re/scripts_warps.conf +++ b/npc/pre-re/scripts_warps.conf @@ -9,7 +9,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 @@ -29,21 +29,21 @@ //========================================================================= //================= Cities ================================================ -npc: npc/pre-re/warps/cities/izlude.txt -npc: npc/pre-re/warps/cities/rachel.txt -npc: npc/pre-re/warps/cities/yggdrasil.txt +"npc/pre-re/warps/cities/izlude.txt", +"npc/pre-re/warps/cities/rachel.txt", +"npc/pre-re/warps/cities/yggdrasil.txt", //================= Fields ================================================ -npc: npc/pre-re/warps/fields/com_fild.txt -npc: npc/pre-re/warps/fields/geffen_fild.txt -npc: npc/pre-re/warps/fields/hugel_fild.txt -npc: npc/pre-re/warps/fields/morroc_fild.txt -npc: npc/pre-re/warps/fields/payon_fild.txt -npc: npc/pre-re/warps/fields/prontera_fild.txt -npc: npc/pre-re/warps/fields/rachel_fild.txt -npc: npc/pre-re/warps/fields/veins_fild.txt -npc: npc/pre-re/warps/fields/yuno_fild.txt +"npc/pre-re/warps/fields/com_fild.txt", +"npc/pre-re/warps/fields/geffen_fild.txt", +"npc/pre-re/warps/fields/hugel_fild.txt", +"npc/pre-re/warps/fields/morroc_fild.txt", +"npc/pre-re/warps/fields/payon_fild.txt", +"npc/pre-re/warps/fields/prontera_fild.txt", +"npc/pre-re/warps/fields/rachel_fild.txt", +"npc/pre-re/warps/fields/veins_fild.txt", +"npc/pre-re/warps/fields/yuno_fild.txt", //================= Others ================================================ -npc: npc/pre-re/warps/other/arena.txt -npc: npc/pre-re/warps/other/sign.txt +"npc/pre-re/warps/other/arena.txt", +"npc/pre-re/warps/other/sign.txt", diff --git a/npc/re/scripts.conf b/npc/re/scripts.conf index 53c5f4944..38caffc81 100644 --- a/npc/re/scripts.conf +++ b/npc/re/scripts.conf @@ -9,7 +9,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 @@ -29,152 +29,152 @@ //========================================================================= //================= Airport =============================================== -npc: npc/re/airports/izlude.txt +"npc/re/airports/izlude.txt", //================ Battlegrounds ========================================== -npc: npc/re/battleground/bg_common.txt +"npc/re/battleground/bg_common.txt", //================= Cities ================================================ -npc: npc/re/cities/alberta.txt -npc: npc/re/cities/brasilis.txt -npc: npc/re/cities/dewata.txt -npc: npc/re/cities/dicastes.txt -npc: npc/re/cities/eclage.txt -npc: npc/re/cities/izlude.txt -npc: npc/re/cities/jawaii.txt -npc: npc/re/cities/malangdo.txt -npc: npc/re/cities/malaya.txt -npc: npc/re/cities/mora.txt -npc: npc/re/cities/yuno.txt +"npc/re/cities/alberta.txt", +"npc/re/cities/brasilis.txt", +"npc/re/cities/dewata.txt", +"npc/re/cities/dicastes.txt", +"npc/re/cities/eclage.txt", +"npc/re/cities/izlude.txt", +"npc/re/cities/jawaii.txt", +"npc/re/cities/malangdo.txt", +"npc/re/cities/malaya.txt", +"npc/re/cities/mora.txt", +"npc/re/cities/yuno.txt", //================= Events ================================================ -//npc: npc/re/events/halloween_2013.txt -//npc: npc/re/events/halloween_2014.txt -//npc: npc/re/events/christmas_2013.txt +//"npc/re/events/halloween_2013.txt", +//"npc/re/events/halloween_2014.txt", +//"npc/re/events/christmas_2013.txt", //================= Guides ================================================ -npc: npc/re/guides/navigation.txt -npc: npc/re/guides/guides_alberta.txt -npc: npc/re/guides/guides_aldebaran.txt -npc: npc/re/guides/guides_amatsu.txt -npc: npc/re/guides/guides_ayothaya.txt -npc: npc/re/guides/guides_brasilis.txt -npc: npc/re/guides/guides_comodo.txt -npc: npc/re/guides/guides_dewata.txt -npc: npc/re/guides/guides_dicastes.txt -npc: npc/re/guides/guides_eclage.txt -npc: npc/re/guides/guides_einbroch.txt -npc: npc/re/guides/guides_geffen.txt -npc: npc/re/guides/guides_gonryun.txt -npc: npc/re/guides/guides_hugel.txt -npc: npc/re/guides/guides_izlude.txt -npc: npc/re/guides/guides_juno.txt -npc: npc/re/guides/guides_lighthalzen.txt -npc: npc/re/guides/guides_louyang.txt -npc: npc/re/guides/guides_lutie.txt -npc: npc/re/guides/guides_malaya.txt -npc: npc/re/guides/guides_mora.txt -npc: npc/re/guides/guides_morroc.txt -npc: npc/re/guides/guides_moscovia.txt -npc: npc/re/guides/guides_niflheim.txt -npc: npc/re/guides/guides_payon.txt -npc: npc/re/guides/guides_prontera.txt -npc: npc/re/guides/guides_rachel.txt -npc: npc/re/guides/guides_umbala.txt -npc: npc/re/guides/guides_veins.txt +"npc/re/guides/navigation.txt", +"npc/re/guides/guides_alberta.txt", +"npc/re/guides/guides_aldebaran.txt", +"npc/re/guides/guides_amatsu.txt", +"npc/re/guides/guides_ayothaya.txt", +"npc/re/guides/guides_brasilis.txt", +"npc/re/guides/guides_comodo.txt", +"npc/re/guides/guides_dewata.txt", +"npc/re/guides/guides_dicastes.txt", +"npc/re/guides/guides_eclage.txt", +"npc/re/guides/guides_einbroch.txt", +"npc/re/guides/guides_geffen.txt", +"npc/re/guides/guides_gonryun.txt", +"npc/re/guides/guides_hugel.txt", +"npc/re/guides/guides_izlude.txt", +"npc/re/guides/guides_juno.txt", +"npc/re/guides/guides_lighthalzen.txt", +"npc/re/guides/guides_louyang.txt", +"npc/re/guides/guides_lutie.txt", +"npc/re/guides/guides_malaya.txt", +"npc/re/guides/guides_mora.txt", +"npc/re/guides/guides_morroc.txt", +"npc/re/guides/guides_moscovia.txt", +"npc/re/guides/guides_niflheim.txt", +"npc/re/guides/guides_payon.txt", +"npc/re/guides/guides_prontera.txt", +"npc/re/guides/guides_rachel.txt", +"npc/re/guides/guides_umbala.txt", +"npc/re/guides/guides_veins.txt", //================= Instances ============================================= -npc: npc/re/instances/BakonawaLake.txt -npc: npc/re/instances/BangungotHospital.txt -npc: npc/re/instances/BuwayaCave.txt -npc: npc/re/instances/HazyForest.txt -npc: npc/re/instances/MalangdoCulvert.txt -npc: npc/re/instances/OctopusCave.txt -npc: npc/re/instances/OldGlastHeim.txt -npc: npc/re/instances/saras_memory.txt -npc: npc/re/instances/WolfchevLaboratory.txt -npc: npc/re/instances/EclageInterior.txt +"npc/re/instances/BakonawaLake.txt", +"npc/re/instances/BangungotHospital.txt", +"npc/re/instances/BuwayaCave.txt", +"npc/re/instances/HazyForest.txt", +"npc/re/instances/MalangdoCulvert.txt", +"npc/re/instances/OctopusCave.txt", +"npc/re/instances/OldGlastHeim.txt", +"npc/re/instances/saras_memory.txt", +"npc/re/instances/WolfchevLaboratory.txt", +"npc/re/instances/EclageInterior.txt", //================= Kafras & Cool Event Corp. ============================= -npc: npc/re/kafras/kafras.txt +"npc/re/kafras/kafras.txt", //================= Merchants ============================================= -npc: npc/re/merchants/3rd_trader.txt -npc: npc/re/merchants/advanced_refiner.txt -npc: npc/re/merchants/alchemist.txt -npc: npc/re/merchants/ammo_boxes.txt -npc: npc/re/merchants/ammo_dealer.txt -//npc: npc/re/merchants/blessed_refiner.txt -npc: npc/re/merchants/card_separation.txt -npc: npc/re/merchants/catalog.txt -npc: npc/re/merchants/coin_exchange.txt -npc: npc/re/merchants/diamond.txt -npc: npc/re/merchants/enchan_mal.txt -npc: npc/re/merchants/enchan_mora.txt -npc: npc/re/merchants/enchan_ko.txt -npc: npc/re/merchants/flute.txt -npc: npc/re/merchants/hd_refiner.txt -npc: npc/re/merchants/inn.txt -npc: npc/re/merchants/quivers.txt -npc: npc/re/merchants/refine.txt -npc: npc/re/merchants/renters.txt -npc: npc/re/merchants/shops.txt -//npc: npc/re/merchants/ticket_refiner.txt -//npc: npc/re/merchants/enchan_upg.txt -npc: npc/re/merchants/ninja_craftsman.txt -npc: npc/re/merchants/shadow_refiner.txt +"npc/re/merchants/3rd_trader.txt", +"npc/re/merchants/advanced_refiner.txt", +"npc/re/merchants/alchemist.txt", +"npc/re/merchants/ammo_boxes.txt", +"npc/re/merchants/ammo_dealer.txt", +//"npc/re/merchants/blessed_refiner.txt", +"npc/re/merchants/card_separation.txt", +"npc/re/merchants/catalog.txt", +"npc/re/merchants/coin_exchange.txt", +"npc/re/merchants/diamond.txt", +"npc/re/merchants/enchan_mal.txt", +"npc/re/merchants/enchan_mora.txt", +"npc/re/merchants/enchan_ko.txt", +"npc/re/merchants/flute.txt", +"npc/re/merchants/hd_refiner.txt", +"npc/re/merchants/inn.txt", +"npc/re/merchants/quivers.txt", +"npc/re/merchants/refine.txt", +"npc/re/merchants/renters.txt", +"npc/re/merchants/shops.txt", +//"npc/re/merchants/ticket_refiner.txt", +//"npc/re/merchants/enchan_upg.txt", +"npc/re/merchants/ninja_craftsman.txt", +"npc/re/merchants/shadow_refiner.txt", //================= Others ================================================ -npc: npc/re/other/bulletin_boards.txt -npc: npc/re/other/mail.txt -npc: npc/re/other/mercenary_rent.txt -npc: npc/re/other/pvp.txt -npc: npc/re/other/resetskill.txt -npc: npc/re/other/stone_change.txt -npc: npc/re/other/turbo_track.txt +"npc/re/other/bulletin_boards.txt", +"npc/re/other/mail.txt", +"npc/re/other/mercenary_rent.txt", +"npc/re/other/pvp.txt", +"npc/re/other/resetskill.txt", +"npc/re/other/stone_change.txt", +"npc/re/other/turbo_track.txt", //================= Quests ================================================ // - Eden Group ------------------------------------------------- -npc: npc/re/quests/eden/11-25.txt -npc: npc/re/quests/eden/26-40.txt -npc: npc/re/quests/eden/41-55.txt -npc: npc/re/quests/eden/56-70.txt -npc: npc/re/quests/eden/71-85.txt -npc: npc/re/quests/eden/86-90.txt -npc: npc/re/quests/eden/91-99.txt -npc: npc/re/quests/eden/100-110.txt -npc: npc/re/quests/eden/111-120.txt -npc: npc/re/quests/eden/121-130.txt -npc: npc/re/quests/eden/131-140.txt -npc: npc/re/quests/eden/eden_common.txt -npc: npc/re/quests/eden/eden_quests.txt -npc: npc/re/quests/eden/eden_service.txt -npc: npc/re/quests/eden/eden_tutorial.txt +"npc/re/quests/eden/11-25.txt", +"npc/re/quests/eden/26-40.txt", +"npc/re/quests/eden/41-55.txt", +"npc/re/quests/eden/56-70.txt", +"npc/re/quests/eden/71-85.txt", +"npc/re/quests/eden/86-90.txt", +"npc/re/quests/eden/91-99.txt", +"npc/re/quests/eden/100-110.txt", +"npc/re/quests/eden/111-120.txt", +"npc/re/quests/eden/121-130.txt", +"npc/re/quests/eden/131-140.txt", +"npc/re/quests/eden/eden_common.txt", +"npc/re/quests/eden/eden_quests.txt", +"npc/re/quests/eden/eden_service.txt", +"npc/re/quests/eden/eden_tutorial.txt", // iRO custom additions. -//npc: npc/re/quests/eden/eden_iro.txt +//"npc/re/quests/eden/eden_iro.txt", // -------------------------------------------------------------- // - Quests-Tutorials for basic classes (1st class quests) ------ -npc: npc/re/quests/first_class/tu_archer.txt +"npc/re/quests/first_class/tu_archer.txt", // -------------------------------------------------------------- -//npc: npc/re/quests/cupet.txt -npc: npc/re/quests/homun_s.txt -npc: npc/re/quests/magic_books.txt -npc: npc/re/quests/monstertamers.txt -npc: npc/re/quests/mrsmile.txt -npc: npc/re/quests/pile_bunker.txt -npc: npc/re/quests/quests_13_1.txt -npc: npc/re/quests/quests_aldebaran.txt -npc: npc/re/quests/quests_brasilis.txt -npc: npc/re/quests/quests_dewata.txt -npc: npc/re/quests/quests_dicastes.txt -npc: npc/re/quests/quests_eclage.txt -npc: npc/re/quests/quests_izlude.txt -npc: npc/re/quests/quests_lighthalzen.txt -npc: npc/re/quests/quests_malangdo.txt -npc: npc/re/quests/quests_malaya.txt -npc: npc/re/quests/quests_mora.txt -npc: npc/re/quests/quests_morocc.txt -npc: npc/re/quests/quests_nameless.txt -npc: npc/re/quests/quests_veins.txt +//"npc/re/quests/cupet.txt", +"npc/re/quests/homun_s.txt", +"npc/re/quests/magic_books.txt", +"npc/re/quests/monstertamers.txt", +"npc/re/quests/mrsmile.txt", +"npc/re/quests/pile_bunker.txt", +"npc/re/quests/quests_13_1.txt", +"npc/re/quests/quests_aldebaran.txt", +"npc/re/quests/quests_brasilis.txt", +"npc/re/quests/quests_dewata.txt", +"npc/re/quests/quests_dicastes.txt", +"npc/re/quests/quests_eclage.txt", +"npc/re/quests/quests_izlude.txt", +"npc/re/quests/quests_lighthalzen.txt", +"npc/re/quests/quests_malangdo.txt", +"npc/re/quests/quests_malaya.txt", +"npc/re/quests/quests_mora.txt", +"npc/re/quests/quests_morocc.txt", +"npc/re/quests/quests_nameless.txt", +"npc/re/quests/quests_veins.txt", // - New Gears -------------------------------------------------- -npc: npc/re/quests/newgears/2012_headgears.txt +"npc/re/quests/newgears/2012_headgears.txt", diff --git a/npc/re/scripts_jobs.conf b/npc/re/scripts_jobs.conf index 7a2db4447..08218a912 100644 --- a/npc/re/scripts_jobs.conf +++ b/npc/re/scripts_jobs.conf @@ -9,7 +9,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 @@ -30,32 +30,32 @@ //================= Job Quests ============================================ // - 1-1 -npc: npc/re/jobs/1-1/acolyte.txt -npc: npc/re/jobs/1-1/archer.txt -npc: npc/re/jobs/1-1/mage.txt -npc: npc/re/jobs/1-1/merchant.txt -npc: npc/re/jobs/1-1/swordman.txt -npc: npc/re/jobs/1-1/thief.txt +"npc/re/jobs/1-1/acolyte.txt", +"npc/re/jobs/1-1/archer.txt", +"npc/re/jobs/1-1/mage.txt", +"npc/re/jobs/1-1/merchant.txt", +"npc/re/jobs/1-1/swordman.txt", +"npc/re/jobs/1-1/thief.txt", // - 2e -npc: npc/re/jobs/2e/kagerou_oboro.txt +"npc/re/jobs/2e/kagerou_oboro.txt", // - 3-1 -npc: npc/re/jobs/3-1/archbishop.txt -npc: npc/re/jobs/3-1/mechanic.txt -npc: npc/re/jobs/3-1/ranger.txt -npc: npc/re/jobs/3-1/rune_knight.txt -npc: npc/re/jobs/3-1/warlock.txt -npc: npc/re/jobs/3-1/guillotine_cross.txt +"npc/re/jobs/3-1/archbishop.txt", +"npc/re/jobs/3-1/mechanic.txt", +"npc/re/jobs/3-1/ranger.txt", +"npc/re/jobs/3-1/rune_knight.txt", +"npc/re/jobs/3-1/warlock.txt", +"npc/re/jobs/3-1/guillotine_cross.txt", // - 3-2 -npc: npc/re/jobs/3-2/genetic.txt -npc: npc/re/jobs/3-2/minstrel.txt -npc: npc/re/jobs/3-2/royal_guard.txt -npc: npc/re/jobs/3-2/shadow_chaser.txt -npc: npc/re/jobs/3-2/sorcerer.txt -npc: npc/re/jobs/3-2/sura.txt -npc: npc/re/jobs/3-2/wanderer.txt +"npc/re/jobs/3-2/genetic.txt", +"npc/re/jobs/3-2/minstrel.txt", +"npc/re/jobs/3-2/royal_guard.txt", +"npc/re/jobs/3-2/shadow_chaser.txt", +"npc/re/jobs/3-2/sorcerer.txt", +"npc/re/jobs/3-2/sura.txt", +"npc/re/jobs/3-2/wanderer.txt", // - Novice -npc: npc/re/jobs/novice/academy.txt -// npc: npc/re/jobs/novice/novice.txt -npc: npc/re/jobs/novice/supernovice_ex.txt +"npc/re/jobs/novice/academy.txt", +//"npc/re/jobs/novice/novice.txt", +"npc/re/jobs/novice/supernovice_ex.txt", // - Job Repairs -npc: npc/re/jobs/repair.txt +"npc/re/jobs/repair.txt", diff --git a/npc/re/scripts_main.conf b/npc/re/scripts_main.conf index fd0d85fad..475e8d1be 100644 --- a/npc/re/scripts_main.conf +++ b/npc/re/scripts_main.conf @@ -9,7 +9,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 @@ -27,48 +27,51 @@ //========================================================================= //= Hercules Renewal Primary Scripts File //========================================================================= -// The idea of this new system is to make scripts more organized -// since the old system was rather messy with all the NPCs in one -// file. Now scripts are organized in to files arraged by type. -// Custom scripts are now in scripts_custom.conf, all other -// scripts are deemed as 'official'. You should place your NPCs -// in to scripts_custom.conf to follow the trend. -// -// Thanks, -// Ancyker and the rest of the Hercules Team -// -// Note: "Comments" are all text on the right side of a double slash "//" -// Whatever text is commented will not be parsed by the servers, and serves -// only as information/reference. +// The idea of this new system is to make scripts more organized since the old +// system was rather messy with all the NPCs in one file. Now scripts are +// organized in to files arraged by type. Custom scripts are now in +// scripts_custom.conf, all other scripts are deemed as 'official'. You should +// place your NPCs in to scripts_custom.conf to follow the trend. //========================================================================= -//================= Global Scripts Functions ============================== +//================= Disabled Scripts ====================================== +// All NPCs that you wish to remove from your loading list should be put in +// this file +@include "npc/scripts_removed.conf" + +//================= Global NPC list ======================================= +// Only files that are included here will be read by the server +npc_global_list: ( + +//- Global Scripts Functions - // Utilitarian functions used by many scripts. -npc: npc/other/Global_Functions.txt +"npc/other/Global_Functions.txt", -//================= Cash Shop Functions =================================== +//- Cash Shop Functions - // Used by cash shop items in the Item Database. -npc: npc/other/CashShop_Functions.txt +"npc/other/CashShop_Functions.txt", + +//- Common Script Files - +@include "npc/scripts.conf" +@include "npc/scripts_woe.conf" +@include "npc/scripts_jobs.conf" +@include "npc/scripts_mapflags.conf" +@include "npc/scripts_monsters.conf" +@include "npc/scripts_warps.conf" -//================= Common Script Files =================================== -import: npc/scripts.conf -import: npc/scripts_woe.conf -import: npc/scripts_jobs.conf -import: npc/scripts_mapflags.conf -import: npc/scripts_monsters.conf -import: npc/scripts_warps.conf +//- Renewal Script Files - +@include "npc/re/scripts.conf" +@include "npc/re/scripts_woe.conf" +@include "npc/re/scripts_jobs.conf" +@include "npc/re/scripts_mapflags.conf" +@include "npc/re/scripts_monsters.conf" +@include "npc/re/scripts_warps.conf" -//================= Renewal Script Files ================================== -import: npc/re/scripts.conf -import: npc/re/scripts_woe.conf -import: npc/re/scripts_jobs.conf -import: npc/re/scripts_mapflags.conf -import: npc/re/scripts_monsters.conf -import: npc/re/scripts_warps.conf +//- Development / Testing Script Files - +@include "npc/scripts_dev.conf" -//================= Development / Testing Script Files ==================== -import: npc/scripts_dev.conf +//- Custom Script Files - +// Your NPCs go in this file! +@include "npc/scripts_custom.conf" -//================= Custom Script Files =================================== -// - Your NPCs go in this file! -import: npc/scripts_custom.conf +) // npc_global_list diff --git a/npc/re/scripts_mapflags.conf b/npc/re/scripts_mapflags.conf index 9f10792ef..8727d9b44 100644 --- a/npc/re/scripts_mapflags.conf +++ b/npc/re/scripts_mapflags.conf @@ -9,7 +9,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 @@ -28,4 +28,4 @@ //= Map Flags //========================================================================= -npc: npc/re/mapflag/zone.txt +"npc/re/mapflag/zone.txt", diff --git a/npc/re/scripts_monsters.conf b/npc/re/scripts_monsters.conf index cb8e25de6..06b3031bf 100644 --- a/npc/re/scripts_monsters.conf +++ b/npc/re/scripts_monsters.conf @@ -9,7 +9,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 @@ -29,83 +29,83 @@ //========================================================================= //================= Misc Spawns =========================================== -npc: npc/re/mobs/citycleaners.txt -npc: npc/re/mobs/towns.txt -npc: npc/re/mobs/champion.txt +"npc/re/mobs/citycleaners.txt", +"npc/re/mobs/towns.txt", +"npc/re/mobs/champion.txt", //================= Dungeons ============================================== -npc: npc/re/mobs/dungeons/abbey.txt -npc: npc/re/mobs/dungeons/abyss.txt -npc: npc/re/mobs/dungeons/alde_dun.txt -npc: npc/re/mobs/dungeons/ama_dun.txt -npc: npc/re/mobs/dungeons/anthell.txt -npc: npc/re/mobs/dungeons/ayo_dun.txt -npc: npc/re/mobs/dungeons/beach_dun.txt -npc: npc/re/mobs/dungeons/bra_dun.txt -npc: npc/re/mobs/dungeons/c_tower.txt -npc: npc/re/mobs/dungeons/dew_dun.txt -npc: npc/re/mobs/dungeons/dic_dun.txt -npc: npc/re/mobs/dungeons/ecl_tdun.txt -npc: npc/re/mobs/dungeons/ein_dun.txt -npc: npc/re/mobs/dungeons/gef_dun.txt -npc: npc/re/mobs/dungeons/gefenia.txt -npc: npc/re/mobs/dungeons/glastheim.txt -npc: npc/re/mobs/dungeons/gld_dunSE.txt -npc: npc/re/mobs/dungeons/gld_re.txt -npc: npc/re/mobs/dungeons/gon_dun.txt -npc: npc/re/mobs/dungeons/ice_dun.txt -npc: npc/re/mobs/dungeons/in_sphinx.txt -npc: npc/re/mobs/dungeons/iz_dun.txt -npc: npc/re/mobs/dungeons/juperos.txt -npc: npc/re/mobs/dungeons/kh_dun.txt -npc: npc/re/mobs/dungeons/lhz_dun.txt -npc: npc/re/mobs/dungeons/lou_dun.txt -npc: npc/re/mobs/dungeons/ma_dun.txt -npc: npc/re/mobs/dungeons/mag_dun.txt -npc: npc/re/mobs/dungeons/mal_dun.txt -npc: npc/re/mobs/dungeons/mjo_dun.txt -npc: npc/re/mobs/dungeons/moc_pryd.txt -npc: npc/re/mobs/dungeons/mosk_dun.txt -npc: npc/re/mobs/dungeons/nyd_dun.txt -npc: npc/re/mobs/dungeons/odin.txt -npc: npc/re/mobs/dungeons/orcsdun.txt -npc: npc/re/mobs/dungeons/pay_dun.txt -npc: npc/re/mobs/dungeons/prt_maze.txt -npc: npc/re/mobs/dungeons/prt_sew.txt -npc: npc/re/mobs/dungeons/ra_san.txt -npc: npc/re/mobs/dungeons/tha_t.txt -npc: npc/re/mobs/dungeons/thor_v.txt -npc: npc/re/mobs/dungeons/treasure.txt -npc: npc/re/mobs/dungeons/tur_dun.txt -npc: npc/re/mobs/dungeons/xmas_dun.txt -npc: npc/re/mobs/dungeons/yggdrasil.txt +"npc/re/mobs/dungeons/abbey.txt", +"npc/re/mobs/dungeons/abyss.txt", +"npc/re/mobs/dungeons/alde_dun.txt", +"npc/re/mobs/dungeons/ama_dun.txt", +"npc/re/mobs/dungeons/anthell.txt", +"npc/re/mobs/dungeons/ayo_dun.txt", +"npc/re/mobs/dungeons/beach_dun.txt", +"npc/re/mobs/dungeons/bra_dun.txt", +"npc/re/mobs/dungeons/c_tower.txt", +"npc/re/mobs/dungeons/dew_dun.txt", +"npc/re/mobs/dungeons/dic_dun.txt", +"npc/re/mobs/dungeons/ecl_tdun.txt", +"npc/re/mobs/dungeons/ein_dun.txt", +"npc/re/mobs/dungeons/gef_dun.txt", +"npc/re/mobs/dungeons/gefenia.txt", +"npc/re/mobs/dungeons/glastheim.txt", +"npc/re/mobs/dungeons/gld_dunSE.txt", +"npc/re/mobs/dungeons/gld_re.txt", +"npc/re/mobs/dungeons/gon_dun.txt", +"npc/re/mobs/dungeons/ice_dun.txt", +"npc/re/mobs/dungeons/in_sphinx.txt", +"npc/re/mobs/dungeons/iz_dun.txt", +"npc/re/mobs/dungeons/juperos.txt", +"npc/re/mobs/dungeons/kh_dun.txt", +"npc/re/mobs/dungeons/lhz_dun.txt", +"npc/re/mobs/dungeons/lou_dun.txt", +"npc/re/mobs/dungeons/ma_dun.txt", +"npc/re/mobs/dungeons/mag_dun.txt", +"npc/re/mobs/dungeons/mal_dun.txt", +"npc/re/mobs/dungeons/mjo_dun.txt", +"npc/re/mobs/dungeons/moc_pryd.txt", +"npc/re/mobs/dungeons/mosk_dun.txt", +"npc/re/mobs/dungeons/nyd_dun.txt", +"npc/re/mobs/dungeons/odin.txt", +"npc/re/mobs/dungeons/orcsdun.txt", +"npc/re/mobs/dungeons/pay_dun.txt", +"npc/re/mobs/dungeons/prt_maze.txt", +"npc/re/mobs/dungeons/prt_sew.txt", +"npc/re/mobs/dungeons/ra_san.txt", +"npc/re/mobs/dungeons/tha_t.txt", +"npc/re/mobs/dungeons/thor_v.txt", +"npc/re/mobs/dungeons/treasure.txt", +"npc/re/mobs/dungeons/tur_dun.txt", +"npc/re/mobs/dungeons/xmas_dun.txt", +"npc/re/mobs/dungeons/yggdrasil.txt", //================= Fields ================================================ -npc: npc/re/mobs/fields/amatsu.txt -npc: npc/re/mobs/fields/ayothaya.txt -npc: npc/re/mobs/fields/bifrost.txt -npc: npc/re/mobs/fields/brasilis.txt -npc: npc/re/mobs/fields/comodo.txt -npc: npc/re/mobs/fields/dewata.txt -npc: npc/re/mobs/fields/dicastes.txt -npc: npc/re/mobs/fields/eclage.txt -npc: npc/re/mobs/fields/einbroch.txt -npc: npc/re/mobs/fields/geffen.txt -npc: npc/re/mobs/fields/gonryun.txt -npc: npc/re/mobs/fields/hugel.txt -npc: npc/re/mobs/fields/lighthalzen.txt -npc: npc/re/mobs/fields/louyang.txt -npc: npc/re/mobs/fields/lutie.txt -npc: npc/re/mobs/fields/malaya.txt -npc: npc/re/mobs/fields/manuk.txt -npc: npc/re/mobs/fields/mjolnir.txt -npc: npc/re/mobs/fields/morocc.txt -npc: npc/re/mobs/fields/moscovia.txt -npc: npc/re/mobs/fields/niflheim.txt -npc: npc/re/mobs/fields/payon.txt -npc: npc/re/mobs/fields/prontera.txt -npc: npc/re/mobs/fields/rachel.txt -npc: npc/re/mobs/fields/splendide.txt -npc: npc/re/mobs/fields/umbala.txt -npc: npc/re/mobs/fields/veins.txt -npc: npc/re/mobs/fields/yuno.txt +"npc/re/mobs/fields/amatsu.txt", +"npc/re/mobs/fields/ayothaya.txt", +"npc/re/mobs/fields/bifrost.txt", +"npc/re/mobs/fields/brasilis.txt", +"npc/re/mobs/fields/comodo.txt", +"npc/re/mobs/fields/dewata.txt", +"npc/re/mobs/fields/dicastes.txt", +"npc/re/mobs/fields/eclage.txt", +"npc/re/mobs/fields/einbroch.txt", +"npc/re/mobs/fields/geffen.txt", +"npc/re/mobs/fields/gonryun.txt", +"npc/re/mobs/fields/hugel.txt", +"npc/re/mobs/fields/lighthalzen.txt", +"npc/re/mobs/fields/louyang.txt", +"npc/re/mobs/fields/lutie.txt", +"npc/re/mobs/fields/malaya.txt", +"npc/re/mobs/fields/manuk.txt", +"npc/re/mobs/fields/mjolnir.txt", +"npc/re/mobs/fields/morocc.txt", +"npc/re/mobs/fields/moscovia.txt", +"npc/re/mobs/fields/niflheim.txt", +"npc/re/mobs/fields/payon.txt", +"npc/re/mobs/fields/prontera.txt", +"npc/re/mobs/fields/rachel.txt", +"npc/re/mobs/fields/splendide.txt", +"npc/re/mobs/fields/umbala.txt", +"npc/re/mobs/fields/veins.txt", +"npc/re/mobs/fields/yuno.txt", diff --git a/npc/re/scripts_warps.conf b/npc/re/scripts_warps.conf index a67432479..a5ead53e2 100644 --- a/npc/re/scripts_warps.conf +++ b/npc/re/scripts_warps.conf @@ -9,7 +9,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 @@ -29,41 +29,41 @@ //========================================================================= //================= Cities ================================================ -npc: npc/re/warps/cities/brasilis.txt -npc: npc/re/warps/cities/dewata.txt -npc: npc/re/warps/cities/dicastes.txt -npc: npc/re/warps/cities/eclage.txt -npc: npc/re/warps/cities/izlude.txt -npc: npc/re/warps/cities/malangdo.txt -npc: npc/re/warps/cities/malaya.txt -npc: npc/re/warps/cities/rachel.txt -npc: npc/re/warps/cities/yggdrasil.txt +"npc/re/warps/cities/brasilis.txt", +"npc/re/warps/cities/dewata.txt", +"npc/re/warps/cities/dicastes.txt", +"npc/re/warps/cities/eclage.txt", +"npc/re/warps/cities/izlude.txt", +"npc/re/warps/cities/malangdo.txt", +"npc/re/warps/cities/malaya.txt", +"npc/re/warps/cities/rachel.txt", +"npc/re/warps/cities/yggdrasil.txt", //================= Dungeons ============================================== -npc: npc/re/warps/dungeons/bra_dun.txt -npc: npc/re/warps/dungeons/dic_dun.txt -npc: npc/re/warps/dungeons/ecl_dun.txt -npc: npc/re/warps/dungeons/iz_dun.txt -npc: npc/re/warps/dungeons/moc_pryd.txt +"npc/re/warps/dungeons/bra_dun.txt", +"npc/re/warps/dungeons/dic_dun.txt", +"npc/re/warps/dungeons/ecl_dun.txt", +"npc/re/warps/dungeons/iz_dun.txt", +"npc/re/warps/dungeons/moc_pryd.txt", //================= Fields ================================================ -npc: npc/re/warps/fields/bif_fild.txt -npc: npc/re/warps/fields/bra_fild.txt -npc: npc/re/warps/fields/com_fild.txt -npc: npc/re/warps/fields/dic_fild.txt -npc: npc/re/warps/fields/geffen_fild.txt -npc: npc/re/warps/fields/hugel_fild.txt -npc: npc/re/warps/fields/morroc_fild.txt -npc: npc/re/warps/fields/payon_fild.txt -npc: npc/re/warps/fields/prontera_fild.txt -npc: npc/re/warps/fields/rachel_fild.txt -npc: npc/re/warps/fields/veins_fild.txt -npc: npc/re/warps/fields/yuno_fild.txt +"npc/re/warps/fields/bif_fild.txt", +"npc/re/warps/fields/bra_fild.txt", +"npc/re/warps/fields/com_fild.txt", +"npc/re/warps/fields/dic_fild.txt", +"npc/re/warps/fields/geffen_fild.txt", +"npc/re/warps/fields/hugel_fild.txt", +"npc/re/warps/fields/morroc_fild.txt", +"npc/re/warps/fields/payon_fild.txt", +"npc/re/warps/fields/prontera_fild.txt", +"npc/re/warps/fields/rachel_fild.txt", +"npc/re/warps/fields/veins_fild.txt", +"npc/re/warps/fields/yuno_fild.txt", //================= Others ================================================ -npc: npc/re/warps/other/arena.txt -npc: npc/re/warps/other/jobquests.txt -npc: npc/re/warps/other/paradise.txt -npc: npc/re/warps/other/s_workshop.txt -npc: npc/re/warps/other/sign.txt -npc: npc/re/warps/guildcastles.txt +"npc/re/warps/other/arena.txt", +"npc/re/warps/other/jobquests.txt", +"npc/re/warps/other/paradise.txt", +"npc/re/warps/other/s_workshop.txt", +"npc/re/warps/other/sign.txt", +"npc/re/warps/guildcastles.txt", diff --git a/npc/re/scripts_woe.conf b/npc/re/scripts_woe.conf index 9677c55b7..957ac766d 100644 --- a/npc/re/scripts_woe.conf +++ b/npc/re/scripts_woe.conf @@ -9,7 +9,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 @@ -30,5 +30,5 @@ //================= War of Emperium ======================================= // - Hall of Abyss -npc: npc/re/woe-fe/invest_main.txt -npc: npc/re/woe-fe/invest_npc.txt +"npc/re/woe-fe/invest_main.txt", +"npc/re/woe-fe/invest_npc.txt", diff --git a/npc/scripts.conf b/npc/scripts.conf index 4fa9818f7..d56d7cb73 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -9,7 +9,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 @@ -29,282 +29,282 @@ //========================================================================= //================= Message of the Day ==================================== -npc: npc/MOTD.txt +"npc/MOTD.txt", //================= Airport =============================================== -npc: npc/airports/airships.txt -npc: npc/airports/einbroch.txt -npc: npc/airports/hugel.txt -npc: npc/airports/izlude.txt -npc: npc/airports/lighthalzen.txt -npc: npc/airports/rachel.txt -npc: npc/airports/yuno.txt +"npc/airports/airships.txt", +"npc/airports/einbroch.txt", +"npc/airports/hugel.txt", +"npc/airports/izlude.txt", +"npc/airports/lighthalzen.txt", +"npc/airports/rachel.txt", +"npc/airports/yuno.txt", //================= Battlegrounds ========================================= // - Flavius ---------------------------------------------------- -npc: npc/battleground/flavius/flavius_enter.txt -npc: npc/battleground/flavius/flavius01.txt -npc: npc/battleground/flavius/flavius02.txt +"npc/battleground/flavius/flavius_enter.txt", +"npc/battleground/flavius/flavius01.txt", +"npc/battleground/flavius/flavius02.txt", // - Kreiger Von Midgard ---------------------------------------- -npc: npc/battleground/kvm/kvm_enter.txt -npc: npc/battleground/kvm/kvm_item_pay.txt -npc: npc/battleground/kvm/kvm01.txt -npc: npc/battleground/kvm/kvm02.txt -npc: npc/battleground/kvm/kvm03.txt +"npc/battleground/kvm/kvm_enter.txt", +"npc/battleground/kvm/kvm_item_pay.txt", +"npc/battleground/kvm/kvm01.txt", +"npc/battleground/kvm/kvm02.txt", +"npc/battleground/kvm/kvm03.txt", // - Tierra Gorge ----------------------------------------------- -npc: npc/battleground/tierra/tierra_enter.txt -npc: npc/battleground/tierra/tierra01.txt -npc: npc/battleground/tierra/tierra02.txt +"npc/battleground/tierra/tierra_enter.txt", +"npc/battleground/tierra/tierra01.txt", +"npc/battleground/tierra/tierra02.txt", // -------------------------------------------------------------- -npc: npc/battleground/bg_common.txt +"npc/battleground/bg_common.txt", //================= Cities ================================================ -npc: npc/cities/alberta.txt -npc: npc/cities/aldebaran.txt -npc: npc/cities/amatsu.txt -npc: npc/cities/ayothaya.txt -npc: npc/cities/comodo.txt -npc: npc/cities/einbech.txt -npc: npc/cities/einbroch.txt -npc: npc/cities/geffen.txt -npc: npc/cities/gonryun.txt -npc: npc/cities/hugel.txt -npc: npc/cities/izlude.txt -npc: npc/cities/jawaii.txt -npc: npc/cities/lighthalzen.txt -npc: npc/cities/louyang.txt -npc: npc/cities/lutie.txt -npc: npc/cities/manuk.txt -npc: npc/cities/morocc.txt -npc: npc/cities/moscovia.txt -npc: npc/cities/niflheim.txt -npc: npc/cities/payon.txt -npc: npc/cities/prontera.txt -npc: npc/cities/rachel.txt -npc: npc/cities/splendide.txt -npc: npc/cities/umbala.txt -npc: npc/cities/veins.txt -npc: npc/cities/yuno.txt +"npc/cities/alberta.txt", +"npc/cities/aldebaran.txt", +"npc/cities/amatsu.txt", +"npc/cities/ayothaya.txt", +"npc/cities/comodo.txt", +"npc/cities/einbech.txt", +"npc/cities/einbroch.txt", +"npc/cities/geffen.txt", +"npc/cities/gonryun.txt", +"npc/cities/hugel.txt", +"npc/cities/izlude.txt", +"npc/cities/jawaii.txt", +"npc/cities/lighthalzen.txt", +"npc/cities/louyang.txt", +"npc/cities/lutie.txt", +"npc/cities/manuk.txt", +"npc/cities/morocc.txt", +"npc/cities/moscovia.txt", +"npc/cities/niflheim.txt", +"npc/cities/payon.txt", +"npc/cities/prontera.txt", +"npc/cities/rachel.txt", +"npc/cities/splendide.txt", +"npc/cities/umbala.txt", +"npc/cities/veins.txt", +"npc/cities/yuno.txt", //================= Events ================================================ // - Novice WoE ------------------------------------------------- // Novice WoE is a kRO Event, after the event, the scripts were disabled. // Novice Castles don't have real dungeons. They're connected to the common ones. // So it's better not to uncomment this line. -//npc: npc/events/nguild/nguild_dunsw.txt -//npc: npc/events/nguild/nguild_treas.txt -//npc: npc/events/nguild/nguild_guardians.txt -//npc: npc/events/nguild/nguild_warper.txt -//npc: npc/events/nguild/nguild_ev_agit.txt -//npc: npc/events/nguild/nguild_flags.txt -//npc: npc/events/nguild/nguild_managers.txt -//npc: npc/events/nguild/nguild_kafras.txt +//"npc/events/nguild/nguild_dunsw.txt", +//"npc/events/nguild/nguild_treas.txt", +//"npc/events/nguild/nguild_guardians.txt", +//"npc/events/nguild/nguild_warper.txt", +//"npc/events/nguild/nguild_ev_agit.txt", +//"npc/events/nguild/nguild_flags.txt", +//"npc/events/nguild/nguild_managers.txt", +//"npc/events/nguild/nguild_kafras.txt", // -------------------------------------------------------------- -//npc: npc/events/bossnia.txt +//"npc/events/bossnia.txt", // - Official indian Ro Event Children Week -//npc: npc/events/children_week.txt +//"npc/events/children_week.txt", // - Official Christmas Events (iRO) -//npc: npc/events/christmas_2005.txt -//npc: npc/events/christmas_2008.txt -//npc: npc/events/dumplingfestival.txt +//"npc/events/christmas_2005.txt", +//"npc/events/christmas_2008.txt", +//"npc/events/dumplingfestival.txt", // - Official Easter (2008) Event (iRO) -//npc: npc/events/easter_2008.txt +//"npc/events/easter_2008.txt", // - Official Easter (2010) Event -//npc: npc/events/easter_2010.txt +//"npc/events/easter_2010.txt", // - Official kRO, idRO Skill Reset Event -//npc: npc/events/event_skill_reset.txt +//"npc/events/event_skill_reset.txt", // - Events related to WoE SE Guild Dungeons. -npc: npc/events/gdevent_aru.txt -npc: npc/events/gdevent_sch.txt +"npc/events/gdevent_aru.txt", +"npc/events/gdevent_sch.txt", // - God Item SE post-creation Event -npc: npc/events/god_se_festival.txt +"npc/events/god_se_festival.txt", // - Official Halloween Events (iRO) -//npc: npc/events/halloween_2006.txt -//npc: npc/events/halloween_2008.txt -//npc: npc/events/halloween_2009.txt +//"npc/events/halloween_2006.txt", +//"npc/events/halloween_2008.txt", +//"npc/events/halloween_2009.txt", // - Official idRO Idul Fitri Event -//npc: npc/events/idul_fitri.txt +//"npc/events/idul_fitri.txt", // - Official Lunar New Year (2008) Event (iRO) -//npc: npc/events/lunar_2008.txt +//"npc/events/lunar_2008.txt", // - Official RWC (2011) Golden Poring Event -//npc: npc/events/RWC_2011.txt +//"npc/events/RWC_2011.txt", // - Official RWC (2012) Enchants Event -//npc: npc/events/RWC_2012.txt +//"npc/events/RWC_2012.txt", // - Official Memorial Day (2009) Event (iRO) -//npc: npc/events/MemorialDay_2008.txt +//"npc/events/MemorialDay_2008.txt", // - Official St. Patrick's Day (2008) Event (iRO) -//npc: npc/events/StPatrick_2008.txt -//npc: npc/events/twintowers.txt -//npc: npc/events/valentinesday.txt +//"npc/events/StPatrick_2008.txt", +//"npc/events/twintowers.txt", +//"npc/events/valentinesday.txt", // - Official Valentine's Day Events (iRO) -//npc: npc/events/valentinesday_2009.txt -//npc: npc/events/valentinesday_2012.txt -//npc: npc/events/whiteday.txt -//npc: npc/events/xmas.txt +//"npc/events/valentinesday_2009.txt", +//"npc/events/valentinesday_2012.txt", +//"npc/events/whiteday.txt", +//"npc/events/xmas.txt", //================= Instances ============================================= -npc: npc/instances/SealedShrine.txt -npc: npc/instances/EndlessTower.txt -npc: npc/instances/OrcsMemory.txt -npc: npc/instances/NydhoggsNest.txt +"npc/instances/SealedShrine.txt", +"npc/instances/EndlessTower.txt", +"npc/instances/OrcsMemory.txt", +"npc/instances/NydhoggsNest.txt", //================= Kafras & Cool Event Corp. ============================= -npc: npc/kafras/cool_event_corp.txt -npc: npc/kafras/dts_warper.txt -npc: npc/kafras/functions_kafras.txt -npc: npc/kafras/kafras.txt +"npc/kafras/cool_event_corp.txt", +"npc/kafras/dts_warper.txt", +"npc/kafras/functions_kafras.txt", +"npc/kafras/kafras.txt", //================= Merchants ============================================= -npc: npc/merchants/advanced_refiner.txt -npc: npc/merchants/alchemist.txt -npc: npc/merchants/ammo_boxes.txt -npc: npc/merchants/ammo_dealer.txt -npc: npc/merchants/buying_shops.txt -//npc: npc/merchants/clothes_dyer.txt -npc: npc/merchants/coin_exchange.txt -npc: npc/merchants/dye_maker.txt -npc: npc/merchants/elemental_trader.txt -npc: npc/merchants/enchan_arm.txt -npc: npc/merchants/gemstone.txt -npc: npc/merchants/hair_dyer.txt -npc: npc/merchants/hair_style.txt -//npc: npc/merchants/hd_refine.txt -//npc: npc/merchants/icecream.txt -npc: npc/merchants/inn.txt -npc: npc/merchants/kunai_maker.txt -npc: npc/merchants/milk_trader.txt -npc: npc/merchants/novice_exchange.txt -npc: npc/merchants/old_pharmacist.txt -npc: npc/merchants/quivers.txt -npc: npc/merchants/refine.txt -npc: npc/merchants/renters.txt -npc: npc/merchants/shops.txt -npc: npc/merchants/socket_enchant.txt -npc: npc/merchants/socket_enchant2.txt -npc: npc/merchants/wander_pet_food.txt +"npc/merchants/advanced_refiner.txt", +"npc/merchants/alchemist.txt", +"npc/merchants/ammo_boxes.txt", +"npc/merchants/ammo_dealer.txt", +"npc/merchants/buying_shops.txt", +//"npc/merchants/clothes_dyer.txt", +"npc/merchants/coin_exchange.txt", +"npc/merchants/dye_maker.txt", +"npc/merchants/elemental_trader.txt", +"npc/merchants/enchan_arm.txt", +"npc/merchants/gemstone.txt", +"npc/merchants/hair_dyer.txt", +"npc/merchants/hair_style.txt", +//"npc/merchants/hd_refine.txt", +//"npc/merchants/icecream.txt", +"npc/merchants/inn.txt", +"npc/merchants/kunai_maker.txt", +"npc/merchants/milk_trader.txt", +"npc/merchants/novice_exchange.txt", +"npc/merchants/old_pharmacist.txt", +"npc/merchants/quivers.txt", +"npc/merchants/refine.txt", +"npc/merchants/renters.txt", +"npc/merchants/shops.txt", +"npc/merchants/socket_enchant.txt", +"npc/merchants/socket_enchant2.txt", +"npc/merchants/wander_pet_food.txt", // - Cash Shop // See file before enabling, as you may wish to change the // point value of items to suit your own needs. -//npc: npc/merchants/cash_hair.txt -//npc: npc/merchants/cash_trader.txt -npc: npc/merchants/cashheadgear_dye.txt +//"npc/merchants/cash_hair.txt", +//"npc/merchants/cash_trader.txt", +"npc/merchants/cashheadgear_dye.txt", //================= Others ================================================ // - Izlude Battle Arena ---------------------------------------- -npc: npc/other/arena/arena_aco.txt -npc: npc/other/arena/arena_lvl50.txt -npc: npc/other/arena/arena_lvl60.txt -npc: npc/other/arena/arena_lvl70.txt -npc: npc/other/arena/arena_lvl80.txt -npc: npc/other/arena/arena_party.txt -npc: npc/other/arena/arena_point.txt -npc: npc/other/arena/arena_room.txt +"npc/other/arena/arena_aco.txt", +"npc/other/arena/arena_lvl50.txt", +"npc/other/arena/arena_lvl60.txt", +"npc/other/arena/arena_lvl70.txt", +"npc/other/arena/arena_lvl80.txt", +"npc/other/arena/arena_party.txt", +"npc/other/arena/arena_point.txt", +"npc/other/arena/arena_room.txt", // -------------------------------------------------------------- -//npc: npc/other/acolyte_warp.txt -npc: npc/other/auction.txt -npc: npc/other/books.txt -npc: npc/other/bulletin_boards.txt -//npc: npc/other/card_trader.txt -npc: npc/other/comodo_gambling.txt -npc: npc/other/divorce.txt -npc: npc/other/fortune.txt -npc: npc/other/gm_npcs.txt -npc: npc/other/guildpvp.txt -npc: npc/other/gympass.txt -npc: npc/other/hugel_bingo.txt -npc: npc/other/mail.txt -npc: npc/other/marriage.txt -npc: npc/other/mercenary_rent.txt -npc: npc/other/monster_museum.txt +//"npc/other/acolyte_warp.txt", +"npc/other/auction.txt", +"npc/other/books.txt", +"npc/other/bulletin_boards.txt", +//"npc/other/card_trader.txt", +"npc/other/comodo_gambling.txt", +"npc/other/divorce.txt", +"npc/other/fortune.txt", +"npc/other/gm_npcs.txt", +"npc/other/guildpvp.txt", +"npc/other/gympass.txt", +"npc/other/hugel_bingo.txt", +"npc/other/mail.txt", +"npc/other/marriage.txt", +"npc/other/mercenary_rent.txt", +"npc/other/monster_museum.txt", // - Hugel Monster Races -npc: npc/other/monster_race.txt -//npc: npc/other/msg_boards.txt -npc: npc/other/poring_war.txt -npc: npc/other/powernpc.txt -npc: npc/other/pvp.txt +"npc/other/monster_race.txt", +//"npc/other/msg_boards.txt", +"npc/other/poring_war.txt", +"npc/other/powernpc.txt", +"npc/other/pvp.txt", // - Turbo Track Arena -npc: npc/other/turbo_track.txt -npc: npc/other/item_merge.txt +"npc/other/turbo_track.txt", +"npc/other/item_merge.txt", //================= Quests ================================================ // - Quests-Tutorials for basic classes (1st class quests) ------ -npc: npc/quests/first_class/tu_acolyte.txt -npc: npc/quests/first_class/tu_archer.txt -npc: npc/quests/first_class/tu_magician01.txt -npc: npc/quests/first_class/tu_ma_th01.txt -npc: npc/quests/first_class/tu_merchant.txt -npc: npc/quests/first_class/tu_sword.txt -npc: npc/quests/first_class/tu_thief01.txt +"npc/quests/first_class/tu_acolyte.txt", +"npc/quests/first_class/tu_archer.txt", +"npc/quests/first_class/tu_magician01.txt", +"npc/quests/first_class/tu_ma_th01.txt", +"npc/quests/first_class/tu_merchant.txt", +"npc/quests/first_class/tu_sword.txt", +"npc/quests/first_class/tu_thief01.txt", // - Headgear Quests -------------------------------------------- -npc: npc/quests/newgears/2004_headgears.txt -npc: npc/quests/newgears/2005_headgears.txt -npc: npc/quests/newgears/2006_headgears.txt -npc: npc/quests/newgears/2008_headgears.txt -npc: npc/quests/newgears/2010_headgears.txt +"npc/quests/newgears/2004_headgears.txt", +"npc/quests/newgears/2005_headgears.txt", +"npc/quests/newgears/2006_headgears.txt", +"npc/quests/newgears/2008_headgears.txt", +"npc/quests/newgears/2010_headgears.txt", // - Falicious Okolnir ------------------------------------------ // God Item Second Edition Quests -npc: npc/quests/okolnir.txt +"npc/quests/okolnir.txt", // - The God Item Quest ----------------------------------------- // - Controller file, allow GMs to change variables. -npc: npc/quests/seals/god_global.txt -npc: npc/quests/seals/brisingamen_seal.txt -npc: npc/quests/seals/god_weapon_creation.txt -npc: npc/quests/seals/megingard_seal.txt -npc: npc/quests/seals/mjolnir_seal.txt -npc: npc/quests/seals/sleipnir_seal.txt +"npc/quests/seals/god_global.txt", +"npc/quests/seals/brisingamen_seal.txt", +"npc/quests/seals/god_weapon_creation.txt", +"npc/quests/seals/megingard_seal.txt", +"npc/quests/seals/mjolnir_seal.txt", +"npc/quests/seals/sleipnir_seal.txt", // - Seal status board. -npc: npc/quests/seals/seal_status.txt +"npc/quests/seals/seal_status.txt", // -------------------------------------------------------------- // - Wandering Minstrel Quest -npc: npc/quests/bard_quest.txt -npc: npc/quests/bunnyband.txt -npc: npc/quests/cooking_quest.txt -npc: npc/quests/counteragent_mixture.txt -//npc: npc/quests/dandelion_request.txt -npc: npc/quests/doomed_swords.txt -npc: npc/quests/doomed_swords_quest.txt -npc: npc/quests/eye_of_hellion.txt +"npc/quests/bard_quest.txt", +"npc/quests/bunnyband.txt", +"npc/quests/cooking_quest.txt", +"npc/quests/counteragent_mixture.txt", +//"npc/quests/dandelion_request.txt", +"npc/quests/doomed_swords.txt", +"npc/quests/doomed_swords_quest.txt", +"npc/quests/eye_of_hellion.txt", // - Guild Relay Quests -npc: npc/quests/guildrelay.txt -npc: npc/quests/gunslinger_quests.txt -npc: npc/quests/juice_maker.txt -npc: npc/quests/kiel_hyre_quest.txt -npc: npc/quests/lvl4_weapon_quest.txt -npc: npc/quests/mage_solution.txt -npc: npc/quests/monstertamers.txt -npc: npc/quests/mrsmile.txt -npc: npc/quests/ninja_quests.txt -npc: npc/quests/obb_quest.txt -npc: npc/quests/partyrelay.txt -npc: npc/quests/quests_13_1.txt -npc: npc/quests/quests_13_2.txt -npc: npc/quests/quests_airship.txt -npc: npc/quests/quests_alberta.txt -npc: npc/quests/quests_aldebaran.txt -npc: npc/quests/quests_amatsu.txt -npc: npc/quests/quests_ayothaya.txt -npc: npc/quests/quests_comodo.txt -npc: npc/quests/quests_ein.txt -npc: npc/quests/quests_geffen.txt -npc: npc/quests/quests_gonryun.txt -npc: npc/quests/quests_hugel.txt -npc: npc/quests/quests_izlude.txt -npc: npc/quests/quests_juperos.txt -npc: npc/quests/quests_lighthalzen.txt -npc: npc/quests/quests_louyang.txt -npc: npc/quests/quests_lutie.txt -npc: npc/quests/quests_morocc.txt -npc: npc/quests/quests_moscovia.txt -npc: npc/quests/quests_nameless.txt -npc: npc/quests/quests_niflheim.txt -npc: npc/quests/quests_payon.txt -npc: npc/quests/quests_prontera.txt -npc: npc/quests/quests_rachel.txt -npc: npc/quests/quests_umbala.txt -npc: npc/quests/quests_veins.txt -npc: npc/quests/quests_yuno.txt -npc: npc/quests/thana_quest.txt +"npc/quests/guildrelay.txt", +"npc/quests/gunslinger_quests.txt", +"npc/quests/juice_maker.txt", +"npc/quests/kiel_hyre_quest.txt", +"npc/quests/lvl4_weapon_quest.txt", +"npc/quests/mage_solution.txt", +"npc/quests/monstertamers.txt", +"npc/quests/mrsmile.txt", +"npc/quests/ninja_quests.txt", +"npc/quests/obb_quest.txt", +"npc/quests/partyrelay.txt", +"npc/quests/quests_13_1.txt", +"npc/quests/quests_13_2.txt", +"npc/quests/quests_airship.txt", +"npc/quests/quests_alberta.txt", +"npc/quests/quests_aldebaran.txt", +"npc/quests/quests_amatsu.txt", +"npc/quests/quests_ayothaya.txt", +"npc/quests/quests_comodo.txt", +"npc/quests/quests_ein.txt", +"npc/quests/quests_geffen.txt", +"npc/quests/quests_gonryun.txt", +"npc/quests/quests_hugel.txt", +"npc/quests/quests_izlude.txt", +"npc/quests/quests_juperos.txt", +"npc/quests/quests_lighthalzen.txt", +"npc/quests/quests_louyang.txt", +"npc/quests/quests_lutie.txt", +"npc/quests/quests_morocc.txt", +"npc/quests/quests_moscovia.txt", +"npc/quests/quests_nameless.txt", +"npc/quests/quests_niflheim.txt", +"npc/quests/quests_payon.txt", +"npc/quests/quests_prontera.txt", +"npc/quests/quests_rachel.txt", +"npc/quests/quests_umbala.txt", +"npc/quests/quests_veins.txt", +"npc/quests/quests_yuno.txt", +"npc/quests/thana_quest.txt", // - The Sign Quest // Be sure that the time zone set corresponds with the server's. // For more info, read the comments in npc/quests/the_sign_quest.txt -npc: npc/quests/the_sign_quest.txt +"npc/quests/the_sign_quest.txt", diff --git a/npc/scripts_custom.conf b/npc/scripts_custom.conf index 940405beb..14384fd17 100644 --- a/npc/scripts_custom.conf +++ b/npc/scripts_custom.conf @@ -9,7 +9,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 @@ -35,103 +35,103 @@ // All the custom scripts, remove the '//' to enable... // Place your scripts here! -//npc: npc/location/to/script.txt +//"npc/location/to/script.txt", //================= Basic Scripts ========================================= -//npc: npc/custom/itembind.txt -//npc: npc/custom/warper.txt -//npc: npc/custom/jobmaster.txt -//npc: npc/custom/platinum_skills.txt -//npc: npc/custom/healer.txt -//npc: npc/custom/breeder.txt -//npc: npc/custom/itemmall.txt -//npc: npc/custom/stylist.txt -//npc: npc/custom/resetnpc.txt -//npc: npc/custom/card_remover.txt -//npc: npc/custom/item_signer.txt -//npc: npc/custom/woe_controller.txt +//"npc/custom/itembind.txt", +//"npc/custom/warper.txt", +//"npc/custom/jobmaster.txt", +//"npc/custom/platinum_skills.txt", +//"npc/custom/healer.txt", +//"npc/custom/breeder.txt", +//"npc/custom/itemmall.txt", +//"npc/custom/stylist.txt", +//"npc/custom/resetnpc.txt", +//"npc/custom/card_remover.txt", +//"npc/custom/item_signer.txt", +//"npc/custom/woe_controller.txt", //================= Other Scripts ========================================= // -- MVP Arena -//npc: npc/custom/etc/mvp_arena.txt +//"npc/custom/etc/mvp_arena.txt", // -- Penal Servitude (Jails Quest) -//npc: npc/custom/etc/penal_servitude.txt +//"npc/custom/etc/penal_servitude.txt", // -- Banks -//npc: npc/custom/etc/bank_kafra.txt -//npc: npc/custom/etc/bank.txt +//"npc/custom/etc/bank_kafra.txt", +//"npc/custom/etc/bank.txt", // -- Lottery (very flexible) -//npc: npc/custom/etc/lottery.txt +//"npc/custom/etc/lottery.txt", // -- Stock Market (Play on it, earn money, very flexible) -//npc: npc/custom/etc/stock_market.txt +//"npc/custom/etc/stock_market.txt", // -- Russian Roulette + Rock Scissors Paper (warning! contains OBB/OVB/OCA/etc. prizes!) -//npc: npc/custom/etc/rpsroulette.txt +//"npc/custom/etc/rpsroulette.txt", // -- Black Jack -//npc: npc/custom/etc/blackjack.txt +//"npc/custom/etc/blackjack.txt", // -- Hire ninja squads to assassinate an enemy! -//npc: npc/custom/etc/shifty_assassin.txt +//"npc/custom/etc/shifty_assassin.txt", // -- Train your monsters to fight against other players' monsters -//npc: npc/custom/etc/monster_arena.txt +//"npc/custom/etc/monster_arena.txt", // -- Raceway mini-game -//npc: npc/custom/etc/morroc_raceway.txt +//"npc/custom/etc/morroc_raceway.txt", // -- Random change of Drop/Exp rates 1x ~ 1.5x every 6 hours on your server -//npc: npc/custom/etc/floating_rates.txt +//"npc/custom/etc/floating_rates.txt", // -- Wedding script that supports same-sex marriages -//npc: npc/custom/etc/marriage.txt +//"npc/custom/etc/marriage.txt", // -- Warper that works only after locations are unlocked -//npc: npc/custom/etc/quest_warper.txt +//"npc/custom/etc/quest_warper.txt", //================= Quest Scripts ========================================= // -- Dynamic Quest Scripts -//npc: npc/custom/quests/hunting_missions.txt -//npc: npc/custom/quests/quest_shop.txt -//npc: npc/custom/quests/questboard.txt +//"npc/custom/quests/hunting_missions.txt", +//"npc/custom/quests/quest_shop.txt", +//"npc/custom/quests/questboard.txt", // -- Treasure Hunters Guild Quests (40 Quests + Special Guild Shop) -//npc: npc/custom/quests/thq/THQS_ChatingNPC.txt -//npc: npc/custom/quests/thq/THQS_GuildNPC.txt -//npc: npc/custom/quests/thq/THQS_QuestNPC.txt -//npc: npc/custom/quests/thq/THQS_Quests.txt -//npc: npc/custom/quests/thq/THQS_TTShop.txt +//"npc/custom/quests/thq/THQS_ChatingNPC.txt", +//"npc/custom/quests/thq/THQS_GuildNPC.txt", +//"npc/custom/quests/thq/THQS_QuestNPC.txt", +//"npc/custom/quests/thq/THQS_Quests.txt", +//"npc/custom/quests/thq/THQS_TTShop.txt", // -- Equipment Quests -//npc: npc/custom/quests/elvenear.txt -//npc: npc/custom/quests/sunglasses.txt -//npc: npc/custom/quests/bandit_beard.txt -//npc: npc/custom/quests/event_6_new_hats.txt -//npc: npc/custom/quests/may_hats.txt -//npc: npc/custom/quests/kings_items.txt +//"npc/custom/quests/elvenear.txt", +//"npc/custom/quests/sunglasses.txt", +//"npc/custom/quests/bandit_beard.txt", +//"npc/custom/quests/event_6_new_hats.txt", +//"npc/custom/quests/may_hats.txt", +//"npc/custom/quests/kings_items.txt", // -- Misc Item Quests -//npc: npc/custom/quests/dead_branch.txt -//npc: npc/custom/quests/berzebub.txt -//npc: npc/custom/quests/jewel_case.txt +//"npc/custom/quests/dead_branch.txt", +//"npc/custom/quests/berzebub.txt", +//"npc/custom/quests/jewel_case.txt", // -- Godly Equipment Quests (be careful!) -//npc: npc/custom/quests/valhallen.txt -//npc: npc/custom/quests/kaho_balmung.txt -//npc: npc/custom/quests/kahohorn.txt +//"npc/custom/quests/valhallen.txt", +//"npc/custom/quests/kaho_balmung.txt", +//"npc/custom/quests/kahohorn.txt", //================= Event Scripts ========================================= // -- Daily Events -//npc: npc/custom/events/disguise.txt -//npc: npc/custom/events/mushroom_event.txt -//npc: npc/custom/events/cluckers.txt +//"npc/custom/events/disguise.txt", +//"npc/custom/events/mushroom_event.txt", +//"npc/custom/events/cluckers.txt", // -- Holiday Events -//npc: npc/custom/events/xmas_rings_event.txt -//npc: npc/custom/events/valentinesdayexp.txt -//npc: npc/custom/events/hallow06.txt -//npc: npc/custom/events/uneasy_cemetery.txt +//"npc/custom/events/xmas_rings_event.txt", +//"npc/custom/events/valentinesdayexp.txt", +//"npc/custom/events/hallow06.txt", +//"npc/custom/events/uneasy_cemetery.txt", //================= Unofficial Scripts ==================================== // -- Unofficial Airplane script -//npc: npc/custom/etc/airplane.txt +//"npc/custom/etc/airplane.txt", // -- Thanatos Tower Statues Quest -//npc: npc/custom/quests/tha_statues.txt +//"npc/custom/quests/tha_statues.txt", // -- Custom quests from official Umbalian Quests -//npc: npc/custom/quests/sphinx_mask.txt -//npc: npc/custom/quests/umbalian_language.txt +//"npc/custom/quests/sphinx_mask.txt", +//"npc/custom/quests/umbalian_language.txt", // -- Unofficial Battlegrounds -//npc: npc/custom/battleground/bg_common.txt -//npc: npc/custom/battleground/bg_tierra_01.txt -//npc: npc/custom/battleground/bg_tierra_02.txt -//npc: npc/custom/battleground/bg_flavius_01.txt -//npc: npc/custom/battleground/bg_flavius_02.txt -//npc: npc/custom/battleground/bg_kvm01.txt -//npc: npc/custom/battleground/bg_kvm02.txt -//npc: npc/custom/battleground/bg_kvm03.txt +//"npc/custom/battleground/bg_common.txt", +//"npc/custom/battleground/bg_tierra_01.txt", +//"npc/custom/battleground/bg_tierra_02.txt", +//"npc/custom/battleground/bg_flavius_01.txt", +//"npc/custom/battleground/bg_flavius_02.txt", +//"npc/custom/battleground/bg_kvm01.txt", +//"npc/custom/battleground/bg_kvm02.txt", +//"npc/custom/battleground/bg_kvm03.txt", diff --git a/npc/scripts_dev.conf b/npc/scripts_dev.conf index 2d282de6e..ff4ef4c4f 100644 --- a/npc/scripts_dev.conf +++ b/npc/scripts_dev.conf @@ -9,7 +9,7 @@ //= This file is part of Hercules. //= http://herc.ws - http://github.com/HerculesWS/Hercules //= -//= Copyright (C) 2014-2015 Hercules Dev Team +//= Copyright (C) 2014-2016 Hercules Dev Team //= //= Hercules is free software: you can redistribute it and/or modify //= it under the terms of the GNU General Public License as published by @@ -31,4 +31,4 @@ //========================================================================= //================= Script Engine self-test =============================== -//npc: npc/dev/test.txt +//"npc: npc/dev/test.txt", diff --git a/npc/scripts_jobs.conf b/npc/scripts_jobs.conf index 8731d773c..c95f9da9d 100644 --- a/npc/scripts_jobs.conf +++ b/npc/scripts_jobs.conf @@ -9,7 +9,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 @@ -30,68 +30,68 @@ //================= Job Quests ============================================ // - 1-1 Expanded -npc: npc/jobs/1-1e/gunslinger.txt -npc: npc/jobs/1-1e/ninja.txt -npc: npc/jobs/1-1e/taekwon.txt +"npc/jobs/1-1e/gunslinger.txt", +"npc/jobs/1-1e/ninja.txt", +"npc/jobs/1-1e/taekwon.txt", // - 2-1 -npc: npc/jobs/2-1/assassin.txt -npc: npc/jobs/2-1/blacksmith.txt -npc: npc/jobs/2-1/hunter.txt -npc: npc/jobs/2-1/knight.txt -npc: npc/jobs/2-1/priest.txt -npc: npc/jobs/2-1/wizard.txt +"npc/jobs/2-1/assassin.txt", +"npc/jobs/2-1/blacksmith.txt", +"npc/jobs/2-1/hunter.txt", +"npc/jobs/2-1/knight.txt", +"npc/jobs/2-1/priest.txt", +"npc/jobs/2-1/wizard.txt", // - 2-1 Transcended -npc: npc/jobs/2-1a/AssassinCross.txt -npc: npc/jobs/2-1a/HighPriest.txt -npc: npc/jobs/2-1a/HighWizard.txt -npc: npc/jobs/2-1a/LordKnight.txt -npc: npc/jobs/2-1a/Sniper.txt -npc: npc/jobs/2-1a/WhiteSmith.txt +"npc/jobs/2-1a/AssassinCross.txt", +"npc/jobs/2-1a/HighPriest.txt", +"npc/jobs/2-1a/HighWizard.txt", +"npc/jobs/2-1a/LordKnight.txt", +"npc/jobs/2-1a/Sniper.txt", +"npc/jobs/2-1a/WhiteSmith.txt", // - 2-1 Expanded -npc: npc/jobs/2-1e/StarGladiator.txt +"npc/jobs/2-1e/StarGladiator.txt", // - 2-2 -npc: npc/jobs/2-2/alchemist.txt -npc: npc/jobs/2-2/bard.txt -npc: npc/jobs/2-2/crusader.txt -npc: npc/jobs/2-2/dancer.txt -npc: npc/jobs/2-2/monk.txt -npc: npc/jobs/2-2/rogue.txt -npc: npc/jobs/2-2/sage.txt +"npc/jobs/2-2/alchemist.txt", +"npc/jobs/2-2/bard.txt", +"npc/jobs/2-2/crusader.txt", +"npc/jobs/2-2/dancer.txt", +"npc/jobs/2-2/monk.txt", +"npc/jobs/2-2/rogue.txt", +"npc/jobs/2-2/sage.txt", // - 2-2 Transcended -npc: npc/jobs/2-2a/Champion.txt -npc: npc/jobs/2-2a/Clown.txt -npc: npc/jobs/2-2a/Creator.txt -npc: npc/jobs/2-2a/Gypsy.txt -npc: npc/jobs/2-2a/Paladin.txt -npc: npc/jobs/2-2a/Professor.txt -npc: npc/jobs/2-2a/Stalker.txt +"npc/jobs/2-2a/Champion.txt", +"npc/jobs/2-2a/Clown.txt", +"npc/jobs/2-2a/Creator.txt", +"npc/jobs/2-2a/Gypsy.txt", +"npc/jobs/2-2a/Paladin.txt", +"npc/jobs/2-2a/Professor.txt", +"npc/jobs/2-2a/Stalker.txt", // - 2-2 Expanded -npc: npc/jobs/2-2e/SoulLinker.txt +"npc/jobs/2-2e/SoulLinker.txt", // - Novice -npc: npc/jobs/novice/supernovice.txt +"npc/jobs/novice/supernovice.txt", // - Transcended Quest (2-x -> High Novice) -npc: npc/jobs/valkyrie.txt +"npc/jobs/valkyrie.txt", //================= Skill Quests ========================================== // - 1-1 -npc: npc/quests/skills/acolyte_skills.txt -npc: npc/quests/skills/archer_skills.txt -npc: npc/quests/skills/mage_skills.txt -npc: npc/quests/skills/merchant_skills.txt -npc: npc/quests/skills/swordman_skills.txt -npc: npc/quests/skills/thief_skills.txt +"npc/quests/skills/acolyte_skills.txt", +"npc/quests/skills/archer_skills.txt", +"npc/quests/skills/mage_skills.txt", +"npc/quests/skills/merchant_skills.txt", +"npc/quests/skills/swordman_skills.txt", +"npc/quests/skills/thief_skills.txt", // - 2-1 -npc: npc/quests/skills/assassin_skills.txt -npc: npc/quests/skills/blacksmith_skills.txt -npc: npc/quests/skills/hunter_skills.txt -npc: npc/quests/skills/knight_skills.txt -npc: npc/quests/skills/priest_skills.txt -npc: npc/quests/skills/rogue_skills.txt -npc: npc/quests/skills/wizard_skills.txt +"npc/quests/skills/assassin_skills.txt", +"npc/quests/skills/blacksmith_skills.txt", +"npc/quests/skills/hunter_skills.txt", +"npc/quests/skills/knight_skills.txt", +"npc/quests/skills/priest_skills.txt", +"npc/quests/skills/rogue_skills.txt", +"npc/quests/skills/wizard_skills.txt", // - 2-2 -npc: npc/quests/skills/alchemist_skills.txt -npc: npc/quests/skills/bard_skills.txt -npc: npc/quests/skills/crusader_skills.txt -npc: npc/quests/skills/dancer_skills.txt -npc: npc/quests/skills/monk_skills.txt -npc: npc/quests/skills/sage_skills.txt +"npc/quests/skills/alchemist_skills.txt", +"npc/quests/skills/bard_skills.txt", +"npc/quests/skills/crusader_skills.txt", +"npc/quests/skills/dancer_skills.txt", +"npc/quests/skills/monk_skills.txt", +"npc/quests/skills/sage_skills.txt", diff --git a/npc/scripts_mapflags.conf b/npc/scripts_mapflags.conf index 0a4f64069..c662f7562 100644 --- a/npc/scripts_mapflags.conf +++ b/npc/scripts_mapflags.conf @@ -9,7 +9,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 @@ -28,32 +28,32 @@ //= Map Flags //========================================================================= -npc: npc/mapflag/nopvp.txt -npc: npc/mapflag/gvg.txt -npc: npc/mapflag/jail.txt -npc: npc/mapflag/nightmare.txt -npc: npc/mapflag/nobranch.txt -npc: npc/mapflag/noexp.txt -npc: npc/mapflag/noicewall.txt -npc: npc/mapflag/noloot.txt -npc: npc/mapflag/nomemo.txt -npc: npc/mapflag/nopenalty.txt -npc: npc/mapflag/nosave.txt -npc: npc/mapflag/noteleport.txt -npc: npc/mapflag/noreturn.txt -npc: npc/mapflag/noskill.txt -npc: npc/mapflag/nowarp.txt -npc: npc/mapflag/nowarpto.txt -npc: npc/mapflag/partylock.txt -npc: npc/mapflag/pvp.txt -npc: npc/mapflag/pvp_noparty.txt -npc: npc/mapflag/pvp_noguild.txt -npc: npc/mapflag/night.txt -npc: npc/mapflag/zone.txt -npc: npc/mapflag/battleground.txt -npc: npc/mapflag/novending.txt -npc: npc/mapflag/town.txt -npc: npc/mapflag/reset.txt -npc: npc/mapflag/skillmodifier.txt -npc: npc/mapflag/skillduration.txt -npc: npc/mapflag/notomb.txt +"npc/mapflag/nopvp.txt", +"npc/mapflag/gvg.txt", +"npc/mapflag/jail.txt", +"npc/mapflag/nightmare.txt", +"npc/mapflag/nobranch.txt", +"npc/mapflag/noexp.txt", +"npc/mapflag/noicewall.txt", +"npc/mapflag/noloot.txt", +"npc/mapflag/nomemo.txt", +"npc/mapflag/nopenalty.txt", +"npc/mapflag/nosave.txt", +"npc/mapflag/noteleport.txt", +"npc/mapflag/noreturn.txt", +"npc/mapflag/noskill.txt", +"npc/mapflag/nowarp.txt", +"npc/mapflag/nowarpto.txt", +"npc/mapflag/partylock.txt", +"npc/mapflag/pvp.txt", +"npc/mapflag/pvp_noparty.txt", +"npc/mapflag/pvp_noguild.txt", +"npc/mapflag/night.txt", +"npc/mapflag/zone.txt", +"npc/mapflag/battleground.txt", +"npc/mapflag/novending.txt", +"npc/mapflag/town.txt", +"npc/mapflag/reset.txt", +"npc/mapflag/skillmodifier.txt", +"npc/mapflag/skillduration.txt", +"npc/mapflag/notomb.txt", diff --git a/npc/scripts_monsters.conf b/npc/scripts_monsters.conf index 2c4cc9ea4..beab8fdf6 100644 --- a/npc/scripts_monsters.conf +++ b/npc/scripts_monsters.conf @@ -9,7 +9,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 @@ -29,7 +29,7 @@ //========================================================================= //================= Misc Spawns =========================================== -npc: npc/mobs/citycleaners.txt -npc: npc/mobs/jail.txt -npc: npc/mobs/pvp.txt -npc: npc/mobs/towns.txt +"npc/mobs/citycleaners.txt", +"npc/mobs/jail.txt", +"npc/mobs/pvp.txt", +"npc/mobs/towns.txt", diff --git a/npc/scripts_removed.conf b/npc/scripts_removed.conf new file mode 100644 index 000000000..c1089466c --- /dev/null +++ b/npc/scripts_removed.conf @@ -0,0 +1,37 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules is free software: you can redistribute it and/or modify +//= it under the terms of the GNU General Public License as published by +//= the Free Software Foundation, either version 3 of the License, or +//= (at your option) any later version. +//= +//= This program is distributed in the hope that it will be useful, +//= but WITHOUT ANY WARRANTY; without even the implied warranty of +//= MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +//= GNU General Public License for more details. +//= +//= You should have received a copy of the GNU General Public License +//= along with this program. If not, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Hercules global npc removed list +//========================================================================= +// All NPCs that you wish to remove from your loading list should be put in +// this file +//========================================================================= + +// If instead of a path to an NPC is put "all" no file will be loaded +npc_removed_list: ( + //"all", + //"path/to/npc", +) // removed diff --git a/npc/scripts_warps.conf b/npc/scripts_warps.conf index 05dd4ede2..c89d75089 100644 --- a/npc/scripts_warps.conf +++ b/npc/scripts_warps.conf @@ -9,7 +9,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 @@ -29,87 +29,87 @@ //========================================================================= //================= Cities ================================================ -npc: npc/warps/cities/alberta.txt -npc: npc/warps/cities/aldebaran.txt -npc: npc/warps/cities/amatsu.txt -npc: npc/warps/cities/ayothaya.txt -npc: npc/warps/cities/comodo.txt -npc: npc/warps/cities/einbech.txt -npc: npc/warps/cities/einbroch.txt -npc: npc/warps/cities/geffen.txt -npc: npc/warps/cities/gonryun.txt -npc: npc/warps/cities/hugel.txt -npc: npc/warps/cities/lighthalzen.txt -npc: npc/warps/cities/louyang.txt -npc: npc/warps/cities/lutie.txt -npc: npc/warps/cities/manuk.txt -npc: npc/warps/cities/mid_camp.txt -npc: npc/warps/cities/morroc.txt -npc: npc/warps/cities/moscovia.txt -npc: npc/warps/cities/nameless.txt -npc: npc/warps/cities/niflheim.txt -npc: npc/warps/cities/payon.txt -npc: npc/warps/cities/prontera.txt -npc: npc/warps/cities/splendide.txt -npc: npc/warps/cities/umbala.txt -npc: npc/warps/cities/veins.txt -npc: npc/warps/cities/yuno.txt +"npc/warps/cities/alberta.txt", +"npc/warps/cities/aldebaran.txt", +"npc/warps/cities/amatsu.txt", +"npc/warps/cities/ayothaya.txt", +"npc/warps/cities/comodo.txt", +"npc/warps/cities/einbech.txt", +"npc/warps/cities/einbroch.txt", +"npc/warps/cities/geffen.txt", +"npc/warps/cities/gonryun.txt", +"npc/warps/cities/hugel.txt", +"npc/warps/cities/lighthalzen.txt", +"npc/warps/cities/louyang.txt", +"npc/warps/cities/lutie.txt", +"npc/warps/cities/manuk.txt", +"npc/warps/cities/mid_camp.txt", +"npc/warps/cities/morroc.txt", +"npc/warps/cities/moscovia.txt", +"npc/warps/cities/nameless.txt", +"npc/warps/cities/niflheim.txt", +"npc/warps/cities/payon.txt", +"npc/warps/cities/prontera.txt", +"npc/warps/cities/splendide.txt", +"npc/warps/cities/umbala.txt", +"npc/warps/cities/veins.txt", +"npc/warps/cities/yuno.txt", //================= Dungeons ============================================== -npc: npc/warps/dungeons/abbey.txt -npc: npc/warps/dungeons/abyss.txt -npc: npc/warps/dungeons/alde_dun.txt -npc: npc/warps/dungeons/ama_dun.txt -npc: npc/warps/dungeons/anthell.txt -npc: npc/warps/dungeons/ayo_dun.txt -npc: npc/warps/dungeons/beach_dun.txt -npc: npc/warps/dungeons/c_tower.txt -npc: npc/warps/dungeons/ein_dun.txt -npc: npc/warps/dungeons/gef_dun.txt -npc: npc/warps/dungeons/gon_dun.txt -npc: npc/warps/dungeons/ice_dun.txt -npc: npc/warps/dungeons/in_sphinx.txt -npc: npc/warps/dungeons/iz_dun.txt -npc: npc/warps/dungeons/juperos.txt -npc: npc/warps/dungeons/kh_dun.txt -npc: npc/warps/dungeons/lhz_dun.txt -npc: npc/warps/dungeons/lou_dun.txt -npc: npc/warps/dungeons/mag_dun.txt -npc: npc/warps/dungeons/mjo_dun.txt -npc: npc/warps/dungeons/moc_pryd.txt -npc: npc/warps/dungeons/mosk_dun.txt -npc: npc/warps/dungeons/odin.txt -npc: npc/warps/dungeons/orcsdun.txt -npc: npc/warps/dungeons/pay_dun.txt -npc: npc/warps/dungeons/prt_maze.txt -npc: npc/warps/dungeons/ra_san.txt -npc: npc/warps/dungeons/tha_t.txt -npc: npc/warps/dungeons/thor_v.txt -npc: npc/warps/dungeons/treasure.txt -npc: npc/warps/dungeons/tur_dun.txt -npc: npc/warps/dungeons/um_dun.txt -npc: npc/warps/dungeons/xmas_dun.txt +"npc/warps/dungeons/abbey.txt", +"npc/warps/dungeons/abyss.txt", +"npc/warps/dungeons/alde_dun.txt", +"npc/warps/dungeons/ama_dun.txt", +"npc/warps/dungeons/anthell.txt", +"npc/warps/dungeons/ayo_dun.txt", +"npc/warps/dungeons/beach_dun.txt", +"npc/warps/dungeons/c_tower.txt", +"npc/warps/dungeons/ein_dun.txt", +"npc/warps/dungeons/gef_dun.txt", +"npc/warps/dungeons/gon_dun.txt", +"npc/warps/dungeons/ice_dun.txt", +"npc/warps/dungeons/in_sphinx.txt", +"npc/warps/dungeons/iz_dun.txt", +"npc/warps/dungeons/juperos.txt", +"npc/warps/dungeons/kh_dun.txt", +"npc/warps/dungeons/lhz_dun.txt", +"npc/warps/dungeons/lou_dun.txt", +"npc/warps/dungeons/mag_dun.txt", +"npc/warps/dungeons/mjo_dun.txt", +"npc/warps/dungeons/moc_pryd.txt", +"npc/warps/dungeons/mosk_dun.txt", +"npc/warps/dungeons/odin.txt", +"npc/warps/dungeons/orcsdun.txt", +"npc/warps/dungeons/pay_dun.txt", +"npc/warps/dungeons/prt_maze.txt", +"npc/warps/dungeons/ra_san.txt", +"npc/warps/dungeons/tha_t.txt", +"npc/warps/dungeons/thor_v.txt", +"npc/warps/dungeons/treasure.txt", +"npc/warps/dungeons/tur_dun.txt", +"npc/warps/dungeons/um_dun.txt", +"npc/warps/dungeons/xmas_dun.txt", //================= Fields ================================================ -npc: npc/warps/fields/abyss_warper.txt -npc: npc/warps/fields/amatsu_fild.txt -npc: npc/warps/fields/ein_fild.txt -npc: npc/warps/fields/gefenia.txt -npc: npc/warps/fields/glastheim.txt -npc: npc/warps/fields/jawaii.txt -npc: npc/warps/fields/lhalzen_fild.txt -npc: npc/warps/fields/lutie_fild.txt -npc: npc/warps/fields/man_fild.txt -npc: npc/warps/fields/mtmjolnir.txt -npc: npc/warps/fields/spl_fild.txt -npc: npc/warps/fields/umbala_fild.txt +"npc/warps/fields/abyss_warper.txt", +"npc/warps/fields/amatsu_fild.txt", +"npc/warps/fields/ein_fild.txt", +"npc/warps/fields/gefenia.txt", +"npc/warps/fields/glastheim.txt", +"npc/warps/fields/jawaii.txt", +"npc/warps/fields/lhalzen_fild.txt", +"npc/warps/fields/lutie_fild.txt", +"npc/warps/fields/man_fild.txt", +"npc/warps/fields/mtmjolnir.txt", +"npc/warps/fields/spl_fild.txt", +"npc/warps/fields/umbala_fild.txt", //================= Others ================================================ -npc: npc/warps/other/airplane.txt -npc: npc/warps/other/arena.txt -npc: npc/warps/other/god.txt -npc: npc/warps/other/jobquests.txt -npc: npc/warps/other/kiel.txt -npc: npc/warps/other/other.txt -npc: npc/warps/guildcastles.txt -npc: npc/warps/pvp.txt +"npc/warps/other/airplane.txt", +"npc/warps/other/arena.txt", +"npc/warps/other/god.txt", +"npc/warps/other/jobquests.txt", +"npc/warps/other/kiel.txt", +"npc/warps/other/other.txt", +"npc/warps/guildcastles.txt", +"npc/warps/pvp.txt", diff --git a/npc/scripts_woe.conf b/npc/scripts_woe.conf index 4fdaf5731..695a1a398 100644 --- a/npc/scripts_woe.conf +++ b/npc/scripts_woe.conf @@ -9,7 +9,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 @@ -30,52 +30,52 @@ //================= War of Emperium ======================================= // - Guild WoE time settings -npc: npc/woe-fe/agit_controller.txt +"npc/woe-fe/agit_controller.txt", // - Guild NPC Template file -npc: npc/woe-fe/agit_main.txt +"npc/woe-fe/agit_main.txt", // - Al De Baran -npc: npc/woe-fe/aldeg_cas01.txt -npc: npc/woe-fe/aldeg_cas02.txt -npc: npc/woe-fe/aldeg_cas03.txt -npc: npc/woe-fe/aldeg_cas04.txt -npc: npc/woe-fe/aldeg_cas05.txt +"npc/woe-fe/aldeg_cas01.txt", +"npc/woe-fe/aldeg_cas02.txt", +"npc/woe-fe/aldeg_cas03.txt", +"npc/woe-fe/aldeg_cas04.txt", +"npc/woe-fe/aldeg_cas05.txt", // - Geffen -npc: npc/woe-fe/gefg_cas01.txt -npc: npc/woe-fe/gefg_cas02.txt -npc: npc/woe-fe/gefg_cas03.txt -npc: npc/woe-fe/gefg_cas04.txt -npc: npc/woe-fe/gefg_cas05.txt +"npc/woe-fe/gefg_cas01.txt", +"npc/woe-fe/gefg_cas02.txt", +"npc/woe-fe/gefg_cas03.txt", +"npc/woe-fe/gefg_cas04.txt", +"npc/woe-fe/gefg_cas05.txt", // - Payon -npc: npc/woe-fe/payg_cas01.txt -npc: npc/woe-fe/payg_cas02.txt -npc: npc/woe-fe/payg_cas03.txt -npc: npc/woe-fe/payg_cas04.txt -npc: npc/woe-fe/payg_cas05.txt +"npc/woe-fe/payg_cas01.txt", +"npc/woe-fe/payg_cas02.txt", +"npc/woe-fe/payg_cas03.txt", +"npc/woe-fe/payg_cas04.txt", +"npc/woe-fe/payg_cas05.txt", // - Prontera -npc: npc/woe-fe/prtg_cas01.txt -npc: npc/woe-fe/prtg_cas02.txt -npc: npc/woe-fe/prtg_cas03.txt -npc: npc/woe-fe/prtg_cas04.txt -npc: npc/woe-fe/prtg_cas05.txt +"npc/woe-fe/prtg_cas01.txt", +"npc/woe-fe/prtg_cas02.txt", +"npc/woe-fe/prtg_cas03.txt", +"npc/woe-fe/prtg_cas04.txt", +"npc/woe-fe/prtg_cas05.txt", // - Treasure Room Protection -//npc: npc/woe-fe/trs_rp.txt +//"npc/woe-fe/trs_rp.txt", //================= War of Emperium Second Edition ======================== // - WoE SE time settings -npc: npc/woe-se/agit_start_se.txt +"npc/woe-se/agit_start_se.txt", // - Guild NPC Template file -npc: npc/woe-se/agit_main_se.txt +"npc/woe-se/agit_main_se.txt", // - Town Flags -npc: npc/woe-se/guild_flags.txt +"npc/woe-se/guild_flags.txt", // - Arunafeltz -npc: npc/woe-se/arug_cas01.txt -npc: npc/woe-se/arug_cas02.txt -npc: npc/woe-se/arug_cas03.txt -npc: npc/woe-se/arug_cas04.txt -npc: npc/woe-se/arug_cas05.txt +"npc/woe-se/arug_cas01.txt", +"npc/woe-se/arug_cas02.txt", +"npc/woe-se/arug_cas03.txt", +"npc/woe-se/arug_cas04.txt", +"npc/woe-se/arug_cas05.txt", // - Schwaltzvalt -npc: npc/woe-se/schg_cas01.txt -npc: npc/woe-se/schg_cas02.txt -npc: npc/woe-se/schg_cas03.txt -npc: npc/woe-se/schg_cas04.txt -npc: npc/woe-se/schg_cas05.txt +"npc/woe-se/schg_cas01.txt", +"npc/woe-se/schg_cas02.txt", +"npc/woe-se/schg_cas03.txt", +"npc/woe-se/schg_cas04.txt", +"npc/woe-se/schg_cas05.txt", diff --git a/src/char/char.c b/src/char/char.c index 2851d3eba..6f79a55e3 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 @@ -42,6 +42,7 @@ #include "common/HPM.h" #include "common/cbasetypes.h" +#include "common/conf.h" #include "common/console.h" #include "common/core.h" #include "common/db.h" @@ -61,6 +62,7 @@ #include <stdio.h> #include <stdlib.h> #include <sys/types.h> +#include <sys/stat.h> // stat() #if MAX_MAP_SERVERS > 1 # ifdef _MSC_VER @@ -110,9 +112,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 +122,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,19 +130,24 @@ 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; int autosave_interval = DEFAULT_AUTOSAVE_INTERVAL; int start_zeny = 0; -int start_items[MAX_START_ITEMS*3]; + +/// Start items for new characters +struct start_item_s { + int id; + int amount; + int loc; + bool stackable; +}; +VECTOR_DECL(struct start_item_s) start_items; + int guild_exp_rate = 100; //Custom limits for the fame lists. [Skotlex] @@ -690,7 +694,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 +1047,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 +1341,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 +1469,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); } @@ -1543,7 +1548,7 @@ int char_make_new_char_sql(struct char_session_data *sd, const char *name_, int { char name[NAME_LENGTH]; char esc_name[NAME_LENGTH*2+1]; - int char_id, flag, k, l; + int char_id, flag, i; nullpo_retr(-2, sd); nullpo_retr(-2, name_); @@ -1606,32 +1611,29 @@ 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); } //Give the char the default items - for (k = 0; k < ARRAYLENGTH(start_items) && start_items[k] != 0; k += 3) { - // FIXME: How to define if an item is stackable without having to lookup itemdb? [panikon] - if( start_items[k+2] == 1 ) - { - if( SQL_ERROR == SQL->Query(inter->sql_handle, - "INSERT INTO `%s` (`char_id`,`nameid`, `amount`, `identify`) VALUES ('%d', '%d', '%d', '%d')", - inventory_db, char_id, start_items[k], start_items[k + 1], 1) ) - Sql_ShowDebug(inter->sql_handle); - } - else if( start_items[k+2] == 0 ) - { + for (i = 0; i < VECTOR_LENGTH(start_items); i++) { + struct start_item_s *item = &VECTOR_INDEX(start_items, i); + if (item->stackable) { + if (SQL_ERROR == SQL->Query(inter->sql_handle, + "INSERT INTO `%s` (`char_id`,`nameid`, `amount`, `identify`) VALUES ('%d', '%d', '%d', '%d')", + inventory_db, char_id, item->id, item->amount, 1)) + Sql_ShowDebug(inter->sql_handle); + } else { // Non-stackable items should have their own entries (issue: 7279) - for( l = 0; l < start_items[k+1]; l++ ) - { - if( SQL_ERROR == SQL->Query(inter->sql_handle, - "INSERT INTO `%s` (`char_id`,`nameid`, `amount`, `identify`) VALUES ('%d', '%d', '%d', '%d')", - inventory_db, char_id, start_items[k], 1, 1) - ) + int l, loc = item->loc; + for (l = 0; l < item->amount; l++) { + if (SQL_ERROR == SQL->Query(inter->sql_handle, + "INSERT INTO `%s` (`char_id`,`nameid`, `amount`, `equip`, `identify`) VALUES ('%d', '%d', '%d', '%d', '%d')", + inventory_db, char_id, item->id, 1, loc, 1)) Sql_ShowDebug(inter->sql_handle); } } @@ -1804,13 +1806,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 +2017,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 @@ -2181,7 +2183,7 @@ int char_parse_fromlogin_connection_state(int fd) ShowError("Can not connect to login-server.\n"); ShowError("The server communication passwords (default s1/p1) are probably invalid.\n"); ShowError("Also, please make sure your login db has the correct communication username/passwords and the gender of the account is S.\n"); - ShowError("The communication passwords are set in /conf/map-server.conf and /conf/char-server.conf\n"); + ShowError("The communication passwords are set in /conf/map-server.conf and /conf/char/char-server.conf\n"); sockt->eof(fd); return 1; } else { @@ -4516,13 +4518,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 +4617,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 { @@ -5348,304 +5350,673 @@ static int char_online_data_cleanup(int tid, int64 tick, int id, intptr_t data) return 0; } -void char_sql_config_read(const char* cfgName) +/** + * Reads the 'inter_configuration' config file and initializes required variables. + * + * @param filename Path to configuration file + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool char_sql_config_read(const char *filename, bool imported) { - char line[1024], w1[1024], w2[1024]; - FILE* fp; + struct config_t config; + const struct config_setting_t *setting = NULL; + const char *import = NULL; + bool retval = true; - if ((fp = fopen(cfgName, "r")) == NULL) { - ShowError("File not found: %s\n", cfgName); - return; + nullpo_retr(false, filename); + + if (!libconfig->load_file(&config, filename)) + return false; // Error message is already shown by libconfig->load_file + + if ((setting = libconfig->lookup(&config, "inter_configuration/database_names")) == NULL) { + libconfig->destroy(&config); + if (imported) + return true; + ShowError("sql_config_read: inter_configuration/database_names was not found in %s!\n", filename); + return false; + } + libconfig->setting_lookup_mutable_string(setting, "char_db", char_db, sizeof(char_db)); + libconfig->setting_lookup_mutable_string(setting, "interlog_db", interlog_db, sizeof(interlog_db)); + libconfig->setting_lookup_mutable_string(setting, "ragsrvinfo_db", ragsrvinfo_db, sizeof(ragsrvinfo_db)); + + if (!chr->sql_config_read_registry(filename, &config, imported)) + retval = false; + if (!chr->sql_config_read_pc(filename, &config, imported)) + retval = false; + if (!chr->sql_config_read_guild(filename, &config, imported)) + retval = false; + + ShowInfo("Done reading %s.\n", filename); + // import should overwrite any previous configuration, so it should be called last + if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) { + if (strcmp(import, filename) == 0 || strcmp(import, chr->SQL_CONF_NAME) == 0) { + ShowWarning("sql_config_read: Loop detected in %s! Skipping 'import'...\n", filename); + } else { + if (!chr->sql_config_read(import, true)) + retval = false; + } } - while(fgets(line, sizeof(line), fp)) - { - if(line[0] == '/' && line[1] == '/') - continue; + // TODO HPM->parseConf(w1, w2, HPCT_CHAR_INTER); - if (sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2) != 2) - continue; + libconfig->destroy(&config); + return retval; +} - if(!strcmpi(w1,"char_db")) - safestrncpy(char_db, w2, sizeof(char_db)); - else if(!strcmpi(w1,"scdata_db")) - safestrncpy(scdata_db, w2, sizeof(scdata_db)); - else if(!strcmpi(w1,"cart_db")) - safestrncpy(cart_db, w2, sizeof(cart_db)); - else if(!strcmpi(w1,"inventory_db")) - safestrncpy(inventory_db, w2, sizeof(inventory_db)); - else if(!strcmpi(w1,"charlog_db")) - safestrncpy(charlog_db, w2, sizeof(charlog_db)); - else if(!strcmpi(w1,"storage_db")) - safestrncpy(storage_db, w2, sizeof(storage_db)); - else if(!strcmpi(w1,"skill_db")) - safestrncpy(skill_db, w2, sizeof(skill_db)); - else if(!strcmpi(w1,"interlog_db")) - safestrncpy(interlog_db, w2, sizeof(interlog_db)); - else if(!strcmpi(w1,"memo_db")) - safestrncpy(memo_db, w2, sizeof(memo_db)); - else if(!strcmpi(w1,"guild_db")) - safestrncpy(guild_db, w2, sizeof(guild_db)); - else if(!strcmpi(w1,"guild_alliance_db")) - safestrncpy(guild_alliance_db, w2, sizeof(guild_alliance_db)); - else if(!strcmpi(w1,"guild_castle_db")) - safestrncpy(guild_castle_db, w2, sizeof(guild_castle_db)); - else if(!strcmpi(w1,"guild_expulsion_db")) - safestrncpy(guild_expulsion_db, w2, sizeof(guild_expulsion_db)); - else if(!strcmpi(w1,"guild_member_db")) - safestrncpy(guild_member_db, w2, sizeof(guild_member_db)); - else if(!strcmpi(w1,"guild_skill_db")) - safestrncpy(guild_skill_db, w2, sizeof(guild_skill_db)); - else if(!strcmpi(w1,"guild_position_db")) - safestrncpy(guild_position_db, w2, sizeof(guild_position_db)); - else if(!strcmpi(w1,"guild_storage_db")) - safestrncpy(guild_storage_db, w2, sizeof(guild_storage_db)); - else if(!strcmpi(w1,"party_db")) - safestrncpy(party_db, w2, sizeof(party_db)); - else if(!strcmpi(w1,"pet_db")) - safestrncpy(pet_db, w2, sizeof(pet_db)); - else if(!strcmpi(w1,"mail_db")) - safestrncpy(mail_db, w2, sizeof(mail_db)); - else if(!strcmpi(w1,"auction_db")) - safestrncpy(auction_db, w2, sizeof(auction_db)); - else if(!strcmpi(w1,"friend_db")) - safestrncpy(friend_db, w2, sizeof(friend_db)); - else if(!strcmpi(w1,"hotkey_db")) - safestrncpy(hotkey_db, w2, sizeof(hotkey_db)); - else if(!strcmpi(w1,"quest_db")) - safestrncpy(quest_db,w2,sizeof(quest_db)); - else if(!strcmpi(w1,"homunculus_db")) - safestrncpy(homunculus_db,w2,sizeof(homunculus_db)); - else if(!strcmpi(w1,"skill_homunculus_db")) - safestrncpy(skill_homunculus_db,w2,sizeof(skill_homunculus_db)); - else if(!strcmpi(w1,"mercenary_db")) - safestrncpy(mercenary_db,w2,sizeof(mercenary_db)); - else if(!strcmpi(w1,"mercenary_owner_db")) - safestrncpy(mercenary_owner_db,w2,sizeof(mercenary_owner_db)); - else if(!strcmpi(w1,"ragsrvinfo_db")) - safestrncpy(ragsrvinfo_db,w2,sizeof(ragsrvinfo_db)); - else if(!strcmpi(w1,"elemental_db")) - safestrncpy(elemental_db,w2,sizeof(elemental_db)); - else if(!strcmpi(w1,"account_data_db")) - safestrncpy(account_data_db,w2,sizeof(account_data_db)); - else if(!strcmpi(w1,"char_reg_num_db")) - safestrncpy(char_reg_num_db, w2, sizeof(char_reg_num_db)); - else if(!strcmpi(w1,"char_reg_str_db")) - safestrncpy(char_reg_str_db, w2, sizeof(char_reg_str_db)); - else if(!strcmpi(w1,"acc_reg_str_db")) - safestrncpy(acc_reg_str_db, w2, sizeof(acc_reg_str_db)); - else if(!strcmpi(w1,"acc_reg_num_db")) - safestrncpy(acc_reg_num_db, w2, sizeof(acc_reg_num_db)); - //support the import command, just like any other config - else if(!strcmpi(w1,"import")) - chr->sql_config_read(w2); - else - HPM->parseConf(w1, w2, HPCT_CHAR_INTER); +/** + * Reads the 'inter_configuration/database_names/registry' config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool char_sql_config_read_registry(const char *filename, const struct config_t *config, bool imported) +{ + const struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "inter_configuration/database_names/registry")) == NULL) { + if (imported) + return true; + ShowError("sql_config_read: inter_configuration/database_names/registry was not found in %s!\n", filename); + return false; } - fclose(fp); - ShowInfo("Done reading %s.\n", cfgName); + // Not all registries are read by char-server + libconfig->setting_lookup_mutable_string(setting, "char_reg_num_db", char_reg_num_db, sizeof(char_reg_num_db)); + libconfig->setting_lookup_mutable_string(setting, "char_reg_str_db", char_reg_str_db, sizeof(char_reg_str_db)); + libconfig->setting_lookup_mutable_string(setting, "acc_reg_str_db", acc_reg_str_db, sizeof(acc_reg_str_db)); + libconfig->setting_lookup_mutable_string(setting, "acc_reg_num_db", acc_reg_num_db, sizeof(acc_reg_num_db)); + + return true; } -void char_config_dispatch(char *w1, char *w2) { - bool (*dispatch_to[]) (char *w1, char *w2) = { - /* as many as it needs */ - pincode->config_read - }; - int i, len = ARRAYLENGTH(dispatch_to); - for(i = 0; i < len; i++) { - if( (*dispatch_to[i])(w1,w2) ) - break;/* we found who this belongs to, can stop */ +/** + * Reads the 'inter_configuration/database_names/pc' config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool char_sql_config_read_pc(const char *filename, const struct config_t *config, bool imported) +{ + const struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "inter_configuration/database_names/pc")) == NULL) { + if (imported) + return true; + ShowError("sql_config_read: inter_configuration/database_names/pc was not found in %s!\n", filename); + return false; } - if (i == len) - HPM->parseConf(w1, w2, HPCT_CHAR); + libconfig->setting_lookup_mutable_string(setting, "hotkey_db", hotkey_db, sizeof(hotkey_db)); + libconfig->setting_lookup_mutable_string(setting, "scdata_db", scdata_db, sizeof(scdata_db)); + libconfig->setting_lookup_mutable_string(setting, "inventory_db", inventory_db, sizeof(inventory_db)); + libconfig->setting_lookup_mutable_string(setting, "cart_db", cart_db, sizeof(cart_db)); + libconfig->setting_lookup_mutable_string(setting, "charlog_db", charlog_db, sizeof(charlog_db)); + libconfig->setting_lookup_mutable_string(setting, "storage_db", storage_db, sizeof(storage_db)); + libconfig->setting_lookup_mutable_string(setting, "skill_db", skill_db, sizeof(skill_db)); + libconfig->setting_lookup_mutable_string(setting, "memo_db", memo_db, sizeof(memo_db)); + libconfig->setting_lookup_mutable_string(setting, "party_db", party_db, sizeof(party_db)); + libconfig->setting_lookup_mutable_string(setting, "pet_db", pet_db, sizeof(pet_db)); + libconfig->setting_lookup_mutable_string(setting, "friend_db", friend_db, sizeof(friend_db)); + libconfig->setting_lookup_mutable_string(setting, "mail_db", mail_db, sizeof(mail_db)); + libconfig->setting_lookup_mutable_string(setting, "auction_db", auction_db, sizeof(auction_db)); + libconfig->setting_lookup_mutable_string(setting, "quest_db", quest_db, sizeof(quest_db)); + libconfig->setting_lookup_mutable_string(setting, "homunculus_db", homunculus_db, sizeof(homunculus_db)); + libconfig->setting_lookup_mutable_string(setting, "skill_homunculus_db", skill_homunculus_db, sizeof(skill_homunculus_db)); + libconfig->setting_lookup_mutable_string(setting, "mercenary_db", mercenary_db, sizeof(mercenary_db)); + libconfig->setting_lookup_mutable_string(setting, "mercenary_owner_db", mercenary_owner_db, sizeof(mercenary_owner_db)); + libconfig->setting_lookup_mutable_string(setting, "elemental_db", elemental_db, sizeof(elemental_db)); + libconfig->setting_lookup_mutable_string(setting, "account_data_db", account_data_db, sizeof(account_data_db)); + + return true; } -int char_config_read(const char* cfgName) +/** + * Reads the 'inter_configuration/database_names/guild' config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool char_sql_config_read_guild(const char *filename, const struct config_t *config, bool imported) { - char line[1024], w1[1024], w2[1024]; - FILE* fp = fopen(cfgName, "r"); + const struct config_setting_t *setting = NULL; - if (fp == NULL) { - ShowError("Configuration file not found: %s.\n", cfgName); - return 1; + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "inter_configuration/database_names/guild")) == NULL) { + if (imported) + return true; + ShowError("sql_config_read: inter_configuration/database_names/guild was not found in %s!\n", filename); + return false; + } + + libconfig->setting_lookup_mutable_string(setting, "main_db", guild_db, sizeof(guild_db)); + libconfig->setting_lookup_mutable_string(setting, "alliance_db", guild_alliance_db, sizeof(guild_alliance_db)); + libconfig->setting_lookup_mutable_string(setting, "castle_db", guild_castle_db, sizeof(guild_castle_db)); + libconfig->setting_lookup_mutable_string(setting, "expulsion_db", guild_expulsion_db, sizeof(guild_expulsion_db)); + libconfig->setting_lookup_mutable_string(setting, "member_db", guild_member_db, sizeof(guild_member_db)); + libconfig->setting_lookup_mutable_string(setting, "skill_db", guild_skill_db, sizeof(guild_skill_db)); + libconfig->setting_lookup_mutable_string(setting, "position_db", guild_position_db, sizeof(guild_position_db)); + libconfig->setting_lookup_mutable_string(setting, "storage_db", guild_storage_db, sizeof(guild_storage_db)); + + return true; +} + +/** + * Reads the 'char_configuration' config file and initializes required variables. + * + * @param filename Path to configuration file. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool char_config_read(const char *filename, bool imported) +{ + struct config_t config; + const char *import = NULL; + bool retval = true; + + nullpo_retr(false, filename); + + if (!libconfig->load_file(&config, filename)) + return false; // Error message is already shown by libconfig->load_file + + if (!chr->config_read_top(filename, &config, imported)) + retval = false; + if (!chr->config_read_inter(filename, &config, imported)) + retval = false; + if (!chr->config_read_permission(filename, &config, imported)) + retval = false; + if (!chr->config_read_player(filename, &config, imported)) + retval = false; + if (!chr->config_read_console(filename, &config, imported)) + retval = false; + if (!chr->config_read_database(filename, &config, imported)) + retval = false; + if (!inter->config_read_connection(filename, &config, imported)) + retval = false; + if (!pincode->config_read(filename, &config, imported)) + retval = false; + + // TODO HPM->parseConf(w1, w2, HPCT_CHAR); + + ShowInfo("Done reading %s.\n", filename); + + // import should overwrite any previous configuration, so it should be called last + if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) { + if (strcmp(import, filename) == 0 || strcmp(import, chr->CHAR_CONF_NAME) == 0) { + ShowWarning("char_config_read: Loop detected in %s! Skipping 'import'...\n", filename); + } else { + if (!chr->config_read(import, true)) + retval = false; + } } - while(fgets(line, sizeof(line), fp)) { - if (line[0] == '/' && line[1] == '/') + libconfig->destroy(&config); + return retval; +} + +/** + * Reads the 'char_configuration' top level config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool char_config_read_top(const char *filename, const struct config_t *config, bool imported) +{ + const struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "char_configuration")) == NULL) { + if (imported) + return true; + ShowError("char_config_read: char_configuration was not found in %s!\n", filename); + return false; + } + + // char_configuration/server_name + if (libconfig->setting_lookup_mutable_string(setting, "server_name", chr->server_name, sizeof(chr->server_name)) == CONFIG_TRUE) { + ShowInfo("server name %s\n", chr->server_name); + } else if (!imported) { + ShowWarning("char_config_read: server_name was not set! Defaulting to 'Hercules'.\n"); + safestrncpy(chr->server_name, "Hercules", sizeof(chr->server_name)); + } + // char_configuration/wisp_server_name + if (libconfig->setting_lookup_mutable_string(setting, "wisp_server_name", wisp_server_name, sizeof(wisp_server_name)) == CONFIG_TRUE) { + // wisp_server_name should _always_ be equal or bigger than 4 characters! + if (strlen(wisp_server_name) < 4) { // TODO: This length should be a #define (i.e. MIN_NAME_LENGTH) + ShowWarning("char_config_read: char_configuration/wisp_server_name is too small! Defaulting to: Server.\n"); + safestrncpy(chr->server_name, "Server", sizeof(chr->server_name)); + } + } + // char_configuration/guild_exp_rate + libconfig->setting_lookup_int(setting, "guild_exp_rate", &guild_exp_rate); + + return true; +} + +/** + * Reads the 'char_configuration/inter' config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool char_config_read_inter(const char *filename, const struct config_t *config, bool imported) +{ + const struct config_setting_t *setting = NULL; + const char *str = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "char_configuration/inter")) == NULL) { + if (imported) + return true; + ShowError("char_config_read: char_configuration/inter was not found in %s!\n", filename); + return false; + } + + // Login information + libconfig->setting_lookup_mutable_string(setting, "userid", chr->userid, sizeof(chr->userid)); + libconfig->setting_lookup_mutable_string(setting, "passwd", chr->passwd, sizeof(chr->passwd)); + + // Login-server and character-server information + if (libconfig->setting_lookup_string(setting, "login_ip", &str) == CONFIG_TRUE) + chr->config_set_ip("Login server", str, &login_ip, login_ip_str); + + if (libconfig->setting_lookup_string(setting, "char_ip", &str) == CONFIG_TRUE) + chr->config_set_ip("Character server", str, &chr->ip, char_ip_str); + + if (libconfig->setting_lookup_string(setting, "bind_ip", &str) == CONFIG_TRUE) + chr->config_set_ip("Character server binding", str, &bind_ip, bind_ip_str); + + libconfig->setting_lookup_uint16(setting, "login_port", &login_port); + libconfig->setting_lookup_uint16(setting, "char_port", &chr->port); + + return true; +} + +/** + * Reads the 'char_configuration/database' config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool char_config_read_database(const char *filename, const struct config_t *config, bool imported) +{ + const struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "char_configuration/database")) == NULL) { + if (imported) + return true; + ShowError("char_config_read: char_configuration/database was not found in %s!\n", filename); + return false; + } + if (libconfig->setting_lookup_int(setting, "autosave_time", &autosave_interval) == CONFIG_TRUE) { + autosave_interval *= 1000; + if (autosave_interval <= 0) + autosave_interval = DEFAULT_AUTOSAVE_INTERVAL; + } + libconfig->setting_lookup_mutable_string(setting, "db_path", db_path, sizeof(db_path)); + libconfig->setting_lookup_bool_real(setting, "log_char", &chr->enable_logs); + return true; +} + +/** + * Reads the 'char_configuration/console' config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool char_config_read_console(const char *filename, const struct config_t *config, bool imported) +{ + const struct config_setting_t *setting; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "char_configuration/console")) == NULL) { + if (imported) + return true; + ShowError("char_config_read: char_configuration/console was not found in %s!\n", filename); + return false; + } + libconfig->setting_lookup_bool_real(setting, "stdout_with_ansisequence", &showmsg->stdout_with_ansisequence); + libconfig->setting_lookup_bool_real(setting, "save_log", &chr->show_save_log); + if (libconfig->setting_lookup_int(setting, "console_silent", &showmsg->silent) == CONFIG_TRUE) { + if (showmsg->silent) // only bother if its actually enabled + ShowInfo("Console Silent Setting: %d\n", showmsg->silent); + } + libconfig->setting_lookup_mutable_string(setting, "timestamp_format", showmsg->timestamp_format, sizeof(showmsg->timestamp_format)); + + return true; +} + +/** + * Reads the 'char_configuration/player' config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool char_config_read_player(const char *filename, const struct config_t *config, bool imported) +{ + bool retval = true; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if (!chr->config_read_player_new(filename, config, imported)) + retval = false; + if (!chr->config_read_player_name(filename, config, imported)) + retval = false; + if (!chr->config_read_player_deletion(filename, config, imported)) + retval = false; + if (!chr->config_read_player_fame(filename, config, imported)) + retval = false; + + return retval; +} + +/** + * Reads the 'char_configuration/player/fame' config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool char_config_read_player_fame(const char *filename, const struct config_t *config, bool imported) +{ + const struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "char_configuration/player/fame")) == NULL) { + if (imported) + return true; + ShowError("char_config_read: char_configuration/player/fame was not found in %s!\n", filename); + return false; + } + + libconfig->setting_lookup_int(setting, "alchemist", &fame_list_size_chemist); + if (fame_list_size_chemist > MAX_FAME_LIST) { + ShowWarning("Max fame list size is %d (fame_list_alchemist)\n", MAX_FAME_LIST); + fame_list_size_chemist = MAX_FAME_LIST; + } + + libconfig->setting_lookup_int(setting, "blacksmith", &fame_list_size_smith); + if (fame_list_size_smith > MAX_FAME_LIST) { + ShowWarning("Max fame list size is %d (fame_list_blacksmith)\n", MAX_FAME_LIST); + fame_list_size_smith = MAX_FAME_LIST; + } + + libconfig->setting_lookup_int(setting, "taekwon", &fame_list_size_taekwon); + if (fame_list_size_taekwon > MAX_FAME_LIST) { + ShowWarning("Max fame list size is %d (fame_list_taekwon)\n", MAX_FAME_LIST); + fame_list_size_taekwon = MAX_FAME_LIST; + } + + return true; +} + +/** + * Reads the 'char_configuration/player/deletion' config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool char_config_read_player_deletion(const char *filename, const struct config_t *config, bool imported) +{ + const struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "char_configuration/player/deletion")) == NULL) { + if (imported) + return true; + ShowError("char_config_read: char_configuration/player/deletion was not found in %s!\n", filename); + return false; + } + libconfig->setting_lookup_int(setting, "level", &char_del_level); + libconfig->setting_lookup_int(setting, "delay", &char_del_delay); + libconfig->setting_lookup_bool_real(setting, "use_aegis_delete", &char_aegis_delete); + + return true; +} + +/** + * Reads the 'char_configuration/player/name' config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool char_config_read_player_name(const char *filename, const struct config_t *config, bool imported) +{ + const struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "char_configuration/player/name")) == NULL) { + if (imported) + return true; + ShowError("char_config_read: char_configuration/player/name was not found in %s!\n", filename); + return false; + } + libconfig->setting_lookup_mutable_string(setting, "unknown_char_name", unknown_char_name, sizeof(unknown_char_name)); + libconfig->setting_lookup_mutable_string(setting, "name_letters", char_name_letters, sizeof(char_name_letters)); + libconfig->setting_lookup_int(setting, "name_option", &char_name_option); + libconfig->setting_lookup_bool_real(setting, "name_ignoring_case", &name_ignoring_case); + + return true; +} + +/** + * Defines start_items based on '(...)/player/new/start_item'. + * + * @param setting The already retrieved start_item setting. + */ +void char_config_set_start_item(const struct config_setting_t *setting) +{ + int i, count; + + nullpo_retv(setting); + + VECTOR_CLEAR(start_items); + + count = libconfig->setting_length(setting); + if (!count) + return; + + VECTOR_ENSURE(start_items, count, 1); + + for (i = 0; i < count; i++) { + const struct config_setting_t *t = libconfig->setting_get_elem(setting, i); + struct start_item_s start_item = { 0 }; + + if (t == NULL) continue; - if (sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2) != 2) + if (libconfig->setting_lookup_int(t, "id", &start_item.id) != CONFIG_TRUE) { + ShowWarning("char_config_read: entry (%d) is missing id! Ignoring...\n", i); + continue; + } + if (libconfig->setting_lookup_int(t, "amount", &start_item.amount) != CONFIG_TRUE) { + ShowWarning("char_config_read: entry (%d) is missing amount! Defaulting to 1...\n", i); + start_item.amount = 1; + } + if (libconfig->setting_lookup_bool_real(t, "stackable", &start_item.stackable) != CONFIG_TRUE) { + // Without knowing if the item is stackable or not we can't add it! + ShowWarning("char_config_read: entry (%d) is missing stackable! Ignoring...\n", i); continue; + } + if (libconfig->setting_lookup_int(t, "loc", &start_item.loc) != CONFIG_TRUE) + start_item.loc = 0; + VECTOR_PUSH(start_items, start_item); + } +} - remove_control_chars(w1); - remove_control_chars(w2); - if(strcmpi(w1,"timestamp_format") == 0) { - safestrncpy(showmsg->timestamp_format, w2, sizeof(showmsg->timestamp_format)); - } else if(strcmpi(w1,"console_silent")==0){ - showmsg->silent = atoi(w2); - if (showmsg->silent) /* only bother if its actually enabled */ - ShowInfo("Console Silent Setting: %d\n", atoi(w2)); - } else if(strcmpi(w1,"stdout_with_ansisequence")==0){ - showmsg->stdout_with_ansisequence = config_switch(w2) ? true : false; - } else if (strcmpi(w1, "userid") == 0) { - safestrncpy(chr->userid, w2, sizeof(chr->userid)); - } else if (strcmpi(w1, "passwd") == 0) { - safestrncpy(chr->passwd, w2, sizeof(chr->passwd)); - } else if (strcmpi(w1, "server_name") == 0) { - safestrncpy(chr->server_name, w2, sizeof(chr->server_name)); - } else if (strcmpi(w1, "wisp_server_name") == 0) { - if (strlen(w2) >= 4) { - safestrncpy(wisp_server_name, w2, sizeof(wisp_server_name)); - } - } else if (strcmpi(w1, "login_ip") == 0) { - login_ip = sockt->host2ip(w2); - if (login_ip) { - char ip_str[16]; - safestrncpy(login_ip_str, w2, sizeof(login_ip_str)); - ShowStatus("Login server IP address : %s -> %s\n", w2, sockt->ip2str(login_ip, ip_str)); - } - } else if (strcmpi(w1, "login_port") == 0) { - login_port = atoi(w2); - } else if (strcmpi(w1, "char_ip") == 0) { - chr->ip = sockt->host2ip(w2); - if (chr->ip) { - char ip_str[16]; - safestrncpy(char_ip_str, w2, sizeof(char_ip_str)); - ShowStatus("Character server IP address : %s -> %s\n", w2, sockt->ip2str(chr->ip, ip_str)); - } - } else if (strcmpi(w1, "bind_ip") == 0) { - bind_ip = sockt->host2ip(w2); - if (bind_ip) { - char ip_str[16]; - safestrncpy(bind_ip_str, w2, sizeof(bind_ip_str)); - ShowStatus("Character server binding IP address : %s -> %s\n", w2, sockt->ip2str(bind_ip, ip_str)); - } - } else if (strcmpi(w1, "char_port") == 0) { - chr->port = atoi(w2); - } 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); - } else if (strcmpi(w1, "char_new_display") == 0) { - chr->new_display = atoi(w2); - } else if (strcmpi(w1, "max_connect_user") == 0) { - max_connect_user = atoi(w2); - if (max_connect_user < -1) - max_connect_user = -1; // unlimited online players - } else if(strcmpi(w1, "gm_allow_group") == 0) { - gm_allow_group = atoi(w2); - } else if (strcmpi(w1, "autosave_time") == 0) { - autosave_interval = atoi(w2) * 1000; - if (autosave_interval <= 0) - autosave_interval = DEFAULT_AUTOSAVE_INTERVAL; - } else if (strcmpi(w1, "save_log") == 0) { - save_log = config_switch(w2); +/** + * Reads the 'char_configuration/player/new' config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool char_config_read_player_new(const char *filename, const struct config_t *config, bool imported) +{ + const struct config_setting_t *setting = NULL, *setting2 = NULL; +#ifdef RENEWAL + const char *start_point_setting = "start_point_re"; +#else + const char *start_point_setting = "start_point_pre"; +#endif + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "char_configuration/player/new")) == NULL) { + if (imported) + return true; + ShowError("char_config_read: char_configuration/player/new was not found in %s!\n", filename); + return false; + } + + if (libconfig->setting_lookup_int(setting, "zeny", &start_zeny) == CONFIG_TRUE) { + if (start_zeny > MAX_ZENY) { + ShowWarning("char_config_read: player/new/zeny is too big! Capping to MAX_ZENY.\n"); + start_zeny = MAX_ZENY; } - #ifdef RENEWAL - else if (strcmpi(w1, "start_point_re") == 0) { - char map[MAP_NAME_LENGTH_EXT]; - int x, y; - if (sscanf(w2, "%15[^,],%d,%d", map, &x, &y) < 3) - continue; - start_point.map = mapindex->name2id(map); - if (!start_point.map) - ShowError("Specified start_point_re '%s' not found in map-index cache.\n", map); - start_point.x = x; - start_point.y = y; - } - #else - else if (strcmpi(w1, "start_point_pre") == 0) { - char map[MAP_NAME_LENGTH_EXT]; - int x, y; - if (sscanf(w2, "%15[^,],%d,%d", map, &x, &y) < 3) - continue; - start_point.map = mapindex->name2id(map); - if (!start_point.map) - ShowError("Specified start_point_pre '%s' not found in map-index cache.\n", map); - start_point.x = x; - start_point.y = y; - } - #endif - else if (strcmpi(w1, "start_items") == 0) { - int i; - char *split; + } - i = 0; - split = strtok(w2, ","); - while (split != NULL && i < MAX_START_ITEMS * 3) { - char *split2 = split; - split = strtok(NULL, ","); - start_items[i] = atoi(split2); + if ((setting2 = libconfig->setting_get_member(setting, "start_items"))) + chr->config_set_start_item(setting2); - if (start_items[i] < 0) - start_items[i] = 0; + // start_point / start_point_pre + if ((setting2 = libconfig->setting_get_member(setting, start_point_setting))) { + const char *str = NULL; + if (libconfig->setting_lookup_string(setting2, "map", &str) == CONFIG_TRUE) { + start_point.map = mapindex->name2id(str); + if (start_point.map == 0) + ShowError("char_config_read_player_new: Specified start_point %s not found in map-index cache.\n", str); + libconfig->setting_lookup_int16(setting2, "x", &start_point.x); + libconfig->setting_lookup_int16(setting2, "y", &start_point.y); + } + } - ++i; - } + return true; +} - // Format is: id1,quantity1,stackable1,idN,quantityN,stackableN - if( i%3 ) - { - ShowWarning("chr->config_read: There are not enough parameters in start_items, ignoring last item...\n"); - if( i%3 == 1 ) - start_items[i-1] = 0; - else - start_items[i-2] = 0; - } - } else if (strcmpi(w1, "start_zeny") == 0) { - 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, "unknown_char_name") == 0) { - safestrncpy(unknown_char_name, w2, sizeof(unknown_char_name)); - unknown_char_name[NAME_LENGTH-1] = '\0'; - } else if (strcmpi(w1, "name_ignoring_case") == 0) { - name_ignoring_case = (bool)config_switch(w2); - } else if (strcmpi(w1, "char_name_option") == 0) { - char_name_option = atoi(w2); - } else if (strcmpi(w1, "char_name_letters") == 0) { - safestrncpy(char_name_letters, w2, sizeof(char_name_letters)); - } else if (strcmpi(w1, "char_del_level") == 0) { //disable/enable char deletion by its level condition [Lupus] - char_del_level = atoi(w2); - } 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); - } else if(strcmpi(w1,"db_path")==0) { - safestrncpy(db_path, w2, sizeof(db_path)); - } else if (strcmpi(w1, "fame_list_alchemist") == 0) { - fame_list_size_chemist = atoi(w2); - if (fame_list_size_chemist > MAX_FAME_LIST) { - ShowWarning("Max fame list size is %d (fame_list_alchemist)\n", MAX_FAME_LIST); - fame_list_size_chemist = MAX_FAME_LIST; - } - } else if (strcmpi(w1, "fame_list_blacksmith") == 0) { - fame_list_size_smith = atoi(w2); - if (fame_list_size_smith > MAX_FAME_LIST) { - ShowWarning("Max fame list size is %d (fame_list_blacksmith)\n", MAX_FAME_LIST); - fame_list_size_smith = MAX_FAME_LIST; - } - } else if (strcmpi(w1, "fame_list_taekwon") == 0) { - fame_list_size_taekwon = atoi(w2); - if (fame_list_size_taekwon > MAX_FAME_LIST) { - ShowWarning("Max fame list size is %d (fame_list_taekwon)\n", MAX_FAME_LIST); - fame_list_size_taekwon = MAX_FAME_LIST; - } - } else if (strcmpi(w1, "guild_exp_rate") == 0) { - guild_exp_rate = atoi(w2); - } else if (strcmpi(w1, "char_maintenance_min_group_id") == 0) { - char_maintenance_min_group_id = atoi(w2); - } else if (strcmpi(w1, "import") == 0) { - chr->config_read(w2); - } else - chr->config_dispatch(w1,w2); +/** + * Reads the 'char_configuration/permission' config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool char_config_read_permission(const char *filename, const struct config_t *config, bool imported) +{ + const struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "char_configuration/permission")) == NULL) { + if (imported) + return true; + ShowError("char_config_read: char_configuration/permission was not found in %s!\n", filename); + return false; } - fclose(fp); - ShowInfo("Done reading %s.\n", cfgName); - return 0; + libconfig->setting_lookup_bool_real(setting, "enable_char_creation", &enable_char_creation); + libconfig->setting_lookup_int16(setting, "display_new", &chr->new_display); + libconfig->setting_lookup_int(setting, "max_connect_user", &max_connect_user); + libconfig->setting_lookup_int(setting, "gm_allow_group", &gm_allow_group); + libconfig->setting_lookup_int(setting, "maintenance_min_group_id", &char_maintenance_min_group_id); + if (libconfig->setting_lookup_int(setting, "server_type", &chr->server_type) == CONFIG_TRUE) { + if (chr->server_type < CST_NORMAL || chr->server_type >= CST_MAX) { + ShowWarning("char_config_read: Invalid permission/server_type %d, defaulting to CST_NORMAL.\n", chr->server_type); + chr->server_type = CST_NORMAL; + } + } + + return true; +} + +/** + * Loads an IP into 'out_ip' and shows status. + * + * @param type[in] String containing the type of IP being set (for logging purposes). + * @param value[in] New ip value to parse. + * @param out_ip[in] Pointer to numeric value that will be changed. + * @param out_ip_str[in,out] Pointer to str value that will be changed (expected to be already initialized, to display previous value, if any). + * + * @retval false in case of error. + */ +bool char_config_set_ip(const char *type, const char *value, uint32 *out_ip, char *out_ip_str) +{ + uint32 ip = 0; + + nullpo_retr(false, type); + nullpo_retr(false, value); + nullpo_retr(false, out_ip); + nullpo_retr(false, out_ip_str); + + if ((ip = sockt->host2ip(value)) == 0) + return false; + *out_ip = ip; + + ShowStatus("%s IP address : %s -> %s\n", type, out_ip_str[0] ? out_ip_str : "0.0.0.0", sockt->ip2str(ip, NULL)); + safestrncpy(out_ip_str, value, sizeof(out_ip_str)); + return true; } int do_final(void) { @@ -5685,6 +6056,8 @@ int do_final(void) { for (i = 0; i < MAX_MAP_SERVERS; i++) VECTOR_CLEAR(chr->server[i].maps); + VECTOR_CLEAR(start_items); + aFree(chr->CHAR_CONF_NAME); aFree(chr->NET_CONF_NAME); aFree(chr->SQL_CONF_NAME); @@ -5791,10 +6164,12 @@ int do_init(int argc, char **argv) { char_load_defaults(); - chr->CHAR_CONF_NAME = aStrdup("conf/char-server.conf"); + chr->CHAR_CONF_NAME = aStrdup("conf/char/char-server.conf"); chr->NET_CONF_NAME = aStrdup("conf/network.conf"); - chr->SQL_CONF_NAME = aStrdup("conf/inter-server.conf"); - chr->INTER_CONF_NAME = aStrdup("conf/inter-server.conf"); + chr->SQL_CONF_NAME = aStrdup("conf/common/inter-server.conf"); + chr->INTER_CONF_NAME = aStrdup("conf/common/inter-server.conf"); + + VECTOR_INIT(start_items); for (i = 0; i < MAX_MAP_SERVERS; i++) VECTOR_INIT(chr->server[i].maps); @@ -5813,16 +6188,39 @@ int do_init(int argc, char **argv) { start_point.map = mapindex->name2id("new_1-1"); #endif + safestrncpy(chr->userid, "s1", sizeof(chr->userid)); + safestrncpy(chr->passwd, "p1", sizeof(chr->passwd)); + cmdline->exec(argc, argv, CMDLINE_OPT_NORMAL); - chr->config_read(chr->CHAR_CONF_NAME); + chr->config_read(chr->CHAR_CONF_NAME, false); sockt->net_config_read(chr->NET_CONF_NAME); - chr->sql_config_read(chr->SQL_CONF_NAME); + chr->sql_config_read(chr->SQL_CONF_NAME, false); + + { + // TODO: Remove this when no longer needed. +#define CHECK_OLD_LOCAL_CONF(oldname, newname) do { \ + if (stat((oldname), &fileinfo) == 0 && fileinfo.st_size > 0) { \ + ShowWarning("An old configuration file \"%s\" was found.\n", (oldname)); \ + ShowWarning("If it contains settings you wish to keep, please merge them into \"%s\".\n", (newname)); \ + ShowWarning("Otherwise, just delete it.\n"); \ + ShowInfo("Resuming in 10 seconds...\n"); \ + HSleep(10); \ + } \ +} while (0) + struct stat fileinfo; + + CHECK_OLD_LOCAL_CONF("conf/import/char_conf.txt", "conf/import/char-server.conf"); + CHECK_OLD_LOCAL_CONF("conf/import/inter_conf.txt", "conf/import/inter-server.conf"); + CHECK_OLD_LOCAL_CONF("conf/import/packet_conf.txt", "conf/import/socket.conf"); + +#undef CHECK_OLD_LOCAL_CONF + } #ifndef BUILDBOT if (strcmp(chr->userid, "s1")==0 && strcmp(chr->passwd, "p1")==0) { ShowWarning("Using the default user/password s1/p1 is NOT RECOMMENDED.\n"); ShowNotice("Please edit your 'login' table to create a proper inter-server user/password (gender 'S')\n"); - ShowNotice("And then change the user/password to use in conf/char-server.conf (or conf/import/char_conf.txt)\n"); + ShowNotice("And then change the user/password to use in conf/char/char-server.conf (or conf/import/char-server.conf)\n"); } #endif @@ -5947,6 +6345,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; @@ -6103,6 +6504,20 @@ void char_defaults(void) chr->online_data_cleanup_sub = char_online_data_cleanup_sub; chr->online_data_cleanup = char_online_data_cleanup; chr->sql_config_read = char_sql_config_read; - chr->config_dispatch = char_config_dispatch; + chr->sql_config_read_registry = char_sql_config_read_registry; + chr->sql_config_read_pc = char_sql_config_read_pc; + chr->sql_config_read_guild = char_sql_config_read_guild; chr->config_read = char_config_read; + chr->config_read_database = char_config_read_database; + chr->config_read_console = char_config_read_console; + chr->config_read_player_fame = char_config_read_player_fame; + chr->config_read_player_deletion = char_config_read_player_deletion; + chr->config_read_player_name = char_config_read_player_name; + chr->config_set_start_item = char_config_set_start_item; + chr->config_read_player_new = char_config_read_player_new; + chr->config_read_player = char_config_read_player; + chr->config_read_permission = char_config_read_permission; + chr->config_set_ip = char_config_set_ip; + chr->config_read_inter = char_config_read_inter; + chr->config_read_top = char_config_read_top; } diff --git a/src/char/char.h b/src/char/char.h index a0cfb3bd7..4dbdfd9db 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 @@ -26,6 +26,10 @@ #include "common/db.h" #include "common/mmo.h" +/* Forward Declarations */ +struct config_setting_t; // common/conf.h +struct config_t; // common/conf.h + enum E_CHARSERVER_ST { CHARSERVER_ST_RUNNING = CORE_ST_LAST, CHARSERVER_ST_SHUTDOWN, @@ -110,13 +114,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); @@ -272,9 +279,24 @@ struct char_interface { int (*check_connect_login_server) (int tid, int64 tick, int id, intptr_t data); int (*online_data_cleanup_sub) (union DBKey key, struct DBData *data, va_list ap); int (*online_data_cleanup) (int tid, int64 tick, int id, intptr_t data); - void (*sql_config_read) (const char* cfgName); - void (*config_dispatch) (char *w1, char *w2); - int (*config_read) (const char* cfgName); + + bool (*sql_config_read) (const char *filename, bool imported); + bool (*sql_config_read_registry) (const char *filename, const struct config_t *config, bool imported); + bool (*sql_config_read_pc) (const char *filename, const struct config_t *config, bool imported); + bool (*sql_config_read_guild) (const char *filename, const struct config_t *config, bool imported); + bool (*config_read) (const char *filename, bool imported); + bool (*config_read_database) (const char *filename, const struct config_t *config, bool imported); + bool (*config_read_console) (const char *filename, const struct config_t *config, bool imported); + bool (*config_read_player_fame) (const char *filename, const struct config_t *config, bool imported); + bool (*config_read_player_deletion) (const char *filename, const struct config_t *config, bool imported); + bool (*config_read_player_name) (const char *filename, const struct config_t *config, bool imported); + void (*config_set_start_item) (const struct config_setting_t *setting); + bool (*config_read_player_new) (const char *filename, const struct config_t *config, bool imported); + bool (*config_read_player) (const char *filename, const struct config_t *config, bool imported); + bool (*config_read_permission) (const char *filename, const struct config_t *config, bool imported); + bool (*config_set_ip) (const char *type, const char *value, uint32 *out_ip, char *out_ip_str); + bool (*config_read_inter) (const char *filename, const struct config_t *config, bool imported); + bool (*config_read_top) (const char *filename, const struct config_t *config, bool imported); }; #ifdef HERCULES_CORE @@ -282,7 +304,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 +339,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..4c5eb05e5 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 @@ -36,6 +36,7 @@ #include "char/int_storage.h" #include "char/mapif.h" #include "common/cbasetypes.h" +#include "common/conf.h" #include "common/db.h" #include "common/memmgr.h" #include "common/mmo.h" @@ -62,7 +63,7 @@ char char_server_pw[100] = "ragnarok"; char char_server_db[32] = "ragnarok"; char default_codepage[32] = ""; //Feature by irmin. -unsigned int party_share_level = 10; +int party_share_level = 10; // recv. packet list int inter_recv_packet_length[] = { @@ -791,50 +792,84 @@ int inter_accreg_fromsql(int account_id,int char_id, int fd, int type) return 1; } -/*========================================== - * read config file - *------------------------------------------*/ -static int inter_config_read(const char* cfgName) +/** + * Reads the 'char_configuration/sql_connection' config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool inter_config_read_connection(const char *filename, const struct config_t *config, bool imported) { - char line[1024], w1[1024], w2[1024]; - FILE* fp; + const struct config_setting_t *setting = NULL; - nullpo_retr(1, cfgName); - fp = fopen(cfgName, "r"); - if(fp == NULL) { - ShowError("File not found: %s\n", cfgName); - return 1; + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "char_configuration/sql_connection")) == NULL) { + if (imported) + return true; + ShowError("char_config_read: char_configuration/sql_connection was not found in %s!\n", filename); + ShowWarning("inter_config_read_connection: Defaulting sql_connection...\n"); + return false; } - while (fgets(line, sizeof(line), fp)) { - int i = sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2); - if(i != 2) - continue; + libconfig->setting_lookup_int(setting, "db_port", &char_server_port); + libconfig->setting_lookup_mutable_string(setting, "db_hostname", char_server_ip, sizeof(char_server_ip)); + libconfig->setting_lookup_mutable_string(setting, "db_username", char_server_id, sizeof(char_server_id)); + libconfig->setting_lookup_mutable_string(setting, "db_password", char_server_pw, sizeof(char_server_pw)); + libconfig->setting_lookup_mutable_string(setting, "db_database", char_server_db, sizeof(char_server_db)); + libconfig->setting_lookup_mutable_string(setting, "default_codepage", default_codepage, sizeof(default_codepage)); + + return true; +} - if(!strcmpi(w1,"char_server_ip")) { - safestrncpy(char_server_ip, w2, sizeof(char_server_ip)); - } else if(!strcmpi(w1,"char_server_port")) { - char_server_port = atoi(w2); - } else if(!strcmpi(w1,"char_server_id")) { - safestrncpy(char_server_id, w2, sizeof(char_server_id)); - } else if(!strcmpi(w1,"char_server_pw")) { - safestrncpy(char_server_pw, w2, sizeof(char_server_pw)); - } else if(!strcmpi(w1,"char_server_db")) { - safestrncpy(char_server_db, w2, sizeof(char_server_db)); - } else if(!strcmpi(w1,"default_codepage")) { - safestrncpy(default_codepage, w2, sizeof(default_codepage)); - } else if(!strcmpi(w1,"party_share_level")) - party_share_level = atoi(w2); - else if(!strcmpi(w1,"log_inter")) - log_inter = atoi(w2); - else if(!strcmpi(w1,"import")) - inter->config_read(w2); +/** + * Reads the 'inter_configuration' config file and initializes required variables. + * + * @param filename Path to configuration file + * @param imported Whether the current config is from an imported file. + * + * @retval false in case of error. + */ +bool inter_config_read(const char *filename, bool imported) +{ + struct config_t config; + const struct config_setting_t *setting = NULL; + const char *import = NULL; + bool retval = true; + + nullpo_retr(false, filename); + + if (!libconfig->load_file(&config, filename)) + return false; + + if ((setting = libconfig->lookup(&config, "inter_configuration")) == NULL) { + libconfig->destroy(&config); + if (imported) + return true; + ShowError("inter_config_read: inter_configuration was not found in %s!\n", filename); + return false; } - fclose(fp); + libconfig->setting_lookup_int(setting, "party_share_level", &party_share_level); + libconfig->setting_lookup_bool_real(setting, "log_inter", &inter->enable_logs); - ShowInfo ("Done reading %s.\n", cfgName); + ShowInfo("Done reading %s.\n", filename); - return 0; + // import should overwrite any previous configuration, so it should be called last + if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) { + if (strcmp(import, filename) == 0 || strcmp(import, chr->INTER_CONF_NAME) == 0) { + ShowWarning("inter_config_read: Loop detected in %s! Skipping 'import'...\n", filename); + } else { + if (!inter->config_read(import, true)) + retval = false; + } + } + + libconfig->destroy(&config); + return retval; } /** @@ -879,9 +914,7 @@ int inter_log(char* fmt, ...) // initialize int inter_init_sql(const char *file) { - //int i; - - inter->config_read(file); + inter->config_read(file, false); //DB connection initialized inter->sql_handle = SQL->Malloc(); @@ -1364,6 +1397,7 @@ void inter_defaults(void) { inter = &inter_s; + inter->enable_logs = true; inter->sql_handle = NULL; inter->msg_txt = inter_msg_txt; @@ -1384,4 +1418,5 @@ void inter_defaults(void) inter->check_length = inter_check_length; inter->parse_frommap = inter_parse_frommap; inter->final = inter_final; + inter->config_read_connection = inter_config_read_connection; } diff --git a/src/char/inter.h b/src/char/inter.h index 4e8d113ce..57d1db86c 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 @@ -28,11 +28,13 @@ /* Forward Declarations */ struct Sql; // common/sql.h +struct config_t; // common/conf.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); @@ -42,7 +44,6 @@ struct inter_interface { void (*msg_to_fd) (int fd, int u_fd, int aid, char *msg, ...) __attribute__((format(printf, 4, 5))); void (*savereg) (int account_id, int char_id, const char *key, unsigned int index, intptr_t val, bool is_string); int (*accreg_fromsql) (int account_id,int char_id, int fd, int type); - int (*config_read) (const char* cfgName); int (*vlog) (char* fmt, va_list ap); int (*log) (char* fmt, ...); int (*init_sql) (const char *file); @@ -52,10 +53,12 @@ struct inter_interface { int (*check_length) (int fd, int length); int (*parse_frommap) (int fd); void (*final) (void); + bool (*config_read) (const char *filename, bool imported); + bool (*config_read_connection) (const char *filename, const struct config_t *config, bool imported); }; #ifdef HERCULES_CORE -extern unsigned int party_share_level; +extern int party_share_level; ///< Share range for parties. void inter_defaults(void); #endif // HERCULES_CORE diff --git a/src/char/pincode.c b/src/char/pincode.c index 6930a7a57..fc1a4c037 100644 --- a/src/char/pincode.c +++ b/src/char/pincode.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 @@ -24,6 +24,7 @@ #include "char/char.h" #include "common/cbasetypes.h" +#include "common/conf.h" #include "common/db.h" #include "common/mmo.h" #include "common/nullpo.h" @@ -178,33 +179,52 @@ void pincode_decrypt(unsigned int userSeed, char* pin) { sprintf(pin, "%d%d%d%d", pin[0], pin[1], pin[2], pin[3]); } -bool pincode_config_read(char *w1, char *w2) { +/** + * Reads the 'char_configuration/pincode' config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool pincode_config_read(const char *filename, const struct config_t *config, bool imported) +{ + const struct config_setting_t *setting = NULL; + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "char_configuration/pincode")) == NULL) { + if (imported) + return true; + ShowError("char_config_read: char_configuration/pincode was not found in %s!\n", filename); + return false; + } - nullpo_ret(w1); - nullpo_ret(w2); - while ( true ) { - if ( strcmpi(w1, "pincode_enabled") == 0 ) { - pincode->enabled = atoi(w2); + if (libconfig->setting_lookup_bool(setting, "enabled", &pincode->enabled) == CONFIG_TRUE) { #if PACKETVER < 20110309 - if( pincode->enabled ) { - ShowWarning("pincode_enabled requires PACKETVER 20110309 or higher. disabling...\n"); - pincode->enabled = 0; - } + if (pincode->enabled) { + ShowWarning("pincode_enabled requires PACKETVER 20110309 or higher. disabling...\n"); + pincode->enabled = 0; + } #endif - } else if ( strcmpi(w1, "pincode_changetime") == 0 ) { - pincode->changetime = atoi(w2)*60; - } else if ( strcmpi(w1, "pincode_maxtry") == 0 ) { - pincode->maxtry = atoi(w2); - if( pincode->maxtry > 3 ) { - ShowWarning("pincode_maxtry is too high (%d); maximum allowed: 3! capping to 3...\n", pincode->maxtry); - pincode->maxtry = 3; - } - } else if ( strcmpi(w1, "pincode_charselect") == 0 ) { - pincode->charselect = atoi(w2); - } else { - return false; + } + + if (libconfig->setting_lookup_int(setting, "change_time", &pincode->changetime) == CONFIG_TRUE) + pincode->changetime *= 60; + + if (libconfig->setting_lookup_int(setting, "max_tries", &pincode->maxtry) == CONFIG_TRUE) { + if (pincode->maxtry > 3) { + ShowWarning("pincode_maxtry is too high (%d); Maximum allowed: 3! Capping to 3...\n",pincode->maxtry); + pincode->maxtry = 3; + } + } + + if (libconfig->setting_lookup_int(setting, "request", &pincode->charselect) == CONFIG_TRUE) { + if (pincode->charselect != 1 && pincode->charselect != 0) { + ShowWarning("Invalid pincode/request! Defaulting to 0\n"); + pincode->charselect = 0; } - break; } return true; diff --git a/src/char/pincode.h b/src/char/pincode.h index fb0c1a9c4..cffaa3054 100644 --- a/src/char/pincode.h +++ b/src/char/pincode.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 @@ -23,7 +23,9 @@ #include "common/hercules.h" +/* Forward Declarations */ struct char_session_data; +struct config_t; // common/conf.h enum PincodeResponseCode { PINCODE_OK = 0, @@ -55,7 +57,7 @@ struct pincode_interface { void (*change) (int fd, struct char_session_data* sd); int (*compare) (int fd, struct char_session_data* sd, char* pin); void (*check) (int fd, struct char_session_data* sd); - bool (*config_read) (char *w1, char *w2); + bool (*config_read) (const char *filename, const struct config_t *config, bool imported); }; #ifdef HERCULES_CORE diff --git a/src/common/HPM.c b/src/common/HPM.c index 8e0bbe992..a134a4822 100644 --- a/src/common/HPM.c +++ b/src/common/HPM.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2015 Hercules Dev Team + * Copyright (C) 2013-2016 Hercules Dev Team * * Hercules is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -407,7 +407,7 @@ bool hpm_add_arg(unsigned int pluginID, char *name, bool has_param, CmdlineExecF * @retval true if the listener was added successfully. * @retval false in case of error. */ -bool hplugins_addconf(unsigned int pluginID, enum HPluginConfType type, char *name, void (*parse_func) (const char *key, const char *val), int (*return_func) (const char *key)) +bool hplugins_addconf(unsigned int pluginID, enum HPluginConfType type, char *name, void (*parse_func) (const char *key, const char *val), int (*return_func) (const char *key), bool required) { struct HPConfListenStorage *conf; int i; @@ -442,6 +442,7 @@ bool hplugins_addconf(unsigned int pluginID, enum HPluginConfType type, char *na safestrncpy(conf->key, name, HPM_ADDCONF_LENGTH); conf->parse_func = parse_func; conf->return_func = return_func; + conf->required = required; return true; } @@ -859,6 +860,52 @@ bool hplugins_get_battle_conf(const char *w1, int *value) } /** + * Parses battle config entries registered by plugins. + * + * @param config The configuration file to parse. + * @param filename Path to configuration file. + * @param imported Whether the current config is imported from another file. + * @retval false in case of error. + */ +bool hplugins_parse_battle_conf(const struct config_t *config, const char *filename, bool imported) +{ + const struct config_setting_t *setting = NULL; + int i, val, type; + char str[1024]; + bool retval = true; + + nullpo_retr(false, config); + + for (i = 0; i < VECTOR_LENGTH(HPM->config_listeners[HPCT_BATTLE]); i++) { + const struct HPConfListenStorage *entry = &VECTOR_INDEX(HPM->config_listeners[HPCT_BATTLE], i); + const char *config_name = entry->key; + if ((setting = libconfig->lookup(config, config_name)) == NULL) { + if (!imported && entry->required) { + ShowWarning("Missing configuration '%s' in file %s!\n", config_name, filename); + retval = false; + } + continue; + } + + switch ((type = config_setting_type(setting))) { + case CONFIG_TYPE_INT: + val = libconfig->setting_get_int(setting); + break; + case CONFIG_TYPE_BOOL: + val = libconfig->setting_get_bool(setting); + break; + default: // Unsupported type + ShowWarning("Setting %s has unsupported type %d, ignoring...\n", config_name, type); + retval = false; + continue; + } + sprintf(str, "%d", val); // FIXME: Remove this when support to int's as value is added + entry->parse_func(config_name, str); + } + return retval; +} + +/** * Helper to destroy an interface's hplugin_data store and release any owned memory. * * The pointer will be cleared. @@ -1074,6 +1121,7 @@ void hpm_defaults(void) HPM->parse_packets = hplugins_parse_packets; HPM->load_sub = NULL; HPM->parseConf = hplugins_parse_conf; + HPM->parse_battle_conf = hplugins_parse_battle_conf; HPM->getBattleConf = hplugins_get_battle_conf; HPM->DataCheck = HPM_DataCheck; HPM->datacheck_init = HPM_datacheck_init; diff --git a/src/common/HPM.h b/src/common/HPM.h index 0b1275fde..43f610a6a 100644 --- a/src/common/HPM.h +++ b/src/common/HPM.h @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2013-2015 Hercules Dev Team + * Copyright (C) 2013-2016 Hercules Dev Team * * Hercules is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -65,7 +65,9 @@ #endif // WIN32 +/* Forward Declarations */ struct HPMHooking_core_interface; +struct config_t; struct hplugin { DLL dll; @@ -121,6 +123,7 @@ struct HPConfListenStorage { char key[HPM_ADDCONF_LENGTH]; void (*parse_func) (const char *key, const char *val); int (*return_func) (const char *key); + bool required; }; /* Hercules Plugin Manager Interface */ @@ -155,6 +158,7 @@ struct HPM_interface { void *(*import_symbol) (char *name, unsigned int pID); void (*share) (void *value, const char *name); void (*config_read) (void); + bool (*parse_battle_conf) (const struct config_t *config, const char *filename, bool imported); char *(*pid2name) (unsigned int pid); unsigned char (*parse_packets) (int fd, int packet_id, enum HPluginPacketHookingPoints point); void (*load_sub) (struct hplugin *plugin); diff --git a/src/common/HPMi.h b/src/common/HPMi.h index e16eb1d75..19b9b20a5 100644 --- a/src/common/HPMi.h +++ b/src/common/HPMi.h @@ -188,19 +188,19 @@ enum HPluginConfType { /* HPMi->addPacket */ #define addPacket(cmd,len,receive,point) HPMi->addPacket(cmd,len,receive,point,HPMi->pid) /* HPMi->addBattleConf */ -#define addBattleConf(bcname,funcname,returnfunc) HPMi->addConf(HPMi->pid,HPCT_BATTLE,bcname,funcname,returnfunc) +#define addBattleConf(bcname, funcname, returnfunc, required) HPMi->addConf(HPMi->pid, HPCT_BATTLE, bcname, funcname, returnfunc, required) /* HPMi->addLogin */ -#define addLoginConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_LOGIN,bcname,funcname,NULL) +#define addLoginConf(bcname, funcname) HPMi->addConf(HPMi->pid, HPCT_LOGIN, bcname, funcname, NULL, false) /* HPMi->addChar */ -#define addCharConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_CHAR,bcname,funcname,NULL) +#define addCharConf(bcname, funcname) HPMi->addConf(HPMi->pid, HPCT_CHAR, bcname, funcname, NULL, false) /* HPMi->addCharInter */ -#define addCharInterConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_CHAR_INTER,bcname,funcname,NULL) +#define addCharInterConf(bcname, funcname) HPMi->addConf(HPMi->pid, HPCT_CHAR_INTER, bcname, funcname, NULL, false) /* HPMi->addMapInter */ -#define addMapInterConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_MAP_INTER,bcname,funcname,NULL) +#define addMapInterConf(bcname, funcname) HPMi->addConf(HPMi->pid, HPCT_MAP_INTER, bcname, funcname, NULL, false) /* HPMi->addLog */ -#define addLogConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_LOG,bcname,funcname,NULL) +#define addLogConf(bcname, funcname) HPMi->addConf(HPMi->pid, HPCT_LOG, bcname, funcname, NULL, false) /* HPMi->addScript */ -#define addScriptConf(bcname,funcname) HPMi->addConf(HPMi->pid,HPCT_SCRIPT,bcname,funcname,NULL) +#define addScriptConf(bcname, funcname) HPMi->addConf(HPMi->pid, HPCT_SCRIPT, bcname, funcname, NULL, false) /* HPMi->addPCGPermission */ #define addGroupPermission(pcgname,maskptr) HPMi->addPCGPermission(HPMi->pid,pcgname,&maskptr) @@ -223,7 +223,7 @@ struct HPMi_interface { /* program --arg/-a */ bool (*addArg) (unsigned int pluginID, char *name, bool has_param, CmdlineExecFunc func, const char *help); /* battle-config recv param */ - bool (*addConf) (unsigned int pluginID, enum HPluginConfType type, char *name, void (*parse_func) (const char *key, const char *val), int (*return_func) (const char *key)); + bool (*addConf) (unsigned int pluginID, enum HPluginConfType type, char *name, void (*parse_func) (const char *key, const char *val), int (*return_func) (const char *key), bool required); /* pc group permission */ void (*addPCGPermission) (unsigned int pluginID, char *name, unsigned int *mask); diff --git a/src/common/mmo.h b/src/common/mmo.h index 0a5d9d053..77f706f0d 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -185,9 +185,6 @@ #ifndef MAX_QUEST_OBJECTIVES #define MAX_QUEST_OBJECTIVES 3 // Max quest objectives for a quest #endif -#ifndef MAX_START_ITEMS -#define MAX_START_ITEMS 32 // Max number of items allowed to be given to a char whenever it's created. [mkbu95] -#endif // for produce #define MIN_ATTRIBUTE 0 @@ -360,7 +357,7 @@ enum equip_pos { struct point { unsigned short map; - short x,y; + int16 x, y; }; enum e_skill_flag @@ -1068,6 +1065,7 @@ enum e_char_server_type { CST_OVER18 = 2, CST_PAYING = 3, CST_F2P = 4, + CST_MAX, }; enum e_pc_reg_loading { diff --git a/src/common/socket.c b/src/common/socket.c index af5e8aa73..cee2875d5 100644 --- a/src/common/socket.c +++ b/src/common/socket.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 @@ -80,6 +80,8 @@ struct socket_interface *sockt; struct socket_data **session; +const char *SOCKET_CONF_FILENAME = "conf/common/socket.conf"; + #ifdef SEND_SHORTLIST // Add a fd to the shortlist so that it'll be recognized as a fd that needs // sending done on it. @@ -1059,17 +1061,19 @@ int do_sockets(int next) ////////////////////////////// // IP rules and DDoS protection -typedef struct connect_history { +struct connect_history { uint32 ip; int64 tick; int count; unsigned ddos : 1; -} ConnectHistory; +}; -typedef struct access_control { +struct access_control { uint32 ip; uint32 mask; -} AccessControl; +}; + +VECTOR_STRUCT_DECL(access_control_list, struct access_control); enum aco { ACO_DENY_ALLOW, @@ -1077,11 +1081,9 @@ enum aco { ACO_MUTUAL_FAILURE }; -static AccessControl* access_allow = NULL; -static AccessControl* access_deny = NULL; +static struct access_control_list access_allow; +static struct access_control_list access_deny; static int access_order = ACO_DENY_ALLOW; -static int access_allownum = 0; -static int access_denynum = 0; static int access_debug = 0; static int ddos_count = 10; static int ddos_interval = 3*1000; @@ -1106,33 +1108,35 @@ static int connect_check(uint32 ip) /// 1 or 2 : Connection Accepted static int connect_check_(uint32 ip) { - ConnectHistory* hist = NULL; + struct connect_history *hist = NULL; int i; int is_allowip = 0; int is_denyip = 0; int connect_ok = 0; // Search the allow list - for( i=0; i < access_allownum; ++i ){ - if (SUBNET_MATCH(ip, access_allow[i].ip, access_allow[i].mask)) { - if( access_debug ){ + for (i = 0; i < VECTOR_LENGTH(access_allow); ++i) { + struct access_control *entry = &VECTOR_INDEX(access_allow, i); + if (SUBNET_MATCH(ip, entry->ip, entry->mask)) { + if (access_debug) { ShowInfo("connect_check: Found match from allow list:%u.%u.%u.%u IP:%u.%u.%u.%u Mask:%u.%u.%u.%u\n", CONVIP(ip), - CONVIP(access_allow[i].ip), - CONVIP(access_allow[i].mask)); + CONVIP(entry->ip), + CONVIP(entry->mask)); } is_allowip = 1; break; } } // Search the deny list - for( i=0; i < access_denynum; ++i ){ - if (SUBNET_MATCH(ip, access_deny[i].ip, access_deny[i].mask)) { - if( access_debug ){ + for (i = 0; i < VECTOR_LENGTH(access_deny); ++i) { + struct access_control *entry = &VECTOR_INDEX(access_deny, i); + if (SUBNET_MATCH(ip, entry->ip, entry->mask)) { + if (access_debug) { ShowInfo("connect_check: Found match from deny list:%u.%u.%u.%u IP:%u.%u.%u.%u Mask:%u.%u.%u.%u\n", CONVIP(ip), - CONVIP(access_deny[i].ip), - CONVIP(access_deny[i].mask)); + CONVIP(entry->ip), + CONVIP(entry->mask)); } is_denyip = 1; break; @@ -1187,7 +1191,7 @@ static int connect_check_(uint32 ip) } } // IP not found, add to history - CREATE(hist, ConnectHistory, 1); + CREATE(hist, struct connect_history, 1); hist->ip = ip; hist->tick = timer->gettick(); uidb_put(connect_history, ip, hist); @@ -1199,7 +1203,7 @@ static int connect_check_(uint32 ip) static int connect_check_clear(int tid, int64 tick, int id, intptr_t data) { int clear = 0; int list = 0; - ConnectHistory *hist = NULL; + struct connect_history *hist = NULL; struct DBIterator *iter; if( !db_size(connect_history) ) @@ -1227,7 +1231,7 @@ static int connect_check_clear(int tid, int64 tick, int id, intptr_t data) { /// Parses the ip address and mask and puts it into acc. /// Returns 1 is successful, 0 otherwise. -int access_ipmask(const char* str, AccessControl* acc) +int access_ipmask(const char *str, struct access_control *acc) { uint32 ip; uint32 mask; @@ -1270,82 +1274,210 @@ int access_ipmask(const char* str, AccessControl* acc) acc->mask = mask; return 1; } + +/** + * Adds an entry to the access list. + * + * @param setting The setting to read from. + * @param list_name The list name (used in error messages). + * @param access_list The access list to edit. + * + * @retval false in case of failure + */ +bool access_list_add(struct config_setting_t *setting, const char *list_name, struct access_control_list *access_list) +{ + const char *temp = NULL; + int i, setting_length; + + nullpo_retr(false, setting); + nullpo_retr(false, list_name); + nullpo_retr(false, access_list); + + if ((setting_length = libconfig->setting_length(setting)) <= 0) + return false; + + VECTOR_ENSURE(*access_list, setting_length, 1); + for (i = 0; i < setting_length; i++) { + struct access_control acc; + if ((temp = libconfig->setting_get_string_elem(setting, i)) == NULL) { + continue; + } + + if (!access_ipmask(temp, &acc)) { + ShowError("access_list_add: Invalid ip or ip range %s '%d'!\n", list_name, i); + continue; + } + VECTOR_PUSH(*access_list, acc); + } + + return true; +} + ////////////////////////////// #endif // MINICORE ////////////////////////////// -int socket_config_read(const char* cfgName) +/** + * Reads 'socket_configuration/ip_rules' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool socket_config_read_iprules(const char *filename, struct config_t *config, bool imported) { - char line[1024],w1[1024],w2[1024]; - FILE *fp; +#ifndef MINICORE + struct config_setting_t *setting = NULL; + const char *temp = NULL; - fp = fopen(cfgName, "r"); - if(fp == NULL) { - ShowError("File not found: %s\n", cfgName); - return 1; + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "socket_configuration/ip_rules")) == NULL) { + if (imported) + return true; + ShowError("socket_config_read: socket_configuration/ip_rules was not found in %s!\n", filename); + return false; } + libconfig->setting_lookup_bool(setting, "enable", &ip_rules); - while (fgets(line, sizeof(line), fp)) { - if(line[0] == '/' && line[1] == '/') - continue; - if (sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2) != 2) - continue; + if (!ip_rules) + return true; - if (!strcmpi(w1, "stall_time")) { - sockt->stall_time = atoi(w2); - if( sockt->stall_time < 3 ) - sockt->stall_time = 3;/* a minimum is required to refrain it from killing itself */ - } -#ifdef SOCKET_EPOLL - else if(!strcmpi(w1, "epoll_maxevents")) { - epoll_maxevents = atoi(w2); - if(epoll_maxevents < 16){ - epoll_maxevents = 16; // minimum that seems to be useful - } + if (libconfig->setting_lookup_string(setting, "order", &temp) == CONFIG_TRUE) { + if (strcmpi(temp, "deny,allow" ) == 0) { + access_order = ACO_DENY_ALLOW; + } else if (strcmpi(temp, "allow, deny") == 0) { + access_order = ACO_ALLOW_DENY; + } else if (strcmpi(temp, "mutual-failure") == 0) { + access_order = ACO_MUTUAL_FAILURE; + } else { + ShowWarning("socket_config_read: invalid value '%s' for socket_configuration/ip_rules/order.\n", temp); } + } + + if ((setting = libconfig->lookup(config, "socket_configuration/ip_rules/allow_list")) == NULL) { + if (!imported) + ShowError("socket_config_read: socket_configuration/ip_rules/allow_list was not found in %s!\n", filename); + } else { + access_list_add(setting, "allow_list", &access_allow); + } + + if ((setting = libconfig->lookup(config, "socket_configuration/ip_rules/deny_list")) == NULL) { + if (!imported) + ShowError("socket_config_read: socket_configuration/ip_rules/deny_list was not found in %s!\n", filename); + } else { + access_list_add(setting, "deny_list", &access_deny); + } +#endif // ! MINICORE + + return true; +} + +/** + * Reads 'socket_configuration/ddos' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool socket_config_read_ddos(const char *filename, struct config_t *config, bool imported) +{ +#ifndef MINICORE + struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "socket_configuration/ddos")) == NULL) { + if (imported) + return true; + ShowError("socket_config_read: socket_configuration/ddos was not found in %s!\n", filename); + return false; + } + + libconfig->setting_lookup_int(setting, "interval", &ddos_interval); + libconfig->setting_lookup_int(setting, "count", &ddos_count); + libconfig->setting_lookup_int(setting, "autoreset", &ddos_autoreset); + +#endif // ! MINICORE + return true; +} + +/** + * Reads 'socket_configuration' and initializes required variables. + * + * @param filename Path to configuration file. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool socket_config_read(const char *filename, bool imported) +{ + struct config_t config; + struct config_setting_t *setting = NULL; + const char *import; + int i32 = 0; + bool retval = true; + + nullpo_retr(false, filename); + + if (!libconfig->load_file(&config, filename)) + return false; + + if ((setting = libconfig->lookup(&config, "socket_configuration")) == NULL) { + libconfig->destroy(&config); + if (imported) + return true; + ShowError("socket_config_read: socket_configuration was not found in %s!\n", filename); + return false; + } + + if (libconfig->setting_lookup_int(setting, "stall_time", &i32) == CONFIG_TRUE) { + if (i32 < 3) + i32 = 3; /* a minimum is required in order to refrain from killing itself */ + sockt->stall_time = i32; + } + +#ifdef SOCKET_EPOLL + if (libconfig->setting_lookup_int(setting, "epoll_maxevents", &i32) == CONFIG_TRUE) { + if (i32 < 16) + i32 = 16; // minimum that seems to be useful + epoll_maxevents = i32; + } #endif // SOCKET_EPOLL + #ifndef MINICORE - else if (!strcmpi(w1, "enable_ip_rules")) { - ip_rules = config_switch(w2); - } else if (!strcmpi(w1, "order")) { - if (!strcmpi(w2, "deny,allow")) - access_order = ACO_DENY_ALLOW; - else if (!strcmpi(w2, "allow,deny")) - access_order = ACO_ALLOW_DENY; - else if (!strcmpi(w2, "mutual-failure")) - access_order = ACO_MUTUAL_FAILURE; - } else if (!strcmpi(w1, "allow")) { - RECREATE(access_allow, AccessControl, access_allownum+1); - if (access_ipmask(w2, &access_allow[access_allownum])) - ++access_allownum; - else - ShowError("socket_config_read: Invalid ip or ip range '%s'!\n", line); - } else if (!strcmpi(w1, "deny")) { - RECREATE(access_deny, AccessControl, access_denynum+1); - if (access_ipmask(w2, &access_deny[access_denynum])) - ++access_denynum; - else - ShowError("socket_config_read: Invalid ip or ip range '%s'!\n", line); + { + uint32 ui32 = 0; + libconfig->setting_lookup_bool(setting, "debug", &access_debug); + if (libconfig->setting_lookup_uint32(setting, "socket_max_client_packet", &ui32) == CONFIG_TRUE) { + socket_max_client_packet = ui32; } - else if (!strcmpi(w1,"ddos_interval")) - ddos_interval = atoi(w2); - else if (!strcmpi(w1,"ddos_count")) - ddos_count = atoi(w2); - else if (!strcmpi(w1,"ddos_autoreset")) - ddos_autoreset = atoi(w2); - else if (!strcmpi(w1,"debug")) - access_debug = config_switch(w2); - else if (!strcmpi(w1,"socket_max_client_packet")) - socket_max_client_packet = strtoul(w2, NULL, 0); -#endif // MINICORE - else if (!strcmpi(w1, "import")) - socket_config_read(w2); - else - ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName); } - fclose(fp); - return 0; + if (!socket_config_read_iprules(filename, &config, imported)) + retval = false; + if (!socket_config_read_ddos(filename, &config, imported)) + retval = false; +#endif // MINICORE + + // import should overwrite any previous configuration, so it should be called last + if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) { + if (strcmp(import, filename) == 0 || strcmp(import, SOCKET_CONF_FILENAME) == 0) { + ShowWarning("socket_config_read: Loop detected! Skipping 'import'...\n"); + } else { + if (!socket_config_read(import, true)) + retval = false; + } + } + + libconfig->destroy(&config); + return retval; } void socket_final(void) @@ -1354,10 +1486,8 @@ void socket_final(void) #ifndef MINICORE if( connect_history ) db_destroy(connect_history); - if( access_allow ) - aFree(access_allow); - if( access_deny ) - aFree(access_deny); + VECTOR_CLEAR(access_allow); + VECTOR_CLEAR(access_deny); #endif // MINICORE for( i = 1; i < sockt->fd_max; i++ ) @@ -1496,7 +1626,6 @@ int socket_getips(uint32* ips, int max) void socket_init(void) { - char *SOCKET_CONF_FILENAME = "conf/packet.conf"; uint64 rlim_cur = FD_SETSIZE; #ifdef WIN32 @@ -1544,10 +1673,15 @@ void socket_init(void) } #endif // defined(HAVE_SETRLIMIT) && !defined(CYGWIN) +#ifndef MINICORE + VECTOR_INIT(access_allow); + VECTOR_INIT(access_deny); +#endif // ! MINICORE + // Get initial local ips sockt->naddr_ = sockt->getips(sockt->addr_,16); - socket_config_read(SOCKET_CONF_FILENAME); + socket_config_read(SOCKET_CONF_FILENAME, false); #ifndef SOCKET_EPOLL // Select based Event Dispatcher: diff --git a/src/common/sql.c b/src/common/sql.c index 9a90f9807..be0bd43e3 100644 --- a/src/common/sql.c +++ b/src/common/sql.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 @@ -23,7 +23,9 @@ #include "sql.h" #include "common/cbasetypes.h" +#include "common/conf.h" #include "common/memmgr.h" +#include "common/nullpo.h" #include "common/showmsg.h" #include "common/strlib.h" #include "common/timer.h" @@ -37,8 +39,8 @@ void hercules_mysql_error_handler(unsigned int ecode); -int mysql_reconnect_type; -unsigned int mysql_reconnect_count; +int mysql_reconnect_type = 2; +int mysql_reconnect_count = 1; struct sql_interface sql_s; struct sql_interface *SQL; @@ -868,55 +870,67 @@ void hercules_mysql_error_handler(unsigned int ecode) { switch( ecode ) { case 2003:/* Can't connect to MySQL (this error only happens here when failing to reconnect) */ if( mysql_reconnect_type == 1 ) { - static unsigned int retry = 1; + static int retry = 1; if( ++retry > mysql_reconnect_count ) { - ShowFatalError("MySQL has been unreachable for too long, %u reconnects were attempted. Shutting Down\n", retry); + ShowFatalError("MySQL has been unreachable for too long, %d reconnects were attempted. Shutting Down\n", retry); exit(EXIT_FAILURE); } } break; } } -void Sql_inter_server_read(const char* cfgName, bool first) { - char line[1024], w1[1024], w2[1024]; - FILE* fp; - - fp = fopen(cfgName, "r"); - if(fp == NULL) { - if( first ) { - ShowFatalError("File not found: %s\n", cfgName); - exit(EXIT_FAILURE); - } else - ShowError("File not found: %s\n", cfgName); - return; + +/** + * Parses mysql_reconnect from inter_configuration. + * + * @param filename Path to configuration file. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool Sql_inter_server_read(const char *filename, bool imported) +{ + struct config_t config; + const struct config_setting_t *setting = NULL; + const char *import = NULL; + bool retval = true; + + nullpo_retr(false, filename); + + if (!libconfig->load_file(&config, filename)) + return false; + + if ((setting = libconfig->lookup(&config, "inter_configuration/mysql_reconnect")) == NULL) { + config_destroy(&config); + if (imported) + return true; + ShowError("Sql_inter_server_read: inter_configuration/mysql_reconnect was not found in %s!\n", filename); + return false; } - while (fgets(line, sizeof(line), fp)) { - int i = sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2); - if (i != 2) - continue; + if (libconfig->setting_lookup_int(setting, "type", &mysql_reconnect_type) == CONFIG_TRUE) { + if (mysql_reconnect_type != 1 && mysql_reconnect_type != 2) { + ShowError("%s::inter_configuration/mysql_reconnect/type is set to %d which is not valid, defaulting to 1...\n", filename, mysql_reconnect_type); + mysql_reconnect_type = 1; + } + } + if (libconfig->setting_lookup_int(setting, "count", &mysql_reconnect_count) == CONFIG_TRUE) { + if (mysql_reconnect_count < 1) + mysql_reconnect_count = 1; + } - if(!strcmpi(w1,"mysql_reconnect_type")) { - mysql_reconnect_type = atoi(w2); - switch( mysql_reconnect_type ) { - case 1: - case 2: - break; - default: - ShowError("%s::mysql_reconnect_type is set to %d which is not valid, defaulting to 1...\n", cfgName, mysql_reconnect_type); - mysql_reconnect_type = 1; - break; - } - } else if(!strcmpi(w1,"mysql_reconnect_count")) { - mysql_reconnect_count = atoi(w2); - if( mysql_reconnect_count < 1 ) - mysql_reconnect_count = 1; - } else if(!strcmpi(w1,"import")) - Sql_inter_server_read(w2,false); + // import should overwrite any previous configuration, so it should be called last + if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) { + if (strcmp(import, filename) == 0 || strcmp(import, "conf/common/inter-server.conf") == 0) { // FIXME: Hardcoded path + ShowWarning("Sql_inter_server_read: Loop detected in %s! Skipping 'import'...\n", filename); + } else { + if (!Sql_inter_server_read(import, true)) + retval = false; + } } - fclose(fp); - return; + libconfig->destroy(&config); + return retval; } void Sql_HerculesUpdateCheck(struct Sql *self) @@ -1019,7 +1033,7 @@ void Sql_HerculesUpdateSkip(struct Sql *self, const char *filename) } void Sql_Init(void) { - Sql_inter_server_read("conf/inter-server.conf",true); + Sql_inter_server_read("conf/common/inter-server.conf", false); // FIXME: Hardcoded path } void sql_defaults(void) { SQL = &sql_s; diff --git a/src/common/sql.h b/src/common/sql.h index 07be829fc..4d9a12cc1 100644 --- a/src/common/sql.h +++ b/src/common/sql.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 diff --git a/src/login/account.h b/src/login/account.h index 7e1930ad4..9bb07fda3 100644 --- a/src/login/account.h +++ b/src/login/account.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 @@ -27,6 +27,9 @@ /* Forward declarations */ struct Sql; // common/sql.h +/* Forward Declarations */ +struct config_t; // common/conf.h + typedef struct AccountDB AccountDB; typedef struct AccountDBIterator AccountDBIterator; @@ -107,10 +110,9 @@ struct AccountDB /// Sets a property in this database. /// /// @param self Database - /// @param key Property name - /// @param value Property value + /// @param config Configuration node /// @return true if successful - bool (*set_property)(AccountDB* self, const char* key, const char* value); + bool (*set_property)(AccountDB* self, struct config_t *config, bool imported); /// Creates a new account in this database. /// If acc->account_id is not -1, the provided value will be used. diff --git a/src/login/account_sql.c b/src/login/account_sql.c index 2e128e8bf..70d4f3dfb 100644 --- a/src/login/account_sql.c +++ b/src/login/account_sql.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 @@ -24,6 +24,7 @@ #include "account.h" #include "common/cbasetypes.h" +#include "common/conf.h" #include "common/console.h" #include "common/memmgr.h" #include "common/mmo.h" @@ -45,14 +46,7 @@ typedef struct AccountDB_SQL struct Sql *accounts; // SQL accounts storage - // global sql settings - char global_db_hostname[32]; - uint16 global_db_port; - char global_db_username[32]; - char global_db_password[100]; - char global_db_database[32]; - char global_codepage[32]; - // local sql settings + // Sql settings char db_hostname[32]; uint16 db_port; char db_username[32]; @@ -81,7 +75,7 @@ typedef struct AccountDBIterator_SQL static bool account_db_sql_init(AccountDB* self); static void account_db_sql_destroy(AccountDB* self); static bool account_db_sql_get_property(AccountDB* self, const char* key, char* buf, size_t buflen); -static bool account_db_sql_set_property(AccountDB* self, const char* option, const char* value); +static bool account_db_sql_set_property(AccountDB* self, struct config_t *config, bool imported); static bool account_db_sql_create(AccountDB* self, struct mmo_account* acc); static bool account_db_sql_remove(AccountDB* self, const int account_id); static bool account_db_sql_save(AccountDB* self, const struct mmo_account* acc); @@ -113,19 +107,12 @@ AccountDB* account_db_sql(void) // initialize to default values db->accounts = NULL; - // global sql settings - safestrncpy(db->global_db_hostname, "127.0.0.1", sizeof(db->global_db_hostname)); - db->global_db_port = 3306; - safestrncpy(db->global_db_username, "ragnarok", sizeof(db->global_db_username)); - safestrncpy(db->global_db_password, "ragnarok", sizeof(db->global_db_password)); - safestrncpy(db->global_db_database, "ragnarok", sizeof(db->global_db_database)); - safestrncpy(db->global_codepage, "", sizeof(db->global_codepage)); - // local sql settings - safestrncpy(db->db_hostname, "", sizeof(db->db_hostname)); + // Sql settings + safestrncpy(db->db_hostname, "127.0.0.1", sizeof(db->db_hostname)); db->db_port = 3306; - safestrncpy(db->db_username, "", sizeof(db->db_username)); - safestrncpy(db->db_password, "", sizeof(db->db_password)); - safestrncpy(db->db_database, "", sizeof(db->db_database)); + safestrncpy(db->db_username, "ragnarok", sizeof(db->db_username)); + safestrncpy(db->db_password, "ragnarok", sizeof(db->db_password)); + safestrncpy(db->db_database, "ragnarok", sizeof(db->db_database)); safestrncpy(db->codepage, "", sizeof(db->codepage)); // other settings db->case_sensitive = false; @@ -144,46 +131,22 @@ AccountDB* account_db_sql(void) static bool account_db_sql_init(AccountDB* self) { AccountDB_SQL* db = (AccountDB_SQL*)self; - struct Sql *sql_handle; - const char* username; - const char* password; - const char* hostname; - uint16 port; - const char* database; - const char* codepage; + struct Sql *sql_handle = NULL; nullpo_ret(db); + db->accounts = SQL->Malloc(); sql_handle = db->accounts; - if( db->db_hostname[0] != '\0' ) - {// local settings - username = db->db_username; - password = db->db_password; - hostname = db->db_hostname; - port = db->db_port; - database = db->db_database; - codepage = db->codepage; - } - else - {// global settings - username = db->global_db_username; - password = db->global_db_password; - hostname = db->global_db_hostname; - port = db->global_db_port; - database = db->global_db_database; - codepage = db->global_codepage; - } - - if( SQL_ERROR == SQL->Connect(sql_handle, username, password, hostname, port, database) ) - { + if (SQL_ERROR == SQL->Connect(sql_handle, db->db_username, db->db_password, + db->db_hostname, db->db_port, db->db_database)) { Sql_ShowDebug(sql_handle); SQL->Free(db->accounts); db->accounts = NULL; return false; } - if( codepage[0] != '\0' && SQL_ERROR == SQL->SetEncoding(sql_handle, codepage) ) + if (db->codepage[0] != '\0' && SQL_ERROR == SQL->SetEncoding(sql_handle, db->codepage)) Sql_ShowDebug(sql_handle); Sql_HerculesUpdateCheck(db->accounts); @@ -207,6 +170,15 @@ static void account_db_sql_destroy(AccountDB* self) /// Gets a property from this database. static bool account_db_sql_get_property(AccountDB* self, const char* key, char* buf, size_t buflen) { + /* TODO: + * This functionality is not being used as of now, it was removed in + * commit 5479f9631f8579d03fbfd14d8a49c7976226a156, it is meant to get + * engine properties when more than one engine is available. I'll + * re-add it as soon as I can, following the new standards. If anyone + * is interested in this functionality you can contact me in our boards + * and I'll try to add it sooner (Pan) [Panikon] + */ +#if 0 AccountDB_SQL* db = (AccountDB_SQL*)self; const char* signature; @@ -230,32 +202,6 @@ static bool account_db_sql_get_property(AccountDB* self, const char* key, char* return true; } - signature = "sql."; - if( strncmpi(key, signature, strlen(signature)) == 0 ) - { - key += strlen(signature); - if( strcmpi(key, "db_hostname") == 0 ) - safesnprintf(buf, buflen, "%s", db->global_db_hostname); - else - if( strcmpi(key, "db_port") == 0 ) - safesnprintf(buf, buflen, "%d", db->global_db_port); - else - if( strcmpi(key, "db_username") == 0 ) - safesnprintf(buf, buflen, "%s", db->global_db_username); - else - if( strcmpi(key, "db_password") == 0 ) - safesnprintf(buf, buflen, "%s", db->global_db_password); - else - if( strcmpi(key, "db_database") == 0 ) - safesnprintf(buf, buflen, "%s", db->global_db_database); - else - if( strcmpi(key, "codepage") == 0 ) - safesnprintf(buf, buflen, "%s", db->global_codepage); - else - return false;// not found - return true; - } - signature = "account.sql."; if( strncmpi(key, signature, strlen(signature)) == 0 ) { @@ -295,82 +241,91 @@ static bool account_db_sql_get_property(AccountDB* self, const char* key, char* } return false;// not found +#endif // 0 + return false; } -/// if the option is supported, adjusts the internal state -static bool account_db_sql_set_property(AccountDB* self, const char* key, const char* value) +/** + * Reads the 'inter_configuration' config file and initializes required variables. + * + * @param db Self. + * @param filename Path to configuration file + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool account_db_read_inter(AccountDB_SQL *db, const char *filename, bool imported) +{ + struct config_t config; + struct config_setting_t *setting = NULL; + + nullpo_retr(false, db); + nullpo_retr(false, filename); + + if (!libconfig->load_file(&config, filename)) + return false; // Error message is already shown by libconfig->load_file + + if ((setting = libconfig->lookup(&config, "inter_configuration/database_names")) == NULL) { + libconfig->destroy(&config); + if (imported) + return true; + ShowError("account_db_sql_set_property: inter_configuration/database_names was not found!\n"); + return false; + } + libconfig->setting_lookup_mutable_string(setting, "account_db", db->account_db, sizeof(db->account_db)); + + if ((setting = libconfig->lookup(&config, "inter_configuration/database_names/registry")) == NULL) { + libconfig->destroy(&config); + if (imported) + return true; + ShowError("account_db_sql_set_property: inter_configuration/database_names/registry was not found!\n"); + return false; + } + libconfig->setting_lookup_mutable_string(setting, "global_acc_reg_str_db", db->global_acc_reg_str_db, sizeof(db->global_acc_reg_str_db)); + libconfig->setting_lookup_mutable_string(setting, "global_acc_reg_num_db", db->global_acc_reg_num_db, sizeof(db->global_acc_reg_num_db)); + + // TODO: Proper import mechanism for this file + + libconfig->destroy(&config); + return true; +} + +/** + * Loads the sql configuration. + * + * @param self Self. + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +static bool account_db_sql_set_property(AccountDB* self, struct config_t *config, bool imported) { AccountDB_SQL* db = (AccountDB_SQL*)self; - const char* signature; + struct config_setting_t *setting = NULL; nullpo_ret(db); - nullpo_ret(key); - nullpo_ret(value); - signature = "sql."; - if( strncmp(key, signature, strlen(signature)) == 0 ) - { - key += strlen(signature); - if( strcmpi(key, "db_hostname") == 0 ) - safestrncpy(db->global_db_hostname, value, sizeof(db->global_db_hostname)); - else - if( strcmpi(key, "db_port") == 0 ) - db->global_db_port = (uint16)strtoul(value, NULL, 10); - else - if( strcmpi(key, "db_username") == 0 ) - safestrncpy(db->global_db_username, value, sizeof(db->global_db_username)); - else - if( strcmpi(key, "db_password") == 0 ) - safestrncpy(db->global_db_password, value, sizeof(db->global_db_password)); - else - if( strcmpi(key, "db_database") == 0 ) - safestrncpy(db->global_db_database, value, sizeof(db->global_db_database)); - else - if( strcmpi(key, "codepage") == 0 ) - safestrncpy(db->global_codepage, value, sizeof(db->global_codepage)); - else - return false;// not found - return true; - } + nullpo_ret(config); - signature = "account.sql."; - if( strncmp(key, signature, strlen(signature)) == 0 ) - { - key += strlen(signature); - if( strcmpi(key, "db_hostname") == 0 ) - safestrncpy(db->db_hostname, value, sizeof(db->db_hostname)); - else - if( strcmpi(key, "db_port") == 0 ) - db->db_port = (uint16)strtoul(value, NULL, 10); - else - if( strcmpi(key, "db_username") == 0 ) - safestrncpy(db->db_username, value, sizeof(db->db_username)); - else - if( strcmpi(key, "db_password") == 0 ) - safestrncpy(db->db_password, value, sizeof(db->db_password)); - else - if( strcmpi(key, "db_database") == 0 ) - safestrncpy(db->db_database, value, sizeof(db->db_database)); - else - if( strcmpi(key, "codepage") == 0 ) - safestrncpy(db->codepage, value, sizeof(db->codepage)); - else - if( strcmpi(key, "case_sensitive") == 0 ) - db->case_sensitive = (bool)config_switch(value); - else - if( strcmpi(key, "account_db") == 0 ) - safestrncpy(db->account_db, value, sizeof(db->account_db)); - else - if( strcmpi(key, "global_acc_reg_str_db") == 0 ) - safestrncpy(db->global_acc_reg_str_db, value, sizeof(db->global_acc_reg_str_db)); - else - if( strcmpi(key, "global_acc_reg_num_db") == 0 ) - safestrncpy(db->global_acc_reg_num_db, value, sizeof(db->global_acc_reg_num_db)); - else - return false;// not found - return true; + if ((setting = libconfig->lookup(config, "login_configuration/account/sql_connection")) == NULL) { + if (imported) + return true; + ShowError("account_db_sql_set_property: login_configuration/account/sql_connection was not found!\n"); + ShowWarning("account_db_sql_set_property: Defaulting sql_connection...\n"); + return false; } - return false;// not found + libconfig->setting_lookup_mutable_string(setting, "db_hostname", db->db_hostname, sizeof(db->db_hostname)); + libconfig->setting_lookup_mutable_string(setting, "db_username", db->db_username, sizeof(db->db_username)); + libconfig->setting_lookup_mutable_string(setting, "db_password", db->db_password, sizeof(db->db_password)); + libconfig->setting_lookup_mutable_string(setting, "db_database", db->db_database, sizeof(db->db_database)); + libconfig->setting_lookup_mutable_string(setting, "codepage", db->codepage, sizeof(db->codepage)); // FIXME: Why do we need both codepage and default_codepage? + libconfig->setting_lookup_uint16(setting, "db_port", &db->db_port); + libconfig->setting_lookup_bool_real(setting, "case_sensitive", &db->case_sensitive); + + account_db_read_inter(db, "conf/common/inter-server.conf", imported); + + return true; } /// create a new account entry diff --git a/src/login/ipban.h b/src/login/ipban.h index 85cf3873c..104e3a8a3 100644 --- a/src/login/ipban.h +++ b/src/login/ipban.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 @@ -23,6 +23,9 @@ #include "common/cbasetypes.h" +/* Forward Declarations */ +struct config_t; // common/conf.h + #ifdef HERCULES_CORE // TODO: Interface // initialize @@ -37,8 +40,8 @@ bool ipban_check(uint32 ip); // increases failure count for the specified IP void ipban_log(uint32 ip); -// parses configuration option -bool ipban_config_read(const char *key, const char* value); +// parses configuration options +bool ipban_config_read(const char *filename, struct config_t *config, bool imported); #endif // HERCULES_CORE #endif /* LOGIN_IPBAN_H */ diff --git a/src/login/ipban_sql.c b/src/login/ipban_sql.c index bec0217f4..d74e6c4fa 100644 --- a/src/login/ipban_sql.c +++ b/src/login/ipban_sql.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 @@ -25,26 +25,21 @@ #include "login/login.h" #include "login/loginlog.h" #include "common/cbasetypes.h" +#include "common/conf.h" #include "common/nullpo.h" +#include "common/showmsg.h" #include "common/sql.h" #include "common/strlib.h" #include "common/timer.h" #include <stdlib.h> -// global sql settings -static char global_db_hostname[32] = "127.0.0.1"; -static uint16 global_db_port = 3306; -static char global_db_username[32] = "ragnarok"; -static char global_db_password[100] = "ragnarok"; -static char global_db_database[32] = "ragnarok"; -static char global_codepage[32] = ""; -// local sql settings -static char ipban_db_hostname[32] = ""; -static uint16 ipban_db_port = 0; -static char ipban_db_username[32] = ""; -static char ipban_db_password[100] = ""; -static char ipban_db_database[32] = ""; +// Sql settings +static char ipban_db_hostname[32] = "127.0.0.1"; +static uint16 ipban_db_port = 3306; +static char ipban_db_username[32] = "ragnarok"; +static char ipban_db_password[100] = "ragnarok"; +static char ipban_db_database[32] = "ragnarok"; static char ipban_codepage[32] = ""; static char ipban_table[32] = "ipbanlist"; @@ -59,54 +54,30 @@ int ipban_cleanup(int tid, int64 tick, int id, intptr_t data); // initialize void ipban_init(void) { - const char* username; - const char* password; - const char* hostname; - uint16 port; - const char* database; - const char* codepage; - ipban_inited = true; if (!login->config->ipban) return;// ipban disabled - if( ipban_db_hostname[0] != '\0' ) - {// local settings - username = ipban_db_username; - password = ipban_db_password; - hostname = ipban_db_hostname; - port = ipban_db_port; - database = ipban_db_database; - codepage = ipban_codepage; - } - else - {// global settings - username = global_db_username; - password = global_db_password; - hostname = global_db_hostname; - port = global_db_port; - database = global_db_database; - codepage = global_codepage; - } - // establish connections sql_handle = SQL->Malloc(); - if( SQL_ERROR == SQL->Connect(sql_handle, username, password, hostname, port, database) ) - { + if (SQL_ERROR == SQL->Connect(sql_handle, ipban_db_username, ipban_db_password, + ipban_db_hostname, ipban_db_port, ipban_db_database)) { Sql_ShowDebug(sql_handle); SQL->Free(sql_handle); exit(EXIT_FAILURE); } - if( codepage[0] != '\0' && SQL_ERROR == SQL->SetEncoding(sql_handle, codepage) ) + if (ipban_codepage[0] != '\0' && SQL_ERROR == SQL->SetEncoding(sql_handle, ipban_codepage)) Sql_ShowDebug(sql_handle); - if (login->config->ipban_cleanup_interval > 0) - { // set up periodic cleanup of connection history and active bans + if (login->config->ipban_cleanup_interval > 0) { + // set up periodic cleanup of connection history and active bans timer->add_func_list(ipban_cleanup, "ipban_cleanup"); cleanup_timer_id = timer->add_interval(timer->gettick()+10, ipban_cleanup, 0, 0, login->config->ipban_cleanup_interval*1000); - } else // make sure it gets cleaned up on login-server start regardless of interval-based cleanups + } else { + // make sure it gets cleaned up on login-server start regardless of interval-based cleanups ipban_cleanup(0,0,0,0); + } } // finalize @@ -126,95 +97,153 @@ void ipban_final(void) sql_handle = NULL; } -// load configuration options -bool ipban_config_read(const char* key, const char* value) +/** + * Reads 'inter_configuration' and initializes required variables/Sets global + * configuration. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + + */ +bool ipban_config_read_inter(const char *filename, bool imported) { - const char* signature; + struct config_t config; + struct config_setting_t *setting = NULL; + const char *import = NULL; + bool retval = true; - nullpo_ret(key); - nullpo_ret(value); - if( ipban_inited ) - return false;// settings can only be changed before init + nullpo_retr(false, filename); - signature = "sql."; - if( strncmpi(key, signature, strlen(signature)) == 0 ) - { - key += strlen(signature); - if( strcmpi(key, "db_hostname") == 0 ) - safestrncpy(global_db_hostname, value, sizeof(global_db_hostname)); - else - if( strcmpi(key, "db_port") == 0 ) - global_db_port = (uint16)strtoul(value, NULL, 10); - else - if( strcmpi(key, "db_username") == 0 ) - safestrncpy(global_db_username, value, sizeof(global_db_username)); - else - if( strcmpi(key, "db_password") == 0 ) - safestrncpy(global_db_password, value, sizeof(global_db_password)); - else - if( strcmpi(key, "db_database") == 0 ) - safestrncpy(global_db_database, value, sizeof(global_db_database)); - else - if( strcmpi(key, "codepage") == 0 ) - safestrncpy(global_codepage, value, sizeof(global_codepage)); - else - return false;// not found - return true; + if (!libconfig->load_file(&config, filename)) + return false; // Error message is already shown by libconfig->read_file + + if ((setting = libconfig->lookup(&config, "inter_configuration/database_names")) == NULL) { + libconfig->destroy(&config); + if (imported) + return true; + ShowError("ipban_config_read: inter_configuration/database_names was not found!\n"); + return false; + } + libconfig->setting_lookup_mutable_string(setting, "ipban_table", ipban_table, sizeof(ipban_table)); + + // import should overwrite any previous configuration, so it should be called last + if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) { + if (strcmp(import, filename) == 0 || strcmp(import, "conf/common/inter-server.conf") == 0) { + ShowWarning("ipban_config_read_inter: Loop detected! Skipping 'import'...\n"); + } else { + if (!ipban_config_read_inter(import, true)) + retval = false; + } } - signature = "ipban.sql."; - if( strncmpi(key, signature, strlen(signature)) == 0 ) - { - key += strlen(signature); - if( strcmpi(key, "db_hostname") == 0 ) - safestrncpy(ipban_db_hostname, value, sizeof(ipban_db_hostname)); - else - if( strcmpi(key, "db_port") == 0 ) - ipban_db_port = (uint16)strtoul(value, NULL, 10); - else - if( strcmpi(key, "db_username") == 0 ) - safestrncpy(ipban_db_username, value, sizeof(ipban_db_username)); - else - if( strcmpi(key, "db_password") == 0 ) - safestrncpy(ipban_db_password, value, sizeof(ipban_db_password)); - else - if( strcmpi(key, "db_database") == 0 ) - safestrncpy(ipban_db_database, value, sizeof(ipban_db_database)); - else - if( strcmpi(key, "codepage") == 0 ) - safestrncpy(ipban_codepage, value, sizeof(ipban_codepage)); - else - if( strcmpi(key, "ipban_table") == 0 ) - safestrncpy(ipban_table, value, sizeof(ipban_table)); - else - return false;// not found - return true; + libconfig->destroy(&config); + return retval; +} + +/** + * Reads login_configuration/account/ipban/sql_connection and loads configuration options. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool ipban_config_read_connection(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "login_configuration/account/ipban/sql_connection")) == NULL) { + if (imported) + return true; + ShowError("account_db_sql_set_property: login_configuration/account/ipban/sql_connection was not found in %s!\n", filename); + return false; } - signature = "ipban."; - if( strncmpi(key, signature, strlen(signature)) == 0 ) - { - key += strlen(signature); - if( strcmpi(key, "enable") == 0 ) - login->config->ipban = (bool)config_switch(value); - else - if( strcmpi(key, "dynamic_pass_failure_ban") == 0 ) - login->config->dynamic_pass_failure_ban = (bool)config_switch(value); - else - if( strcmpi(key, "dynamic_pass_failure_ban_interval") == 0 ) - login->config->dynamic_pass_failure_ban_interval = atoi(value); - else - if( strcmpi(key, "dynamic_pass_failure_ban_limit") == 0 ) - login->config->dynamic_pass_failure_ban_limit = atoi(value); - else - if( strcmpi(key, "dynamic_pass_failure_ban_duration") == 0 ) - login->config->dynamic_pass_failure_ban_duration = atoi(value); - else - return false;// not found - return true; + libconfig->setting_lookup_mutable_string(setting, "db_hostname", ipban_db_hostname, sizeof(ipban_db_hostname)); + libconfig->setting_lookup_mutable_string(setting, "db_database", ipban_db_database, sizeof(ipban_db_database)); + + libconfig->setting_lookup_mutable_string(setting, "db_username", ipban_db_username, sizeof(ipban_db_username)); + libconfig->setting_lookup_mutable_string(setting, "db_password", ipban_db_password, sizeof(ipban_db_password)); + libconfig->setting_lookup_mutable_string(setting, "codepage", ipban_codepage, sizeof(ipban_codepage)); + libconfig->setting_lookup_uint16(setting, "db_port", &ipban_db_port); + + return true; +} + +/** + * Reads login_configuration/account/ipban/dynamic_pass_failure and loads configuration options. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool ipban_config_read_dynamic(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "login_configuration/account/ipban/dynamic_pass_failure")) == NULL) { + if (imported) + return true; + ShowError("account_db_sql_set_property: login_configuration/account/ipban/dynamic_pass_failure was not found in %s!\n", filename); + return false; + } + + libconfig->setting_lookup_bool_real(setting, "enabled", &login->config->dynamic_pass_failure_ban); + libconfig->setting_lookup_uint32(setting, "ban_interval", &login->config->dynamic_pass_failure_ban_interval); + libconfig->setting_lookup_uint32(setting, "ban_limit", &login->config->dynamic_pass_failure_ban_limit); + libconfig->setting_lookup_uint32(setting, "ban_duration", &login->config->dynamic_pass_failure_ban_duration); + + return true; +} + +/** + * Reads login_configuration.account.ipban and loads configuration options. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool ipban_config_read(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + bool retval = true; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if (ipban_inited) + return false; // settings can only be changed before init + + if ((setting = libconfig->lookup(config, "login_configuration/account/ipban")) == NULL) { + if (!imported) + ShowError("login_config_read: login_configuration/log was not found in %s!\n", filename); + return false; } - return false;// not found + libconfig->setting_lookup_bool_real(setting, "enabled", &login->config->ipban); + libconfig->setting_lookup_uint32(setting, "cleanup_interval", &login->config->ipban_cleanup_interval); + + if (!ipban_config_read_inter("conf/common/inter-server.conf", imported)) + retval = false; + if (!ipban_config_read_connection(filename, config, imported)) + retval = false; + if (!ipban_config_read_dynamic(filename, config, imported)) + retval = false; + + return retval; } // check ip against active bans list diff --git a/src/login/login.c b/src/login/login.c index 6b422eef2..19293d61b 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -29,6 +29,7 @@ #include "login/lclif.h" #include "common/HPM.h" #include "common/cbasetypes.h" +#include "common/conf.h" #include "common/core.h" #include "common/db.h" #include "common/memmgr.h" @@ -43,6 +44,7 @@ #include <stdio.h> #include <stdlib.h> +#include <sys/stat.h> // stat() /** @file * Implementation of the login interface. @@ -1064,13 +1066,14 @@ int login_mmo_auth(struct login_session_data* sd, bool isServer) { if (login->config->use_dnsbl) { char r_ip[16]; char ip_dnsbl[256]; - char* dnsbl_serv; uint8* sin_addr = (uint8*)&sockt->session[sd->fd]->client_addr; + int i; sprintf(r_ip, "%u.%u.%u.%u", sin_addr[0], sin_addr[1], sin_addr[2], sin_addr[3]); - for (dnsbl_serv = strtok(login->config->dnsbl_servs,","); dnsbl_serv != NULL; dnsbl_serv = strtok(NULL,",")) { - sprintf(ip_dnsbl, "%s.%s", r_ip, trim(dnsbl_serv)); + for (i = 0; i < VECTOR_LENGTH(login->config->dnsbl_servers); i++) { + char *dnsbl_server = VECTOR_INDEX(login->config->dnsbl_servers, i); + sprintf(ip_dnsbl, "%s.%s", r_ip, trim(dnsbl_server)); if (sockt->host2ip(ip_dnsbl)) { ShowInfo("DNSBL: (%s) Blacklisted. User Kicked.\n", r_ip); return 3; @@ -1450,150 +1453,431 @@ void login_config_set_defaults(void) login->config->dynamic_pass_failure_ban_limit = 7; login->config->dynamic_pass_failure_ban_duration = 5; login->config->use_dnsbl = false; - safestrncpy(login->config->dnsbl_servs, "", sizeof(login->config->dnsbl_servs)); + VECTOR_INIT(login->config->dnsbl_servers); login->config->client_hash_check = 0; login->config->client_hash_nodes = NULL; } -//----------------------------------- -// Reading main configuration file -//----------------------------------- -int login_config_read(const char *cfgName) +/** + * Reads 'login_configuration/inter' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool login_config_read_inter(const char *filename, struct config_t *config, bool imported) { - char line[1024], w1[1024], w2[1024]; - FILE* fp; - nullpo_retr(1, cfgName); - fp = fopen(cfgName, "r"); - if (fp == NULL) { - ShowError("Configuration file (%s) not found.\n", cfgName); - return 1; + struct config_setting_t *setting = NULL; + const char *str = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "login_configuration/inter")) == NULL) { + if (imported) + return true; + ShowError("login_config_read: login_configuration/inter was not found in %s!\n", filename); + return false; } - while(fgets(line, sizeof(line), fp)) { - if (line[0] == '/' && line[1] == '/') - continue; - if (sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2) < 2) + libconfig->setting_lookup_uint16(setting, "login_port", &login->config->login_port); + + if (libconfig->setting_lookup_uint32(setting, "ip_sync_interval", &login->config->ip_sync_interval) == CONFIG_TRUE) + login->config->ip_sync_interval *= 1000*60; // In minutes + + if (libconfig->setting_lookup_string(setting, "bind_ip", &str) == CONFIG_TRUE) { + char old_ip_str[16]; + sockt->ip2str(login->config->login_ip, old_ip_str); + + if ((login->config->login_ip = sockt->host2ip(str)) != 0) + ShowStatus("Login server binding IP address : %s -> %s\n", old_ip_str, str); + } + + return true; +} + +/** + * Reads 'login_configuration.console' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool login_config_read_console(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "login_configuration/console")) == NULL) { + if (imported) + return true; + ShowError("login_config_read: login_configuration/console was not found in %s!\n", filename); + return false; + } + + libconfig->setting_lookup_bool_real(setting, "stdout_with_ansisequence", &showmsg->stdout_with_ansisequence); + if (libconfig->setting_lookup_int(setting, "console_silent", &showmsg->silent) == CONFIG_TRUE) { + if (showmsg->silent) // only bother if its actually enabled + ShowInfo("Console Silent Setting: %d\n", showmsg->silent); + } + libconfig->setting_lookup_mutable_string(setting, "timestamp_format", showmsg->timestamp_format, sizeof(showmsg->timestamp_format)); + + return true; +} + +/** + * Reads 'login_configuration.log' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool login_config_read_log(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "login_configuration/log")) == NULL) { + if (imported) + return true; + ShowError("login_config_read: login_configuration/log was not found in %s!\n", filename); + return false; + } + + libconfig->setting_lookup_bool_real(setting, "log_login", &login->config->log_login); + libconfig->setting_lookup_mutable_string(setting, "date_format", login->config->date_format, sizeof(login->config->date_format)); + return true; +} + +/** + * Reads 'login_configuration.account' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool login_config_read_account(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + AccountDB *db = account_engine[0].db; + bool retval = true; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "login_configuration/account")) == NULL) { + if (imported) + return true; + ShowError("login_config_read: login_configuration/account was not found in %s!\n", filename); + return false; + } + + libconfig->setting_lookup_bool_real(setting, "new_account", &login->config->new_account_flag); + libconfig->setting_lookup_bool_real(setting, "new_acc_length_limit", &login->config->new_acc_length_limit); + + libconfig->setting_lookup_int(setting, "allowed_regs", &login->config->allowed_regs); + libconfig->setting_lookup_int(setting, "time_allowed", &login->config->time_allowed); + libconfig->setting_lookup_int(setting, "start_limited_time", &login->config->start_limited_time); + libconfig->setting_lookup_bool_real(setting, "use_MD5_passwords", &login->config->use_md5_passwds); + + if (!db->set_property(db, config, imported)) + retval = false; + if (!ipban_config_read(filename, config, imported)) + retval = false; + + return retval; +} + +/** + * Frees login->config->client_hash_nodes + **/ +void clear_client_hash_nodes(void) +{ + struct client_hash_node *node = login->config->client_hash_nodes; + + while (node != NULL) { + struct client_hash_node *next = node->next; + aFree(node); + node = next; + } + + login->config->client_hash_nodes = NULL; +} + +/** + * Reads information from login_configuration.permission.hash.md5_hashes. + * + * @param setting The setting to read from. + */ +void login_config_set_md5hash(struct config_setting_t *setting) +{ + int i; + int count = libconfig->setting_length(setting); + + clear_client_hash_nodes(); + + // There's no need to parse if it's disabled or if there's no list + if (count <= 0 || !login->config->client_hash_check) + return; + + for (i = 0; i < count; i++) { + int j; + int group_id = 0; + char md5hash[33]; + struct client_hash_node *nnode = NULL; + struct config_setting_t *item = libconfig->setting_get_elem(setting, i); + + if (item == NULL) continue; - if(!strcmpi(w1,"timestamp_format")) - safestrncpy(showmsg->timestamp_format, w2, 20); - else if(!strcmpi(w1,"stdout_with_ansisequence")) - showmsg->stdout_with_ansisequence = config_switch(w2) ? true : false; - else if(!strcmpi(w1,"console_silent")) { - showmsg->silent = atoi(w2); - if (showmsg->silent) /* only bother if we actually have this enabled */ - ShowInfo("Console Silent Setting: %d\n", atoi(w2)); - } - else if( !strcmpi(w1, "bind_ip") ) { - login->config->login_ip = sockt->host2ip(w2); - if (login->config->login_ip) { - char ip_str[16]; - ShowStatus("Login server binding IP address : %s -> %s\n", w2, sockt->ip2str(login->config->login_ip, ip_str)); - } + if (libconfig->setting_lookup_int(item, "group_id", &group_id) != CONFIG_TRUE) { + ShowWarning("login_config_set_md5hash: entry (%d) is missing group_id! Ignoring...\n", i); + continue; } - else if( !strcmpi(w1, "login_port") ) { - login->config->login_port = (uint16)atoi(w2); + + if (libconfig->setting_lookup_mutable_string(item, "hash", md5hash, sizeof(md5hash)) != CONFIG_TRUE) { + ShowWarning("login_config_set_md5hash: entry (%d) is missing hash! Ignoring...\n", i); + continue; } - else if(!strcmpi(w1, "log_login")) - login->config->log_login = (bool)config_switch(w2); - - else if(!strcmpi(w1, "new_account")) - login->config->new_account_flag = (bool)config_switch(w2); - else if(!strcmpi(w1, "new_acc_length_limit")) - login->config->new_acc_length_limit = (bool)config_switch(w2); - else if(!strcmpi(w1, "start_limited_time")) - login->config->start_limited_time = atoi(w2); - else if(!strcmpi(w1, "check_client_version")) - login->config->check_client_version = (bool)config_switch(w2); - else if(!strcmpi(w1, "client_version_to_connect")) - login->config->client_version_to_connect = (unsigned int)strtoul(w2, NULL, 10); - else if(!strcmpi(w1, "use_MD5_passwords")) - login->config->use_md5_passwds = (bool)config_switch(w2); - else if(!strcmpi(w1, "group_id_to_connect")) - login->config->group_id_to_connect = atoi(w2); - else if(!strcmpi(w1, "min_group_id_to_connect")) - login->config->min_group_id_to_connect = atoi(w2); - else if(!strcmpi(w1, "date_format")) - safestrncpy(login->config->date_format, w2, sizeof(login->config->date_format)); - else if(!strcmpi(w1, "allowed_regs")) //account flood protection system - login->config->allowed_regs = atoi(w2); - else if(!strcmpi(w1, "time_allowed")) - login->config->time_allowed = atoi(w2); - else if(!strcmpi(w1, "use_dnsbl")) - login->config->use_dnsbl = (bool)config_switch(w2); - else if(!strcmpi(w1, "dnsbl_servers")) - safestrncpy(login->config->dnsbl_servs, w2, sizeof(login->config->dnsbl_servs)); - else if(!strcmpi(w1, "ipban_cleanup_interval")) - login->config->ipban_cleanup_interval = (unsigned int)atoi(w2); - else if(!strcmpi(w1, "ip_sync_interval")) - login->config->ip_sync_interval = (unsigned int)1000*60*atoi(w2); //w2 comes in minutes. - else if(!strcmpi(w1, "client_hash_check")) - login->config->client_hash_check = config_switch(w2); - else if(!strcmpi(w1, "client_hash")) { - int group = 0; - char md5hash[33]; - memset(md5hash, '\0', 33); - - if (sscanf(w2, "%d, %32s", &group, md5hash) == 2) { - struct client_hash_node *nnode; - CREATE(nnode, struct client_hash_node, 1); - - if (strcmpi(md5hash, "disabled") == 0) { - nnode->hash[0] = '\0'; - } else { - int i; - for (i = 0; i < 32; i += 2) { - char buf[3]; - unsigned int byte; - - memcpy(buf, &md5hash[i], 2); - buf[2] = 0; - - sscanf(buf, "%x", &byte); - nnode->hash[i / 2] = (uint8)(byte & 0xFF); - } - } - - nnode->group_id = group; - nnode->next = login->config->client_hash_nodes; - - login->config->client_hash_nodes = nnode; + + CREATE(nnode, struct client_hash_node, 1); + if (strcmpi(md5hash, "disabled") == 0) { + nnode->hash[0] = '\0'; + } else { + for (j = 0; j < 32; j += 2) { + char buf[3]; + unsigned int byte; + + memcpy(buf, &md5hash[j], 2); + buf[2] = 0; + + sscanf(buf, "%x", &byte); + nnode->hash[j / 2] = (uint8)(byte & 0xFF); } } - else if(!strcmpi(w1, "import")) - login_config_read(w2); - else - { - AccountDB* db = account_engine[0].db; - if (db) - db->set_property(db, w1, w2); - ipban_config_read(w1, w2); - loginlog_config_read(w1, w2); - HPM->parseConf(w1, w2, HPCT_LOGIN); + nnode->group_id = group_id; + nnode->next = login->config->client_hash_nodes; // login->config->client_hash_nodes is initialized before calling this function + login->config->client_hash_nodes = nnode; + } + + return; +} + +/** + * Reads 'login_configuration/permission/hash' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool login_config_read_permission_hash(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "login_configuration/permission/hash")) == NULL) { + if (imported) + return true; + ShowError("login_config_read: login_configuration/permission/hash was not found in %s!\n", filename); + return false; + } + + libconfig->setting_lookup_bool_real(setting, "enabled", &login->config->client_hash_check); + + if ((setting = libconfig->lookup(config, "login_configuration/permission/hash/MD5_hashes")) != NULL) + login_config_set_md5hash(setting); + + return true; +} + +/** + * Clears login->config->dnsbl_servers, freeing any allocated memory. + */ +void clear_dnsbl_servers(void) +{ + while (VECTOR_LENGTH(login->config->dnsbl_servers) > 0) { + aFree(&VECTOR_POP(login->config->dnsbl_servers)); + } + VECTOR_CLEAR(login->config->dnsbl_servers); +} + +/** + * Reads information from login_config/permission/DNS_blacklist/dnsbl_servers. + * + * @param setting The configuration setting to read from. + */ +void login_config_set_dnsbl_servers(struct config_setting_t *setting) +{ + int i; + int count = libconfig->setting_length(setting); + + clear_dnsbl_servers(); + + // There's no need to parse if it's disabled + if (count <= 0 || !login->config->use_dnsbl) + return; + + VECTOR_ENSURE(login->config->dnsbl_servers, count, 1); + + for (i = 0; i < count; i++) { + const char *string = libconfig->setting_get_string_elem(setting, i); + + if (string == NULL || string[0] == '\0') + continue; + + VECTOR_PUSH(login->config->dnsbl_servers, aStrdup(string)); + } +} + +/** + * Reads 'login_configuration/permission/DNS_blacklist' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool login_config_read_permission_blacklist(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "login_configuration/permission/DNS_blacklist")) == NULL) { + if (imported) + return true; + ShowError("login_config_read: login_configuration/permission/DNS_blacklist was not found in %s!\n", filename); + return false; + } + + libconfig->setting_lookup_bool_real(setting, "enabled", &login->config->use_dnsbl); + + if ((setting = libconfig->lookup(config, "login_configuration/permission/DNS_blacklist/dnsbl_servers")) != NULL) + login_config_set_dnsbl_servers(setting); + + return true; +} + +/** + * Reads 'login_configuration.permission' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool login_config_read_permission(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + bool retval = true; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "login_configuration/permission")) == NULL) { + if (imported) + return true; + ShowError("login_config_read: login_configuration/permission was not found in %s!\n", filename); + return false; + } + + libconfig->setting_lookup_int(setting, "group_id_to_connect", &login->config->group_id_to_connect); + libconfig->setting_lookup_int(setting, "min_group_id_to_connect", &login->config->min_group_id_to_connect); + libconfig->setting_lookup_bool_real(setting, "check_client_version", &login->config->check_client_version); + libconfig->setting_lookup_uint32(setting, "client_version_to_connect", &login->config->client_version_to_connect); + + if (!login_config_read_permission_hash(filename, config, imported)) + retval = false; + if (!login_config_read_permission_blacklist(filename, config, imported)) + retval = false; + + return retval; +} + +/** + * Reads the 'login-config' configuration file and initializes required variables. + * + * @param filename Path to configuration file. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + **/ +bool login_config_read(const char *filename, bool imported) +{ + struct config_t config; + const char *import = NULL; + bool retval = true; + + nullpo_retr(false, filename); + + if (!libconfig->load_file(&config, filename)) + return false; // Error message is already shown by libconfig->load_file + + if (!login_config_read_inter(filename, &config, imported)) + retval = false; + if (!login_config_read_console(filename, &config, imported)) + retval = false; + if (!login_config_read_log(filename, &config, imported)) + retval = false; + if (!login_config_read_account(filename, &config, imported)) + retval = false; + if (!login_config_read_permission(filename, &config, imported)) + retval = false; + + if (!loginlog_config_read("conf/common/inter-server.conf", imported)) // Only inter-server + retval = false; + + // TODO HPM->parseConf(w1, w2, HPCT_LOGIN); + + ShowInfo("Finished reading %s.\n", filename); + + // import should overwrite any previous configuration, so it should be called last + if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) { + if (strcmp(import, filename) == 0 || strcmp(import, login->LOGIN_CONF_NAME) == 0) { + ShowWarning("login_config_read: Loop detected in %s! Skipping 'import'...\n", filename); + } else { + if (!login->config_read(import, true)) + retval = false; } } - fclose(fp); - ShowInfo("Finished reading %s.\n", cfgName); - return 0; + + config_destroy(&config); + return retval; } //-------------------------------------- // Function called at exit of the server //-------------------------------------- -int do_final(void) { +int do_final(void) +{ int i; - struct client_hash_node *hn = login->config->client_hash_nodes; ShowStatus("Terminating...\n"); HPM->event(HPET_FINAL); - while (hn) { - struct client_hash_node *tmp = hn; - hn = hn->next; - aFree(tmp); - } + clear_client_hash_nodes(); + clear_dnsbl_servers(); login_log(0, "login server", 100, "login server shutdown"); @@ -1730,9 +2014,29 @@ int do_init(int argc, char** argv) // read login-server configuration login->config_set_defaults(); - login->LOGIN_CONF_NAME = aStrdup("conf/login-server.conf"); + login->LOGIN_CONF_NAME = aStrdup("conf/login/login-server.conf"); login->NET_CONF_NAME = aStrdup("conf/network.conf"); + { + // TODO: Remove this when no longer needed. +#define CHECK_OLD_LOCAL_CONF(oldname, newname) do { \ + if (stat((oldname), &fileinfo) == 0 && fileinfo.st_size > 0) { \ + ShowWarning("An old configuration file \"%s\" was found.\n", (oldname)); \ + ShowWarning("If it contains settings you wish to keep, please merge them into \"%s\".\n", (newname)); \ + ShowWarning("Otherwise, just delete it.\n"); \ + ShowInfo("Resuming in 10 seconds...\n"); \ + HSleep(10); \ + } \ +} while (0) + struct stat fileinfo; + + CHECK_OLD_LOCAL_CONF("conf/import/login_conf.txt", "conf/import/login-server.conf"); + CHECK_OLD_LOCAL_CONF("conf/import/inter_conf.txt", "conf/import/inter-server.conf"); + CHECK_OLD_LOCAL_CONF("conf/import/packet_conf.txt", "conf/import/socket.conf"); + +#undef CHECK_OLD_LOCAL_CONF + } + lclif->init(); HPM_login_do_init(); @@ -1741,7 +2045,7 @@ int do_init(int argc, char** argv) HPM->event(HPET_PRE_INIT); cmdline->exec(argc, argv, CMDLINE_OPT_NORMAL); - login_config_read(login->LOGIN_CONF_NAME); + login->config_read(login->LOGIN_CONF_NAME, false); sockt->net_config_read(login->NET_CONF_NAME); for( i = 0; i < ARRAYLENGTH(server); ++i ) diff --git a/src/login/login.h b/src/login/login.h index 36085ae91..5632e6529 100644 --- a/src/login/login.h +++ b/src/login/login.h @@ -97,8 +97,8 @@ struct Login_Config { uint32 login_ip; ///< the address to bind to uint16 login_port; ///< the port to bind to - unsigned int ipban_cleanup_interval; ///< interval (in seconds) to clean up expired IP bans - unsigned int ip_sync_interval; ///< interval (in minutes) to execute a DNS/IP update (for dynamic IPs) + uint32 ipban_cleanup_interval; ///< interval (in seconds) to clean up expired IP bans + uint32 ip_sync_interval; ///< interval (in minutes) to execute a DNS/IP update (for dynamic IPs) bool log_login; ///< whether to log login server actions or not char date_format[32]; ///< date format used in messages bool new_account_flag,new_acc_length_limit; ///< auto-registration via _M/_F ? / if yes minimum length is 4? @@ -113,13 +113,14 @@ struct Login_Config { bool ipban; ///< perform IP blocking (via contents of `ipbanlist`) ? bool dynamic_pass_failure_ban; ///< automatic IP blocking due to failed login attemps ? - unsigned int dynamic_pass_failure_ban_interval; ///< how far to scan the loginlog for password failures - unsigned int dynamic_pass_failure_ban_limit; ///< number of failures needed to trigger the ipban - unsigned int dynamic_pass_failure_ban_duration; ///< duration of the ipban + uint32 dynamic_pass_failure_ban_interval; ///< how far to scan the loginlog for password failures + uint32 dynamic_pass_failure_ban_limit; ///< number of failures needed to trigger the ipban + uint32 dynamic_pass_failure_ban_duration; ///< duration of the ipban bool use_dnsbl; ///< dns blacklist blocking ? - char dnsbl_servs[1024]; ///< comma-separated list of dnsbl servers + VECTOR_DECL(char *) dnsbl_servers; ///< dnsbl servers - int client_hash_check; ///< flags for checking client md5 + bool client_hash_check; ///< flags for checking client md5 + // TODO: VECTOR candidate struct client_hash_node *client_hash_nodes; ///< linked list containg md5 hash for each gm group }; @@ -207,7 +208,7 @@ struct login_interface { void (*char_server_connection_status) (int fd, struct login_session_data* sd, uint8 status); void (*parse_request_connection) (int fd, struct login_session_data* sd, const char *ip, uint32 ipl); void (*config_set_defaults) (void); - int (*config_read) (const char *cfgName); + bool (*config_read) (const char *filename, bool included); char *LOGIN_CONF_NAME; char *NET_CONF_NAME; ///< Network configuration filename }; diff --git a/src/login/loginlog.h b/src/login/loginlog.h index efb0873bd..589bc4fa1 100644 --- a/src/login/loginlog.h +++ b/src/login/loginlog.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 @@ -29,7 +29,7 @@ unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes); void login_log(uint32 ip, const char* username, int rcode, const char* message); bool loginlog_init(void); bool loginlog_final(void); -bool loginlog_config_read(const char* w1, const char* w2); +bool loginlog_config_read(const char *filename, bool imported); #endif // HERCULES_CORE #endif /* LOGIN_LOGINLOG_H */ diff --git a/src/login/loginlog_sql.c b/src/login/loginlog_sql.c index 16accfada..7dff14990 100644 --- a/src/login/loginlog_sql.c +++ b/src/login/loginlog_sql.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 @@ -23,27 +23,22 @@ #include "loginlog.h" #include "common/cbasetypes.h" +#include "common/conf.h" #include "common/mmo.h" #include "common/nullpo.h" +#include "common/showmsg.h" #include "common/socket.h" #include "common/sql.h" #include "common/strlib.h" #include <stdlib.h> // exit -// global sql settings (in ipban_sql.c) -static char global_db_hostname[32] = "127.0.0.1"; -static uint16 global_db_port = 3306; -static char global_db_username[32] = "ragnarok"; -static char global_db_password[100] = "ragnarok"; -static char global_db_database[32] = "ragnarok"; -static char global_codepage[32] = ""; -// local sql settings -static char log_db_hostname[32] = ""; -static uint16 log_db_port = 0; -static char log_db_username[32] = ""; -static char log_db_password[100] = ""; -static char log_db_database[32] = ""; +// Sql settings +static char log_db_hostname[32] = "127.0.0.1"; +static uint16 log_db_port = 3306; +static char log_db_username[32] = "ragnarok"; +static char log_db_password[100] = "ragnarok"; +static char log_db_database[32] = "ragnarok"; static char log_codepage[32] = ""; static char log_login_db[256] = "loginlog"; @@ -102,42 +97,16 @@ void login_log(uint32 ip, const char* username, int rcode, const char* message) bool loginlog_init(void) { - const char* username; - const char* password; - const char* hostname; - uint16 port; - const char* database; - const char* codepage; - - if( log_db_hostname[0] != '\0' ) - {// local settings - username = log_db_username; - password = log_db_password; - hostname = log_db_hostname; - port = log_db_port; - database = log_db_database; - codepage = log_codepage; - } - else - {// global settings - username = global_db_username; - password = global_db_password; - hostname = global_db_hostname; - port = global_db_port; - database = global_db_database; - codepage = global_codepage; - } - sql_handle = SQL->Malloc(); - if( SQL_ERROR == SQL->Connect(sql_handle, username, password, hostname, port, database) ) - { + if (SQL_ERROR == SQL->Connect(sql_handle, log_db_username, log_db_password, + log_db_hostname, log_db_port, log_db_database)) { Sql_ShowDebug(sql_handle); SQL->Free(sql_handle); exit(EXIT_FAILURE); } - if( codepage[0] != '\0' && SQL_ERROR == SQL->SetEncoding(sql_handle, codepage) ) + if (log_codepage[0] != '\0' && SQL_ERROR == SQL->SetEncoding(sql_handle, log_codepage)) Sql_ShowDebug(sql_handle); enabled = true; @@ -152,60 +121,105 @@ bool loginlog_final(void) return true; } -bool loginlog_config_read(const char* key, const char* value) +/** + * Reads 'inter_configuration/database_names' and initializes required + * variables/Sets global configuration. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool loginlog_config_read_names(const char *filename, struct config_t *config, bool imported) { - const char* signature; + struct config_setting_t *setting = NULL; - nullpo_ret(key); - nullpo_ret(value); - signature = "sql."; - if( strncmpi(key, signature, strlen(signature)) == 0 ) - { - key += strlen(signature); - if( strcmpi(key, "db_hostname") == 0 ) - safestrncpy(global_db_hostname, value, sizeof(global_db_hostname)); - else - if( strcmpi(key, "db_port") == 0 ) - global_db_port = (uint16)strtoul(value, NULL, 10); - else - if( strcmpi(key, "db_username") == 0 ) - safestrncpy(global_db_username, value, sizeof(global_db_username)); - else - if( strcmpi(key, "db_password") == 0 ) - safestrncpy(global_db_password, value, sizeof(global_db_password)); - else - if( strcmpi(key, "db_database") == 0 ) - safestrncpy(global_db_database, value, sizeof(global_db_database)); - else - if( strcmpi(key, "codepage") == 0 ) - safestrncpy(global_codepage, value, sizeof(global_codepage)); - else - return false;// not found - return true; + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "inter_configuration/database_names")) == NULL) { + if (imported) + return true; + ShowError("loginlog_config_read: inter_configuration/database_names was not found in %s!\n", filename); + return false; } - if( strcmpi(key, "log_db_ip") == 0 ) - safestrncpy(log_db_hostname, value, sizeof(log_db_hostname)); - else - if( strcmpi(key, "log_db_port") == 0 ) - log_db_port = (uint16)strtoul(value, NULL, 10); - else - if( strcmpi(key, "log_db_id") == 0 ) - safestrncpy(log_db_username, value, sizeof(log_db_username)); - else - if( strcmpi(key, "log_db_pw") == 0 ) - safestrncpy(log_db_password, value, sizeof(log_db_password)); - else - if( strcmpi(key, "log_db_db") == 0 ) - safestrncpy(log_db_database, value, sizeof(log_db_database)); - else - if( strcmpi(key, "log_codepage") == 0 ) - safestrncpy(log_codepage, value, sizeof(log_codepage)); - else - if( strcmpi(key, "log_login_db") == 0 ) - safestrncpy(log_login_db, value, sizeof(log_login_db)); - else + libconfig->setting_lookup_mutable_string(setting, "login_db", log_login_db, sizeof(log_login_db)); + + return true; +} + +/** + * Reads 'inter_configuration.log' and initializes required variables/Sets + * global configuration. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool loginlog_config_read_log(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "inter_configuration/log/sql_connection")) == NULL) { + if (imported) + return true; + ShowError("loginlog_config_read: inter_configuration/log/sql_connection was not found in %s!\n", filename); return false; + } + + libconfig->setting_lookup_mutable_string(setting, "db_hostname", log_db_hostname, sizeof(log_db_hostname)); + libconfig->setting_lookup_mutable_string(setting, "db_database", log_db_database, sizeof(log_db_database)); + libconfig->setting_lookup_mutable_string(setting, "db_username", log_db_username, sizeof(log_db_username)); + libconfig->setting_lookup_mutable_string(setting, "db_password", log_db_password, sizeof(log_db_password)); + + libconfig->setting_lookup_uint16(setting, "db_port", &log_db_port); + libconfig->setting_lookup_mutable_string(setting, "codepage", log_codepage, sizeof(log_codepage)); return true; } + +/** + * Reads 'inter_configuration' and initializes required variables/Sets global + * configuration. + * + * @param filename Path to configuration file. + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + **/ +bool loginlog_config_read(const char *filename, bool imported) +{ + struct config_t config; + const char *import = NULL; + bool retval = true; + + nullpo_retr(false, filename); + + if (!libconfig->load_file(&config, filename)) + return false; // Error message is already shown by libconfig->load_file + + if (!loginlog_config_read_names(filename, &config, imported)) + retval = false; + if (!loginlog_config_read_log(filename, &config, imported)) + retval = false; + + if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) { + if (strcmp(import, filename) == 0 || strcmp(import, "conf/common/inter-server.conf") == 0) { + ShowWarning("inter_config_read: Loop detected! Skipping 'import'...\n"); + } else { + if (!loginlog_config_read(import, true)) + retval = false; + } + } + + libconfig->destroy(&config); + return retval; +} diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 8d4aa317f..3f916eb42 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -3611,7 +3611,7 @@ ACMD(reloadbattleconf) struct Battle_Config prev_config; memcpy(&prev_config, &battle_config, sizeof(prev_config)); - battle->config_read(map->BATTLE_CONF_FILENAME); + battle->config_read(map->BATTLE_CONF_FILENAME, false); if (prev_config.feature_roulette == 0 && battle_config.feature_roulette == 1 && !clif->parse_roulette_db()) battle_config.feature_roulette = 0; diff --git a/src/map/battle.c b/src/map/battle.c index 908f0364b..c564b81cd 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -41,6 +41,7 @@ #include "map/status.h" #include "common/HPM.h" #include "common/cbasetypes.h" +#include "common/conf.h" #include "common/ers.h" #include "common/memmgr.h" #include "common/nullpo.h" @@ -7018,7 +7019,7 @@ static const struct battle_data { { "show_steal_in_same_party", &battle_config.show_steal_in_same_party, 0, 0, 1, }, { "party_hp_mode", &battle_config.party_hp_mode, 0, 0, 1, }, { "show_party_share_picker", &battle_config.party_show_share_picker, 1, 0, 1, }, - { "show_picker.item_type", &battle_config.show_picker_item_type, 112, 0, INT_MAX, }, + { "show_picker_item_type", &battle_config.show_picker_item_type, 112, 0, INT_MAX, }, { "party_update_interval", &battle_config.party_update_interval, 1000, 100, INT_MAX, }, { "party_item_share_type", &battle_config.party_share_type, 0, 0, 1|2|3, }, { "attack_attr_none", &battle_config.attack_attr_none, ~BL_PC, BL_NUL, BL_ALL, }, @@ -7177,14 +7178,14 @@ static const struct battle_data { { "display_status_timers", &battle_config.display_status_timers, 1, 0, 1, }, { "skill_add_heal_rate", &battle_config.skill_add_heal_rate, 7, 0, INT_MAX, }, { "eq_single_target_reflectable", &battle_config.eq_single_target_reflectable, 1, 0, 1, }, - { "invincible.nodamage", &battle_config.invincible_nodamage, 0, 0, 1, }, + { "invincible_nodamage", &battle_config.invincible_nodamage, 0, 0, 1, }, { "mob_slave_keep_target", &battle_config.mob_slave_keep_target, 0, 0, 1, }, { "autospell_check_range", &battle_config.autospell_check_range, 0, 0, 1, }, { "knockback_left", &battle_config.knockback_left, 1, 0, 1, }, { "client_reshuffle_dice", &battle_config.client_reshuffle_dice, 0, 0, 1, }, { "client_sort_storage", &battle_config.client_sort_storage, 0, 0, 1, }, - { "feature.buying_store", &battle_config.feature_buying_store, 1, 0, 1, }, - { "feature.search_stores", &battle_config.feature_search_stores, 1, 0, 1, }, + { "features/buying_store", &battle_config.feature_buying_store, 1, 0, 1, }, + { "features/search_stores", &battle_config.feature_search_stores, 1, 0, 1, }, { "searchstore_querydelay", &battle_config.searchstore_querydelay, 10, 0, INT_MAX, }, { "searchstore_maxresults", &battle_config.searchstore_maxresults, 30, 1, INT_MAX, }, { "display_party_name", &battle_config.display_party_name, 0, 0, 1, }, @@ -7204,7 +7205,7 @@ static const struct battle_data { { "atcommand_max_stat_bypass", &battle_config.atcommand_max_stat_bypass, 0, 0, 100, }, { "skill_amotion_leniency", &battle_config.skill_amotion_leniency, 90, 0, 300 }, { "mvp_tomb_enabled", &battle_config.mvp_tomb_enabled, 1, 0, 1 }, - { "feature.atcommand_suggestions", &battle_config.atcommand_suggestions_enabled, 0, 0, 1 }, + { "features/atcommand_suggestions", &battle_config.atcommand_suggestions_enabled, 0, 0, 1 }, { "min_npc_vendchat_distance", &battle_config.min_npc_vendchat_distance, 3, 0, 100 }, { "vendchat_near_hiddennpc", &battle_config.vendchat_near_hiddennpc, 0, 0, 1 }, { "atcommand_mobinfo_type", &battle_config.atcommand_mobinfo_type, 0, 0, 1 }, @@ -7225,8 +7226,8 @@ static const struct battle_data { { "client_accept_chatdori", &battle_config.client_accept_chatdori, 0, 0, INT_MAX, }, { "snovice_call_type", &battle_config.snovice_call_type, 0, 0, 1, }, { "guild_notice_changemap", &battle_config.guild_notice_changemap, 2, 0, 2, }, - { "feature.banking", &battle_config.feature_banking, 1, 0, 1, }, - { "feature.auction", &battle_config.feature_auction, 0, 0, 2, }, + { "features/banking", &battle_config.feature_banking, 1, 0, 1, }, + { "features/auction", &battle_config.feature_auction, 0, 0, 2, }, { "idletime_criteria", &battle_config.idletime_criteria, 0x25, 1, INT_MAX, }, { "mon_trans_disable_in_gvg", &battle_config.mon_trans_disable_in_gvg, 0, 0, 1, }, { "case_sensitive_aegisnames", &battle_config.case_sensitive_aegisnames, 1, 0, 1, }, @@ -7238,7 +7239,7 @@ static const struct battle_data { { "monster_chase_refresh", &battle_config.mob_chase_refresh, 1, 0, 30, }, { "mob_icewall_walk_block", &battle_config.mob_icewall_walk_block, 75, 0, 255, }, { "boss_icewall_walk_block", &battle_config.boss_icewall_walk_block, 0, 0, 255, }, - { "feature.roulette", &battle_config.feature_roulette, 1, 0, 1, }, + { "features/roulette", &battle_config.feature_roulette, 1, 0, 1, }, { "show_monster_hp_bar", &battle_config.show_monster_hp_bar, 1, 0, 1, }, { "fix_warp_hit_delay_abuse", &battle_config.fix_warp_hit_delay_abuse, 0, 0, 1, }, { "costume_refine_def", &battle_config.costume_refine_def, 1, 0, 1, }, @@ -7413,28 +7414,36 @@ static int Hercules_report_timer(int tid, int64 tick, int id, intptr_t data) { } #endif -int battle_set_value(const char* w1, const char* w2) +bool battle_set_value_sub(int index, int value) { - int val = config_switch(w2); + Assert_retr(false, index >= 0); + if (value < battle_data[index].min || value > battle_data[index].max) { + ShowWarning("Value for setting '%s': %d is invalid (min:%d max:%d)! Defaulting to %d...\n", + battle_data[index].str, value, battle_data[index].min, battle_data[index].max, battle_data[index].defval); + value = battle_data[index].defval; + } + *battle_data[index].val = value; + return true; +} + +bool battle_set_value(const char *param, const char *value) +{ + int val; int i; - nullpo_retr(1, w1); - nullpo_retr(1, w2); - ARR_FIND(0, ARRAYLENGTH(battle_data), i, strcmpi(w1, battle_data[i].str) == 0); - if (i == ARRAYLENGTH(battle_data)) { - if( HPM->parseConf(w1,w2,HPCT_BATTLE) ) /* if plugin-owned, succeed */ - return 1; - return 0; // not found - } + nullpo_retr(false, param); + nullpo_retr(false, value); - if (val < battle_data[i].min || val > battle_data[i].max) - { - ShowWarning("Value for setting '%s': %s is invalid (min:%i max:%i)! Defaulting to %i...\n", w1, w2, battle_data[i].min, battle_data[i].max, battle_data[i].defval); - val = battle_data[i].defval; + val = config_switch(value); + + ARR_FIND(0, ARRAYLENGTH(battle_data), i, strcmpi(param, battle_data[i].str) == 0); + if (i == ARRAYLENGTH(battle_data)) { + if (HPM->parseConf(param, value, HPCT_BATTLE)) /* if plugin-owned, succeed */ + return true; + return false; // not found } - *battle_data[i].val = val; - return 1; + return battle->config_set_value_sub(i, val); } bool battle_get_value(const char *w1, int *value) @@ -7485,36 +7494,36 @@ void battle_adjust_conf(void) { #if PACKETVER < 20100427 if( battle_config.feature_buying_store ) { - ShowWarning("conf/battle/feature.conf buying_store is enabled but it requires PACKETVER 2010-04-27 or newer, disabling...\n"); + ShowWarning("conf/map/battle/feature.conf buying_store is enabled but it requires PACKETVER 2010-04-27 or newer, disabling...\n"); battle_config.feature_buying_store = 0; } #endif #if PACKETVER < 20100803 if( battle_config.feature_search_stores ) { - ShowWarning("conf/battle/feature.conf search_stores is enabled but it requires PACKETVER 2010-08-03 or newer, disabling...\n"); + ShowWarning("conf/map/battle/feature.conf search_stores is enabled but it requires PACKETVER 2010-08-03 or newer, disabling...\n"); battle_config.feature_search_stores = 0; } #endif #if PACKETVER < 20130724 if( battle_config.feature_banking ) { - ShowWarning("conf/battle/feature.conf banking is enabled but it requires PACKETVER 2013-07-24 or newer, disabling...\n"); + ShowWarning("conf/map/battle/feature.conf banking is enabled but it requires PACKETVER 2013-07-24 or newer, disabling...\n"); battle_config.feature_banking = 0; } #endif #if PACKETVER < 20141022 if( battle_config.feature_roulette ) { - ShowWarning("conf/battle/feature.conf roulette is enabled but it requires PACKETVER 2014-10-22 or newer, disabling...\n"); + ShowWarning("conf/map/battle/feature.conf roulette is enabled but it requires PACKETVER 2014-10-22 or newer, disabling...\n"); battle_config.feature_roulette = 0; } #endif #if PACKETVER > 20120000 && PACKETVER < 20130515 /* exact date (when it started) not known */ if( battle_config.feature_auction == 1 ) { - ShowWarning("conf/battle/feature.conf:feature.auction is enabled but it is not stable on PACKETVER "EXPAND_AND_QUOTE(PACKETVER)", disabling...\n"); - ShowWarning("conf/battle/feature.conf:feature.auction change value to '2' to silence this warning and maintain it enabled\n"); + ShowWarning("conf/map/battle/feature.conf:features/auction is enabled but it is not stable on PACKETVER "EXPAND_AND_QUOTE(PACKETVER)", disabling...\n"); + ShowWarning("conf/map/battle/feature.conf:features/auction change value to '2' to silence this warning and maintain it enabled\n"); battle_config.feature_auction = 0; } #endif @@ -7525,48 +7534,78 @@ void battle_adjust_conf(void) { #endif } -int battle_config_read(const char* cfgName) +/** + * Dynamically reads battle configuration and initializes required variables. + * + * @param filename Path to configuration file. + * @param imported Whether the current config is imported from another file. + * @retval false in case of error. + */ +bool battle_config_read(const char *filename, bool imported) { - FILE* fp; - static int count = 0; + struct config_t config; + const struct config_setting_t *setting = NULL; + int i; + const char *import = NULL; + bool retval = true; + + nullpo_retr(false, filename); - nullpo_ret(cfgName); + if (!libconfig->load_file(&config, filename)) + return false; // Error message is already shown by libconfig->load_file() - if (count == 0) + if (!imported) battle->config_set_defaults(); - count++; + for (i = 0; i < ARRAYLENGTH(battle_data); i++) { + int type, val; + char config_name[256]; + safesnprintf(config_name, sizeof config_name, "battle_configuration/%s", battle_data[i].str); - fp = fopen(cfgName,"r"); - if (fp == NULL) - ShowError("File not found: %s\n", cfgName); - else - { - char line[1024], w1[1024], w2[1024]; - while(fgets(line, sizeof(line), fp)) - { - if (line[0] == '/' && line[1] == '/') - continue; - if (sscanf(line, "%1023[^:]:%1023s", w1, w2) != 2) - continue; - if (strcmpi(w1, "import") == 0) - battle->config_read(w2); - else - if (battle->config_set_value(w1, w2) == 0) - ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName); + if ((setting = libconfig->lookup(&config, config_name)) == NULL) { + if (!imported) { + ShowWarning("Missing configuration '%s' in file %s!\n", config_name, filename); + retval = false; + } + continue; } - fclose(fp); + switch ((type = config_setting_type(setting))) { + case CONFIG_TYPE_INT: + val = libconfig->setting_get_int(setting); + break; + case CONFIG_TYPE_BOOL: + val = libconfig->setting_get_bool(setting); + break; + default: // Unsupported type + ShowWarning("Setting %s has unsupported type %d, ignoring...\n", config_name, type); + retval = false; + continue; + } + + if (!battle->config_set_value_sub(i, val)) + retval = false; } - count--; + if (!HPM->parse_battle_conf(&config, filename, imported)) + retval = false; + + // import should overwrite any previous configuration, so it should be called last + if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) { + if (strcmp(import, filename) == 0 || strcmp(import, map->BATTLE_CONF_FILENAME) == 0) { + ShowWarning("battle_config_read: Loop detected! Skipping 'import'...\n"); + } else { + if (!battle->config_read(import, true)) + retval = false; + } + } - if (count == 0) { + libconfig->destroy(&config); + if (!imported) { battle->config_adjust(); clif->bc_ready(); } - - return 0; + return retval; } void do_init_battle(bool minimal) { @@ -7645,6 +7684,7 @@ void battle_defaults(void) { battle->calc_drain = battle_calc_drain; battle->config_read = battle_config_read; battle->config_set_defaults = battle_set_defaults; + battle->config_set_value_sub = battle_set_value_sub; battle->config_set_value = battle_set_value; battle->config_get_value = battle_get_value; battle->config_adjust = battle_adjust_conf; diff --git a/src/map/battle.h b/src/map/battle.h index e04a713ae..ebfa0e305 100644 --- a/src/map/battle.h +++ b/src/map/battle.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 @@ -663,10 +663,11 @@ struct battle_interface { int (*adjust_skill_damage) (int m, unsigned short skill_id); int64 (*add_mastery) (struct map_session_data *sd,struct block_list *target,int64 dmg,int type); int (*calc_drain) (int64 damage, int rate, int per); - /* - battle_config */ - int (*config_read) (const char *cfgName); + /* battle_config */ + bool (*config_read) (const char *filename, bool imported); void (*config_set_defaults) (void); - int (*config_set_value) (const char *w1, const char *w2); + bool (*config_set_value_sub) (int index, int value); + bool (*config_set_value) (const char *param, const char *value); bool (*config_get_value) (const char *w1, int *value); void (*config_adjust) (void); /* ----------------------------------------- */ diff --git a/src/map/log.c b/src/map/log.c index c19190d90..6131f9cf4 100644 --- a/src/map/log.c +++ b/src/map/log.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 @@ -28,6 +28,7 @@ #include "map/mob.h" #include "map/pc.h" #include "common/cbasetypes.h" +#include "common/conf.h" #include "common/nullpo.h" #include "common/showmsg.h" #include "common/sql.h" // SQL_INNODB @@ -479,119 +480,250 @@ void log_sql_final(void) { logs->mysql_handle = NULL; } -void log_set_defaults(void) { +/** + * Initializes logs->config variables + */ +void log_set_defaults(void) +{ memset(&logs->config, 0, sizeof(logs->config)); - //LOG FILTER Default values + //map_log default values + logs->config.enable_logs = 0xFFFFF; + logs->config.commands = true; + + //map_log/database default values + logs->config.sql_logs = true; + // file/table names defaults are defined inside log_config_read_database + + //map_log/filter/item default values + logs->config.filter = 1; // logs any item logs->config.refine_items_log = 5; // log refined items, with refine >= +5 logs->config.rare_items_log = 100; // log rare items. drop chance <= 1% logs->config.price_items_log = 1000; // 1000z logs->config.amount_items_log = 100; } -int log_config_read(const char* cfgName) { - static int count = 0; - char line[1024], w1[1024], w2[1024]; - FILE *fp; +/** + * Reads 'map_log/database' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool log_config_read_database(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "map_log/database")) == NULL) { + if (imported) + return true; + ShowError("log_config_read: map_log/database was not found in %s!\n", filename); + return false; + } + libconfig->setting_lookup_bool_real(setting, "use_sql", &logs->config.sql_logs); + + // map_log.database defaults are defined in order to not make unecessary calls to safestrncpy [Panikon] + if (libconfig->setting_lookup_mutable_string(setting, "log_branch_db", + logs->config.log_branch, sizeof(logs->config.log_branch)) == CONFIG_FALSE) + safestrncpy(logs->config.log_branch, "branchlog", sizeof(logs->config.log_branch)); + + if (libconfig->setting_lookup_mutable_string(setting, "log_pick_db", + logs->config.log_pick, sizeof(logs->config.log_pick)) == CONFIG_FALSE) + safestrncpy(logs->config.log_pick, "picklog", sizeof(logs->config.log_pick)); + + if (libconfig->setting_lookup_mutable_string(setting, "log_zeny_db", + logs->config.log_zeny, sizeof(logs->config.log_zeny)) == CONFIG_FALSE) + safestrncpy(logs->config.log_zeny, "zenylog", sizeof(logs->config.log_zeny)); + + if (libconfig->setting_lookup_mutable_string(setting, "log_mvpdrop_db", + logs->config.log_mvpdrop, sizeof(logs->config.log_mvpdrop)) == CONFIG_FALSE) + safestrncpy(logs->config.log_mvpdrop, "mvplog", sizeof(logs->config.log_mvpdrop)); + + if (libconfig->setting_lookup_mutable_string(setting, "log_gm_db", + logs->config.log_gm, sizeof(logs->config.log_gm)) == CONFIG_FALSE) + safestrncpy(logs->config.log_gm, "atcommandlog", sizeof(logs->config.log_gm)); + + if (libconfig->setting_lookup_mutable_string(setting, "log_npc_db", + logs->config.log_npc, sizeof(logs->config.log_npc)) == CONFIG_FALSE) + safestrncpy(logs->config.log_npc, "npclog", sizeof(logs->config.log_npc)); + + if (libconfig->setting_lookup_mutable_string(setting, "log_chat_db", + logs->config.log_chat, sizeof(logs->config.log_chat)) == CONFIG_FALSE) + safestrncpy(logs->config.log_chat, "chatlog", sizeof(logs->config.log_chat)); + + return true; +} + +/** + * Reads 'map_log/filter/item' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool log_config_read_filter_item(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); - nullpo_retr(1, cfgName); - if( count++ == 0 ) + if ((setting = libconfig->lookup(config, "map_log/filter/item")) == NULL) { + if (!imported) + ShowError("log_config_read: map_log/filter/item was not found in %s!\n", filename); + return false; + } + libconfig->setting_lookup_int(setting, "log_filter", &logs->config.filter); + libconfig->setting_lookup_int(setting, "refine_items_log", &logs->config.refine_items_log); + libconfig->setting_lookup_int(setting, "rare_items_log", &logs->config.rare_items_log); + libconfig->setting_lookup_int(setting, "price_items_log", &logs->config.price_items_log); + libconfig->setting_lookup_int(setting, "amount_items_log", &logs->config.amount_items_log); + return true; +} + +/** + * Reads 'map_log.filter.chat' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool log_config_read_filter_chat(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "map_log/filter/chat")) == NULL) { + if (!imported) + ShowError("log_config_read: map_log/filter/chat was not found in %s!\n", filename); + return false; + } + libconfig->setting_lookup_int(setting, "log_chat", &logs->config.chat); + libconfig->setting_lookup_bool_real(setting, "log_chat_woe_disable", &logs->config.log_chat_woe_disable); + return true; +} + +/** + * Reads 'map_log.filter' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool log_config_read_filter(const char *filename, struct config_t *config, bool imported) +{ + bool retval = true; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if (!log_config_read_filter_item(filename, config, imported)) + retval = false; + if (!log_config_read_filter_chat(filename, config, imported)) + retval = false; + + return retval; +} + +/** + * Reads 'map_log' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool log_config_read(const char *filename, bool imported) +{ + struct config_t config; + struct config_setting_t *setting = NULL; + const char *import; + const char *target; // Type of storage 'file'/'table' + int temp; + bool retval = true; + + nullpo_retr(false, filename); + + if (!imported) log_set_defaults(); - if( ( fp = fopen(cfgName, "r") ) == NULL ) { - ShowError("Log configuration file not found at: %s\n", cfgName); - return 1; + if (!libconfig->load_file(&config, filename)) + return false; + + if ((setting = libconfig->lookup(&config, "map_log")) == NULL) { + libconfig->destroy(&config); + if (imported) + return true; + ShowError("log_config_read: map_log was not found in %s!\n", filename); + return false; } - while (fgets(line, sizeof(line), fp)) { - if (line[0] == '/' && line[1] == '/') - continue; - - if (sscanf(line, "%1023[^:]: %1023[^\r\n]", w1, w2) == 2) { - if( strcmpi(w1, "enable_logs") == 0 ) - logs->config.enable_logs = (e_log_pick_type)config_switch(w2); - else if( strcmpi(w1, "sql_logs") == 0 ) - logs->config.sql_logs = (bool)config_switch(w2); -//start of common filter settings - else if( strcmpi(w1, "rare_items_log") == 0 ) - logs->config.rare_items_log = atoi(w2); - else if( strcmpi(w1, "refine_items_log") == 0 ) - logs->config.refine_items_log = atoi(w2); - else if( strcmpi(w1, "price_items_log") == 0 ) - logs->config.price_items_log = atoi(w2); - else if( strcmpi(w1, "amount_items_log") == 0 ) - logs->config.amount_items_log = atoi(w2); -//end of common filter settings - else if( strcmpi(w1, "log_branch") == 0 ) - logs->config.branch = config_switch(w2); - else if( strcmpi(w1, "log_filter") == 0 ) - logs->config.filter = config_switch(w2); - else if( strcmpi(w1, "log_zeny") == 0 ) - logs->config.zeny = config_switch(w2); - else if( strcmpi(w1, "log_commands") == 0 ) - logs->config.commands = config_switch(w2); - else if( strcmpi(w1, "log_npc") == 0 ) - logs->config.npc = config_switch(w2); - else if( strcmpi(w1, "log_chat") == 0 ) - logs->config.chat = config_switch(w2); - else if( strcmpi(w1, "log_mvpdrop") == 0 ) - logs->config.mvpdrop = config_switch(w2); - else if( strcmpi(w1, "log_chat_woe_disable") == 0 ) - logs->config.log_chat_woe_disable = (bool)config_switch(w2); - else if( strcmpi(w1, "log_branch_db") == 0 ) - safestrncpy(logs->config.log_branch, w2, sizeof(logs->config.log_branch)); - else if( strcmpi(w1, "log_pick_db") == 0 ) - safestrncpy(logs->config.log_pick, w2, sizeof(logs->config.log_pick)); - else if( strcmpi(w1, "log_zeny_db") == 0 ) - safestrncpy(logs->config.log_zeny, w2, sizeof(logs->config.log_zeny)); - else if( strcmpi(w1, "log_mvpdrop_db") == 0 ) - safestrncpy(logs->config.log_mvpdrop, w2, sizeof(logs->config.log_mvpdrop)); - else if( strcmpi(w1, "log_gm_db") == 0 ) - safestrncpy(logs->config.log_gm, w2, sizeof(logs->config.log_gm)); - else if( strcmpi(w1, "log_npc_db") == 0 ) - safestrncpy(logs->config.log_npc, w2, sizeof(logs->config.log_npc)); - else if( strcmpi(w1, "log_chat_db") == 0 ) - safestrncpy(logs->config.log_chat, w2, sizeof(logs->config.log_chat)); - //support the import command, just like any other config - else if( strcmpi(w1,"import") == 0 ) - logs->config_read(w2); - else if (HPM->parseConf(w1, w2, HPCT_LOG)) - ; // handled by plugins - else - ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName); - } + if (libconfig->setting_lookup_int(setting, "enable", &temp) == CONFIG_TRUE) { + logs->config.enable_logs = temp&LOG_TYPE_ALL; // e_log_pick_type } + libconfig->setting_lookup_int(setting, "log_zeny", &logs->config.zeny); + libconfig->setting_lookup_bool_real(setting, "log_branch", &logs->config.branch); + libconfig->setting_lookup_bool_real(setting, "log_mvpdrop", &logs->config.mvpdrop); + libconfig->setting_lookup_bool_real(setting, "log_commands", &logs->config.commands); + libconfig->setting_lookup_bool_real(setting, "log_npc", &logs->config.npc); - fclose(fp); + if (!log_config_read_database(filename, &config, imported)) + retval = false; + if (!log_config_read_filter(filename, &config, imported)) + retval = false; - if( --count == 0 ) {// report final logging state - const char* target = logs->config.sql_logs ? "table" : "file"; + // TODO HPM->parseConf(w1, w2, HPCT_LOG); - if( logs->config.enable_logs && logs->config.filter ) { - ShowInfo("Logging item transactions to %s '%s'.\n", target, logs->config.log_pick); - } - if( logs->config.branch ) { - ShowInfo("Logging monster summon item usage to %s '%s'.\n", target, logs->config.log_pick); - } - if( logs->config.chat ) { - ShowInfo("Logging chat to %s '%s'.\n", target, logs->config.log_chat); - } - if( logs->config.commands ) { - ShowInfo("Logging commands to %s '%s'.\n", target, logs->config.log_gm); - } - if( logs->config.mvpdrop ) { - ShowInfo("Logging MVP monster rewards to %s '%s'.\n", target, logs->config.log_mvpdrop); - } - if( logs->config.npc ) { - ShowInfo("Logging 'logmes' messages to %s '%s'.\n", target, logs->config.log_npc); - } - if( logs->config.zeny ) { - ShowInfo("Logging Zeny transactions to %s '%s'.\n", target, logs->config.log_zeny); + target = logs->config.sql_logs ? "table" : "file"; + + if (logs->config.enable_logs && logs->config.filter) + ShowInfo("Logging item transactions to %s '%s'.\n", target, logs->config.log_pick); + + if (logs->config.branch) + ShowInfo("Logging monster summon item usage to %s '%s'.\n", target, logs->config.log_branch); + + if (logs->config.chat) + ShowInfo("Logging chat to %s '%s'.\n", target, logs->config.log_chat); + + if (logs->config.commands) + ShowInfo("Logging commands to %s '%s'.\n", target, logs->config.log_gm); + + if (logs->config.mvpdrop) + ShowInfo("Logging MVP monster rewards to %s '%s'.\n", target, logs->config.log_mvpdrop); + + if (logs->config.npc) + ShowInfo("Logging 'logmes' messages to %s '%s'.\n", target, logs->config.log_npc); + + if (logs->config.zeny) + ShowInfo("Logging Zeny transactions to %s '%s'.\n", target, logs->config.log_zeny); + + logs->config_done(); + + // import should overwrite any previous configuration, so it should be called last + if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) { + if (strcmp(import, filename) == 0 || strcmp(import, map->LOG_CONF_NAME) == 0) { + ShowWarning("log_config_read: Loop detected! Skipping 'import'...\n"); + } else { + if (!logs->config_read(import, true)) + retval = false; } - logs->config_done(); } - return 0; + libconfig->destroy(&config); + return retval; } void log_config_complete(void) { @@ -606,6 +738,9 @@ void log_config_complete(void) { } } +/** + * Initializes the log interface to the default values. + */ void log_defaults(void) { logs = &log_s; diff --git a/src/map/log.h b/src/map/log.h index 0a5e13208..7ff36d126 100644 --- a/src/map/log.h +++ b/src/map/log.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 @@ -118,7 +118,8 @@ struct log_interface { bool sql_logs; bool log_chat_woe_disable; int rare_items_log,refine_items_log,price_items_log,amount_items_log; - int branch, mvpdrop, zeny, commands, npc, chat; + int zeny, chat; + bool branch, mvpdrop, commands, npc; char log_branch[64], log_pick[64], log_zeny[64], log_mvpdrop[64], log_gm[64], log_npc[64], log_chat[64]; } config; /* */ @@ -146,7 +147,7 @@ struct log_interface { void (*branch_sub) (struct map_session_data* sd); void (*mvpdrop_sub) (struct map_session_data* sd, int monster_id, int* log_mvp); - int (*config_read) (const char* cfgName); + bool (*config_read) (const char *filename, bool imported); void (*config_done) (void); void (*sql_init) (void); void (*sql_final) (void); diff --git a/src/map/map.c b/src/map/map.c index d6425b94e..40bcd9263 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -79,6 +79,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <sys/stat.h> #ifndef _WIN32 #include <unistd.h> #endif @@ -3330,20 +3331,42 @@ int map_readfromcache(struct map_data *m, char *buffer) { return 0; // Not found } -int map_addmap(const char* mapname) { +/** + * Adds a new empty map to the map list. + * + * Assumes that there's enough space in the map list. + * + * @param mapname The new map's name. + * @return success state. + */ +int map_addmap(const char *mapname) +{ map->list[map->count].instance_id = -1; mapindex->getmapname(mapname, map->list[map->count++].name); return 0; } -void map_delmapid(int id) { +/** + * Removes a map from the map list. + * + * @param id The map ID. + */ +void map_delmapid(int id) +{ Assert_retv(id >= 0 && id < map->count); ShowNotice("Removing map [ %s ] from maplist"CL_CLL"\n",map->list[id].name); memmove(map->list+id, map->list+id+1, sizeof(map->list[0])*(map->count-id-1)); map->count--; } -int map_delmap(char* mapname) { +/** + * Removes a map fromt he map list. + * + * @param mapname The name of the map to remove. + * @return the number of removed maps. + */ +int map_delmap(const char *mapname) +{ int i; char map_name[MAP_NAME_LENGTH]; @@ -3798,181 +3821,383 @@ int map_readallmaps (void) { return 0; } -/*========================================== - * Read map server configuration files (conf/map_server.conf...) - *------------------------------------------*/ -int map_config_read(char *cfgName) { - char line[1024], w1[1024], w2[1024]; - FILE *fp; +/** + * Reads 'map_configuration/console' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool map_config_read_console(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; - nullpo_retr(1, cfgName); + nullpo_retr(false, filename); + nullpo_retr(false, config); - fp = fopen(cfgName,"r"); - if( fp == NULL ) { - ShowError("Map configuration file not found at: %s\n", cfgName); - return 1; + if ((setting = libconfig->lookup(config, "map_configuration/console")) == NULL) { + if (imported) + return true; + ShowError("map_config_read: map_configuration/console was not found in %s!\n", filename); + return false; } - while (fgets(line, sizeof(line), fp)) { - char* ptr; + libconfig->setting_lookup_bool_real(setting, "stdout_with_ansisequence", &showmsg->stdout_with_ansisequence); + if (libconfig->setting_lookup_int(setting, "console_silent", &showmsg->silent) == CONFIG_TRUE) { + if (showmsg->silent) // only bother if its actually enabled + ShowInfo("Console Silent Setting: %d\n", showmsg->silent); + } + libconfig->setting_lookup_mutable_string(setting, "timestamp_format", showmsg->timestamp_format, sizeof(showmsg->timestamp_format)); + libconfig->setting_lookup_int(setting, "console_msg_log", &showmsg->console_log); - if (line[0] == '/' && line[1] == '/') - continue; - if ((ptr = strstr(line, "//")) != NULL) - *ptr = '\n'; //Strip comments - if (sscanf(line, "%1023[^:]: %1023[^\t\r\n]", w1, w2) < 2) - continue; + return true; +} - //Strip trailing spaces - ptr = w2 + strlen(w2); - while (--ptr >= w2 && *ptr == ' '); - ptr++; - *ptr = '\0'; - - if(strcmpi(w1,"timestamp_format")==0) - safestrncpy(showmsg->timestamp_format, w2, 20); - else if(strcmpi(w1,"stdout_with_ansisequence")==0) - showmsg->stdout_with_ansisequence = config_switch(w2) ? true : false; - else if(strcmpi(w1,"console_silent")==0) { - showmsg->silent = atoi(w2); - if (showmsg->silent) // only bother if its actually enabled - ShowInfo("Console Silent Setting: %d\n", atoi(w2)); - } else if (strcmpi(w1, "userid")==0) - chrif->setuserid(w2); - else if (strcmpi(w1, "passwd") == 0) - chrif->setpasswd(w2); - else if (strcmpi(w1, "char_ip") == 0) - map->char_ip_set = chrif->setip(w2); - else if (strcmpi(w1, "char_port") == 0) - chrif->setport(atoi(w2)); - else if (strcmpi(w1, "map_ip") == 0) - map->ip_set = clif->setip(w2); - else if (strcmpi(w1, "bind_ip") == 0) - clif->setbindip(w2); - else if (strcmpi(w1, "map_port") == 0) { - clif->setport(atoi(w2)); - map->port = (atoi(w2)); - } else if (strcmpi(w1, "map") == 0) - map->count++; - else if (strcmpi(w1, "delmap") == 0) - map->count--; - else if (strcmpi(w1, "npc") == 0) - npc->addsrcfile(w2); - else if (strcmpi(w1, "delnpc") == 0) - npc->delsrcfile(w2); - else if (strcmpi(w1, "autosave_time") == 0) { - map->autosave_interval = atoi(w2); - if (map->autosave_interval < 1) //Revert to default saving. - map->autosave_interval = DEFAULT_AUTOSAVE_INTERVAL; - else - map->autosave_interval *= 1000; //Pass from sec to ms - } else if (strcmpi(w1, "minsave_time") == 0) { - map->minsave_interval= atoi(w2); - if (map->minsave_interval < 1) - map->minsave_interval = 1; - } else if (strcmpi(w1, "save_settings") == 0) - map->save_settings = atoi(w2); - else if (strcmpi(w1, "help_txt") == 0) - strcpy(map->help_txt, w2); - else if (strcmpi(w1, "help2_txt") == 0) - strcpy(map->help2_txt, w2); - else if (strcmpi(w1, "charhelp_txt") == 0) - strcpy(map->charhelp_txt, w2); - else if(strcmpi(w1,"db_path") == 0) - safestrncpy(map->db_path,w2,255); - else if (strcmpi(w1, "enable_spy") == 0) - map->enable_spy = config_switch(w2); - else if (strcmpi(w1, "use_grf") == 0) - map->enable_grf = config_switch(w2); - else if (strcmpi(w1, "console_msg_log") == 0) - showmsg->console_log = atoi(w2);//[Ind] - else if (strcmpi(w1, "default_language") == 0) - safestrncpy(map->default_lang_str, w2, sizeof(map->default_lang_str)); - else if (strcmpi(w1, "import") == 0) - map->config_read(w2); +/** + * Reads 'map_configuration/sql_connection' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool map_config_read_connection(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "map_configuration/sql_connection")) == NULL) { + if (imported) + return true; + ShowError("map_config_read: map_configuration/sql_connection was not found in %s!\n", filename); + ShowWarning("map_config_read_connection: Defaulting sql_connection...\n"); + return false; + } + + libconfig->setting_lookup_int(setting, "db_port", &map->server_port); + libconfig->setting_lookup_mutable_string(setting, "db_hostname", map->server_ip, sizeof(map->server_ip)); + libconfig->setting_lookup_mutable_string(setting, "db_username", map->server_id, sizeof(map->server_id)); + libconfig->setting_lookup_mutable_string(setting, "db_password", map->server_pw, sizeof(map->server_pw)); + libconfig->setting_lookup_mutable_string(setting, "db_database", map->server_db, sizeof(map->server_db)); + libconfig->setting_lookup_mutable_string(setting, "default_codepage", map->default_codepage, sizeof(map->default_codepage)); + return true; +} + +/** + * Reads 'map_configuration/inter' and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool map_config_read_inter(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + const char *str = NULL; + char temp[24]; + uint16 port; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "map_configuration/inter")) == NULL) { + if (imported) + return true; + ShowError("map_config_read: map_configuration/inter was not found in %s!\n", filename); + return false; + } + + // Login information + if (libconfig->setting_lookup_mutable_string(setting, "userid", temp, sizeof(temp)) == CONFIG_TRUE) + chrif->setuserid(temp); + if (libconfig->setting_lookup_mutable_string(setting, "passwd", temp, sizeof(temp)) == CONFIG_TRUE) + chrif->setpasswd(temp); + + // Char and map-server information + if (libconfig->setting_lookup_string(setting, "char_ip", &str) == CONFIG_TRUE) + map->char_ip_set = chrif->setip(str); + if (libconfig->setting_lookup_uint16(setting, "char_port", &port) == CONFIG_TRUE) + chrif->setport(port); + + if (libconfig->setting_lookup_string(setting, "map_ip", &str) == CONFIG_TRUE) + map->ip_set = clif->setip(str); + if (libconfig->setting_lookup_uint16(setting, "map_port", &port) == CONFIG_TRUE) { + clif->setport(port); + map->port = port; + } + if (libconfig->setting_lookup_string(setting, "bind_ip", &str) == CONFIG_TRUE) + clif->setbindip(str); + + return true; +} + +/** + * Reads 'map_configuration/database' and initializes required variables + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool map_config_read_database(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "map_configuration/database")) == NULL) { + if (imported) + return true; + ShowError("map_config_read: map_configuration/database was not found in %s!\n", filename); + return false; + } + libconfig->setting_lookup_mutable_string(setting, "db_path", map->db_path, sizeof(map->db_path)); + libconfig->setting_lookup_int(setting, "save_settings", &map->save_settings); + + if (libconfig->setting_lookup_int(setting, "autosave_time", &map->autosave_interval) == CONFIG_TRUE) { + if (map->autosave_interval < 1) // Revert to default saving + map->autosave_interval = DEFAULT_AUTOSAVE_INTERVAL; else - ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName); + map->autosave_interval *= 1000; // Pass from s to ms + } + if (libconfig->setting_lookup_int(setting, "minsave_time", &map->minsave_interval) == CONFIG_TRUE) { + if (map->minsave_interval < 1) + map->minsave_interval = 1; } - fclose(fp); - return 0; + return true; } -int map_config_read_sub(char *cfgName) { - char line[1024], w1[1024], w2[1024]; - FILE *fp; - nullpo_retr(1, cfgName); - fp = fopen(cfgName,"r"); - if (fp == NULL) { - ShowError("Map configuration file not found at: %s\n", cfgName); - return 1; +/** + * Reads 'map_configuration/map_list'/'map_configuration/map_removed' and adds + * or removes maps from map-server. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool map_config_read_map_list(const char *filename, struct config_t *config, bool imported) +{ + struct config_setting_t *setting = NULL; + int i, count = 0; + struct DBMap *deleted_maps; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + deleted_maps = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_KEY, MAP_NAME_LENGTH); + + // Remove maps + if ((setting = libconfig->lookup(config, "map_configuration/map_removed")) != NULL) { + count = libconfig->setting_length(setting); + for (i = 0; i < count; i++) { + const char *mapname; + + if ((mapname = libconfig->setting_get_string_elem(setting, i)) == NULL || mapname[0] == '\0') + continue; + + strdb_put(deleted_maps, mapname, NULL); + + if (imported) // Map list is empty on the first run, only do this for imported files. + map->delmap(mapname); + } + } + + if ((setting = libconfig->lookup(config, "map_configuration/map_list")) == NULL) { + db_destroy(deleted_maps); + if (imported) + return true; + ShowError("map_config_read_map_list: map_configuration/map_list was not found in %s!\n", filename); + return false; } - while (fgets(line, sizeof(line), fp)) { - char* ptr; + // Add maps to map->list + count = libconfig->setting_length(setting); - if (line[0] == '/' && line[1] == '/') + if (count <= 0) { + db_destroy(deleted_maps); + if (imported) + return true; + ShowWarning("map_config_read_map_list: no maps found in %s!\n", filename); + return false; + } + + RECREATE(map->list, struct map_data, map->count + count); // TODO: VECTOR candidate + + for (i = 0; i < count; i++) { + const char *mapname; + + if ((mapname = libconfig->setting_get_string_elem(setting, i)) == NULL || mapname[0] == '\0') continue; - if ((ptr = strstr(line, "//")) != NULL) - *ptr = '\n'; //Strip comments - if (sscanf(line, "%1023[^:]: %1023[^\t\r\n]", w1, w2) < 2) + + if (strdb_exists(deleted_maps, mapname)) continue; - //Strip trailing spaces - ptr = w2 + strlen(w2); - while (--ptr >= w2 && *ptr == ' '); - ptr++; - *ptr = '\0'; + map->addmap(mapname); + } + + RECREATE(map->list, struct map_data, map->count); + + db_destroy(deleted_maps); + return true; +} + +/** + * Reads map-server configuration files (map-server.conf) and initialises + * required variables. + * + * @param filename Path to configuration file. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool map_config_read(const char *filename, bool imported) +{ + struct config_t config; + struct config_setting_t *setting = NULL; + const char *import = NULL; + bool retval = true; + + nullpo_retr(false, filename); + + if (!libconfig->load_file(&config, filename)) + return false; - if (strcmpi(w1, "map") == 0) - map->addmap(w2); - else if (strcmpi(w1, "delmap") == 0) - map->delmap(w2); - else if (strcmpi(w1, "import") == 0) - map->config_read_sub(w2); + if ((setting = libconfig->lookup(&config, "map_configuration")) == NULL) { + libconfig->destroy(&config); + if (imported) + return true; + ShowError("map_config_read: map_configuration was not found in %s!\n", filename); + return false; } - fclose(fp); - return 0; + libconfig->setting_lookup_mutable_string(setting, "help_txt", map->help_txt, sizeof(map->help_txt)); + libconfig->setting_lookup_mutable_string(setting, "charhelp_txt", map->charhelp_txt, sizeof(map->charhelp_txt)); + libconfig->setting_lookup_bool(setting, "enable_spy", &map->enable_spy); + libconfig->setting_lookup_bool(setting, "use_grf", &map->enable_grf); + libconfig->setting_lookup_mutable_string(setting, "default_language", map->default_lang_str, sizeof(map->default_lang_str)); + + if (!map_config_read_console(filename, &config, imported)) + retval = false; + if (!map_config_read_connection(filename, &config, imported)) + retval = false; + if (!map_config_read_inter(filename, &config, imported)) + retval = false; + if (!map_config_read_database(filename, &config, imported)) + retval = false; + if (!map_config_read_map_list(filename, &config, imported)) + retval = false; + + // import should overwrite any previous configuration, so it should be called last + if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) { + if (strcmp(import, filename) == 0 || strcmp(import, map->MAP_CONF_NAME) == 0) { + ShowWarning("map_config_read: Loop detected! Skipping 'import'...\n"); + } else { + if (!map->config_read(import, true)) + retval = false; + } + } + + libconfig->destroy(&config); + return retval; } -void map_reloadnpc_sub(char *cfgName) { - char line[1024], w1[1024], w2[1024]; - FILE *fp; - nullpo_retv(cfgName); - fp = fopen(cfgName,"r"); - if (fp == NULL) { - ShowError("Map configuration file not found at: %s\n", cfgName); - return; +/** + * Reads 'npc_global_list'/'npc_removed_list' and adds or removes NPC sources + * from map-server. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool map_read_npclist(const char *filename, bool imported) +{ + struct config_t config; + struct config_setting_t *setting = NULL; + const char *import = NULL; + bool retval = true; + + struct DBMap *deleted_npcs; + + nullpo_retr(false, filename); + + if (!libconfig->load_file(&config, filename)) + return false; + + deleted_npcs = strdb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_KEY, MAP_NAME_LENGTH); + + // Remove maps + if ((setting = libconfig->lookup(&config, "npc_removed_list")) != NULL) { + int i, del_count = libconfig->setting_length(setting); + for (i = 0; i < del_count; i++) { + const char *scriptname; + + if ((scriptname = libconfig->setting_get_string_elem(setting, i)) == NULL || scriptname[0] == '\0') + continue; + + strdb_put(deleted_npcs, scriptname, NULL); + + if (imported) // Map list is empty on the first run, only do this for imported files. + npc->delsrcfile(scriptname); + } } - while (fgets(line, sizeof(line), fp)) { - char* ptr; + if ((setting = libconfig->lookup(&config, "npc_global_list")) != NULL) { + int i, count = libconfig->setting_length(setting); + if (count <= 0) { + if (!imported) { + ShowWarning("map_read_npclist: no NPCs found in %s!\n", filename); + retval = false; + } + } + for (i = 0; i < count; i++) { + const char *scriptname; - if (line[0] == '/' && line[1] == '/') - continue; - if ((ptr = strstr(line, "//")) != NULL) - *ptr = '\n'; //Strip comments - if (sscanf(line, "%1023[^:]: %1023[^\t\r\n]", w1, w2) < 2) - continue; + if ((scriptname = libconfig->setting_get_string_elem(setting, i)) == NULL || scriptname[0] == '\0') + continue; - //Strip trailing spaces - ptr = w2 + strlen(w2); - while (--ptr >= w2 && *ptr == ' '); - ptr++; - *ptr = '\0'; - - if (strcmpi(w1, "npc") == 0) - npc->addsrcfile(w2); - else if (strcmpi(w1, "import") == 0) - map->reloadnpc_sub(w2); - else if (strcmpi(w1, "delnpc") == 0) - npc->delsrcfile(w2); - else - ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName); + if (strdb_exists(deleted_npcs, scriptname)) + continue; + + npc->addsrcfile(scriptname); + } + } else { + ShowError("map_read_npclist: npc_global_list was not found in %s!\n", filename); + retval = false; } - fclose(fp); + db_destroy(deleted_npcs); + + // import should overwrite any previous configuration, so it should be called last + if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) { + const char *base_npclist = NULL; +#ifdef RENEWAL + base_npclist = "npc/re/scripts_main.conf"; +#else + base_npclist = "npc/pre-re/scripts_main.conf"; +#endif + if (strcmp(import, filename) == 0 || strcmp(import, base_npclist) == 0) { + ShowWarning("map_read_npclist: Loop detected! Skipping 'import'...\n"); + } else { + if (!map->read_npclist(import, true)) + retval = false; + } + } + + libconfig->destroy(&config); + return retval; } /** @@ -3986,9 +4211,9 @@ void map_reloadnpc(bool clear) { npc->addsrcfile("clear"); // this will clear the current script list #ifdef RENEWAL - map->reloadnpc_sub("npc/re/scripts_main.conf"); + map->read_npclist("npc/re/scripts_main.conf", false); #else - map->reloadnpc_sub("npc/pre-re/scripts_main.conf"); + map->read_npclist("npc/pre-re/scripts_main.conf", false); #endif // Append extra scripts @@ -3997,63 +4222,125 @@ void map_reloadnpc(bool clear) { } } -int inter_config_read(char *cfgName) { - char line[1024],w1[1024],w2[1024]; - FILE *fp; +/** + * Reads inter-server.conf and initializes required variables. + * + * @param filename Path to configuration file + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool inter_config_read(const char *filename, bool imported) +{ + struct config_t config; + const struct config_setting_t *setting = NULL; + const char *import = NULL; + bool retval = true; + + nullpo_retr(false, filename); + + if (!libconfig->load_file(&config, filename)) + return false; + + if ((setting = libconfig->lookup(&config, "inter_configuration")) == NULL) { + libconfig->destroy(&config); + if (imported) + return true; + ShowError("inter_config_read: inter_configuration was not found in %s!\n", filename); + return false; + } + + if (!map->inter_config_read_database_names(filename, &config, imported)) + retval = false; + if (!map->inter_config_read_connection(filename, &config, imported)) + retval = false; + + // TODO HPM->parseConf(w1, w2, HPCT_MAP_INTER); + + // import should overwrite any previous configuration, so it should be called last + if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) { + if (strcmp(import, filename) == 0 || strcmp(import, map->INTER_CONF_NAME) == 0) { + ShowWarning("inter_config_read: Loop detected in %s! Skipping 'import'...\n", filename); + } else { + if (!map->inter_config_read(import, true)) + retval = false; + } + } + + libconfig->destroy(&config); + return retval; +} + +/** + * Reads the 'inter_configuration/log/sql_connection' config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool inter_config_read_connection(const char *filename, const struct config_t *config, bool imported) +{ + const struct config_setting_t *setting = NULL; - nullpo_retr(1, cfgName); - if (!(fp = fopen(cfgName,"r"))) { - ShowError("File not found: %s\n",cfgName); - return 1; + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "inter_configuration/log/sql_connection")) == NULL) { + if (imported) + return true; + ShowError("inter_config_read: inter_configuration/log/sql_connection was not found in %s!\n", filename); + return false; } - while (fgets(line, sizeof(line), fp)) { - if (line[0] == '/' && line[1] == '/') - continue; - if (sscanf(line,"%1023[^:]: %1023[^\r\n]", w1, w2) < 2) - continue; - /* map sql stuff */ - if(strcmpi(w1,"map_server_ip")==0) - safestrncpy(map->server_ip, w2, sizeof(map->server_ip)); - else if(strcmpi(w1,"map_server_port")==0) - map->server_port=atoi(w2); - else if(strcmpi(w1,"map_server_id")==0) - safestrncpy(map->server_id, w2, sizeof(map->server_id)); - else if(strcmpi(w1,"map_server_pw")==0) - safestrncpy(map->server_pw, w2, sizeof(map->server_pw)); - else if(strcmpi(w1,"map_server_db")==0) - safestrncpy(map->server_db, w2, sizeof(map->server_db)); - else if(strcmpi(w1,"default_codepage")==0) - safestrncpy(map->default_codepage, w2, sizeof(map->default_codepage)); - else if(strcmpi(w1,"autotrade_merchants_db")==0) - safestrncpy(map->autotrade_merchants_db, w2, sizeof(map->autotrade_merchants_db)); - else if(strcmpi(w1,"autotrade_data_db")==0) - safestrncpy(map->autotrade_data_db, w2, sizeof(map->autotrade_data_db)); - else if(strcmpi(w1,"npc_market_data_db")==0) - safestrncpy(map->npc_market_data_db, w2, sizeof(map->npc_market_data_db)); - /* sql log db */ - else if(strcmpi(w1,"log_db_ip")==0) - safestrncpy(logs->db_ip, w2, sizeof(logs->db_ip)); - else if(strcmpi(w1,"log_db_id")==0) - safestrncpy(logs->db_id, w2, sizeof(logs->db_id)); - else if(strcmpi(w1,"log_db_pw")==0) - safestrncpy(logs->db_pw, w2, sizeof(logs->db_pw)); - else if(strcmpi(w1,"log_db_port")==0) - logs->db_port = atoi(w2); - else if(strcmpi(w1,"log_db_db")==0) - safestrncpy(logs->db_name, w2, sizeof(logs->db_name)); - /* mapreg */ - else if( mapreg->config_read(w1,w2) ) - continue; - /* import */ - else if(strcmpi(w1,"import")==0) - map->inter_config_read(w2); - else - HPM->parseConf(w1, w2, HPCT_MAP_INTER); + libconfig->setting_lookup_int(setting, "port", &logs->db_port); + libconfig->setting_lookup_mutable_string(setting, "db_hostname", logs->db_ip, sizeof(logs->db_ip)); + libconfig->setting_lookup_mutable_string(setting, "db_username", logs->db_id, sizeof(logs->db_id)); + libconfig->setting_lookup_mutable_string(setting, "db_password", logs->db_pw, sizeof(logs->db_pw)); + libconfig->setting_lookup_mutable_string(setting, "db_database", logs->db_name, sizeof(logs->db_name)); + + return true; +} + +/** + * Reads the 'inter_configuration/database_names' config entry and initializes required variables. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool inter_config_read_database_names(const char *filename, const struct config_t *config, bool imported) +{ + const struct config_setting_t *setting = NULL; + bool retval = true; + + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if ((setting = libconfig->lookup(config, "inter_configuration/database_names")) == NULL) { + if (imported) + return true; + ShowError("inter_config_read: inter_configuration/database_names was not found in %s!\n", filename); + return false; } - fclose(fp); - return 0; + libconfig->setting_lookup_mutable_string(setting, "autotrade_merchants_db", map->autotrade_merchants_db, sizeof(map->autotrade_merchants_db)); + libconfig->setting_lookup_mutable_string(setting, "autotrade_data_db", map->autotrade_data_db, sizeof(map->autotrade_data_db)); + libconfig->setting_lookup_mutable_string(setting, "npc_market_data_db", map->npc_market_data_db, sizeof(map->npc_market_data_db)); + + if (!mapreg->config_read(filename, setting, imported)) + retval = false; + + if ((setting = libconfig->lookup(config, "inter_configuration/database_names/registry")) == NULL) { + if (imported) + return retval; + ShowError("inter_config_read: inter_configuration/database_names/registry was not found in %s!\n", filename); + return false; + } + return retval; } /*======================================= @@ -6077,12 +6364,12 @@ int do_init(int argc, char *argv[]) map_load_defaults(); - map->INTER_CONF_NAME = aStrdup("conf/inter-server.conf"); - map->LOG_CONF_NAME = aStrdup("conf/logs.conf"); - map->MAP_CONF_NAME = aStrdup("conf/map-server.conf"); - map->BATTLE_CONF_FILENAME = aStrdup("conf/battle.conf"); + map->INTER_CONF_NAME = aStrdup("conf/common/inter-server.conf"); + map->LOG_CONF_NAME = aStrdup("conf/map/logs.conf"); + map->MAP_CONF_NAME = aStrdup("conf/map/map-server.conf"); + map->BATTLE_CONF_FILENAME = aStrdup("conf/map/battle.conf"); map->ATCOMMAND_CONF_FILENAME = aStrdup("conf/atcommand.conf"); - map->SCRIPT_CONF_NAME = aStrdup("conf/script.conf"); + map->SCRIPT_CONF_NAME = aStrdup("conf/map/script.conf"); map->MSG_CONF_NAME = aStrdup("conf/messages.conf"); map->GRF_PATH_FILENAME = aStrdup("conf/grf-files.txt"); @@ -6095,10 +6382,30 @@ int do_init(int argc, char *argv[]) cmdline->exec(argc, argv, CMDLINE_OPT_NORMAL); minimal = map->minimal;/* temp (perhaps make minimal a mask with options of what to load? e.g. plugin 1 does minimal |= mob_db; */ if (!minimal) { - map->config_read(map->MAP_CONF_NAME); - CREATE(map->list,struct map_data,map->count); - map->count = 0; - map->config_read_sub(map->MAP_CONF_NAME); + map->config_read(map->MAP_CONF_NAME, false); + + { + // TODO: Remove this when no longer needed. +#define CHECK_OLD_LOCAL_CONF(oldname, newname) do { \ + if (stat((oldname), &fileinfo) == 0 && fileinfo.st_size > 0) { \ + ShowWarning("An old configuration file \"%s\" was found.\n", (oldname)); \ + ShowWarning("If it contains settings you wish to keep, please merge them into \"%s\".\n", (newname)); \ + ShowWarning("Otherwise, just delete it.\n"); \ + ShowInfo("Resuming in 10 seconds...\n"); \ + HSleep(10); \ + } \ +} while (0) + struct stat fileinfo; + + CHECK_OLD_LOCAL_CONF("conf/import/map_conf.txt", "conf/import/map-server.conf"); + CHECK_OLD_LOCAL_CONF("conf/import/inter_conf.txt", "conf/import/inter-server.conf"); + CHECK_OLD_LOCAL_CONF("conf/import/log_conf.txt", "conf/import/logs.conf"); + CHECK_OLD_LOCAL_CONF("conf/import/script_conf.txt", "conf/import/script.conf"); + CHECK_OLD_LOCAL_CONF("conf/import/packet_conf.txt", "conf/import/socket.conf"); + CHECK_OLD_LOCAL_CONF("conf/import/battle_conf.txt", "conf/import/battle.conf"); + +#undef CHECK_OLD_LOCAL_CONF + } // loads npcs map->reloadnpc(false); @@ -6110,7 +6417,7 @@ int do_init(int argc, char *argv[]) sockt->ip2str(sockt->addr_[0], ip_str); #ifndef BUILDBOT - ShowWarning("Not all IP addresses in /conf/map-server.conf configured, auto-detecting...\n"); + ShowWarning("Not all IP addresses in /conf/map/map-server.conf configured, auto-detecting...\n"); #endif if (sockt->naddr_ == 0) @@ -6126,12 +6433,12 @@ int do_init(int argc, char *argv[]) chrif->setip(ip_str); } - battle->config_read(map->BATTLE_CONF_FILENAME); + battle->config_read(map->BATTLE_CONF_FILENAME, false); atcommand->msg_read(map->MSG_CONF_NAME, false); - map->inter_config_read(map->INTER_CONF_NAME); - logs->config_read(map->LOG_CONF_NAME); + map->inter_config_read(map->INTER_CONF_NAME, false); + logs->config_read(map->LOG_CONF_NAME, false); } - script->config_read(map->SCRIPT_CONF_NAME); + script->config_read(map->SCRIPT_CONF_NAME, false); map->id_db = idb_alloc(DB_OPT_BASE); map->pc_db = idb_alloc(DB_OPT_BASE); //Added for reliable map->id2sd() use. [Skotlex] @@ -6275,7 +6582,6 @@ void map_defaults(void) { sprintf(map->db_path ,"db"); sprintf(map->help_txt ,"conf/help.txt"); - sprintf(map->help2_txt ,"conf/help2.txt"); sprintf(map->charhelp_txt ,"conf/charhelp.txt"); sprintf(map->wisp_server_name ,"Server"); // can be modified in char-server configuration file @@ -6288,12 +6594,12 @@ void map_defaults(void) { map->night_flag = 0; // 0=day, 1=night [Yor] map->enable_spy = 0; //To enable/disable @spy commands, which consume too much cpu time when sending packets. [Skotlex] - map->INTER_CONF_NAME="conf/inter-server.conf"; - map->LOG_CONF_NAME="conf/logs.conf"; - map->MAP_CONF_NAME = "conf/map-server.conf"; - map->BATTLE_CONF_FILENAME = "conf/battle.conf"; + map->INTER_CONF_NAME="conf/common/inter-server.conf"; + map->LOG_CONF_NAME="conf/map/logs.conf"; + map->MAP_CONF_NAME = "conf/map/map-server.conf"; + map->BATTLE_CONF_FILENAME = "conf/map/battle.conf"; map->ATCOMMAND_CONF_FILENAME = "conf/atcommand.conf"; - map->SCRIPT_CONF_NAME = "conf/script.conf"; + map->SCRIPT_CONF_NAME = "conf/map/script.conf"; map->MSG_CONF_NAME = "conf/messages.conf"; map->GRF_PATH_FILENAME = "conf/grf-files.txt"; @@ -6499,9 +6805,10 @@ void map_defaults(void) { map->readgat = map_readgat; map->readallmaps = map_readallmaps; map->config_read = map_config_read; - map->config_read_sub = map_config_read_sub; - map->reloadnpc_sub = map_reloadnpc_sub; + map->read_npclist = map_read_npclist; map->inter_config_read = inter_config_read; + map->inter_config_read_database_names = inter_config_read_database_names; + map->inter_config_read_connection = inter_config_read_connection; map->sql_init = map_sql_init; map->sql_close = map_sql_close; map->zone_mf_cache = map_zone_mf_cache; diff --git a/src/map/map.h b/src/map/map.h index dbd30febf..723691971 100644 --- a/src/map/map.h +++ b/src/map/map.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 @@ /* Forward Declarations */ struct Sql; // common/sql.h +struct config_t; // common/conf.h struct mob_data; struct npc_data; struct channel_data; @@ -967,7 +968,6 @@ struct map_interface { char db_path[256]; char help_txt[256]; - char help2_txt[256]; char charhelp_txt[256]; char wisp_server_name[NAME_LENGTH]; @@ -996,7 +996,7 @@ struct map_interface { char server_db[32]; struct Sql *mysql_handle; - int port; + uint16 port; int users; int enable_grf; //To enable/disable reading maps from GRF files, bypassing mapcache [blackhole89] bool ip_set; @@ -1147,7 +1147,7 @@ END_ZEROED_BLOCK; int (*cleanup_sub) (struct block_list *bl, va_list ap); - int (*delmap) (char* mapname); + int (*delmap) (const char *mapname); void (*flags_init) (void); bool (*iwall_set) (int16 m, int16 x, int16 y, int size, int8 dir, bool shootable, const char* wall_name); @@ -1187,10 +1187,11 @@ END_ZEROED_BLOCK; int (*waterheight) (char *mapname); int (*readgat) (struct map_data *m); int (*readallmaps) (void); - int (*config_read) (char *cfgName); - int (*config_read_sub) (char *cfgName); - void (*reloadnpc_sub) (char *cfgName); - int (*inter_config_read) (char *cfgName); + bool (*config_read) (const char *filename, bool imported); + bool (*read_npclist) (const char *filename, bool imported); + bool (*inter_config_read) (const char *filename, bool imported); + bool (*inter_config_read_database_names) (const char *filename, const struct config_t *config, bool imported); + bool (*inter_config_read_connection) (const char *filename, const struct config_t *config, bool imported); int (*sql_init) (void); int (*sql_close) (void); bool (*zone_mf_cache) (int m, char *flag, char *params); diff --git a/src/map/mapreg.h b/src/map/mapreg.h index d19b2bb80..642bce48e 100644 --- a/src/map/mapreg.h +++ b/src/map/mapreg.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 @@ -25,6 +25,8 @@ #include "common/hercules.h" #include "common/db.h" +/* Forward Declarations */ +struct config_setting_t; // common/conf.h struct eri; /** Container for a mapreg value */ @@ -61,7 +63,7 @@ struct mapreg_interface { int (*save_timer) (int tid, int64 tick, int id, intptr_t data); int (*destroyreg) (union DBKey key, struct DBData *data, va_list ap); void (*reload) (void); - bool (*config_read) (const char *w1, const char *w2); + bool (*config_read) (const char *filename, const struct config_setting_t *config, bool imported); }; #ifdef HERCULES_CORE diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c index 82ce39d64..4cdb91b21 100644 --- a/src/map/mapreg_sql.c +++ b/src/map/mapreg_sql.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 @@ -25,6 +25,7 @@ #include "map/map.h" // map-"mysql_handle #include "map/script.h" #include "common/cbasetypes.h" +#include "common/conf.h" #include "common/db.h" #include "common/ers.h" #include "common/memmgr.h" @@ -349,13 +350,19 @@ void mapreg_init(void) { /** * Loads the mapreg configuration file. + * + * @param filename Path to configuration file (used in error and warning messages). + * @param config The current config being parsed. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. */ -bool mapreg_config_read(const char* w1, const char* w2) { - nullpo_retr(false, w1); - nullpo_retr(false, w2); - if(!strcmpi(w1, "mapreg_db")) - safestrncpy(mapreg->table, w2, sizeof(mapreg->table)); - else +bool mapreg_config_read(const char *filename, const struct config_setting_t *config, bool imported) +{ + nullpo_retr(false, filename); + nullpo_retr(false, config); + + if (libconfig->setting_lookup_mutable_string(config, "mapreg_db", mapreg->table, sizeof(mapreg->table)) != CONFIG_TRUE) return false; return true; diff --git a/src/map/script.c b/src/map/script.c index 353d57a67..09cefa500 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -4521,52 +4521,55 @@ void run_script_main(struct script_state *st) { } } -int script_config_read(char *cfgName) { - int i; - char line[1024],w1[1024],w2[1024]; - FILE *fp; +/** + * Reads 'script_configuration' and initializes required variables. + * + * @param filename Path to configuration file. + * @param imported Whether the current config is imported from another file. + * + * @retval false in case of error. + */ +bool script_config_read(const char *filename, bool imported) +{ + struct config_t config; + struct config_setting_t * setting = NULL; + const char *import = NULL; + bool retval = true; - if( !( fp = fopen(cfgName,"r") ) ) { - ShowError("File not found: %s\n", cfgName); - return 1; + nullpo_retr(false, filename); + + if (!libconfig->load_file(&config, filename)) + return false; + + if ((setting = libconfig->lookup(&config, "script_configuration")) == NULL) { + libconfig->destroy(&config); + if (imported) + return true; + ShowError("script_config_read: script_configuration was not found in %s!\n", filename); + return false; } - while (fgets(line, sizeof(line), fp)) { - if (line[0] == '/' && line[1] == '/') - continue; - i = sscanf(line,"%1023[^:]: %1023[^\r\n]", w1, w2); - if(i!=2) - continue; - if(strcmpi(w1,"warn_func_mismatch_paramnum")==0) { - script->config.warn_func_mismatch_paramnum = config_switch(w2); - } - else if(strcmpi(w1,"check_cmdcount")==0) { - script->config.check_cmdcount = config_switch(w2); - } - else if(strcmpi(w1,"check_gotocount")==0) { - script->config.check_gotocount = config_switch(w2); - } - else if(strcmpi(w1,"input_min_value")==0) { - script->config.input_min_value = config_switch(w2); - } - else if(strcmpi(w1,"input_max_value")==0) { - script->config.input_max_value = config_switch(w2); - } - else if(strcmpi(w1,"warn_func_mismatch_argtypes")==0) { - script->config.warn_func_mismatch_argtypes = config_switch(w2); - } - else if(strcmpi(w1,"import")==0) { - script->config_read(w2); - } - else if(HPM->parseConf(w1, w2, HPCT_SCRIPT)) { - ; // handled by plugin + libconfig->setting_lookup_bool_real(setting, "warn_func_mismatch_paramnum", &script->config.warn_func_mismatch_paramnum); + libconfig->setting_lookup_bool_real(setting, "warn_func_mismatch_argtypes", &script->config.warn_func_mismatch_argtypes); + libconfig->setting_lookup_int(setting, "check_cmdcount", &script->config.check_cmdcount); + libconfig->setting_lookup_int(setting, "check_gotocount", &script->config.check_gotocount); + libconfig->setting_lookup_int(setting, "input_min_value", &script->config.input_min_value); + libconfig->setting_lookup_int(setting, "input_max_value", &script->config.input_max_value); + + // TODO HPM->parseConf(w1, w2, HPCT_SCRIPT)); + + // import should overwrite any previous configuration, so it should be called last + if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) { + if (strcmp(import, filename) == 0 || strcmp(import, map->SCRIPT_CONF_NAME) == 0) { + ShowWarning("script_config_read: Loop detected! Skipping 'import'...\n"); } else { - ShowWarning("Unknown setting '%s' in file %s\n", w1, cfgName); + if (!script->config_read(import, true)) + retval = false; } } - fclose(fp); - return 0; + libconfig->destroy(&config); + return retval; } /** @@ -21449,8 +21452,8 @@ void script_defaults(void) { script->getfuncname = script_getfuncname; /* script_config base */ - script->config.warn_func_mismatch_argtypes = 1; - script->config.warn_func_mismatch_paramnum = 1; + script->config.warn_func_mismatch_argtypes = true; + script->config.warn_func_mismatch_paramnum = true; script->config.check_cmdcount = 65535; script->config.check_gotocount = 2048; script->config.input_min_value = 0; diff --git a/src/map/script.h b/src/map/script.h index 86cb20226..c4c082263 100644 --- a/src/map/script.h +++ b/src/map/script.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 @@ -343,8 +343,8 @@ enum { **/ struct Script_Config { - unsigned warn_func_mismatch_argtypes : 1; - unsigned warn_func_mismatch_paramnum : 1; + bool warn_func_mismatch_argtypes; + bool warn_func_mismatch_paramnum; int check_cmdcount; int check_gotocount; int input_min_value; @@ -692,7 +692,7 @@ struct script_interface { void (*run_autobonus) (const char *autobonus,int id, int pos); void (*cleararray_pc) (struct map_session_data* sd, const char* varname, void* value); void (*setarray_pc) (struct map_session_data* sd, const char* varname, uint32 idx, void* value, int* refcache); - int (*config_read) (char *cfgName); + bool (*config_read) (const char *filename, bool imported); int (*add_str) (const char* p); const char* (*get_str) (int id); int (*search_str) (const char* p); diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index 2023730f7..4061bd4d4 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -198,12 +198,14 @@ typedef int64 (*HPMHOOK_pre_battle_add_mastery) (struct map_session_data **sd, s typedef int64 (*HPMHOOK_post_battle_add_mastery) (int64 retVal___, struct map_session_data *sd, struct block_list *target, int64 dmg, int type); typedef int (*HPMHOOK_pre_battle_calc_drain) (int64 *damage, int *rate, int *per); typedef int (*HPMHOOK_post_battle_calc_drain) (int retVal___, int64 damage, int rate, int per); -typedef int (*HPMHOOK_pre_battle_config_read) (const char **cfgName); -typedef int (*HPMHOOK_post_battle_config_read) (int retVal___, const char *cfgName); +typedef bool (*HPMHOOK_pre_battle_config_read) (const char **filename, bool *imported); +typedef bool (*HPMHOOK_post_battle_config_read) (bool retVal___, const char *filename, bool imported); typedef void (*HPMHOOK_pre_battle_config_set_defaults) (void); typedef void (*HPMHOOK_post_battle_config_set_defaults) (void); -typedef int (*HPMHOOK_pre_battle_config_set_value) (const char **w1, const char **w2); -typedef int (*HPMHOOK_post_battle_config_set_value) (int retVal___, const char *w1, const char *w2); +typedef bool (*HPMHOOK_pre_battle_config_set_value_sub) (int *index, int *value); +typedef bool (*HPMHOOK_post_battle_config_set_value_sub) (bool retVal___, int index, int value); +typedef bool (*HPMHOOK_pre_battle_config_set_value) (const char **param, const char **value); +typedef bool (*HPMHOOK_post_battle_config_set_value) (bool retVal___, const char *param, const char *value); typedef bool (*HPMHOOK_pre_battle_config_get_value) (const char **w1, int **value); typedef bool (*HPMHOOK_post_battle_config_get_value) (bool retVal___, const char *w1, int *value); typedef void (*HPMHOOK_pre_battle_config_adjust) (void); @@ -658,12 +660,40 @@ typedef int (*HPMHOOK_pre_chr_online_data_cleanup_sub) (union DBKey *key, struct typedef int (*HPMHOOK_post_chr_online_data_cleanup_sub) (int retVal___, union DBKey key, struct DBData *data, va_list ap); typedef int (*HPMHOOK_pre_chr_online_data_cleanup) (int *tid, int64 *tick, int *id, intptr_t *data); typedef int (*HPMHOOK_post_chr_online_data_cleanup) (int retVal___, int tid, int64 tick, int id, intptr_t data); -typedef void (*HPMHOOK_pre_chr_sql_config_read) (const char **cfgName); -typedef void (*HPMHOOK_post_chr_sql_config_read) (const char *cfgName); -typedef void (*HPMHOOK_pre_chr_config_dispatch) (char **w1, char **w2); -typedef void (*HPMHOOK_post_chr_config_dispatch) (char *w1, char *w2); -typedef int (*HPMHOOK_pre_chr_config_read) (const char **cfgName); -typedef int (*HPMHOOK_post_chr_config_read) (int retVal___, const char *cfgName); +typedef bool (*HPMHOOK_pre_chr_sql_config_read) (const char **filename, bool *imported); +typedef bool (*HPMHOOK_post_chr_sql_config_read) (bool retVal___, const char *filename, bool imported); +typedef bool (*HPMHOOK_pre_chr_sql_config_read_registry) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_chr_sql_config_read_registry) (bool retVal___, const char *filename, const struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_chr_sql_config_read_pc) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_chr_sql_config_read_pc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_chr_sql_config_read_guild) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_chr_sql_config_read_guild) (bool retVal___, const char *filename, const struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_chr_config_read) (const char **filename, bool *imported); +typedef bool (*HPMHOOK_post_chr_config_read) (bool retVal___, const char *filename, bool imported); +typedef bool (*HPMHOOK_pre_chr_config_read_database) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_chr_config_read_database) (bool retVal___, const char *filename, const struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_chr_config_read_console) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_chr_config_read_console) (bool retVal___, const char *filename, const struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_chr_config_read_player_fame) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_chr_config_read_player_fame) (bool retVal___, const char *filename, const struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_chr_config_read_player_deletion) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_chr_config_read_player_deletion) (bool retVal___, const char *filename, const struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_chr_config_read_player_name) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_chr_config_read_player_name) (bool retVal___, const char *filename, const struct config_t *config, bool imported); +typedef void (*HPMHOOK_pre_chr_config_set_start_item) (const struct config_setting_t **setting); +typedef void (*HPMHOOK_post_chr_config_set_start_item) (const struct config_setting_t *setting); +typedef bool (*HPMHOOK_pre_chr_config_read_player_new) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_chr_config_read_player_new) (bool retVal___, const char *filename, const struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_chr_config_read_player) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_chr_config_read_player) (bool retVal___, const char *filename, const struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_chr_config_read_permission) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_chr_config_read_permission) (bool retVal___, const char *filename, const struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_chr_config_set_ip) (const char **type, const char **value, uint32 **out_ip, char **out_ip_str); +typedef bool (*HPMHOOK_post_chr_config_set_ip) (bool retVal___, const char *type, const char *value, uint32 *out_ip, char *out_ip_str); +typedef bool (*HPMHOOK_pre_chr_config_read_inter) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_chr_config_read_inter) (bool retVal___, const char *filename, const struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_chr_config_read_top) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_chr_config_read_top) (bool retVal___, const char *filename, const struct config_t *config, bool imported); #endif // CHAR_CHAR_H #ifdef MAP_CHAT_H /* chat */ typedef bool (*HPMHOOK_pre_chat_create_pc_chat) (struct map_session_data **sd, const char **title, const char **pass, int *limit, bool *pub); @@ -2828,8 +2858,6 @@ typedef void (*HPMHOOK_pre_inter_savereg) (int *account_id, int *char_id, const typedef void (*HPMHOOK_post_inter_savereg) (int account_id, int char_id, const char *key, unsigned int index, intptr_t val, bool is_string); typedef int (*HPMHOOK_pre_inter_accreg_fromsql) (int *account_id, int *char_id, int *fd, int *type); typedef int (*HPMHOOK_post_inter_accreg_fromsql) (int retVal___, int account_id, int char_id, int fd, int type); -typedef int (*HPMHOOK_pre_inter_config_read) (const char **cfgName); -typedef int (*HPMHOOK_post_inter_config_read) (int retVal___, const char *cfgName); typedef int (*HPMHOOK_pre_inter_vlog) (char **fmt, va_list ap); typedef int (*HPMHOOK_post_inter_vlog) (int retVal___, char *fmt, va_list ap); typedef int (*HPMHOOK_pre_inter_init_sql) (const char **file); @@ -2846,6 +2874,10 @@ typedef int (*HPMHOOK_pre_inter_parse_frommap) (int *fd); typedef int (*HPMHOOK_post_inter_parse_frommap) (int retVal___, int fd); typedef void (*HPMHOOK_pre_inter_final) (void); typedef void (*HPMHOOK_post_inter_final) (void); +typedef bool (*HPMHOOK_pre_inter_config_read) (const char **filename, bool *imported); +typedef bool (*HPMHOOK_post_inter_config_read) (bool retVal___, const char *filename, bool imported); +typedef bool (*HPMHOOK_pre_inter_config_read_connection) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_inter_config_read_connection) (bool retVal___, const char *filename, const struct config_t *config, bool imported); #endif // CHAR_INTER_H #ifdef CHAR_INT_MAIL_H /* inter_mail */ typedef int (*HPMHOOK_pre_inter_mail_sql_init) (void); @@ -3588,8 +3620,8 @@ typedef void (*HPMHOOK_pre_logs_branch_sub) (struct map_session_data **sd); typedef void (*HPMHOOK_post_logs_branch_sub) (struct map_session_data *sd); typedef void (*HPMHOOK_pre_logs_mvpdrop_sub) (struct map_session_data **sd, int *monster_id, int **log_mvp); typedef void (*HPMHOOK_post_logs_mvpdrop_sub) (struct map_session_data *sd, int monster_id, int *log_mvp); -typedef int (*HPMHOOK_pre_logs_config_read) (const char **cfgName); -typedef int (*HPMHOOK_post_logs_config_read) (int retVal___, const char *cfgName); +typedef bool (*HPMHOOK_pre_logs_config_read) (const char **filename, bool *imported); +typedef bool (*HPMHOOK_post_logs_config_read) (bool retVal___, const char *filename, bool imported); typedef void (*HPMHOOK_pre_logs_config_done) (void); typedef void (*HPMHOOK_post_logs_config_done) (void); typedef void (*HPMHOOK_pre_logs_sql_init) (void); @@ -3700,8 +3732,8 @@ typedef void (*HPMHOOK_pre_login_parse_request_connection) (int *fd, struct logi typedef void (*HPMHOOK_post_login_parse_request_connection) (int fd, struct login_session_data *sd, const char *ip, uint32 ipl); typedef void (*HPMHOOK_pre_login_config_set_defaults) (void); typedef void (*HPMHOOK_post_login_config_set_defaults) (void); -typedef int (*HPMHOOK_pre_login_config_read) (const char **cfgName); -typedef int (*HPMHOOK_post_login_config_read) (int retVal___, const char *cfgName); +typedef bool (*HPMHOOK_pre_login_config_read) (const char **filename, bool *included); +typedef bool (*HPMHOOK_post_login_config_read) (bool retVal___, const char *filename, bool included); #endif // LOGIN_LOGIN_H #ifdef CHAR_LOGINIF_H /* loginif */ typedef void (*HPMHOOK_pre_loginif_init) (void); @@ -3936,8 +3968,8 @@ typedef int (*HPMHOOK_pre_map_random_dir) (struct block_list **bl, short **x, sh typedef int (*HPMHOOK_post_map_random_dir) (int retVal___, struct block_list *bl, short *x, short *y); typedef int (*HPMHOOK_pre_map_cleanup_sub) (struct block_list **bl, va_list ap); typedef int (*HPMHOOK_post_map_cleanup_sub) (int retVal___, struct block_list *bl, va_list ap); -typedef int (*HPMHOOK_pre_map_delmap) (char **mapname); -typedef int (*HPMHOOK_post_map_delmap) (int retVal___, char *mapname); +typedef int (*HPMHOOK_pre_map_delmap) (const char **mapname); +typedef int (*HPMHOOK_post_map_delmap) (int retVal___, const char *mapname); typedef void (*HPMHOOK_pre_map_flags_init) (void); typedef void (*HPMHOOK_post_map_flags_init) (void); typedef bool (*HPMHOOK_pre_map_iwall_set) (int16 *m, int16 *x, int16 *y, int *size, int8 *dir, bool *shootable, const char **wall_name); @@ -4006,14 +4038,16 @@ typedef int (*HPMHOOK_pre_map_readgat) (struct map_data **m); typedef int (*HPMHOOK_post_map_readgat) (int retVal___, struct map_data *m); typedef int (*HPMHOOK_pre_map_readallmaps) (void); typedef int (*HPMHOOK_post_map_readallmaps) (int retVal___); -typedef int (*HPMHOOK_pre_map_config_read) (char **cfgName); -typedef int (*HPMHOOK_post_map_config_read) (int retVal___, char *cfgName); -typedef int (*HPMHOOK_pre_map_config_read_sub) (char **cfgName); -typedef int (*HPMHOOK_post_map_config_read_sub) (int retVal___, char *cfgName); -typedef void (*HPMHOOK_pre_map_reloadnpc_sub) (char **cfgName); -typedef void (*HPMHOOK_post_map_reloadnpc_sub) (char *cfgName); -typedef int (*HPMHOOK_pre_map_inter_config_read) (char **cfgName); -typedef int (*HPMHOOK_post_map_inter_config_read) (int retVal___, char *cfgName); +typedef bool (*HPMHOOK_pre_map_config_read) (const char **filename, bool *imported); +typedef bool (*HPMHOOK_post_map_config_read) (bool retVal___, const char *filename, bool imported); +typedef bool (*HPMHOOK_pre_map_read_npclist) (const char **filename, bool *imported); +typedef bool (*HPMHOOK_post_map_read_npclist) (bool retVal___, const char *filename, bool imported); +typedef bool (*HPMHOOK_pre_map_inter_config_read) (const char **filename, bool *imported); +typedef bool (*HPMHOOK_post_map_inter_config_read) (bool retVal___, const char *filename, bool imported); +typedef bool (*HPMHOOK_pre_map_inter_config_read_database_names) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_map_inter_config_read_database_names) (bool retVal___, const char *filename, const struct config_t *config, bool imported); +typedef bool (*HPMHOOK_pre_map_inter_config_read_connection) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_map_inter_config_read_connection) (bool retVal___, const char *filename, const struct config_t *config, bool imported); typedef int (*HPMHOOK_pre_map_sql_init) (void); typedef int (*HPMHOOK_post_map_sql_init) (int retVal___); typedef int (*HPMHOOK_pre_map_sql_close) (void); @@ -4448,8 +4482,8 @@ typedef int (*HPMHOOK_pre_mapreg_destroyreg) (union DBKey *key, struct DBData ** typedef int (*HPMHOOK_post_mapreg_destroyreg) (int retVal___, union DBKey key, struct DBData *data, va_list ap); typedef void (*HPMHOOK_pre_mapreg_reload) (void); typedef void (*HPMHOOK_post_mapreg_reload) (void); -typedef bool (*HPMHOOK_pre_mapreg_config_read) (const char **w1, const char **w2); -typedef bool (*HPMHOOK_post_mapreg_config_read) (bool retVal___, const char *w1, const char *w2); +typedef bool (*HPMHOOK_pre_mapreg_config_read) (const char **filename, const struct config_setting_t **config, bool *imported); +typedef bool (*HPMHOOK_post_mapreg_config_read) (bool retVal___, const char *filename, const struct config_setting_t *config, bool imported); #endif // MAP_MAPREG_H #ifdef COMMON_MD5CALC_H /* md5 */ typedef void (*HPMHOOK_pre_md5_string) (const char **string, char **output); @@ -5682,8 +5716,8 @@ typedef int (*HPMHOOK_pre_pincode_compare) (int *fd, struct char_session_data ** typedef int (*HPMHOOK_post_pincode_compare) (int retVal___, int fd, struct char_session_data *sd, char *pin); typedef void (*HPMHOOK_pre_pincode_check) (int *fd, struct char_session_data **sd); typedef void (*HPMHOOK_post_pincode_check) (int fd, struct char_session_data *sd); -typedef bool (*HPMHOOK_pre_pincode_config_read) (char **w1, char **w2); -typedef bool (*HPMHOOK_post_pincode_config_read) (bool retVal___, char *w1, char *w2); +typedef bool (*HPMHOOK_pre_pincode_config_read) (const char **filename, const struct config_t **config, bool *imported); +typedef bool (*HPMHOOK_post_pincode_config_read) (bool retVal___, const char *filename, const struct config_t *config, bool imported); #endif // CHAR_PINCODE_H #ifdef MAP_QUEST_H /* quest */ typedef void (*HPMHOOK_pre_quest_init) (bool *minimal); @@ -5840,8 +5874,8 @@ typedef void (*HPMHOOK_pre_script_cleararray_pc) (struct map_session_data **sd, typedef void (*HPMHOOK_post_script_cleararray_pc) (struct map_session_data *sd, const char *varname, void *value); typedef void (*HPMHOOK_pre_script_setarray_pc) (struct map_session_data **sd, const char **varname, uint32 *idx, void **value, int **refcache); typedef void (*HPMHOOK_post_script_setarray_pc) (struct map_session_data *sd, const char *varname, uint32 idx, void *value, int *refcache); -typedef int (*HPMHOOK_pre_script_config_read) (char **cfgName); -typedef int (*HPMHOOK_post_script_config_read) (int retVal___, char *cfgName); +typedef bool (*HPMHOOK_pre_script_config_read) (const char **filename, bool *imported); +typedef bool (*HPMHOOK_post_script_config_read) (bool retVal___, const char *filename, bool imported); typedef int (*HPMHOOK_pre_script_add_str) (const char **p); typedef int (*HPMHOOK_post_script_add_str) (int retVal___, const char *p); typedef const char* (*HPMHOOK_pre_script_get_str) (int *id); diff --git a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc index f51ddcffc..44b56143f 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc @@ -344,10 +344,38 @@ struct { struct HPMHookPoint *HP_chr_online_data_cleanup_post; struct HPMHookPoint *HP_chr_sql_config_read_pre; struct HPMHookPoint *HP_chr_sql_config_read_post; - struct HPMHookPoint *HP_chr_config_dispatch_pre; - struct HPMHookPoint *HP_chr_config_dispatch_post; + struct HPMHookPoint *HP_chr_sql_config_read_registry_pre; + struct HPMHookPoint *HP_chr_sql_config_read_registry_post; + struct HPMHookPoint *HP_chr_sql_config_read_pc_pre; + struct HPMHookPoint *HP_chr_sql_config_read_pc_post; + struct HPMHookPoint *HP_chr_sql_config_read_guild_pre; + struct HPMHookPoint *HP_chr_sql_config_read_guild_post; struct HPMHookPoint *HP_chr_config_read_pre; struct HPMHookPoint *HP_chr_config_read_post; + struct HPMHookPoint *HP_chr_config_read_database_pre; + struct HPMHookPoint *HP_chr_config_read_database_post; + struct HPMHookPoint *HP_chr_config_read_console_pre; + struct HPMHookPoint *HP_chr_config_read_console_post; + struct HPMHookPoint *HP_chr_config_read_player_fame_pre; + struct HPMHookPoint *HP_chr_config_read_player_fame_post; + struct HPMHookPoint *HP_chr_config_read_player_deletion_pre; + struct HPMHookPoint *HP_chr_config_read_player_deletion_post; + struct HPMHookPoint *HP_chr_config_read_player_name_pre; + struct HPMHookPoint *HP_chr_config_read_player_name_post; + struct HPMHookPoint *HP_chr_config_set_start_item_pre; + struct HPMHookPoint *HP_chr_config_set_start_item_post; + struct HPMHookPoint *HP_chr_config_read_player_new_pre; + struct HPMHookPoint *HP_chr_config_read_player_new_post; + struct HPMHookPoint *HP_chr_config_read_player_pre; + struct HPMHookPoint *HP_chr_config_read_player_post; + struct HPMHookPoint *HP_chr_config_read_permission_pre; + struct HPMHookPoint *HP_chr_config_read_permission_post; + struct HPMHookPoint *HP_chr_config_set_ip_pre; + struct HPMHookPoint *HP_chr_config_set_ip_post; + struct HPMHookPoint *HP_chr_config_read_inter_pre; + struct HPMHookPoint *HP_chr_config_read_inter_post; + struct HPMHookPoint *HP_chr_config_read_top_pre; + struct HPMHookPoint *HP_chr_config_read_top_post; struct HPMHookPoint *HP_cmdline_init_pre; struct HPMHookPoint *HP_cmdline_init_post; struct HPMHookPoint *HP_cmdline_final_pre; @@ -506,8 +534,6 @@ struct { struct HPMHookPoint *HP_inter_savereg_post; struct HPMHookPoint *HP_inter_accreg_fromsql_pre; struct HPMHookPoint *HP_inter_accreg_fromsql_post; - struct HPMHookPoint *HP_inter_config_read_pre; - struct HPMHookPoint *HP_inter_config_read_post; struct HPMHookPoint *HP_inter_vlog_pre; struct HPMHookPoint *HP_inter_vlog_post; struct HPMHookPoint *HP_inter_init_sql_pre; @@ -524,6 +550,10 @@ struct { struct HPMHookPoint *HP_inter_parse_frommap_post; struct HPMHookPoint *HP_inter_final_pre; struct HPMHookPoint *HP_inter_final_post; + struct HPMHookPoint *HP_inter_config_read_pre; + struct HPMHookPoint *HP_inter_config_read_post; + struct HPMHookPoint *HP_inter_config_read_connection_pre; + struct HPMHookPoint *HP_inter_config_read_connection_post; struct HPMHookPoint *HP_inter_mail_sql_init_pre; struct HPMHookPoint *HP_inter_mail_sql_init_post; struct HPMHookPoint *HP_inter_mail_sql_final_pre; @@ -1817,10 +1847,38 @@ struct { int HP_chr_online_data_cleanup_post; int HP_chr_sql_config_read_pre; int HP_chr_sql_config_read_post; - int HP_chr_config_dispatch_pre; - int HP_chr_config_dispatch_post; + int HP_chr_sql_config_read_registry_pre; + int HP_chr_sql_config_read_registry_post; + int HP_chr_sql_config_read_pc_pre; + int HP_chr_sql_config_read_pc_post; + int HP_chr_sql_config_read_guild_pre; + int HP_chr_sql_config_read_guild_post; int HP_chr_config_read_pre; int HP_chr_config_read_post; + int HP_chr_config_read_database_pre; + int HP_chr_config_read_database_post; + int HP_chr_config_read_console_pre; + int HP_chr_config_read_console_post; + int HP_chr_config_read_player_fame_pre; + int HP_chr_config_read_player_fame_post; + int HP_chr_config_read_player_deletion_pre; + int HP_chr_config_read_player_deletion_post; + int HP_chr_config_read_player_name_pre; + int HP_chr_config_read_player_name_post; + int HP_chr_config_set_start_item_pre; + int HP_chr_config_set_start_item_post; + int HP_chr_config_read_player_new_pre; + int HP_chr_config_read_player_new_post; + int HP_chr_config_read_player_pre; + int HP_chr_config_read_player_post; + int HP_chr_config_read_permission_pre; + int HP_chr_config_read_permission_post; + int HP_chr_config_set_ip_pre; + int HP_chr_config_set_ip_post; + int HP_chr_config_read_inter_pre; + int HP_chr_config_read_inter_post; + int HP_chr_config_read_top_pre; + int HP_chr_config_read_top_post; int HP_cmdline_init_pre; int HP_cmdline_init_post; int HP_cmdline_final_pre; @@ -1979,8 +2037,6 @@ struct { int HP_inter_savereg_post; int HP_inter_accreg_fromsql_pre; int HP_inter_accreg_fromsql_post; - int HP_inter_config_read_pre; - int HP_inter_config_read_post; int HP_inter_vlog_pre; int HP_inter_vlog_post; int HP_inter_init_sql_pre; @@ -1997,6 +2053,10 @@ struct { int HP_inter_parse_frommap_post; int HP_inter_final_pre; int HP_inter_final_post; + int HP_inter_config_read_pre; + int HP_inter_config_read_post; + int HP_inter_config_read_connection_pre; + int HP_inter_config_read_connection_post; int HP_inter_mail_sql_init_pre; int HP_inter_mail_sql_init_post; int HP_inter_mail_sql_final_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc index 4371cf81a..35f9044d5 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.HookingPoints.inc @@ -187,8 +187,22 @@ struct HookingPointData HookingPoints[] = { { HP_POP(chr->online_data_cleanup_sub, HP_chr_online_data_cleanup_sub) }, { HP_POP(chr->online_data_cleanup, HP_chr_online_data_cleanup) }, { HP_POP(chr->sql_config_read, HP_chr_sql_config_read) }, - { HP_POP(chr->config_dispatch, HP_chr_config_dispatch) }, + { HP_POP(chr->sql_config_read_registry, HP_chr_sql_config_read_registry) }, + { HP_POP(chr->sql_config_read_pc, HP_chr_sql_config_read_pc) }, + { HP_POP(chr->sql_config_read_guild, HP_chr_sql_config_read_guild) }, { HP_POP(chr->config_read, HP_chr_config_read) }, + { HP_POP(chr->config_read_database, HP_chr_config_read_database) }, + { HP_POP(chr->config_read_console, HP_chr_config_read_console) }, + { HP_POP(chr->config_read_player_fame, HP_chr_config_read_player_fame) }, + { HP_POP(chr->config_read_player_deletion, HP_chr_config_read_player_deletion) }, + { HP_POP(chr->config_read_player_name, HP_chr_config_read_player_name) }, + { HP_POP(chr->config_set_start_item, HP_chr_config_set_start_item) }, + { HP_POP(chr->config_read_player_new, HP_chr_config_read_player_new) }, + { HP_POP(chr->config_read_player, HP_chr_config_read_player) }, + { HP_POP(chr->config_read_permission, HP_chr_config_read_permission) }, + { HP_POP(chr->config_set_ip, HP_chr_config_set_ip) }, + { HP_POP(chr->config_read_inter, HP_chr_config_read_inter) }, + { HP_POP(chr->config_read_top, HP_chr_config_read_top) }, /* cmdline_interface */ { HP_POP(cmdline->init, HP_cmdline_init) }, { HP_POP(cmdline->final, HP_cmdline_final) }, @@ -279,7 +293,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(inter->vmsg_to_fd, HP_inter_vmsg_to_fd) }, { HP_POP(inter->savereg, HP_inter_savereg) }, { HP_POP(inter->accreg_fromsql, HP_inter_accreg_fromsql) }, - { HP_POP(inter->config_read, HP_inter_config_read) }, { HP_POP(inter->vlog, HP_inter_vlog) }, { HP_POP(inter->init_sql, HP_inter_init_sql) }, { HP_POP(inter->mapif_init, HP_inter_mapif_init) }, @@ -288,6 +301,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(inter->check_length, HP_inter_check_length) }, { HP_POP(inter->parse_frommap, HP_inter_parse_frommap) }, { HP_POP(inter->final, HP_inter_final) }, + { HP_POP(inter->config_read, HP_inter_config_read) }, + { HP_POP(inter->config_read_connection, HP_inter_config_read_connection) }, /* inter_mail_interface */ { HP_POP(inter_mail->sql_init, HP_inter_mail_sql_init) }, { HP_POP(inter_mail->sql_final, HP_inter_mail_sql_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc index aecffbecd..3669b2da8 100644 --- a/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_char.Hooks.inc @@ -4216,67 +4216,123 @@ int HP_chr_online_data_cleanup(int tid, int64 tick, int id, intptr_t data) { } return retVal___; } -void HP_chr_sql_config_read(const char *cfgName) { +bool HP_chr_sql_config_read(const char *filename, bool imported) { int hIndex = 0; + bool retVal___ = false; if( HPMHooks.count.HP_chr_sql_config_read_pre ) { - void (*preHookFunc) (const char **cfgName); + bool (*preHookFunc) (const char **filename, bool *imported); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_chr_sql_config_read_pre[hIndex].func; - preHookFunc(&cfgName); + retVal___ = preHookFunc(&filename, &imported); } if( *HPMforce_return ) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.chr.sql_config_read(cfgName); + retVal___ = HPMHooks.source.chr.sql_config_read(filename, imported); } if( HPMHooks.count.HP_chr_sql_config_read_post ) { - void (*postHookFunc) (const char *cfgName); + bool (*postHookFunc) (bool retVal___, const char *filename, bool imported); for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_chr_sql_config_read_post[hIndex].func; - postHookFunc(cfgName); + retVal___ = postHookFunc(retVal___, filename, imported); } } - return; + return retVal___; } -void HP_chr_config_dispatch(char *w1, char *w2) { +bool HP_chr_sql_config_read_registry(const char *filename, const struct config_t *config, bool imported) { int hIndex = 0; - if( HPMHooks.count.HP_chr_config_dispatch_pre ) { - void (*preHookFunc) (char **w1, char **w2); + bool retVal___ = false; + if( HPMHooks.count.HP_chr_sql_config_read_registry_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_dispatch_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_chr_config_dispatch_pre[hIndex].func; - preHookFunc(&w1, &w2); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_registry_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_sql_config_read_registry_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); } if( *HPMforce_return ) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.chr.config_dispatch(w1, w2); + retVal___ = HPMHooks.source.chr.sql_config_read_registry(filename, config, imported); } - if( HPMHooks.count.HP_chr_config_dispatch_post ) { - void (*postHookFunc) (char *w1, char *w2); - for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_dispatch_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_chr_config_dispatch_post[hIndex].func; - postHookFunc(w1, w2); + if( HPMHooks.count.HP_chr_sql_config_read_registry_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_registry_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_sql_config_read_registry_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); } } - return; + return retVal___; } -int HP_chr_config_read(const char *cfgName) { +bool HP_chr_sql_config_read_pc(const char *filename, const struct config_t *config, bool imported) { int hIndex = 0; - int retVal___ = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_chr_sql_config_read_pc_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_pc_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_sql_config_read_pc_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.chr.sql_config_read_pc(filename, config, imported); + } + if( HPMHooks.count.HP_chr_sql_config_read_pc_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_pc_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_sql_config_read_pc_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_chr_sql_config_read_guild(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_chr_sql_config_read_guild_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_guild_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_sql_config_read_guild_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.chr.sql_config_read_guild(filename, config, imported); + } + if( HPMHooks.count.HP_chr_sql_config_read_guild_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_sql_config_read_guild_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_sql_config_read_guild_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_chr_config_read(const char *filename, bool imported) { + int hIndex = 0; + bool retVal___ = false; if( HPMHooks.count.HP_chr_config_read_pre ) { - int (*preHookFunc) (const char **cfgName); + bool (*preHookFunc) (const char **filename, bool *imported); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_chr_config_read_pre[hIndex].func; - retVal___ = preHookFunc(&cfgName); + retVal___ = preHookFunc(&filename, &imported); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -4284,13 +4340,336 @@ int HP_chr_config_read(const char *cfgName) { } } { - retVal___ = HPMHooks.source.chr.config_read(cfgName); + retVal___ = HPMHooks.source.chr.config_read(filename, imported); } if( HPMHooks.count.HP_chr_config_read_post ) { - int (*postHookFunc) (int retVal___, const char *cfgName); + bool (*postHookFunc) (bool retVal___, const char *filename, bool imported); for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_chr_config_read_post[hIndex].func; - retVal___ = postHookFunc(retVal___, cfgName); + retVal___ = postHookFunc(retVal___, filename, imported); + } + } + return retVal___; +} +bool HP_chr_config_read_database(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_chr_config_read_database_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_database_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_config_read_database_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.chr.config_read_database(filename, config, imported); + } + if( HPMHooks.count.HP_chr_config_read_database_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_database_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_config_read_database_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_chr_config_read_console(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_chr_config_read_console_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_console_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_config_read_console_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.chr.config_read_console(filename, config, imported); + } + if( HPMHooks.count.HP_chr_config_read_console_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_console_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_config_read_console_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_chr_config_read_player_fame(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_chr_config_read_player_fame_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_fame_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_config_read_player_fame_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.chr.config_read_player_fame(filename, config, imported); + } + if( HPMHooks.count.HP_chr_config_read_player_fame_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_fame_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_config_read_player_fame_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_chr_config_read_player_deletion(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_chr_config_read_player_deletion_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_deletion_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_config_read_player_deletion_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.chr.config_read_player_deletion(filename, config, imported); + } + if( HPMHooks.count.HP_chr_config_read_player_deletion_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_deletion_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_config_read_player_deletion_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_chr_config_read_player_name(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_chr_config_read_player_name_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_name_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_config_read_player_name_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.chr.config_read_player_name(filename, config, imported); + } + if( HPMHooks.count.HP_chr_config_read_player_name_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_name_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_config_read_player_name_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +void HP_chr_config_set_start_item(const struct config_setting_t *setting) { + int hIndex = 0; + if( HPMHooks.count.HP_chr_config_set_start_item_pre ) { + void (*preHookFunc) (const struct config_setting_t **setting); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_set_start_item_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_config_set_start_item_pre[hIndex].func; + preHookFunc(&setting); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.chr.config_set_start_item(setting); + } + if( HPMHooks.count.HP_chr_config_set_start_item_post ) { + void (*postHookFunc) (const struct config_setting_t *setting); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_set_start_item_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_config_set_start_item_post[hIndex].func; + postHookFunc(setting); + } + } + return; +} +bool HP_chr_config_read_player_new(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_chr_config_read_player_new_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_new_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_config_read_player_new_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.chr.config_read_player_new(filename, config, imported); + } + if( HPMHooks.count.HP_chr_config_read_player_new_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_new_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_config_read_player_new_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_chr_config_read_player(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_chr_config_read_player_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_config_read_player_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.chr.config_read_player(filename, config, imported); + } + if( HPMHooks.count.HP_chr_config_read_player_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_player_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_config_read_player_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_chr_config_read_permission(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_chr_config_read_permission_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_permission_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_config_read_permission_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.chr.config_read_permission(filename, config, imported); + } + if( HPMHooks.count.HP_chr_config_read_permission_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_permission_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_config_read_permission_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_chr_config_set_ip(const char *type, const char *value, uint32 *out_ip, char *out_ip_str) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_chr_config_set_ip_pre ) { + bool (*preHookFunc) (const char **type, const char **value, uint32 **out_ip, char **out_ip_str); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_set_ip_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_config_set_ip_pre[hIndex].func; + retVal___ = preHookFunc(&type, &value, &out_ip, &out_ip_str); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.chr.config_set_ip(type, value, out_ip, out_ip_str); + } + if( HPMHooks.count.HP_chr_config_set_ip_post ) { + bool (*postHookFunc) (bool retVal___, const char *type, const char *value, uint32 *out_ip, char *out_ip_str); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_set_ip_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_config_set_ip_post[hIndex].func; + retVal___ = postHookFunc(retVal___, type, value, out_ip, out_ip_str); + } + } + return retVal___; +} +bool HP_chr_config_read_inter(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_chr_config_read_inter_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_inter_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_config_read_inter_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.chr.config_read_inter(filename, config, imported); + } + if( HPMHooks.count.HP_chr_config_read_inter_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_inter_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_config_read_inter_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_chr_config_read_top(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_chr_config_read_top_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_top_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chr_config_read_top_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.chr.config_read_top(filename, config, imported); + } + if( HPMHooks.count.HP_chr_config_read_top_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chr_config_read_top_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chr_config_read_top_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); } } return retVal___; @@ -6427,33 +6806,6 @@ int HP_inter_accreg_fromsql(int account_id, int char_id, int fd, int type) { } return retVal___; } -int HP_inter_config_read(const char *cfgName) { - int hIndex = 0; - int retVal___ = 0; - if( HPMHooks.count.HP_inter_config_read_pre ) { - int (*preHookFunc) (const char **cfgName); - *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_inter_config_read_pre[hIndex].func; - retVal___ = preHookFunc(&cfgName); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.inter.config_read(cfgName); - } - if( HPMHooks.count.HP_inter_config_read_post ) { - int (*postHookFunc) (int retVal___, const char *cfgName); - for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_inter_config_read_post[hIndex].func; - retVal___ = postHookFunc(retVal___, cfgName); - } - } - return retVal___; -} int HP_inter_vlog(char *fmt, va_list ap) { int hIndex = 0; int retVal___ = 0; @@ -6681,6 +7033,60 @@ void HP_inter_final(void) { } return; } +bool HP_inter_config_read(const char *filename, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_inter_config_read_pre ) { + bool (*preHookFunc) (const char **filename, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_inter_config_read_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.inter.config_read(filename, imported); + } + if( HPMHooks.count.HP_inter_config_read_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_inter_config_read_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, imported); + } + } + return retVal___; +} +bool HP_inter_config_read_connection(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_inter_config_read_connection_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_connection_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_inter_config_read_connection_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.inter.config_read_connection(filename, config, imported); + } + if( HPMHooks.count.HP_inter_config_read_connection_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_inter_config_read_connection_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_inter_config_read_connection_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} /* inter_mail_interface */ int HP_inter_mail_sql_init(void) { int hIndex = 0; @@ -15726,15 +16132,15 @@ void HP_pincode_check(int fd, struct char_session_data *sd) { } return; } -bool HP_pincode_config_read(char *w1, char *w2) { +bool HP_pincode_config_read(const char *filename, const struct config_t *config, bool imported) { int hIndex = 0; bool retVal___ = false; if( HPMHooks.count.HP_pincode_config_read_pre ) { - bool (*preHookFunc) (char **w1, char **w2); + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_config_read_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_pincode_config_read_pre[hIndex].func; - retVal___ = preHookFunc(&w1, &w2); + retVal___ = preHookFunc(&filename, &config, &imported); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -15742,13 +16148,13 @@ bool HP_pincode_config_read(char *w1, char *w2) { } } { - retVal___ = HPMHooks.source.pincode.config_read(w1, w2); + retVal___ = HPMHooks.source.pincode.config_read(filename, config, imported); } if( HPMHooks.count.HP_pincode_config_read_post ) { - bool (*postHookFunc) (bool retVal___, char *w1, char *w2); + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); for(hIndex = 0; hIndex < HPMHooks.count.HP_pincode_config_read_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_pincode_config_read_post[hIndex].func; - retVal___ = postHookFunc(retVal___, w1, w2); + retVal___ = postHookFunc(retVal___, filename, config, imported); } } return retVal___; diff --git a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc index 013a56104..290c2283a 100644 --- a/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_login.Hooks.inc @@ -4689,15 +4689,15 @@ void HP_login_config_set_defaults(void) { } return; } -int HP_login_config_read(const char *cfgName) { +bool HP_login_config_read(const char *filename, bool included) { int hIndex = 0; - int retVal___ = 0; + bool retVal___ = false; if( HPMHooks.count.HP_login_config_read_pre ) { - int (*preHookFunc) (const char **cfgName); + bool (*preHookFunc) (const char **filename, bool *included); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_login_config_read_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_login_config_read_pre[hIndex].func; - retVal___ = preHookFunc(&cfgName); + retVal___ = preHookFunc(&filename, &included); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -4705,13 +4705,13 @@ int HP_login_config_read(const char *cfgName) { } } { - retVal___ = HPMHooks.source.login.config_read(cfgName); + retVal___ = HPMHooks.source.login.config_read(filename, included); } if( HPMHooks.count.HP_login_config_read_post ) { - int (*postHookFunc) (int retVal___, const char *cfgName); + bool (*postHookFunc) (bool retVal___, const char *filename, bool included); for(hIndex = 0; hIndex < HPMHooks.count.HP_login_config_read_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_login_config_read_post[hIndex].func; - retVal___ = postHookFunc(retVal___, cfgName); + retVal___ = postHookFunc(retVal___, filename, included); } } return retVal___; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 06c4acc50..0845d8cdd 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -198,6 +198,8 @@ struct { struct HPMHookPoint *HP_battle_config_read_post; struct HPMHookPoint *HP_battle_config_set_defaults_pre; struct HPMHookPoint *HP_battle_config_set_defaults_post; + struct HPMHookPoint *HP_battle_config_set_value_sub_pre; + struct HPMHookPoint *HP_battle_config_set_value_sub_post; struct HPMHookPoint *HP_battle_config_set_value_pre; struct HPMHookPoint *HP_battle_config_set_value_post; struct HPMHookPoint *HP_battle_config_get_value_pre; @@ -3234,12 +3236,14 @@ struct { struct HPMHookPoint *HP_map_readallmaps_post; struct HPMHookPoint *HP_map_config_read_pre; struct HPMHookPoint *HP_map_config_read_post; - struct HPMHookPoint *HP_map_config_read_sub_pre; - struct HPMHookPoint *HP_map_config_read_sub_post; - struct HPMHookPoint *HP_map_reloadnpc_sub_pre; - struct HPMHookPoint *HP_map_reloadnpc_sub_post; + struct HPMHookPoint *HP_map_read_npclist_pre; + struct HPMHookPoint *HP_map_read_npclist_post; struct HPMHookPoint *HP_map_inter_config_read_pre; struct HPMHookPoint *HP_map_inter_config_read_post; + struct HPMHookPoint *HP_map_inter_config_read_database_names_pre; + struct HPMHookPoint *HP_map_inter_config_read_database_names_post; + struct HPMHookPoint *HP_map_inter_config_read_connection_pre; + struct HPMHookPoint *HP_map_inter_config_read_connection_post; struct HPMHookPoint *HP_map_sql_init_pre; struct HPMHookPoint *HP_map_sql_init_post; struct HPMHookPoint *HP_map_sql_close_pre; @@ -6249,6 +6253,8 @@ struct { int HP_battle_config_read_post; int HP_battle_config_set_defaults_pre; int HP_battle_config_set_defaults_post; + int HP_battle_config_set_value_sub_pre; + int HP_battle_config_set_value_sub_post; int HP_battle_config_set_value_pre; int HP_battle_config_set_value_post; int HP_battle_config_get_value_pre; @@ -9285,12 +9291,14 @@ struct { int HP_map_readallmaps_post; int HP_map_config_read_pre; int HP_map_config_read_post; - int HP_map_config_read_sub_pre; - int HP_map_config_read_sub_post; - int HP_map_reloadnpc_sub_pre; - int HP_map_reloadnpc_sub_post; + int HP_map_read_npclist_pre; + int HP_map_read_npclist_post; int HP_map_inter_config_read_pre; int HP_map_inter_config_read_post; + int HP_map_inter_config_read_database_names_pre; + int HP_map_inter_config_read_database_names_post; + int HP_map_inter_config_read_connection_pre; + int HP_map_inter_config_read_connection_post; int HP_map_sql_init_pre; int HP_map_sql_init_post; int HP_map_sql_close_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 2cef7f135..30ede196a 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -115,6 +115,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(battle->calc_drain, HP_battle_calc_drain) }, { HP_POP(battle->config_read, HP_battle_config_read) }, { HP_POP(battle->config_set_defaults, HP_battle_config_set_defaults) }, + { HP_POP(battle->config_set_value_sub, HP_battle_config_set_value_sub) }, { HP_POP(battle->config_set_value, HP_battle_config_set_value) }, { HP_POP(battle->config_get_value, HP_battle_config_get_value) }, { HP_POP(battle->config_adjust, HP_battle_config_adjust) }, @@ -1659,9 +1660,10 @@ struct HookingPointData HookingPoints[] = { { HP_POP(map->readgat, HP_map_readgat) }, { HP_POP(map->readallmaps, HP_map_readallmaps) }, { HP_POP(map->config_read, HP_map_config_read) }, - { HP_POP(map->config_read_sub, HP_map_config_read_sub) }, - { HP_POP(map->reloadnpc_sub, HP_map_reloadnpc_sub) }, + { HP_POP(map->read_npclist, HP_map_read_npclist) }, { HP_POP(map->inter_config_read, HP_map_inter_config_read) }, + { HP_POP(map->inter_config_read_database_names, HP_map_inter_config_read_database_names) }, + { HP_POP(map->inter_config_read_connection, HP_map_inter_config_read_connection) }, { HP_POP(map->sql_init, HP_map_sql_init) }, { HP_POP(map->sql_close, HP_map_sql_close) }, { HP_POP(map->zone_mf_cache, HP_map_zone_mf_cache) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 9ef56800f..819c3b28c 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -2335,15 +2335,15 @@ int HP_battle_calc_drain(int64 damage, int rate, int per) { } return retVal___; } -int HP_battle_config_read(const char *cfgName) { +bool HP_battle_config_read(const char *filename, bool imported) { int hIndex = 0; - int retVal___ = 0; + bool retVal___ = false; if( HPMHooks.count.HP_battle_config_read_pre ) { - int (*preHookFunc) (const char **cfgName); + bool (*preHookFunc) (const char **filename, bool *imported); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_read_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_battle_config_read_pre[hIndex].func; - retVal___ = preHookFunc(&cfgName); + retVal___ = preHookFunc(&filename, &imported); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -2351,13 +2351,13 @@ int HP_battle_config_read(const char *cfgName) { } } { - retVal___ = HPMHooks.source.battle.config_read(cfgName); + retVal___ = HPMHooks.source.battle.config_read(filename, imported); } if( HPMHooks.count.HP_battle_config_read_post ) { - int (*postHookFunc) (int retVal___, const char *cfgName); + bool (*postHookFunc) (bool retVal___, const char *filename, bool imported); for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_read_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_battle_config_read_post[hIndex].func; - retVal___ = postHookFunc(retVal___, cfgName); + retVal___ = postHookFunc(retVal___, filename, imported); } } return retVal___; @@ -2388,15 +2388,42 @@ void HP_battle_config_set_defaults(void) { } return; } -int HP_battle_config_set_value(const char *w1, const char *w2) { +bool HP_battle_config_set_value_sub(int index, int value) { int hIndex = 0; - int retVal___ = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_battle_config_set_value_sub_pre ) { + bool (*preHookFunc) (int *index, int *value); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_set_value_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_battle_config_set_value_sub_pre[hIndex].func; + retVal___ = preHookFunc(&index, &value); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.battle.config_set_value_sub(index, value); + } + if( HPMHooks.count.HP_battle_config_set_value_sub_post ) { + bool (*postHookFunc) (bool retVal___, int index, int value); + for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_set_value_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_battle_config_set_value_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, index, value); + } + } + return retVal___; +} +bool HP_battle_config_set_value(const char *param, const char *value) { + int hIndex = 0; + bool retVal___ = false; if( HPMHooks.count.HP_battle_config_set_value_pre ) { - int (*preHookFunc) (const char **w1, const char **w2); + bool (*preHookFunc) (const char **param, const char **value); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_set_value_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_battle_config_set_value_pre[hIndex].func; - retVal___ = preHookFunc(&w1, &w2); + retVal___ = preHookFunc(¶m, &value); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -2404,13 +2431,13 @@ int HP_battle_config_set_value(const char *w1, const char *w2) { } } { - retVal___ = HPMHooks.source.battle.config_set_value(w1, w2); + retVal___ = HPMHooks.source.battle.config_set_value(param, value); } if( HPMHooks.count.HP_battle_config_set_value_post ) { - int (*postHookFunc) (int retVal___, const char *w1, const char *w2); + bool (*postHookFunc) (bool retVal___, const char *param, const char *value); for(hIndex = 0; hIndex < HPMHooks.count.HP_battle_config_set_value_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_battle_config_set_value_post[hIndex].func; - retVal___ = postHookFunc(retVal___, w1, w2); + retVal___ = postHookFunc(retVal___, param, value); } } return retVal___; @@ -38818,15 +38845,15 @@ void HP_logs_mvpdrop_sub(struct map_session_data *sd, int monster_id, int *log_m } return; } -int HP_logs_config_read(const char *cfgName) { +bool HP_logs_config_read(const char *filename, bool imported) { int hIndex = 0; - int retVal___ = 0; + bool retVal___ = false; if( HPMHooks.count.HP_logs_config_read_pre ) { - int (*preHookFunc) (const char **cfgName); + bool (*preHookFunc) (const char **filename, bool *imported); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_config_read_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_logs_config_read_pre[hIndex].func; - retVal___ = preHookFunc(&cfgName); + retVal___ = preHookFunc(&filename, &imported); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -38834,13 +38861,13 @@ int HP_logs_config_read(const char *cfgName) { } } { - retVal___ = HPMHooks.source.logs.config_read(cfgName); + retVal___ = HPMHooks.source.logs.config_read(filename, imported); } if( HPMHooks.count.HP_logs_config_read_post ) { - int (*postHookFunc) (int retVal___, const char *cfgName); + bool (*postHookFunc) (bool retVal___, const char *filename, bool imported); for(hIndex = 0; hIndex < HPMHooks.count.HP_logs_config_read_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_logs_config_read_post[hIndex].func; - retVal___ = postHookFunc(retVal___, cfgName); + retVal___ = postHookFunc(retVal___, filename, imported); } } return retVal___; @@ -41774,11 +41801,11 @@ int HP_map_cleanup_sub(struct block_list *bl, va_list ap) { } return retVal___; } -int HP_map_delmap(char *mapname) { +int HP_map_delmap(const char *mapname) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_map_delmap_pre ) { - int (*preHookFunc) (char **mapname); + int (*preHookFunc) (const char **mapname); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_map_delmap_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_map_delmap_pre[hIndex].func; @@ -41793,7 +41820,7 @@ int HP_map_delmap(char *mapname) { retVal___ = HPMHooks.source.map.delmap(mapname); } if( HPMHooks.count.HP_map_delmap_post ) { - int (*postHookFunc) (int retVal___, char *mapname); + int (*postHookFunc) (int retVal___, const char *mapname); for(hIndex = 0; hIndex < HPMHooks.count.HP_map_delmap_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_map_delmap_post[hIndex].func; retVal___ = postHookFunc(retVal___, mapname); @@ -42734,15 +42761,15 @@ int HP_map_readallmaps(void) { } return retVal___; } -int HP_map_config_read(char *cfgName) { +bool HP_map_config_read(const char *filename, bool imported) { int hIndex = 0; - int retVal___ = 0; + bool retVal___ = false; if( HPMHooks.count.HP_map_config_read_pre ) { - int (*preHookFunc) (char **cfgName); + bool (*preHookFunc) (const char **filename, bool *imported); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_map_config_read_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_map_config_read_pre[hIndex].func; - retVal___ = preHookFunc(&cfgName); + retVal___ = preHookFunc(&filename, &imported); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -42750,26 +42777,26 @@ int HP_map_config_read(char *cfgName) { } } { - retVal___ = HPMHooks.source.map.config_read(cfgName); + retVal___ = HPMHooks.source.map.config_read(filename, imported); } if( HPMHooks.count.HP_map_config_read_post ) { - int (*postHookFunc) (int retVal___, char *cfgName); + bool (*postHookFunc) (bool retVal___, const char *filename, bool imported); for(hIndex = 0; hIndex < HPMHooks.count.HP_map_config_read_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_map_config_read_post[hIndex].func; - retVal___ = postHookFunc(retVal___, cfgName); + retVal___ = postHookFunc(retVal___, filename, imported); } } return retVal___; } -int HP_map_config_read_sub(char *cfgName) { +bool HP_map_read_npclist(const char *filename, bool imported) { int hIndex = 0; - int retVal___ = 0; - if( HPMHooks.count.HP_map_config_read_sub_pre ) { - int (*preHookFunc) (char **cfgName); + bool retVal___ = false; + if( HPMHooks.count.HP_map_read_npclist_pre ) { + bool (*preHookFunc) (const char **filename, bool *imported); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_map_config_read_sub_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_map_config_read_sub_pre[hIndex].func; - retVal___ = preHookFunc(&cfgName); + for(hIndex = 0; hIndex < HPMHooks.count.HP_map_read_npclist_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_map_read_npclist_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &imported); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -42777,52 +42804,53 @@ int HP_map_config_read_sub(char *cfgName) { } } { - retVal___ = HPMHooks.source.map.config_read_sub(cfgName); + retVal___ = HPMHooks.source.map.read_npclist(filename, imported); } - if( HPMHooks.count.HP_map_config_read_sub_post ) { - int (*postHookFunc) (int retVal___, char *cfgName); - for(hIndex = 0; hIndex < HPMHooks.count.HP_map_config_read_sub_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_map_config_read_sub_post[hIndex].func; - retVal___ = postHookFunc(retVal___, cfgName); + if( HPMHooks.count.HP_map_read_npclist_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_map_read_npclist_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_map_read_npclist_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, imported); } } return retVal___; } -void HP_map_reloadnpc_sub(char *cfgName) { +bool HP_map_inter_config_read(const char *filename, bool imported) { int hIndex = 0; - if( HPMHooks.count.HP_map_reloadnpc_sub_pre ) { - void (*preHookFunc) (char **cfgName); + bool retVal___ = false; + if( HPMHooks.count.HP_map_inter_config_read_pre ) { + bool (*preHookFunc) (const char **filename, bool *imported); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_map_reloadnpc_sub_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_map_reloadnpc_sub_pre[hIndex].func; - preHookFunc(&cfgName); + for(hIndex = 0; hIndex < HPMHooks.count.HP_map_inter_config_read_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_map_inter_config_read_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &imported); } if( *HPMforce_return ) { *HPMforce_return = false; - return; + return retVal___; } } { - HPMHooks.source.map.reloadnpc_sub(cfgName); + retVal___ = HPMHooks.source.map.inter_config_read(filename, imported); } - if( HPMHooks.count.HP_map_reloadnpc_sub_post ) { - void (*postHookFunc) (char *cfgName); - for(hIndex = 0; hIndex < HPMHooks.count.HP_map_reloadnpc_sub_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_map_reloadnpc_sub_post[hIndex].func; - postHookFunc(cfgName); + if( HPMHooks.count.HP_map_inter_config_read_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_map_inter_config_read_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_map_inter_config_read_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, imported); } } - return; + return retVal___; } -int HP_map_inter_config_read(char *cfgName) { +bool HP_map_inter_config_read_database_names(const char *filename, const struct config_t *config, bool imported) { int hIndex = 0; - int retVal___ = 0; - if( HPMHooks.count.HP_map_inter_config_read_pre ) { - int (*preHookFunc) (char **cfgName); + bool retVal___ = false; + if( HPMHooks.count.HP_map_inter_config_read_database_names_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_map_inter_config_read_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_map_inter_config_read_pre[hIndex].func; - retVal___ = preHookFunc(&cfgName); + for(hIndex = 0; hIndex < HPMHooks.count.HP_map_inter_config_read_database_names_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_map_inter_config_read_database_names_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -42830,13 +42858,40 @@ int HP_map_inter_config_read(char *cfgName) { } } { - retVal___ = HPMHooks.source.map.inter_config_read(cfgName); + retVal___ = HPMHooks.source.map.inter_config_read_database_names(filename, config, imported); } - if( HPMHooks.count.HP_map_inter_config_read_post ) { - int (*postHookFunc) (int retVal___, char *cfgName); - for(hIndex = 0; hIndex < HPMHooks.count.HP_map_inter_config_read_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_map_inter_config_read_post[hIndex].func; - retVal___ = postHookFunc(retVal___, cfgName); + if( HPMHooks.count.HP_map_inter_config_read_database_names_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_map_inter_config_read_database_names_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_map_inter_config_read_database_names_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); + } + } + return retVal___; +} +bool HP_map_inter_config_read_connection(const char *filename, const struct config_t *config, bool imported) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_map_inter_config_read_connection_pre ) { + bool (*preHookFunc) (const char **filename, const struct config_t **config, bool *imported); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_map_inter_config_read_connection_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_map_inter_config_read_connection_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &config, &imported); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.map.inter_config_read_connection(filename, config, imported); + } + if( HPMHooks.count.HP_map_inter_config_read_connection_post ) { + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_t *config, bool imported); + for(hIndex = 0; hIndex < HPMHooks.count.HP_map_inter_config_read_connection_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_map_inter_config_read_connection_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, config, imported); } } return retVal___; @@ -44050,15 +44105,15 @@ void HP_mapreg_reload(void) { } return; } -bool HP_mapreg_config_read(const char *w1, const char *w2) { +bool HP_mapreg_config_read(const char *filename, const struct config_setting_t *config, bool imported) { int hIndex = 0; bool retVal___ = false; if( HPMHooks.count.HP_mapreg_config_read_pre ) { - bool (*preHookFunc) (const char **w1, const char **w2); + bool (*preHookFunc) (const char **filename, const struct config_setting_t **config, bool *imported); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_config_read_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_mapreg_config_read_pre[hIndex].func; - retVal___ = preHookFunc(&w1, &w2); + retVal___ = preHookFunc(&filename, &config, &imported); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -44066,13 +44121,13 @@ bool HP_mapreg_config_read(const char *w1, const char *w2) { } } { - retVal___ = HPMHooks.source.mapreg.config_read(w1, w2); + retVal___ = HPMHooks.source.mapreg.config_read(filename, config, imported); } if( HPMHooks.count.HP_mapreg_config_read_post ) { - bool (*postHookFunc) (bool retVal___, const char *w1, const char *w2); + bool (*postHookFunc) (bool retVal___, const char *filename, const struct config_setting_t *config, bool imported); for(hIndex = 0; hIndex < HPMHooks.count.HP_mapreg_config_read_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_mapreg_config_read_post[hIndex].func; - retVal___ = postHookFunc(retVal___, w1, w2); + retVal___ = postHookFunc(retVal___, filename, config, imported); } } return retVal___; @@ -62196,15 +62251,15 @@ void HP_script_setarray_pc(struct map_session_data *sd, const char *varname, uin } return; } -int HP_script_config_read(char *cfgName) { +bool HP_script_config_read(const char *filename, bool imported) { int hIndex = 0; - int retVal___ = 0; + bool retVal___ = false; if( HPMHooks.count.HP_script_config_read_pre ) { - int (*preHookFunc) (char **cfgName); + bool (*preHookFunc) (const char **filename, bool *imported); *HPMforce_return = false; for(hIndex = 0; hIndex < HPMHooks.count.HP_script_config_read_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_script_config_read_pre[hIndex].func; - retVal___ = preHookFunc(&cfgName); + retVal___ = preHookFunc(&filename, &imported); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -62212,13 +62267,13 @@ int HP_script_config_read(char *cfgName) { } } { - retVal___ = HPMHooks.source.script.config_read(cfgName); + retVal___ = HPMHooks.source.script.config_read(filename, imported); } if( HPMHooks.count.HP_script_config_read_post ) { - int (*postHookFunc) (int retVal___, char *cfgName); + bool (*postHookFunc) (bool retVal___, const char *filename, bool imported); for(hIndex = 0; hIndex < HPMHooks.count.HP_script_config_read_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_script_config_read_post[hIndex].func; - retVal___ = postHookFunc(retVal___, cfgName); + retVal___ = postHookFunc(retVal___, filename, imported); } } return retVal___; diff --git a/src/plugins/sample.c b/src/plugins/sample.c index b1ff4b39f..b37f7c4f7 100644 --- a/src/plugins/sample.c +++ b/src/plugins/sample.c @@ -213,11 +213,12 @@ HPExport void plugin_init (void) { } } /* triggered when server starts loading, before any server-specific data is set */ -HPExport void server_preinit (void) { +HPExport void server_preinit(void) +{ /* makes map server listen to mysetting:value in any "battleconf" file (including imported or custom ones) */ /* value is not limited to numbers, its passed to our plugins handler (parse_my_setting) as const char *, * however for battle config to be returned to our script engine we need it to be number (int) so keep use it as int only */ - addBattleConf("my_setting",parse_my_setting,return_my_setting); + addBattleConf("my_setting", parse_my_setting, return_my_setting, false); } /* run when server is ready (online) */ HPExport void server_online (void) { diff --git a/tools/configconverter.pl b/tools/configconverter.pl new file mode 100755 index 000000000..4fafd1f64 --- /dev/null +++ b/tools/configconverter.pl @@ -0,0 +1,969 @@ +#!/usr/bin/perl +# +# This file is part of Hercules. +# http://herc.ws - http://github.com/HerculesWS/Hercules +# +# Copyright (C) 2016 Hercules Dev Team +# Copyright (C) 2016 Haru +# +# Hercules is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +use strict; +use warnings; + +my $silent = 0; +my $confpath = 'conf'; + +sub parse_config($$) { + my ($input, $defaults) = @_; + + my %output = (); + + for my $line (<$input>) { + chomp $line; + $line =~ s/^\s*//; $line =~ s/\s*$//; + if ($line =~ /^([a-z0-9A-Z_.]+)\s*:\s*(.*)$/) { + my ($variable, $value) = ($1, $2); + if ($defaults->{$variable}) { + next if $defaults->{$variable}->{parse}->($variable, $value, $defaults->{$variable}, \%output); + print "Error: Invalid value for setting '$variable: $value'\n"; + next; + } else { + print "Found unhandled configuration setting: '$variable: $value'\n"; + next; + } + } elsif ($line =~ m{^\s*(?://.*)?$}) { + next; + } else { + print "Error: Unable to parse line '$line'\n"; + } + } + return \%output; +} + +sub cfg_add($$$$) { + my ($variable, $value, $default, $output) = @_; + $output->{$variable} = {value => $value, print => $default->{print}, path => $default->{path}} unless $value eq $default->{default}; +} + +sub cfg_append($$$$) { + my ($variable, $value, $default, $output) = @_; + for my $default_value (@{$default->{default}}) { + return if $value eq $default_value; + } + $output->{$variable} = {value => [], print => $default->{print}, path => $default->{path}} unless $output->{$variable}; + push(@{$output->{$variable}->{value}}, $value); +} + +sub parsecfg_string_sub($$$$$) { + my ($variable, $value, $default, $output, $func) = @_; + if ($value =~ m{\s*"((?:\\"|.)*)"\s*(?://.*)?$}i) { + $func->($variable, $1, $default, $output); + return 1; + } elsif ($value =~ m{\s*((?:\\"|.)*)\s*(?://.*)?$}i) { + $func->($variable, $1, $default, $output); + return 1; + } + return 0; +} + +sub parsecfg_string($$$$) { + my ($variable, $value, $default, $output) = @_; + return parsecfg_string_sub($variable, $value, $default, $output, \&cfg_add); +} + +sub parsecfg_stringarr($$$$) { + my ($variable, $value, $default, $output) = @_; + return parsecfg_string_sub($variable, $value, $default, $output, \&cfg_append); +} + +sub parsecfg_int($$$$) { + my ($variable, $value, $default, $output) = @_; + if ($value =~ m{\s*(-?[0-9]+)\s*(?://.*)?$}) { + cfg_add($variable, int $1, $default, $output); + return 1; + } elsif ($value =~ m{\s*(0x[0-9A-F]+)\s*(?://.*)?$}) { + cfg_add($variable, hex $1, $default, $output); + return 1; + } elsif ($value =~ m{\s*(no|false|off)\s*(?://.*)?$}) { + cfg_add($variable, 0, $default, $output); + return 1; + } + return 0; +} + +sub parsecfg_bool($$$$) { + my ($variable, $value, $default, $output) = @_; + if ($value =~ m{\s*(yes|true|1|on)\s*(?://.*)?$}i) { + cfg_add($variable, "true", $default, $output); + return 1; + } elsif ($value =~ m{\s*(no|false|0|off)\s*(?://.*)?$}i) { + cfg_add($variable, "false", $default, $output); + return 1; + } + return 0; +} + +sub print_config($) { + my ($config) = @_; + + for my $variable (keys %$config) { + my $fullpath = $config->{$variable}->{path}; + $fullpath .= $variable if $fullpath =~ m{[:/]$}; + my ($filename, $configpath) = split(/:/, $fullpath, 2); + next unless $filename and $configpath; + my @path = split(/\//, $configpath); + next unless @path; + + my %output = (); + + my $setting = \%output; + while (scalar @path > 1) { + my $nodename = shift @path; + $setting->{$nodename} = {print => \&printcfg_tree, value => {}} unless $setting->{$nodename}; + $setting = $setting->{$nodename}->{value}; + } + $setting->{$path[0]} = {print => $config->{$variable}->{print}, value => $config->{$variable}->{value}}; + verbose("- Found setting: '$variable'.\n Please manually move the setting to '$filename.conf' as in the following example:\n", + "- '$filename.conf': (from $variable)\n"); + $output{$_}->{print}->($_, $output{$_}->{value}, 0) for keys %output; + } +} + +sub indent($$) { + my ($message, $nestlevel) = @_; + return print "\t" x ($nestlevel + 1) . $message; +} + +sub printcfg_tree($$$) { + my ($variable, $value, $nestlevel) = @_; + + indent("$variable: {\n", $nestlevel); + $value->{$_}{print}->($_, $value->{$_}{value}, $nestlevel + 1) for keys %$value; + indent("}\n", $nestlevel); +} + +sub printcfg_nil($$$) { +} + +sub printcfg_string($$$) { + my ($variable, $value, $nestlevel) = @_; + + indent("$variable: \"$value\"\n", $nestlevel); +} + +sub printcfg_int($$$) { + my ($variable, $value, $nestlevel) = @_; + + indent("$variable: $value\n", $nestlevel); +} + +sub printcfg_hexint($$$) { + my ($variable, $value, $nestlevel) = @_; + + indent(sprintf("%s: 0x%x\n", $variable, $value), $nestlevel); +} + +sub printcfg_bool($$$) { + my ($variable, $value, $nestlevel) = @_; + + indent("$variable: $value\n", $nestlevel); +} + +sub printcfg_point($$$) { + my ($variable, $value, $nestlevel) = @_; + + indent("$variable: {\n", $nestlevel); + + my @point = split(/,/, $value, 3); + indent("map: \"$point[0]\"\n", $nestlevel + 1); + indent("x: $point[1]\n", $nestlevel + 1); + indent("y: $point[2]\n", $nestlevel + 1); + + indent("}\n", $nestlevel); +} + +sub printcfg_items($$$) { + my ($variable, $value, $nestlevel) = @_; + + indent("$variable: (\n", $nestlevel); + + my @items = split(/,/, $value); + while (scalar @items >= 3) { + my $id = shift @items; + my $amount = shift @items; + my $stackable = (shift @items) ? "true" : "false"; + indent("{\n", $nestlevel); + indent("id: $id\n", $nestlevel + 1); + indent("amount: $amount\n", $nestlevel + 1); + indent("stackable: $stackable\n", $nestlevel + 1); + indent("},\n", $nestlevel); + } + + indent(")\n", $nestlevel); +} + +sub printcfg_md5hash($$$) { + my ($variable, $value, $nestlevel) = @_; + + indent("$variable: (\n", $nestlevel); + + for (@$value) { + my ($group_id, $hash) = split(/,/, $_, 2); + $group_id =~ s/\s*$//; $group_id =~ s/^\s*//; + $hash =~ s/\s*$//; $hash =~ s/^\s*//; + + indent("{\n", $nestlevel); + indent("group_id: $group_id\n", $nestlevel + 1); + indent("hash: \"$hash\"\n", $nestlevel + 1); + indent("},\n", $nestlevel); + } + + indent(")\n", $nestlevel); +} + +sub printcfg_strlist($$$) { + my ($variable, $value, $nestlevel) = @_; + + indent("$variable: (\n", $nestlevel); + + for my $string (split(/,/, $value)) { + $string =~ s/\s*$//; $string =~ s/^\s*//; + + indent("\"$string\",\n", $nestlevel + 1); + } + + indent(")\n", $nestlevel); +} + +sub process_conf($$) { + my ($files, $defaults) = @_; + my $found = 0; + for my $file (@$files) { + print "\nChecking $file..."; + print " Ok\n" and next unless open my $FH, '<', $file; # File not found or already converted + print " Old file is still present\n"; + my $output = parse_config($FH, $defaults); + close($FH); + my $count = scalar keys %$output; + print "$count non-default settings found."; + verbose(" The file '$file' is no longer used by Hercules and can be deleted.\n", "\n") and next unless $count; + verbose(" Please review and migrate the settings as described, then delete the file '$file', as it is no longer used by Hercules.\n", "\n"); + print_config($output); + $found = 1; + } + return $found; +} + +sub verbose($;$) { + my ($verbose_message, $silent_message) = @_; + return print $verbose_message unless $silent; + return print $silent_message if defined $silent_message; + return 1; +} + +my @defaults = ( + { + files => ['char-server.conf', 'import/char_conf.txt'], + settings => { + autosave_time => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/database/", default => 60}, + bind_ip => {parse => \&parsecfg_string, print => \&printcfg_string, path => "char-server:char_configuration/inter/", default => "127.0.0.1"}, + char_aegis_delete => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "char-server:char_configuration/player/deletion/use_aegis_delete", default => "false"}, + char_del_delay => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/player/deletion/delay", default => 86400}, + char_del_level => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/player/deletion/level", default => 0}, + char_ip => {parse => \&parsecfg_string, print => \&printcfg_string, path => "char-server:char_configuration/inter/", default => "127.0.0.1"}, + char_maintenance_min_group_id => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/permission/maintenance_min_group_id", default => 99}, + char_name_letters => {parse => \&parsecfg_string, print => \&printcfg_string, path => "char-server:char_configuration/player/name/name_letters", default => "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"}, + char_name_option => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/player/name/name_option", default => 1}, + char_new => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "char-server:char_configuration/permission/enable_char_creation", default => "true"}, + char_new_display => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "char-server:char_configuration/permission/display_new", default => "false"}, + char_port => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/inter/", default => 6121}, + char_server_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/permission/server_type", default => 0}, + console_silent => {parse => \&parsecfg_int, print => \&printcfg_int, path => "console:console/", default => 0}, + db_path => {parse => \&parsecfg_string, print => \&printcfg_string, path => "char-server:char_configuration/database/", default => "db"}, + fame_list_alchemist => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/fame/alchemist", default => 10}, + fame_list_blacksmith => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/fame/blacksmith", default => 10}, + fame_list_taekwon => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/fame/taekwon", default => 10}, + gm_allow_group => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/permission/", default => -1}, + guild_exp_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/", default => 100}, + log_char => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "char-server:char_configuration/database/", default => "true"}, + login_ip => {parse => \&parsecfg_string, print => \&printcfg_string, path => "char-server:char_configuration/inter/", default => "127.0.0.1"}, + login_port => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/inter/", default => 6900}, + max_connect_user => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/permission/", default => -1}, + name_ignoring_case => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "char-server:char_configuration/player/name/", default => "false"}, + passwd => {parse => \&parsecfg_string, print => \&printcfg_string, path => "char-server:char_configuration/inter/", default => "p1"}, + pincode_changetime => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/pincode/change_time", default => 0}, + pincode_charselect => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/pincode/request", default => 0}, + pincode_enabled => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "char-server:char_configuration/pincode/enabled", default => "true"}, + pincode_maxtry => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/pincode/max_tries", default => 3}, + save_log => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "console:console/", default => "true"}, + server_name => {parse => \&parsecfg_string, print => \&printcfg_string, path => "char-server:char_configuration/", default => "Hercules"}, + start_items => {parse => \&parsecfg_string, print => \&printcfg_items, path => "char-server:char_configuration/player/new/", default => "1201,1,0,2301,1,0"}, + start_point_pre => {parse => \&parsecfg_string, print => \&printcfg_point, path => "char-server:char_configuration/player/new/", default => "new_1-1,53,111"}, + start_point_re => {parse => \&parsecfg_string, print => \&printcfg_point, path => "char-server:char_configuration/player/new/", default => "iz_int,97,90"}, + start_zeny => {parse => \&parsecfg_int, print => \&printcfg_int, path => "char-server:char_configuration/player/new/zeny", default => 0}, + stdout_with_ansisequence => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "console:console/", default => "false"}, + timestamp_format => {parse => \&parsecfg_string, print => \&printcfg_string, path => "console:console/", default => "[%d/%b %H:%M]"}, + unknown_char_name => {parse => \&parsecfg_string, print => \&printcfg_string, path => "char-server:char_configuration/player/name/", default => "Unknown"}, + userid => {parse => \&parsecfg_string, print => \&printcfg_string, path => "char-server:char_configuration/inter/", default => "s1"}, + wisp_server_name => {parse => \&parsecfg_string, print => \&printcfg_string, path => "char-server:char_configuration/", default => "Server"}, + import => {parse => \&parsecfg_string, print => \&printcfg_nil, path => "", default => "conf/import/char_conf.txt"}, + } + }, + { + files => ['inter-server.conf', 'import/inter_conf.txt'], + settings => { + party_share_level => {parse => \&parsecfg_int, print => \&printcfg_int, path => "inter-server:inter_configuration/", default => 15}, + log_inter => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "inter-server:inter_configuration/log/", default => "true"}, + inter_log_filename => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/log/", default => "log/inter.log"}, + mysql_reconnect_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "inter-server:inter_configuration/mysql_reconnect/type", default => 2}, + mysql_reconnect_count => {parse => \&parsecfg_int, print => \&printcfg_int, path => "inter-server:inter_configuration/mysql_reconnect/count", default => 1}, + log_login_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/login_db", default => "loginlog"}, + char_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/", default => "char"}, + interlog_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/", default => "interlog"}, + ragsrvinfo_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/", default => "ragsrvinfo"}, + acc_reg_num_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/registry/", default => "acc_reg_num_db"}, + acc_reg_str_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/registry/", default => "acc_reg_str_db"}, + char_reg_num_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/registry/", default => "char_reg_num_db"}, + char_reg_str_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/registry/", default => "char_reg_str_db"}, + global_acc_reg_num_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/registry/", default => "global_acc_reg_num_db"}, + global_acc_reg_str_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/registry/", default => "global_acc_reg_str_db"}, + hotkey_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "hotkey"}, + scdata_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "sc_data"}, + cart_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "cart_inventory"}, + inventory_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "inventory"}, + charlog_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "charlog"}, + storage_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "storage"}, + skill_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "skill"}, + memo_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "memo"}, + party_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "party"}, + pet_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "pet"}, + friend_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "friends"}, + mail_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "mail"}, + auction_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "auction"}, + quest_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "quest"}, + homunculus_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "homunculus"}, + skill_homunculus_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "skill_homunculus"}, + mercenary_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "mercenary"}, + mercenary_owner_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "mercenary_owner"}, + elemental_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "elemental"}, + account_data_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/pc/", default => "account_data"}, + guild_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/guild/main_db", default => "guild"}, + guild_alliance_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/guild/alliance_db", default => "guild_alliance"}, + guild_castle_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/guild/castle_db", default => "guild_castle"}, + guild_expulsion_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/guild/expulsion_db", default => "guild_expulsion"}, + guild_member_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/guild/member_db", default => "guild_member"}, + guild_skill_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/guild/skill_db", default => "guild_skill"}, + guild_position_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/guild/position_db", default => "guild_position"}, + guild_storage_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/guild/storage_db", default => "guild_storage"}, + mapreg_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/", default => "mapreg"}, + autotrade_merchants_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/", default => "autotrade_merchants"}, + autotrade_data_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/", default => "autotrade_data"}, + npc_market_data_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/", default => "npc_market_data"}, + default_codepage => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/", default => ""}, + 'sql.db_hostname' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_hostname", default => "127.0.0.1"}, + char_server_ip => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_hostname", default => "127.0.0.1"}, + map_server_ip => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_hostname", default => "127.0.0.1"}, + log_db_ip => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_hostname", default => "127.0.0.1"}, + 'sql.db_port' => {parse => \&parsecfg_int, print => \&printcfg_int, path => "sql_connection:sql_connection/db_port", default => 3306}, + char_server_port => {parse => \&parsecfg_int, print => \&printcfg_int, path => "sql_connection:sql_connection/db_port", default => 3306}, + map_server_port => {parse => \&parsecfg_int, print => \&printcfg_int, path => "sql_connection:sql_connection/db_port", default => 3306}, + log_db_port => {parse => \&parsecfg_int, print => \&printcfg_int, path => "sql_connection:sql_connection/db_port", default => 3306}, + 'sql.db_username' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_username", default => "ragnarok"}, + char_server_id => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_username", default => "ragnarok"}, + map_server_id => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_username", default => "ragnarok"}, + log_db_id => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_username", default => "ragnarok"}, + 'sql.db_password' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_password", default => "ragnarok"}, + char_server_pw => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_password", default => "ragnarok"}, + map_server_pw => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_password", default => "ragnarok"}, + log_db_pw => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_password", default => "ragnarok"}, + 'sql.db_database' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_database", default => "ragnarok"}, + char_server_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_database", default => "ragnarok"}, + map_server_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_database", default => "ragnarok"}, + log_db_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_database", default => "ragnarok"}, + 'sql.codepage' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/codepage", default => ""}, + log_codepage => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/codepage", default => ""}, + interreg_db => {parse => \&parsecfg_string, print => \&printcfg_nil, path => "", default => "interreg"}, + import => {parse => \&parsecfg_string, print => \&printcfg_nil, path => "", default => "conf/import/inter_conf.txt"}, + } + }, + { + files => ['login-server.conf', 'import/login_conf.txt'], + settings => { + bind_ip => {parse => \&parsecfg_string, print => \&printcfg_string, path => "login-server:login_configuration/inter/", default => "127.0.0.1"}, + login_port => {parse => \&parsecfg_int, print => \&printcfg_int, path => "login-server:login_configuration/inter/", default => 6900}, + timestamp_format => {parse => \&parsecfg_string, print => \&printcfg_string, path => "console:console/", default => "[%d/%b %H:%M]"}, + stdout_with_ansisequence => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "console:console/", default => "false"}, + console_silent => {parse => \&parsecfg_int, print => \&printcfg_int, path => "console:console/", default => 0}, + new_account => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "login-server:login_configuration/account/", default => "true"}, + new_acc_length_limit => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "login-server:login_configuration/account/", default => "true"}, + allowed_regs => {parse => \&parsecfg_int, print => \&printcfg_int, path => "login-server:login_configuration/account/", default => 1}, + time_allowed => {parse => \&parsecfg_int, print => \&printcfg_int, path => "login-server:login_configuration/account/", default => 10}, + log_login => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "login-server:login_configuration/log/", default => "true"}, + date_format => {parse => \&parsecfg_string, print => \&printcfg_string, path => "login-server:login_configuration/log/", default => "%Y-%m-%d %H:%M:%S"}, + group_id_to_connect => {parse => \&parsecfg_int, print => \&printcfg_int, path => "login-server:login_configuration/permission/", default => -1}, + min_group_id_to_connect => {parse => \&parsecfg_int, print => \&printcfg_int, path => "login-server:login_configuration/permission/", default => -1}, + start_limited_time => {parse => \&parsecfg_int, print => \&printcfg_int, path => "login-server:login_configuration/account/", default => -1}, + check_client_version => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "login-server:login_configuration/permission/", default => "false"}, + client_version_to_connect => {parse => \&parsecfg_int, print => \&printcfg_int, path => "login-server:login_configuration/permission/", default => 20}, + use_MD5_passwords => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "login-server:login_configuration/account/", default => "false"}, + 'ipban.enable' => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "login-server:login_configuration/account/ipban/enabled", default => "true"}, + 'ipban.sql.db_hostname' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_hostname", default => "127.0.0.1"}, + 'ipban.sql.db_port' => {parse => \&parsecfg_int, print => \&printcfg_int, path => "sql_connection:sql_connection/db_port", default => 3306}, + 'ipban.sql.db_username' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_username", default => "ragnarok"}, + 'ipban.sql.db_password' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_password", default => "ragnarok"}, + 'ipban.sql.db_database' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_database", default => "ragnarok"}, + 'ipban.sql.codepage' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/codepage", default => ""}, + 'ipban.sql.ipban_table' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/ipban_table", default => "ipbanlist"}, + 'ipban.dynamic_pass_failure_ban' => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "login-server:login_configuration/account/ipban/dynamic_pass_failure/enabled", default => "true"}, + 'ipban.dynamic_pass_failure_ban_interval' => {parse => \&parsecfg_int, print => \&printcfg_int, path => "login-server:login_configuration/account/ipban/dynamic_pass_failure/ban_interval", default => 5}, + 'ipban.dynamic_pass_failure_ban_limit' => {parse => \&parsecfg_int, print => \&printcfg_int, path => "login-server:login_configuration/account/ipban/dynamic_pass_failure/ban_limit", default => 7}, + 'ipban.dynamic_pass_failure_ban_duration' => {parse => \&parsecfg_int, print => \&printcfg_int, path => "login-server:login_configuration/account/ipban/dynamic_pass_failure/ban_duration", default => 5}, + ipban_cleanup_interval => {parse => \&parsecfg_int, print => \&printcfg_int, path => "login-server:login_configuration/account/ipban/cleanup_interval", default => 60}, + ip_sync_interval => {parse => \&parsecfg_int, print => \&printcfg_int, path => "login-server:login_configuration/inter/ip_sync_interval", default => 10}, + use_dnsbl => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "login-server:login_configuration/permission/DNS_blacklist/enabled", default => "false"}, + dnsbl_servers => {parse => \&parsecfg_string, print => \&printcfg_strlist, path => "login-server:login_configuration/permission/DNS_blacklist/dnsbl_servers", default => "bl.blocklist.de, socks.dnsbl.sorbs.net"}, + 'account.sql.db_hostname' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_hostname", default => "127.0.0.1"}, + 'account.sql.db_port' => {parse => \&parsecfg_int, print => \&printcfg_int, path => "sql_connection:sql_connection/db_port", default => 3306}, + 'account.sql.db_username' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_username", default => "ragnarok"}, + 'account.sql.db_password' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_password", default => "ragnarok"}, + 'account.sql.db_database' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/db_database", default => "ragnarok"}, + 'account.sql.codepage' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "sql_connection:sql_connection/codepage", default => ""}, + 'account.sql.case_sensitive' => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "sql_connection:sql_connection/case_sensitive", default => "false"}, + 'account.sql.account_db' => {parse => \&parsecfg_string, print => \&printcfg_string, path => "inter-server:inter_configuration/database_names/account_db", default => "login"}, + client_hash_check => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "login-server:login_configuration/permission/hash/enabled", default => "false"}, + client_hash => {parse => \&parsecfg_stringarr, print => \&printcfg_md5hash, path => "login-server:login_configuration/permission/hash/MD5_hashes", default => []}, + 'account.sql.accreg_db' => {parse => \&parsecfg_string, print => \&printcfg_nil, path => "", default => "global_reg_value"}, + import => {parse => \&parsecfg_stringarr, print => \&printcfg_nil, path => "", default => ["conf/inter-server.conf", "conf/import/login_conf.txt"]}, + } + }, + { + files => ['map-server.conf', 'import/map_conf.txt'], + settings => { + userid => {parse => \&parsecfg_string, print => \&printcfg_string, path => "map-server:map_configuration/inter/", default => "s1"}, + passwd => {parse => \&parsecfg_string, print => \&printcfg_string, path => "map-server:map_configuration/inter/", default => "p1"}, + char_ip => {parse => \&parsecfg_string, print => \&printcfg_string, path => "map-server:map_configuration/inter/", default => "127.0.0.1"}, + bind_ip => {parse => \&parsecfg_string, print => \&printcfg_string, path => "map-server:map_configuration/inter/", default => "127.0.0.1"}, + char_port => {parse => \&parsecfg_int, print => \&printcfg_int, path => "map-server:map_configuration/inter/", default => 6121}, + map_ip => {parse => \&parsecfg_string, print => \&printcfg_string, path => "map-server:map_configuration/inter/", default => "127.0.0.1"}, + map_port => {parse => \&parsecfg_int, print => \&printcfg_int, path => "map-server:map_configuration/inter/", default => 5121}, + timestamp_format => {parse => \&parsecfg_string, print => \&printcfg_string, path => "console:console/", default => "[%d/%b %H:%M]"}, + stdout_with_ansisequence => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "console:console/", default => "false"}, + console_msg_log => {parse => \&parsecfg_int, print => \&printcfg_int, path => "console:console/", default => 0}, + console_silent => {parse => \&parsecfg_int, print => \&printcfg_int, path => "console:console/", default => 0}, + db_path => {parse => \&parsecfg_string, print => \&printcfg_string, path => "map-server:map_configuration/database/", default => "db"}, + enable_spy => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "map-server:map_configuration/", default => "false"}, + use_grf => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "map-server:map_configuration/", default => "false"}, + autosave_time => {parse => \&parsecfg_int, print => \&printcfg_int, path => "map-server:map_configuration/database/", default => 300}, + minsave_time => {parse => \&parsecfg_int, print => \&printcfg_int, path => "map-server:map_configuration/database/", default => 100}, + save_settings => {parse => \&parsecfg_int, print => \&printcfg_hexint, path => "map-server:map_configuration/database/", default => 511}, + default_language => {parse => \&parsecfg_string, print => \&printcfg_string, path => "map-server:map_configuration/", default => "English"}, + help_txt => {parse => \&parsecfg_string, print => \&printcfg_string, path => "map-server:map_configuration/", default => "conf/help.txt"}, + charhelp_txt => {parse => \&parsecfg_string, print => \&printcfg_string, path => "map-server:map_configuration/", default => "conf/charhelp.txt"}, + help2_txt => {parse => \&parsecfg_string, print => \&printcfg_nil, path => "", default => "conf/help2.txt"}, + import => {parse => \&parsecfg_stringarr, print => \&printcfg_nil, path => "", default => ["conf/maps.conf", "conf/import/map_conf.txt"]}, + } + }, + { + files => ['logs.conf', 'import/log_conf.txt'], + settings => { + enable_logs => {parse => \&parsecfg_int, print => \&printcfg_hexint, path => "logs:map_log/enable", default => 0xFFFFF}, + sql_logs => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "logs:map_log/database/use_sql", default => "true"}, + log_filter => {parse => \&parsecfg_int, print => \&printcfg_int, path => "logs:map_log/filter/item/", default => 1}, + refine_items_log => {parse => \&parsecfg_int, print => \&printcfg_int, path => "logs:map_log/filter/item/", default => 5}, + rare_items_log => {parse => \&parsecfg_int, print => \&printcfg_int, path => "logs:map_log/filter/item/", default => 100}, + price_items_log => {parse => \&parsecfg_int, print => \&printcfg_int, path => "logs:map_log/filter/item/", default => 1000}, + amount_items_log => {parse => \&parsecfg_int, print => \&printcfg_int, path => "logs:map_log/filter/item/", default => 100}, + log_branch => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "logs:map_log/", default => "false"}, + log_zeny => {parse => \&parsecfg_int, print => \&printcfg_int, path => "logs:map_log/", default => 0}, + log_mvpdrop => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "logs:map_log/", default => "false"}, + log_commands => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "logs:map_log/", default => "true"}, + log_npc => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "logs:map_log/", default => "false"}, + log_chat => {parse => \&parsecfg_int, print => \&printcfg_int, path => "logs:map_log/filter/chat/", default => 0}, + log_chat_woe_disable => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "logs:map_log/filter/chat/", default => "false"}, + log_gm_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "logs:map_log/database/", default => "atcommandlog"}, + log_branch_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "logs:map_log/database/", default => "branchlog"}, + log_chat_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "logs:map_log/database/", default => "chatlog"}, + log_mvpdrop_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "logs:map_log/database/", default => "mvplog"}, + log_npc_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "logs:map_log/database/", default => "npclog"}, + log_pick_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "logs:map_log/database/", default => "picklog"}, + log_zeny_db => {parse => \&parsecfg_string, print => \&printcfg_string, path => "logs:map_log/database/", default => "zenylog"}, + import => {parse => \&parsecfg_string, print => \&printcfg_nil, path => "", default => "conf/import/log_conf.txt"}, + } + }, + { + files => ['script.conf', 'import/script_conf.txt'], + settings => { + warn_func_mismatch_paramnum => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "script:script_configuration/", default => "true"}, + check_cmdcount => {parse => \&parsecfg_int, print => \&printcfg_int, path => "script:script_configuration/", default => 655360}, + check_gotocount => {parse => \&parsecfg_int, print => \&printcfg_int, path => "script:script_configuration/", default => 2048}, + input_min_value => {parse => \&parsecfg_int, print => \&printcfg_int, path => "script:script_configuration/", default => 0}, + input_max_value => {parse => \&parsecfg_int, print => \&printcfg_int, path => "script:script_configuration/", default => 10000000}, + warn_func_mismatch_argtypes => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "script:script_configuration/", default => "true"}, + import => {parse => \&parsecfg_string, print => \&printcfg_nil, path => "", default => "conf/import/script_conf.txt"}, + } + }, + { + files => ['packet.conf', 'import/packet_conf.txt'], + settings => { + debug => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "socket:socket_configuration/", default => "false"}, + stall_time => {parse => \&parsecfg_int, print => \&printcfg_int, path => "socket:socket_configuration/", default => 60}, + epoll_maxevents => {parse => \&parsecfg_int, print => \&printcfg_int, path => "socket:socket_configuration/", default => 1024}, + socket_max_client_packet => {parse => \&parsecfg_int, print => \&printcfg_int, path => "socket:socket_configuration/", default => 65535}, + enable_ip_rules => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "socket:socket_configuration/ip_rules/enable", default => "true"}, + order => {parse => \&parsecfg_string, print => \&printcfg_string, path => "socket:socket_configuration/ip_rules/", default => "deny,allow"}, + allow => {parse => \&parsecfg_stringarr, print => \&printcfg_strlist, path => "socket:socket_configuration/ip_rules/allow_list", default => []}, + deny => {parse => \&parsecfg_stringarr, print => \&printcfg_strlist, path => "socket:socket_configuration/ip_rules/deny_list", default => []}, + ddos_interval => {parse => \&parsecfg_int, print => \&printcfg_int, path => "socket:socket_configuration/ddos/interval", default => 3000}, + ddos_count => {parse => \&parsecfg_int, print => \&printcfg_int, path => "socket:socket_configuration/ddos/count", default => 5}, + ddos_autoreset => {parse => \&parsecfg_int, print => \&printcfg_int, path => "socket:socket_configuration/ddos/autoreset", default => 600000}, + import => {parse => \&parsecfg_string, print => \&printcfg_nil, path => "", default => "conf/import/packet_conf.txt"}, + } + }, + { + files => ['battle.conf', 'battle/battle.conf', 'battle/client.conf', 'battle/drops.conf', 'battle/exp.conf', 'battle/gm.conf', 'battle/guild.conf', 'battle/battleground.conf', 'battle/items.conf', 'battle/monster.conf', 'battle/party.conf', 'battle/pet.conf', 'battle/homunc.conf', 'battle/player.conf', 'battle/skill.conf', 'battle/status.conf', 'battle/feature.conf', 'battle/misc.conf', 'import/battle_conf.txt'], + settings => { + bg_flee_penalty => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battleground:", default => 20}, + bg_update_interval => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battleground:", default => 1000}, + 'feature.buying_store' => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "feature:features/buying_store", default => "true"}, + 'feature.search_stores' => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "feature:features/search_stores", default => "true"}, + 'feature.atcommand_suggestions' => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "feature:features/atcommand_suggestions", default => "false"}, + 'feature.banking' => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "feature:features/banking", default => "true"}, + 'feature.auction' => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "feature:features/auction", default => "false"}, + 'feature.roulette' => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "feature:features/roulette", default => "false"}, + atcommand_spawn_quantity_limit => {parse => \&parsecfg_int, print => \&printcfg_int, path => "gm:", default => 100}, + atcommand_slave_clone_limit => {parse => \&parsecfg_int, print => \&printcfg_int, path => "gm:", default => 25}, + partial_name_scan => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "gm:", default => "true"}, + atcommand_max_stat_bypass => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "gm:", default => "false"}, + ban_hack_trade => {parse => \&parsecfg_int, print => \&printcfg_int, path => "gm:", default => 5}, + atcommand_mobinfo_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "gm:", default => 0}, + gm_ignore_warpable_area => {parse => \&parsecfg_int, print => \&printcfg_int, path => "gm:", default => 2}, + atcommand_levelup_events => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "gm:", default => "false"}, + guild_emperium_check => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "guild:", default => "true"}, + guild_exp_limit => {parse => \&parsecfg_int, print => \&printcfg_int, path => "guild:", default => 50}, + guild_max_castles => {parse => \&parsecfg_int, print => \&printcfg_int, path => "guild:", default => 0}, + guild_skill_relog_delay => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "guild:", default => "false"}, + castle_defense_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "guild:", default => 100}, + gvg_flee_penalty => {parse => \&parsecfg_int, print => \&printcfg_int, path => "guild:", default => 20}, + require_glory_guild => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "guild:", default => "false"}, + max_guild_alliance => {parse => \&parsecfg_int, print => \&printcfg_int, path => "guild:", default => 3}, + guild_notice_changemap => {parse => \&parsecfg_int, print => \&printcfg_int, path => "guild:", default => 2}, + guild_castle_invite => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "guild:", default => "false"}, + guild_castle_expulsion => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "guild:", default => "false"}, + hom_setting => {parse => \&parsecfg_int, print => \&printcfg_hexint, path => "homunc:", default => 0x1D}, + homunculus_friendly_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "homunc:", default => 100}, + hom_rename => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "homunc:", default => "false"}, + hvan_explosion_intimate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "homunc:", default => 45000}, + homunculus_show_growth => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "homunc:", default => "true"}, + homunculus_autoloot => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "homunc:", default => "true"}, + homunculus_auto_vapor => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "homunc:", default => "true"}, + homunculus_max_level => {parse => \&parsecfg_int, print => \&printcfg_int, path => "homunc:", default => 99}, + homunculus_S_max_level => {parse => \&parsecfg_int, print => \&printcfg_int, path => "homunc:", default => 150}, + enable_baseatk => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 9}, + enable_perfect_flee => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 1}, + enable_critical => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 17}, + mob_critical_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 100}, + critical_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 100}, + attack_walk_delay => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 15}, + pc_damage_walk_delay_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 20}, + damage_walk_delay_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 100}, + multihit_delay => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 80}, + player_damage_delay_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 100}, + undead_detect_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 0}, + attribute_recover => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "battle:", default => "false"}, + min_hitrate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 5}, + max_hitrate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 100}, + agi_penalty_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 1}, + agi_penalty_target => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 1}, + agi_penalty_count => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 3}, + agi_penalty_num => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 10}, + vit_penalty_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 1}, + vit_penalty_target => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 1}, + vit_penalty_count => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 3}, + vit_penalty_num => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 5}, + weapon_defense_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 0}, + magic_defense_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 0}, + attack_direction_change => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 0}, + attack_attr_none => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 14}, + equip_natural_break_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 0}, + equip_self_break_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 100}, + equip_skill_break_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 100}, + delay_battle_damage => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "battle:", default => "true"}, + arrow_decrement => {parse => \&parsecfg_int, print => \&printcfg_int, path => "battle:", default => 1}, + autospell_check_range => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "battle:", default => "false"}, + knockback_left => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "battle:", default => "true"}, + snap_dodge => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "battle:", default => "false"}, + packet_obfuscation => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 1}, + min_chat_delay => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 0}, + min_hair_style => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 0}, + max_hair_style => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 29}, + min_hair_color => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 0}, + max_hair_color => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 8}, + min_cloth_color => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 0}, + max_cloth_color => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 4}, + min_body_style => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 0}, + max_body_style => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 4}, + hide_woe_damage => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "client:", default => "true"}, + pet_hair_style => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 100}, + area_size => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 14}, + max_walk_path => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 17}, + max_lv => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 99}, + aura_lv => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 99}, + client_limit_unit_lv => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 0}, + wedding_modifydisplay => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "client:", default => "false"}, + save_clothcolor => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "client:", default => "true"}, + save_body_style => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "client:", default => "false"}, + wedding_ignorepalette => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "client:", default => "false"}, + xmas_ignorepalette => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "client:", default => "false"}, + summer_ignorepalette => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "client:", default => "false"}, + hanbok_ignorepalette => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "client:", default => "false"}, + display_version => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "client:", default => "false"}, + display_hallucination => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "client:", default => "true"}, + display_status_timers => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "client:", default => "true"}, + client_reshuffle_dice => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "client:", default => "true"}, + client_sort_storage => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "client:", default => "false"}, + client_accept_chatdori => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 0}, + client_emblem_max_blank_percent => {parse => \&parsecfg_int, print => \&printcfg_int, path => "client:", default => 100}, + item_auto_get => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "drops:", default => "false"}, + flooritem_lifetime => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 60000}, + item_first_get_time => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 3000}, + item_second_get_time => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 1000}, + item_third_get_time => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 1000}, + mvp_item_first_get_time => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 10000}, + mvp_item_second_get_time => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 10000}, + mvp_item_third_get_time => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 2000}, + item_rate_common => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 100}, + item_rate_common_boss => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 100}, + item_drop_common_min => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 1}, + item_drop_common_max => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 10000}, + item_rate_heal => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 100}, + item_rate_heal_boss => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 100}, + item_drop_heal_min => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 1}, + item_drop_heal_max => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 10000}, + item_rate_use => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 100}, + item_rate_use_boss => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 100}, + item_drop_use_min => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 1}, + item_drop_use_max => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 10000}, + item_rate_equip => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 100}, + item_rate_equip_boss => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 100}, + item_drop_equip_min => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 1}, + item_drop_equip_max => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 10000}, + item_rate_card => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 100}, + item_rate_card_boss => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 100}, + item_drop_card_min => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 1}, + item_drop_card_max => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 10000}, + item_rate_mvp => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 100}, + item_drop_mvp_min => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 1}, + item_drop_mvp_max => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 10000}, + item_rate_adddrop => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 100}, + item_drop_add_min => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 1}, + item_drop_add_max => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 10000}, + item_rate_treasure => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 100}, + item_drop_treasure_min => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 1}, + item_drop_treasure_max => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 10000}, + item_logarithmic_drops => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "drops:", default => "false"}, + drop_rate0item => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "drops:", default => "false"}, + drops_by_luk => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 0}, + drops_by_luk2 => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 0}, + alchemist_summon_reward => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 1}, + rare_drop_announce => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 0}, + base_exp_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 100}, + job_exp_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 100}, + multi_level_up => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "exp:", default => "false"}, + max_exp_gain_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 0}, + exp_calc_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 0}, + exp_bonus_attacker => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 25}, + exp_bonus_max_attacker => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 12}, + mvp_exp_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 100}, + quest_exp_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 100}, + heal_exp => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 0}, + resurrection_exp => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 0}, + shop_exp => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 0}, + pvp_exp => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "exp:", default => "true"}, + death_penalty_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 1}, + death_penalty_base => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 100}, + death_penalty_job => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 100}, + zeny_penalty => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 0}, + disp_experience => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "exp:", default => "false"}, + disp_zeny => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "exp:", default => "false"}, + use_statpoint_table => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "exp:", default => "true"}, + vending_max_value => {parse => \&parsecfg_int, print => \&printcfg_int, path => "items:", default => 1000000000}, + vending_over_max => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "items:", default => "true"}, + vending_tax => {parse => \&parsecfg_int, print => \&printcfg_int, path => "items:", default => 200}, + buyer_name => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "items:", default => "true"}, + weapon_produce_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "items:", default => 100}, + potion_produce_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "items:", default => 100}, + produce_item_name_input => {parse => \&parsecfg_int, print => \&printcfg_hexint, path => "items:", default => 0x03}, + dead_branch_active => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "items:", default => "true"}, + random_monster_checklv => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "items:", default => "false"}, + ignore_items_gender => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "items:", default => "true"}, + item_check => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "items:", default => "false"}, + item_use_interval => {parse => \&parsecfg_int, print => \&printcfg_int, path => "items:", default => 100}, + cashfood_use_interval => {parse => \&parsecfg_int, print => \&printcfg_int, path => "items:", default => 60000}, + gtb_sc_immunity => {parse => \&parsecfg_int, print => \&printcfg_int, path => "items:", default => 50}, + autospell_stacking => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "items:", default => "false"}, + item_restricted_consumption_type => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "items:", default => "true"}, + item_enabled_npc => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "items:", default => "true"}, + unequip_restricted_equipment => {parse => \&parsecfg_int, print => \&printcfg_int, path => "items:", default => 0}, + pk_mode => {parse => \&parsecfg_int, print => \&printcfg_int, path => "misc:", default => 0}, + manner_system => {parse => \&parsecfg_int, print => \&printcfg_int, path => "misc:", default => 31}, + pk_min_level => {parse => \&parsecfg_int, print => \&printcfg_int, path => "misc:", default => 55}, + pk_level_range => {parse => \&parsecfg_int, print => \&printcfg_int, path => "misc:", default => 0}, + skill_log => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "misc:", default => "false"}, + battle_log => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "misc:", default => "false"}, + etc_log => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "misc:", default => "false"}, + warp_point_debug => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "misc:", default => "false"}, + night_at_start => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "misc:", default => "false"}, + day_duration => {parse => \&parsecfg_int, print => \&printcfg_int, path => "misc:", default => 0}, + night_duration => {parse => \&parsecfg_int, print => \&printcfg_int, path => "misc:", default => 0}, + duel_allow_pvp => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "misc:", default => "false"}, + duel_allow_gvg => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "misc:", default => "false"}, + duel_allow_teleport => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "misc:", default => "false"}, + duel_autoleave_when_die => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "misc:", default => "true"}, + duel_time_interval => {parse => \&parsecfg_int, print => \&printcfg_int, path => "misc:", default => 60}, + duel_only_on_same_map => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "misc:", default => "false"}, + official_cell_stack_limit => {parse => \&parsecfg_int, print => \&printcfg_int, path => "misc:", default => 1}, + custom_cell_stack_limit => {parse => \&parsecfg_int, print => \&printcfg_int, path => "misc:", default => 1}, + check_occupied_cells => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "misc:", default => "true"}, + at_mapflag => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "misc:", default => "false"}, + at_timeout => {parse => \&parsecfg_int, print => \&printcfg_int, path => "misc:", default => 0}, + auction_feeperhour => {parse => \&parsecfg_int, print => \&printcfg_int, path => "misc:", default => 12000}, + auction_maximumprice => {parse => \&parsecfg_int, print => \&printcfg_int, path => "misc:", default => 500000000}, + searchstore_querydelay => {parse => \&parsecfg_int, print => \&printcfg_int, path => "misc:", default => 10}, + searchstore_maxresults => {parse => \&parsecfg_int, print => \&printcfg_int, path => "misc:", default => 30}, + cashshop_show_points => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "misc:", default => "false"}, + mail_show_status => {parse => \&parsecfg_int, print => \&printcfg_int, path => "misc:", default => 0}, + mon_trans_disable_in_gvg => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "misc:", default => "false"}, + case_sensitive_aegisnames => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "misc:", default => "true"}, + mvp_hp_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 100}, + monster_hp_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 100}, + monster_max_aspd => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 199}, + monster_ai => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 0}, + monster_chase_refresh => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 3}, + mob_warp => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 0}, + mob_active_time => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 0}, + boss_active_time => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 0}, + view_range_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 100}, + chase_range_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 100}, + monster_active_enable => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "monster:", default => "true"}, + override_mob_names => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 0}, + monster_damage_delay_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 100}, + monster_loot_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 0}, + mob_skill_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 100}, + mob_skill_delay => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 100}, + mob_count_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 100}, + mob_spawn_delay => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 100}, + plant_spawn_delay => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 100}, + boss_spawn_delay => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 100}, + no_spawn_on_player => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 0}, + force_random_spawn => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "monster:", default => "false"}, + slaves_inherit_mode => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 2}, + slaves_inherit_speed => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 3}, + summons_trigger_autospells => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "monster:", default => "true"}, + retaliate_to_master => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "monster:", default => "true"}, + mob_changetarget_byskill => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "monster:", default => "false"}, + monster_class_change_full_recover => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "monster:", default => "true"}, + show_mob_info => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 0}, + zeny_from_mobs => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "monster:", default => "false"}, + mobs_level_up => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "monster:", default => "false"}, + mobs_level_up_exp_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 1}, + dynamic_mobs => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "monster:", default => "true"}, + mob_remove_damaged => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "monster:", default => "true"}, + mob_remove_delay => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 300000}, + mob_npc_event_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 1}, + ksprotection => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 0}, + mob_slave_keep_target => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "monster:", default => "true"}, + mvp_tomb_enabled => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "monster:", default => "true"}, + show_monster_hp_bar => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "monster:", default => "true"}, + mob_size_influence => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "monster:", default => "false"}, + mob_icewall_walk_block => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 220}, + boss_icewall_walk_block => {parse => \&parsecfg_int, print => \&printcfg_int, path => "monster:", default => 1}, + show_steal_in_same_party => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "party:", default => "false"}, + party_update_interval => {parse => \&parsecfg_int, print => \&printcfg_int, path => "party:", default => 1000}, + party_hp_mode => {parse => \&parsecfg_int, print => \&printcfg_int, path => "party:", default => 0}, + show_party_share_picker => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "party:", default => "true"}, + 'show_picker.item_type' => {parse => \&parsecfg_int, print => \&printcfg_int, path => "party:show_picker_item_type", default => 112}, + party_item_share_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "party:", default => 0}, + idle_no_share => {parse => \&parsecfg_int, print => \&printcfg_int, path => "party:", default => 0}, + party_even_share_bonus => {parse => \&parsecfg_int, print => \&printcfg_int, path => "party:", default => 0}, + display_party_name => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "party:", default => "false"}, + pet_catch_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "pet:", default => 100}, + pet_rename => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "pet:", default => "false"}, + pet_friendly_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "pet:", default => 100}, + pet_hungry_delay_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "pet:", default => 100}, + pet_hungry_friendly_decrease => {parse => \&parsecfg_int, print => \&printcfg_int, path => "pet:", default => 5}, + pet_equip_required => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "pet:", default => "true"}, + pet_attack_support => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "pet:", default => "false"}, + pet_damage_support => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "pet:", default => "false"}, + pet_support_min_friendly => {parse => \&parsecfg_int, print => \&printcfg_int, path => "pet:", default => 900}, + pet_equip_min_friendly => {parse => \&parsecfg_int, print => \&printcfg_int, path => "pet:", default => 900}, + pet_status_support => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "pet:", default => "false"}, + pet_support_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "pet:", default => 100}, + pet_attack_exp_to_master => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "pet:", default => "false"}, + pet_attack_exp_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "pet:", default => 100}, + pet_lv_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "pet:", default => 0}, + pet_max_stats => {parse => \&parsecfg_int, print => \&printcfg_int, path => "pet:", default => 99}, + pet_max_atk1 => {parse => \&parsecfg_int, print => \&printcfg_int, path => "pet:", default => 500}, + pet_max_atk2 => {parse => \&parsecfg_int, print => \&printcfg_int, path => "pet:", default => 1000}, + pet_disable_in_gvg => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "pet:", default => "false"}, + hp_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 100}, + sp_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 100}, + left_cardfix_to_right => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "true"}, + restart_hp_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 0}, + restart_sp_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 0}, + player_skillfree => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "false"}, + player_skillup_limit => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "true"}, + quest_skill_learn => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "false"}, + quest_skill_reset => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "false"}, + basic_skill_check => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "true"}, + player_invincible_time => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 5000}, + fix_warp_hit_delay_abuse => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "false"}, + natural_healhp_interval => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 6000}, + natural_healsp_interval => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 8000}, + natural_heal_skill_interval => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 10000}, + natural_heal_weight_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 50}, + max_aspd => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 190}, + max_third_aspd => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 193}, + max_walk_speed => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 300}, + max_hp => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 1000000}, + max_sp => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 1000000}, + max_parameter => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 99}, + max_third_parameter => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 130}, + max_extended_parameter => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 125}, + max_baby_parameter => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 80}, + max_baby_third_parameter => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 117}, + max_def => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 99}, + over_def_bonus => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 0}, + max_cart_weight => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 8000}, + prevent_logout => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 10000}, + show_hp_sp_drain => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "false"}, + show_hp_sp_gain => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "true"}, + show_katar_crit_bonus => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "false"}, + friend_auto_add => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "true"}, + invite_request_check => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "true"}, + bone_drop => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 0}, + character_size => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 0}, + idle_no_autoloot => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 0}, + min_npc_vendchat_distance => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 3}, + vendchat_near_hiddennpc => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "false"}, + snovice_call_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "player:", default => 0}, + idletime_criteria => {parse => \&parsecfg_int, print => \&printcfg_hexint, path => "player:", default => 0x1F}, + costume_refine_def => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "true"}, + shadow_refine_def => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "true"}, + shadow_refine_atk => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "true"}, + player_warp_keep_direction => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "player:", default => "true"}, + casting_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 100}, + delay_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 100}, + delay_dependon_dex => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "false"}, + delay_dependon_agi => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "false"}, + min_skill_delay_limit => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 100}, + default_walk_delay => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 300}, + no_skill_delay => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 2}, + castrate_dex_scale => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 150}, + vcast_stat_scale => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 530}, + skill_amotion_leniency => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 90}, + skill_delay_attack_enable => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "true"}, + skill_add_range => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 0}, + skill_out_range_consume => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "false"}, + skillrange_by_distance => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 14}, + skillrange_from_weapon => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 0}, + skill_caster_check => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "true"}, + clear_skills_on_death => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 0}, + clear_skills_on_warp => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 15}, + defunit_not_enemy => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "false"}, + skill_min_damage => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 6}, + combo_delay_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 100}, + auto_counter_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 15}, + skill_reiteration => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 0}, + skill_nofootset => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 1}, + gvg_traps_target_all => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 1}, + traps_setting => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 0}, + summon_flora_setting => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 3}, + song_timer_reset => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 0}, + skill_wall_check => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "true"}, + player_cloak_check_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 1}, + monster_cloak_check_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 4}, + land_skill_limit => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 9}, + display_skill_fail => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 0}, + chat_warpportal => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "false"}, + sense_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 1}, + finger_offensive_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 0}, + gx_allhit => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "false"}, + gx_disptype => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 1}, + devotion_level_difference => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 10}, + player_skill_partner_check => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "true"}, + skill_removetrap_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 0}, + backstab_bow_penalty => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "true"}, + skill_steal_max_tries => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 0}, + copyskill_restrict => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 2}, + berserk_cancels_buffs => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "false"}, + max_heal => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 9999}, + max_heal_lv => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 11}, + emergency_call => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 11}, + guild_aura => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 31}, + skip_teleport_lv1_menu => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "false"}, + allow_skill_without_day => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "false"}, + allow_es_magic_player => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "false"}, + sg_miracle_skill_ratio => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 2}, + sg_miracle_skill_duration => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 3600000}, + sg_angel_skill_ratio => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 10}, + skill_add_heal_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 7}, + eq_single_target_reflectable => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "true"}, + 'invincible.nodamage' => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "false"}, + dancing_weaponswitch_fix => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "true"}, + skill_trap_type => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 0}, + mob_max_skilllvl => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 100}, + bowling_bash_area => {parse => \&parsecfg_int, print => \&printcfg_int, path => "skill:", default => 0}, + stormgust_knockback => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "skill:", default => "true"}, + status_cast_cancel => {parse => \&parsecfg_int, print => \&printcfg_int, path => "status:", default => 0}, + pc_status_def_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "status:", default => 100}, + mob_status_def_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "status:", default => 100}, + pc_max_status_def => {parse => \&parsecfg_int, print => \&printcfg_int, path => "status:", default => 100}, + mob_max_status_def => {parse => \&parsecfg_int, print => \&printcfg_int, path => "status:", default => 100}, + import => {parse => \&parsecfg_stringarr, print => \&printcfg_nil, path => "", default => ['conf/battle/battle.conf', 'conf/battle/client.conf', 'conf/battle/drops.conf', 'conf/battle/exp.conf', 'conf/battle/gm.conf', 'conf/battle/guild.conf', 'conf/battle/battleground.conf', 'conf/battle/items.conf', 'conf/battle/monster.conf', 'conf/battle/party.conf', 'conf/battle/pet.conf', 'conf/battle/homunc.conf', 'conf/battle/player.conf', 'conf/battle/skill.conf', 'conf/battle/status.conf', 'conf/battle/feature.conf', 'conf/battle/misc.conf', 'conf/import/battle_conf.txt']}, + } + }, +); + +for (@ARGV) { + if (/^-q$/) { $silent = 1; } + elsif (/^-v$/) { $silent = 0; } + elsif (-d) { $confpath = $_; } + else { undef $confpath } +} + +verbose(<<'EOF'); +=============== Hercules Configuration Migration Helper =============== += _ _ _ = += | | | | | | = += | |_| | ___ _ __ ___ _ _| | ___ ___ = += | _ |/ _ \ '__/ __| | | | |/ _ \/ __| = += | | | | __/ | | (__| |_| | | __/\__ \ = += \_| |_/\___|_| \___|\__,_|_|\___||___/ = +======================================================================= +This tool will assist you through the migration of the old (txt-based) +configuration files to the new (libconfig-based) format. +Please follow the displayed instructions. +======================================================================= + +EOF + +die "Usage: ./$0 [-q | -v] [path to the conf directory]\nIf no options are passed, it acts as if called as ./$0 conf\n" unless defined $confpath and -d $confpath; + +my $count = 0; +for (@defaults) { + my @files = map { $confpath . '/' . $_ } @{$_->{files}}; + $count += process_conf(\@files, $_->{settings}) +} +verbose("\nThere are no files to migrate.\n") unless $count; @@ -99,35 +99,49 @@ case "$MODE" in make plugin.script_mapquit -j3 || aborterror "Build failed." ;; test) - cat >> conf/import/login_conf.txt << EOF -ipban.sql.db_username: $DBUSER -ipban.sql.db_password: $DBPASS -ipban.sql.db_database: $DBNAME -account.sql.db_username: $DBUSER -account.sql.db_password: $DBPASS -account.sql.db_database: $DBNAME -account.sql.db_hostname: localhost + cat > conf/travis_sql_connection.conf << EOF +sql_connection: { + //default_codepage: "" + //case_sensitive: false + db_hostname: "localhost" + db_username: "$DBUSER" + db_password: "$DBPASS" + db_database: "$DBNAME" + //codepage:"" +} +EOF + [ $? -eq 0 ] || aborterror "Unable to write database configuration, aborting tests." + cat > conf/import/login-server.conf << EOF +login_configuration: { + account: { + @include "conf/travis_sql_connection.conf" + ipban: { + @include "conf/travis_sql_connection.conf" + } + } +} +EOF + [ $? -eq 0 ] || aborterror "Unable to override login-server configuration, aborting tests." + cat > conf/import/char-server.conf << EOF +char_configuration: { + @include "conf/travis_sql_connection.conf" +} +EOF + [ $? -eq 0 ] || aborterror "Unable to override char-server configuration, aborting tests." + cat > conf/import/map-server.conf << EOF +map_configuration: { + @include "conf/travis_sql_connection.conf" +} EOF - [ $? -eq 0 ] || aborterror "Unable to import configuration, aborting tests." - cat >> conf/import/inter_conf.txt << EOF -sql.db_username: $DBUSER -sql.db_password: $DBPASS -sql.db_database: $DBNAME -sql.db_hostname: localhost -char_server_id: $DBUSER -char_server_pw: $DBPASS -char_server_db: $DBNAME -char_server_ip: localhost -map_server_id: $DBUSER -map_server_pw: $DBPASS -map_server_db: $DBNAME -map_server_ip: localhost -log_db_id: $DBUSER -log_db_pw: $DBPASS -log_db_db: $DBNAME -log_db_ip: localhost + [ $? -eq 0 ] || aborterror "Unable to override map-server configuration, aborting tests." + cat > conf/import/inter-server.conf << EOF +inter_configuration: { + log: { + @include "conf/travis_sql_connection.conf" + } +} EOF - [ $? -eq 0 ] || aborterror "Unable to import configuration, aborting tests." + [ $? -eq 0 ] || aborterror "Unable to override inter-server configuration, aborting tests." ARGS="--load-script npc/dev/test.txt " ARGS="--load-plugin script_mapquit $ARGS --load-script npc/dev/ci_test.txt" PLUGINS="--load-plugin HPMHooking --load-plugin sample" |