diff --git a/README.md b/README.md index 0fb976de..255682f2 100644 --- a/README.md +++ b/README.md @@ -296,7 +296,7 @@ Some commands only work on the game server and not on the proxy server. The chat * `$maxlevel `: Sets the maximum level for players to join the current game. (This only applies when joining; if a player joins and then levels up past this level during the game, they are not kicked out, but won't be able to rejoin if they leave.) * `$minlevel `: Sets the minimum level for players to join the current game. * `$password `: Sets the game's join password. To unlock the game, run `$password` with nothing after it. - * `$raretable`: Switches between using the client's or the server's drop table. No effect on BB (the server's drop table is always used). The server's rare tables are defined in JSON files in the system/rare-tables directory. + * `$raretable`: Switches between using the client's or the server's drop table. No effect on BB (the server's drop table is always used). The server's rare tables are defined in JSON files in the system/item-tables directory. * Episode 3 commands (game server only) * `$spec`: Toggles the allow spectators flag for Episode 3 games. If any players are spectating when this flag is disabled, they will be sent back to the lobby. diff --git a/src/Lobby.cc b/src/Lobby.cc index 6d2d990f..be353cd9 100644 --- a/src/Lobby.cc +++ b/src/Lobby.cc @@ -48,12 +48,12 @@ void Lobby::create_item_creator() { shared_ptr rare_item_set; if (this->base_version == GameVersion::BB) { - rare_item_set = s->rare_item_sets.at("default-v4"); + rare_item_set = s->rare_item_sets.at("rare-table-v4"); } else if (this->base_version == GameVersion::GC || this->base_version == GameVersion::XB) { - rare_item_set = s->rare_item_sets.at("default-v3"); + rare_item_set = s->rare_item_sets.at("rare-table-v3"); } else { // TODO: Should there be a separate table for V1 eventually? - rare_item_set = s->rare_item_sets.at("default-v2"); + rare_item_set = s->rare_item_sets.at("rare-table-v2"); } this->item_creator.reset(new ItemCreator( s->common_item_set, diff --git a/src/ServerState.cc b/src/ServerState.cc index 24277371..c5712328 100644 --- a/src/ServerState.cc +++ b/src/ServerState.cc @@ -923,8 +923,12 @@ void ServerState::load_word_select_table() { void ServerState::load_item_tables() { config_log.info("Loading rare item sets"); - for (const auto& filename : list_directory_sorted("system/rare-tables")) { - string path = "system/rare-tables/" + filename; + for (const auto& filename : list_directory_sorted("system/item-tables")) { + if (!starts_with(filename, "rare-table-")) { + continue; + } + + string path = "system/item-tables/" + filename; size_t ext_offset = filename.rfind('.'); string basename = (ext_offset == string::npos) ? filename : filename.substr(0, ext_offset); @@ -954,9 +958,10 @@ void ServerState::load_item_tables() { } } - if (!this->rare_item_sets.count("default-v4")) { - config_log.info("default-v4 rare item set is not available; loading from BB data"); - this->rare_item_sets.emplace("default-v4", new RELRareItemSet(this->load_bb_file("ItemRT.rel"))); + if (!this->rare_item_sets.count("rare-table-v4")) { + config_log.info("rare-table-v4 rare item set is not available; loading from BB data"); + shared_ptr data(new string(load_file("system/blueburst/ItemRT.rel"))); + this->rare_item_sets.emplace("rare-table-v4", new RELRareItemSet(data)); } // Note: These files don't exist in BB, so we use the GC versions of them @@ -964,25 +969,25 @@ void ServerState::load_item_tables() { // parameters for Episode 4 implicitly. config_log.info("Loading common item table"); shared_ptr pt_data(new string(load_file( - "system/blueburst/ItemPT_GC.gsl"))); + "system/item-tables/ItemPT-gc.gsl"))); this->common_item_set.reset(new CommonItemSet(pt_data)); config_log.info("Loading armor table"); shared_ptr armor_data(new string(load_file( - "system/blueburst/ArmorRandom_GC.rel"))); + "system/item-tables/ArmorRandom-gc.rel"))); this->armor_random_set.reset(new ArmorRandomSet(armor_data)); config_log.info("Loading tool table"); shared_ptr tool_data(new string(load_file( - "system/blueburst/ToolRandom_GC.rel"))); + "system/item-tables/ToolRandom-gc.rel"))); this->tool_random_set.reset(new ToolRandomSet(tool_data)); config_log.info("Loading weapon tables"); const char* filenames[4] = { - "system/blueburst/WeaponRandomNormal_GC.rel", - "system/blueburst/WeaponRandomHard_GC.rel", - "system/blueburst/WeaponRandomVeryHard_GC.rel", - "system/blueburst/WeaponRandomUltimate_GC.rel", + "system/item-tables/WeaponRandomNormal-gc.rel", + "system/item-tables/WeaponRandomHard-gc.rel", + "system/item-tables/WeaponRandomVeryHard-gc.rel", + "system/item-tables/WeaponRandomUltimate-gc.rel", }; for (size_t z = 0; z < 4; z++) { shared_ptr weapon_data(new string(load_file(filenames[z]))); @@ -991,17 +996,17 @@ void ServerState::load_item_tables() { config_log.info("Loading tekker adjustment table"); shared_ptr tekker_data(new string(load_file( - "system/blueburst/JudgeItem_GC.rel"))); + "system/item-tables/JudgeItem-gc.rel"))); this->tekker_adjustment_set.reset(new TekkerAdjustmentSet(tekker_data)); config_log.info("Loading item definition table"); shared_ptr pmt_data(new string(prs_decompress(load_file( - "system/blueburst/ItemPMT.prs")))); + "system/item-tables/ItemPMT-bb.prs")))); this->item_parameter_table.reset(new ItemParameterTable(pmt_data)); config_log.info("Loading mag evolution table"); shared_ptr mag_data(new string(prs_decompress(load_file( - "system/blueburst/ItemMagEdit.prs")))); + "system/item-tables/ItemMagEdit-bb.prs")))); this->mag_evolution_table.reset(new MagEvolutionTable(mag_data)); } diff --git a/system/blueburst/ItemMagEdit.prs b/system/blueburst/ItemMagEdit.prs deleted file mode 100644 index fb63980a..00000000 Binary files a/system/blueburst/ItemMagEdit.prs and /dev/null differ diff --git a/system/blueburst/ItemMagEdit.prs b/system/blueburst/ItemMagEdit.prs new file mode 120000 index 00000000..2c9c9274 --- /dev/null +++ b/system/blueburst/ItemMagEdit.prs @@ -0,0 +1 @@ +../item-tables/ItemMagEdit-bb.prs \ No newline at end of file diff --git a/system/blueburst/ItemPMT.prs b/system/blueburst/ItemPMT.prs deleted file mode 100644 index 46a92384..00000000 Binary files a/system/blueburst/ItemPMT.prs and /dev/null differ diff --git a/system/blueburst/ItemPMT.prs b/system/blueburst/ItemPMT.prs new file mode 120000 index 00000000..5b431b5d --- /dev/null +++ b/system/blueburst/ItemPMT.prs @@ -0,0 +1 @@ +../item-tables/ItemPMT-bb.prs \ No newline at end of file diff --git a/system/blueburst/ItemRT.rel b/system/blueburst/ItemRT.rel deleted file mode 100644 index db986b81..00000000 Binary files a/system/blueburst/ItemRT.rel and /dev/null differ diff --git a/system/blueburst/ItemRT.rel b/system/blueburst/ItemRT.rel new file mode 120000 index 00000000..cede2ab6 --- /dev/null +++ b/system/blueburst/ItemRT.rel @@ -0,0 +1 @@ +../item-tables/ItemRT-bb.rel \ No newline at end of file diff --git a/system/blueburst/ArmorRandom_GC.rel b/system/item-tables/ArmorRandom-gc.rel similarity index 100% rename from system/blueburst/ArmorRandom_GC.rel rename to system/item-tables/ArmorRandom-gc.rel diff --git a/system/item-tables/ItemMagEdit-bb.prs b/system/item-tables/ItemMagEdit-bb.prs new file mode 100644 index 00000000..fb63980a Binary files /dev/null and b/system/item-tables/ItemMagEdit-bb.prs differ diff --git a/system/item-tables/ItemPMT-bb.prs b/system/item-tables/ItemPMT-bb.prs new file mode 100644 index 00000000..46a92384 Binary files /dev/null and b/system/item-tables/ItemPMT-bb.prs differ diff --git a/system/blueburst/ItemPT_GC.gsl b/system/item-tables/ItemPT-gc.gsl similarity index 100% rename from system/blueburst/ItemPT_GC.gsl rename to system/item-tables/ItemPT-gc.gsl diff --git a/system/item-tables/ItemRT-bb.rel b/system/item-tables/ItemRT-bb.rel new file mode 100644 index 00000000..db986b81 Binary files /dev/null and b/system/item-tables/ItemRT-bb.rel differ diff --git a/system/blueburst/JudgeItem_GC.rel b/system/item-tables/JudgeItem-gc.rel similarity index 100% rename from system/blueburst/JudgeItem_GC.rel rename to system/item-tables/JudgeItem-gc.rel diff --git a/system/blueburst/ToolRandom_GC.rel b/system/item-tables/ToolRandom-gc.rel similarity index 100% rename from system/blueburst/ToolRandom_GC.rel rename to system/item-tables/ToolRandom-gc.rel diff --git a/system/blueburst/WeaponRandomHard_GC.rel b/system/item-tables/WeaponRandomHard-gc.rel similarity index 100% rename from system/blueburst/WeaponRandomHard_GC.rel rename to system/item-tables/WeaponRandomHard-gc.rel diff --git a/system/blueburst/WeaponRandomNormal_GC.rel b/system/item-tables/WeaponRandomNormal-gc.rel similarity index 100% rename from system/blueburst/WeaponRandomNormal_GC.rel rename to system/item-tables/WeaponRandomNormal-gc.rel diff --git a/system/blueburst/WeaponRandomUltimate_GC.rel b/system/item-tables/WeaponRandomUltimate-gc.rel similarity index 100% rename from system/blueburst/WeaponRandomUltimate_GC.rel rename to system/item-tables/WeaponRandomUltimate-gc.rel diff --git a/system/blueburst/WeaponRandomVeryHard_GC.rel b/system/item-tables/WeaponRandomVeryHard-gc.rel similarity index 100% rename from system/blueburst/WeaponRandomVeryHard_GC.rel rename to system/item-tables/WeaponRandomVeryHard-gc.rel diff --git a/system/rare-tables/default-v2.json b/system/item-tables/rare-table-v2.json similarity index 99% rename from system/rare-tables/default-v2.json rename to system/item-tables/rare-table-v2.json index 3de9a090..c2512baf 100644 --- a/system/rare-tables/default-v2.json +++ b/system/item-tables/rare-table-v2.json @@ -1,6 +1,6 @@ { // Rare table for PSO DC and PC. - // See default-v4.json for a description of how this file works. + // See rare-table-v4.json for a description of how this file works. // This file is only used when client rare tables are overridden. By default, // the client controls rare drops and this table is ignored. "Normal": { diff --git a/system/rare-tables/default-v3.json b/system/item-tables/rare-table-v3.json similarity index 99% rename from system/rare-tables/default-v3.json rename to system/item-tables/rare-table-v3.json index 3677c3a4..f6cca8e6 100644 --- a/system/rare-tables/default-v3.json +++ b/system/item-tables/rare-table-v3.json @@ -1,6 +1,6 @@ { // Rare table for PSO GC and XB. - // See default-v4.json for a description of how this file works. + // See rare-table-v4.json for a description of how this file works. // This file is only used when client rare tables are overridden. By default, // the client controls rare drops and this table is ignored. "Normal": { diff --git a/system/rare-tables/default-v4.json b/system/item-tables/rare-table-v4.json similarity index 100% rename from system/rare-tables/default-v4.json rename to system/item-tables/rare-table-v4.json