Skip to content

Commit

Permalink
fix: circular inclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Sep 29, 2024
1 parent 04fa248 commit 7ff9ca0
Show file tree
Hide file tree
Showing 192 changed files with 451 additions and 661 deletions.
3 changes: 2 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"displayName": "Windows - Release",
"description": "Windows Release Build",
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows-static"
"VCPKG_TARGET_TRIPLET": "x64-windows-static",
"SPEED_UP_BUILD_UNITY": "OFF"
},
"architecture": {
"value": "x64",
Expand Down
2 changes: 0 additions & 2 deletions src/account/account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "account/account.hpp"

#include "account/account_repository_db.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/account/account_repository.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "account/account_repository.hpp"

#include "lib/di/container.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/account/account_repository_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "account/account_repository_db.hpp"

#include "database/database.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/canary_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "canary_server.hpp"

#include "declarations.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/config/configmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "config/configmanager.hpp"
#include "lib/di/container.hpp"
#include "game/game.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/appearance/mounts/mounts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/appearance/mounts/mounts.hpp"
#include "game/game.hpp"
#include "utils/pugicast.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/appearance/outfit/outfit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/appearance/outfit/outfit.hpp"
#include "utils/pugicast.hpp"
#include "utils/tools.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/combat/combat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "declarations.hpp"
#include "creatures/combat/combat.hpp"
#include "lua/creature/events.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/combat/condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/combat/condition.hpp"
#include "game/game.hpp"
#include "game/scheduling/dispatcher.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/combat/spells.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/combat/combat.hpp"
#include "creatures/combat/spells.hpp"
#include "creatures/monsters/monster.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/creature.hpp"
#include "declarations.hpp"
#include "game/scheduling/dispatcher.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/interactions/chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/interactions/chat.hpp"
#include "game/game.hpp"
#include "utils/pugicast.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/monsters/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/monsters/monster.hpp"
#include "creatures/combat/spells.hpp"
#include "creatures/players/wheel/player_wheel.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/monsters/monsters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/monsters/monsters.hpp"

#include "creatures/combat/spells.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/monsters/spawns/spawn_monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/monsters/spawns/spawn_monster.hpp"
#include "game/game.hpp"
#include "creatures/monsters/monster.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/npcs/npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/npcs/npc.hpp"
#include "creatures/npcs/npcs.hpp"
#include "declarations.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/npcs/npcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "declarations.hpp"
#include "creatures/combat/combat.hpp"
#include "lua/scripts/lua_environment.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/npcs/spawns/spawn_npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/npcs/spawns/spawn_npc.hpp"
#include "creatures/npcs/npc.hpp"
#include "game/game.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/players/achievement/player_achievement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "player_achievement.hpp"

#include "creatures/players/player.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/players/cyclopedia/player_badge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "player_badge.hpp"

#include "creatures/players/player.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/players/cyclopedia/player_cyclopedia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "player_cyclopedia.hpp"

#include "database/databasetasks.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/players/cyclopedia/player_title.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "player_title.hpp"

#include "creatures/players/player.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/players/grouping/familiars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/players/grouping/familiars.hpp"
#include "lib/di/container.hpp"
#include "config/configmanager.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/players/grouping/groups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "config/configmanager.hpp"
#include "game/game.hpp"
#include "creatures/players/grouping/groups.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/players/grouping/guild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/players/grouping/guild.hpp"
#include "game/game.hpp"

Expand Down
2 changes: 0 additions & 2 deletions src/creatures/players/grouping/party.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

#include <utility>

#include "pch.hpp"

#include "creatures/players/grouping/party.hpp"
#include "game/game.hpp"
#include "lua/creature/events.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/creatures/players/imbuements/imbuements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"
#include "creatures/players/imbuements/imbuements.hpp"
#include "lua/creature/events.hpp"
#include "utils/pugicast.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/players/management/ban.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/players/management/ban.hpp"
#include "database/database.hpp"
#include "database/databasetasks.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/players/management/waitlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/players/management/waitlist.hpp"
#include "game/game.hpp"

Expand Down
2 changes: 0 additions & 2 deletions src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/combat/combat.hpp"
#include "creatures/interactions/chat.hpp"
#include "creatures/monsters/monster.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/players/storages/storages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/players/storages/storages.hpp"

#include "config/configmanager.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/players/vip/player_vip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/players/vip/player_vip.hpp"

#include "io/iologindata.hpp"
Expand Down
2 changes: 0 additions & 2 deletions src/creatures/players/vocations/vocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* Website: https://docs.opentibiabr.com/
*/

#include "pch.hpp"

#include "creatures/players/vocations/vocation.hpp"

#include "utils/pugicast.hpp"
Expand Down
52 changes: 47 additions & 5 deletions src/creatures/players/wheel/player_wheel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@
* Website: https://docs.opentibiabr.org/
*/

#include "pch.hpp"

#include "creatures/players/wheel/player_wheel.hpp"

#include "config/configmanager.hpp"
#include "io/io_wheel.hpp"

#include "game/game.hpp"
#include "server/network/message/networkmessage.hpp"
#include "creatures/players/player.hpp"
#include "creatures/combat/spells.hpp"

#include "config/configmanager.hpp"
#include "kv/kv.hpp"
#include "creatures/players/wheel/wheel_gems.hpp"

const static std::vector<WheelGemBasicModifier_t> wheelGemBasicSlot1Allowed = {
WheelGemBasicModifier_t::General_FireResistance,
Expand Down Expand Up @@ -3151,3 +3150,46 @@ WheelGemBasicModifier_t PlayerWheel::selectBasicModifier2(WheelGemBasicModifier_
}
return modifier;
}

void PlayerWheelGem::save(const std::shared_ptr<KV> &kv) const {
kv->scoped("revealed")->set(uuid, serialize());
}
void PlayerWheelGem::remove(const std::shared_ptr<KV> &kv) const {
kv->scoped("revealed")->remove(uuid);
}

PlayerWheelGem PlayerWheelGem::load(const std::shared_ptr<KV> &kv, const std::string &uuid) {
auto val = kv->scoped("revealed")->get(uuid);
if (!val || !val.has_value()) {
return {};
}
return deserialize(uuid, val.value());
}

ValueWrapper PlayerWheelGem::serialize() const {
return {
{ "uuid", uuid },
{ "locked", locked },
{ "affinity", static_cast<IntType>(affinity) },
{ "quality", static_cast<IntType>(quality) },
{ "basicModifier1", static_cast<IntType>(basicModifier1) },
{ "basicModifier2", static_cast<IntType>(basicModifier2) },
{ "supremeModifier", static_cast<IntType>(supremeModifier) }
};
}

PlayerWheelGem PlayerWheelGem::deserialize(const std::string &uuid, const ValueWrapper &val) {
auto map = val.get<MapType>();
if (map.empty()) {
return {};
}
return {
uuid,
map["locked"]->get<BooleanType>(),
static_cast<WheelGemAffinity_t>(map["affinity"]->get<IntType>()),
static_cast<WheelGemQuality_t>(map["quality"]->get<IntType>()),
static_cast<WheelGemBasicModifier_t>(map["basicModifier1"]->get<IntType>()),
static_cast<WheelGemBasicModifier_t>(map["basicModifier2"]->get<IntType>()),
static_cast<WheelGemSupremeModifier_t>(map["supremeModifier"]->get<IntType>())
};
}
Loading

0 comments on commit 7ff9ca0

Please sign in to comment.