From 451eb0806a81a46c5501859eedd3cffbdfbb2b9e Mon Sep 17 00:00:00 2001 From: brainiac Date: Wed, 17 Dec 2025 09:32:44 -0800 Subject: [PATCH] normalize includes: common --- common/CMakeLists.txt | 1 + common/additive_lagged_fibonacci_engine.h | 4 +- common/base_packet.cpp | 8 +- common/base_packet.h | 16 ++-- common/bazaar.cpp | 5 +- common/bazaar.h | 11 +-- common/bodytypes.cpp | 5 +- common/bodytypes.h | 9 +- common/classes.cpp | 12 ++- common/classes.h | 13 ++- common/cli/eqemu_command_handler.cpp | 10 +- common/compression.cpp | 11 ++- common/compression.h | 2 + common/condition.h | 11 +-- common/content/world_content_service.cpp | 14 +-- common/content/world_content_service.h | 13 ++- common/crash.cpp | 25 ++--- common/crash.h | 5 +- common/crc16.cpp | 5 +- common/crc16.h | 8 +- common/crc32.cpp | 3 +- common/crc32.h | 7 +- common/cron/croncpp.h | 8 +- common/data_bucket.cpp | 11 ++- common/data_bucket.h | 14 ++- common/database.cpp | 91 +++++++++---------- common/database.h | 22 ++--- common/database/database_dump_service.cpp | 23 +++-- common/database/database_dump_service.h | 7 +- common/database/database_update.cpp | 23 +++-- common/database/database_update.h | 8 +- common/database/database_update_manifest.h | 4 + .../database/database_update_manifest_bots.h | 4 + .../database_update_manifest_custom.h | 4 + common/database_instances.cpp | 37 ++++---- common/database_schema.h | 5 +- common/dbcore.cpp | 24 ++--- common/dbcore.h | 18 +--- common/deity.h | 8 +- common/discord/discord.cpp | 16 ++-- common/discord/discord.h | 15 ++- common/discord/discord_manager.cpp | 5 +- common/discord/discord_manager.h | 19 ++-- common/dynamic_zone_base.cpp | 19 ++-- common/dynamic_zone_base.h | 16 ++-- common/dynamic_zone_lockout.cpp | 9 +- common/dynamic_zone_lockout.h | 3 +- common/emu_constants.cpp | 12 +-- common/emu_constants.h | 13 +-- common/emu_limits.h | 9 +- common/emu_opcodes.cpp | 10 +- common/emu_opcodes.h | 7 +- common/emu_versions.cpp | 4 +- common/emu_versions.h | 10 +- common/eq_constants.h | 9 +- common/eq_limits.cpp | 6 +- common/eq_limits.h | 23 ++--- common/eq_packet.cpp | 22 ++--- common/eq_packet.h | 13 +-- common/eq_packet_structs.h | 28 +++--- common/eq_stream.cpp | 40 ++++---- common/eq_stream.h | 27 +++--- common/eq_stream_factory.cpp | 23 +++-- common/eq_stream_factory.h | 14 +-- common/eq_stream_ident.cpp | 14 +-- common/eq_stream_ident.h | 14 ++- common/eq_stream_intf.h | 15 ++- common/eq_stream_locator.h | 14 +-- common/eq_stream_proxy.cpp | 9 +- common/eq_stream_proxy.h | 10 +- common/eq_stream_type.h | 5 +- common/eqdb.cpp | 9 +- common/eqdb.h | 15 ++- common/eqdb_res.cpp | 7 +- common/eqdb_res.h | 13 ++- common/eqemu_config.cpp | 13 +-- common/eqemu_config.h | 16 ++-- common/eqemu_exception.h | 5 +- common/eqemu_logsys.cpp | 38 ++++---- common/eqemu_logsys.h | 20 ++-- common/eqemu_logsys_log_aliases.h | 8 +- common/eqtime.cpp | 13 ++- common/eqtime.h | 8 +- common/event/event_loop.h | 5 +- common/event/task.h | 8 +- common/event/task_scheduler.h | 9 +- common/event/timer.h | 4 +- common/event_sub.h | 2 +- .../events/player_event_discord_formatter.cpp | 15 +-- .../events/player_event_discord_formatter.h | 16 ++-- common/events/player_event_logs.cpp | 20 ++-- common/events/player_event_logs.h | 46 +++++----- common/events/player_events.h | 15 ++- common/evolving_items.cpp | 7 +- common/evolving_items.h | 11 +-- common/extprofile.cpp | 4 +- common/extprofile.h | 14 ++- common/faction.cpp | 6 +- common/faction.h | 10 +- common/features.h | 9 +- common/file.cpp | 17 ++-- common/file.h | 5 +- common/fixed_memory_hash_set.h | 11 +-- common/fixed_memory_variable_hash_set.h | 10 +- common/global_define.h | 6 +- common/guild_base.cpp | 22 ++--- common/guild_base.h | 15 ++- common/guilds.cpp | 8 +- common/guilds.h | 7 +- common/inventory_profile.cpp | 18 +--- common/inventory_profile.h | 12 +-- common/inventory_slot.cpp | 5 +- common/inventory_slot.h | 7 +- common/ip_util.cpp | 19 ++-- common/ip_util.h | 10 +- common/ipc_mutex.cpp | 13 ++- common/ipc_mutex.h | 5 +- common/item_data.cpp | 6 +- common/item_data.h | 9 +- common/item_instance.cpp | 17 +--- common/item_instance.h | 25 +++-- common/json_config.cpp | 1 + common/json_config.h | 2 + common/light_source.cpp | 1 - common/light_source.h | 8 +- common/linked_list.h | 9 +- common/loot.h | 8 +- common/md5.cpp | 9 +- common/md5.h | 9 +- common/memory/ksm.hpp | 9 +- common/memory_buffer.h | 11 +-- common/memory_mapped_file.cpp | 7 +- common/memory_mapped_file.h | 8 +- common/misc.cpp | 28 +++--- common/misc.h | 8 +- common/misc_functions.cpp | 58 ++++++------ common/misc_functions.h | 10 +- common/mutex.cpp | 7 +- common/mutex.h | 19 ++-- common/mysql_request_result.h | 23 +---- common/mysql_request_row.h | 16 +--- common/mysql_stmt.cpp | 8 +- common/mysql_stmt.h | 2 +- common/net/console_server.cpp | 7 +- common/net/console_server.h | 1 + common/net/console_server_connection.cpp | 17 ++-- common/net/console_server_connection.h | 3 +- common/net/crc32.cpp | 1 - common/net/crc32.h | 4 +- common/net/dns.h | 5 +- common/net/endian.h | 2 +- common/net/eqstream.cpp | 3 +- common/net/eqstream.h | 11 ++- common/net/packet.cpp | 7 +- common/net/packet.h | 12 ++- common/net/reliable_stream_connection.cpp | 13 +-- common/net/reliable_stream_connection.h | 18 ++-- common/net/reliable_stream_pooling.h | 13 +-- common/net/reliable_stream_structs.h | 5 +- common/net/servertalk_client_connection.cpp | 5 +- common/net/servertalk_client_connection.h | 8 +- common/net/servertalk_common.h | 2 +- .../servertalk_legacy_client_connection.cpp | 5 +- .../net/servertalk_legacy_client_connection.h | 8 +- common/net/servertalk_server.h | 7 +- common/net/servertalk_server_connection.cpp | 7 +- common/net/servertalk_server_connection.h | 7 +- common/net/tcp_connection.cpp | 4 +- common/net/tcp_connection.h | 7 +- common/net/tcp_connection_pooling.h | 13 +-- common/net/tcp_server.cpp | 3 +- common/net/tcp_server.h | 4 +- common/net/websocket_server.cpp | 13 +-- common/net/websocket_server.h | 8 +- common/net/websocket_server_connection.cpp | 11 ++- common/net/websocket_server_connection.h | 11 ++- common/op_codes.h | 5 +- common/opcode_map.cpp | 3 +- common/opcodemgr.cpp | 5 +- common/opcodemgr.h | 12 +-- common/packet_dump.cpp | 8 +- common/packet_dump.h | 11 +-- common/packet_dump_file.cpp | 2 +- common/packet_dump_file.h | 10 +- common/packet_functions.cpp | 16 ++-- common/packet_functions.h | 9 +- common/packetfile.cpp | 14 +-- common/packetfile.h | 7 +- common/patches/patches.cpp | 14 +-- common/patches/patches.h | 5 +- common/patches/rof.cpp | 31 +++---- common/patches/rof.h | 9 +- common/patches/rof2.cpp | 39 ++++---- common/patches/rof2.h | 7 +- common/patches/rof2_limits.cpp | 2 +- common/patches/rof2_limits.h | 13 +-- common/patches/rof2_structs.h | 23 +++-- common/patches/rof_limits.cpp | 2 +- common/patches/rof_limits.h | 13 +-- common/patches/rof_structs.h | 18 ++-- common/patches/sod.cpp | 31 +++---- common/patches/sod.h | 9 +- common/patches/sod_limits.cpp | 2 +- common/patches/sod_limits.h | 13 +-- common/patches/sod_structs.h | 19 ++-- common/patches/sof.cpp | 29 +++--- common/patches/sof.h | 9 +- common/patches/sof_limits.cpp | 2 +- common/patches/sof_limits.h | 13 +-- common/patches/sof_structs.h | 19 ++-- common/patches/template.cpp | 38 ++------ common/patches/template.h | 10 +- common/patches/template_limits.h | 5 +- common/patches/template_structs.h | 25 +---- common/patches/titanium.cpp | 33 ++++--- common/patches/titanium.h | 9 +- common/patches/titanium_limits.cpp | 2 +- common/patches/titanium_limits.h | 13 +-- common/patches/titanium_structs.h | 20 ++-- common/patches/uf.cpp | 40 ++++---- common/patches/uf.h | 7 +- common/patches/uf_limits.cpp | 2 +- common/patches/uf_limits.h | 13 +-- common/patches/uf_structs.h | 19 ++-- common/path_manager.cpp | 9 +- common/path_manager.h | 6 +- common/pch/app-pch.h | 14 +-- common/pch/std-pch.h | 22 ++--- common/perl_eqdb.cpp | 6 +- common/perl_eqdb_res.cpp | 6 +- common/platform.h | 7 +- common/proc_launcher.cpp | 32 +++---- common/proc_launcher.h | 11 +-- common/process.cpp | 7 +- common/process.h | 6 +- common/process/process.cpp | 6 +- common/process/process.h | 8 +- common/profanity_manager.cpp | 11 ++- common/profanity_manager.h | 10 +- common/profiler.h | 10 +- common/ptimer.cpp | 20 ++-- common/ptimer.h | 9 +- common/queue.h | 6 +- common/races.cpp | 5 +- common/races.h | 10 +- common/raid.h | 6 +- common/random.h | 8 +- common/rdtsc.cpp | 11 ++- common/rdtsc.h | 9 +- common/rulesys.cpp | 16 ++-- common/rulesys.h | 18 ++-- common/say_link.cpp | 11 ++- common/say_link.h | 11 +-- common/seperator.h | 9 +- common/serialize_buffer.h | 8 +- common/server_event_scheduler.cpp | 8 +- common/server_event_scheduler.h | 8 +- common/server_reload_types.h | 9 +- common/serverinfo.cpp | 3 +- common/serverinfo.h | 2 +- common/servertalk.h | 31 +++---- common/shared_tasks.cpp | 4 +- common/shared_tasks.h | 25 +++-- common/shareddb.cpp | 67 ++++++-------- common/shareddb.h | 23 ++--- common/skill_caps.cpp | 3 +- common/skill_caps.h | 14 +-- common/skills.cpp | 3 +- common/skills.h | 9 +- common/spdat.cpp | 24 +++-- common/spdat.h | 12 +-- common/spdat_bot.cpp | 3 +- common/strings.cpp | 24 ++--- common/strings.h | 19 ++-- common/strings_legacy.cpp | 25 ++--- common/strings_misc.cpp | 23 ++--- common/struct_strategy.cpp | 35 +------ common/struct_strategy.h | 42 ++------- common/tasks.h | 12 +-- common/textures.h | 8 +- common/timeoutmgr.cpp | 7 +- common/timeoutmgr.h | 16 ++-- common/timer.cpp | 4 +- common/timer.h | 11 +-- common/types.h | 8 +- common/unix.cpp | 3 +- common/unix.h | 3 +- common/useperl.h | 7 +- common/util/directory.cpp | 2 +- common/util/memory_stream.h | 2 +- common/util/uuid.cpp | 4 +- common/util/uuid.h | 2 +- common/version.h | 6 +- common/zone_store.cpp | 10 +- common/zone_store.h | 11 +-- 295 files changed, 1592 insertions(+), 2009 deletions(-) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 23fbcff69..f250adbb1 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -765,6 +765,7 @@ add_library(common ${common_sources} ${common_headers} ${repositories}) target_compile_definitions(common PUBLIC BOOST_BIND_GLOBAL_PLACEHOLDERS GLM_FORCE_RADIANS GLM_FORCE_CTOR_INIT GLM_ENABLE_EXPERIMENTAL ENABLE_SECURITY) target_include_directories(common PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../submodules/websocketpp") +target_include_directories(common PRIVATE ..) target_link_libraries(common PUBLIC cereal::cereal fmt::fmt unofficial::libmariadb $,libuv::uv_a,libuv::uv> OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB unofficial-sodium::sodium) # Requires libgoogle-perftools-dev google-perftools packages for linux (debian) diff --git a/common/additive_lagged_fibonacci_engine.h b/common/additive_lagged_fibonacci_engine.h index b396b4436..0cd9c6a52 100644 --- a/common/additive_lagged_fibonacci_engine.h +++ b/common/additive_lagged_fibonacci_engine.h @@ -18,11 +18,11 @@ #pragma once +#include #include +#include #include #include -#include -#include /* * This is an additive lagged fibonacci generator as seen in The Art of Computer Programming, Vol. 2 diff --git a/common/base_packet.cpp b/common/base_packet.cpp index 67f8f9034..15608c2bb 100644 --- a/common/base_packet.cpp +++ b/common/base_packet.cpp @@ -16,10 +16,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "global_define.h" -#include "base_packet.h" -#include "misc.h" -#include "packet_dump.h" +#include "common/base_packet.h" +#include "common/global_define.h" +#include "common/misc.h" +#include "common/packet_dump.h" BasePacket::BasePacket(const unsigned char *buf, uint32 len) { diff --git a/common/base_packet.h b/common/base_packet.h index 3b92e3e90..803f37b8d 100644 --- a/common/base_packet.h +++ b/common/base_packet.h @@ -15,13 +15,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef BASEPACKET_H_ -#define BASEPACKET_H_ -#include "types.h" -#include "serialize_buffer.h" -#include -#include +#pragma once + +#include "common/serialize_buffer.h" +#include "common/types.h" + +#include +#include #ifdef _WINDOWS #include @@ -93,6 +94,3 @@ protected: extern void DumpPacketHex(const BasePacket* app); extern void DumpPacketAscii(const BasePacket* app); extern void DumpPacketBin(const BasePacket* app); - -#endif /*BASEPACKET_H_*/ - diff --git a/common/bazaar.cpp b/common/bazaar.cpp index 8244d5c52..870d275a2 100644 --- a/common/bazaar.cpp +++ b/common/bazaar.cpp @@ -1,7 +1,8 @@ #include "bazaar.h" -#include "../../common/item_instance.h" -#include "repositories/trader_repository.h" +#include "common/item_instance.h" +#include "common/repositories/trader_repository.h" + #include std::vector diff --git a/common/bazaar.h b/common/bazaar.h index bec1ae264..aa7f24975 100644 --- a/common/bazaar.h +++ b/common/bazaar.h @@ -1,9 +1,9 @@ -#ifndef EQEMU_BAZAAR_H -#define EQEMU_BAZAAR_H +#pragma once + +#include "common/item_instance.h" +#include "common/shareddb.h" #include -#include "shareddb.h" -#include "../../common/item_instance.h" class Bazaar { public: @@ -11,6 +11,3 @@ public: GetSearchResults(Database &content_db, Database &db, BazaarSearchCriteria_Struct search, unsigned int char_zone_id, int char_zone_instance_id); }; - - -#endif //EQEMU_BAZAAR_H diff --git a/common/bodytypes.cpp b/common/bodytypes.cpp index d8f2441bb..9de4130f4 100644 --- a/common/bodytypes.cpp +++ b/common/bodytypes.cpp @@ -1,5 +1,6 @@ -#include "../common/global_define.h" -#include "../common/bodytypes.h" +#include "bodytypes.h" + +#include "common/global_define.h" std::string BodyType::GetName(uint8 body_type_id) { diff --git a/common/bodytypes.h b/common/bodytypes.h index e88773461..658cc063e 100644 --- a/common/bodytypes.h +++ b/common/bodytypes.h @@ -15,10 +15,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef BODYTYPES_H -#define BODYTYPES_H -#include "types.h" +#pragma once + +#include "common/types.h" + #include #include @@ -109,5 +110,3 @@ static std::map body_type_names = { { BodyType::InvisibleMan, "Invisible Man" }, { BodyType::Special, "Special" }, }; - -#endif diff --git a/common/classes.cpp b/common/classes.cpp index df1350004..704c3c97f 100644 --- a/common/classes.cpp +++ b/common/classes.cpp @@ -15,11 +15,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include "../common/global_define.h" -#include "../common/classes.h" -#include "data_verification.h" + +#include "classes.h" + +#include "common/data_verification.h" +#include "common/global_define.h" + +#include "fmt/format.h" const char *GetClassIDName(uint8 class_id, uint8 level) { diff --git a/common/classes.h b/common/classes.h index dc586ceeb..fefae4940 100644 --- a/common/classes.h +++ b/common/classes.h @@ -15,13 +15,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef CLASSES_CH -#define CLASSES_CH -#include "../common/types.h" -#include "../common/rulesys.h" -#include +#pragma once + +#include "common/rulesys.h" +#include "common/types.h" + #include +#include namespace Class { constexpr uint8 None = 0; @@ -156,5 +157,3 @@ bool IsChainClass(uint8 class_id); bool IsLeatherClass(uint8 class_id); bool IsClothClass(uint8 class_id); uint8 ClassArmorType(uint8 class_id); - -#endif diff --git a/common/cli/eqemu_command_handler.cpp b/common/cli/eqemu_command_handler.cpp index bf796b42b..75626670a 100644 --- a/common/cli/eqemu_command_handler.cpp +++ b/common/cli/eqemu_command_handler.cpp @@ -18,11 +18,11 @@ * */ -#include -#include -#include "eqemu_command_handler.h" -#include "terminal_color.hpp" -#include "../platform.h" +#include "common/cli/eqemu_command_handler.h" +#include "common/cli/terminal_color.hpp" +#include "common/platform.h" + +#include "fmt/format.h" namespace EQEmuCommand { diff --git a/common/compression.cpp b/common/compression.cpp index 07fe13d65..2f8233b28 100644 --- a/common/compression.cpp +++ b/common/compression.cpp @@ -1,7 +1,10 @@ -#include "global_define.h" -#include "types.h" -#include -#include +#include "compression.h" + +#include "common/global_define.h" +#include "common/types.h" + +#include "zlib.h" +#include namespace EQ { diff --git a/common/compression.h b/common/compression.h index 20a4103be..0ef2b0e5f 100644 --- a/common/compression.h +++ b/common/compression.h @@ -1,5 +1,7 @@ #pragma once +#include "common/types.h" + namespace EQ { uint32 EstimateDeflateBuffer(uint32 len); diff --git a/common/condition.h b/common/condition.h index 9c4cd9f7b..7402589e7 100644 --- a/common/condition.h +++ b/common/condition.h @@ -15,11 +15,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __CONDITION_H -#define __CONDITION_H -#include "global_define.h" -#include "mutex.h" +#pragma once + +#include "common/global_define.h" +#include "common/mutex.h" #ifndef WIN32 #include #endif @@ -52,6 +52,3 @@ class Condition { // bool TimedWait(unsigned long usec); ~Condition(); }; - -#endif - diff --git a/common/content/world_content_service.cpp b/common/content/world_content_service.cpp index d6511e710..994906dfc 100644 --- a/common/content/world_content_service.cpp +++ b/common/content/world_content_service.cpp @@ -1,13 +1,13 @@ #include "world_content_service.h" -#include -#include -#include "../database.h" -#include "../rulesys.h" -#include "../eqemu_logsys.h" -#include "../repositories/instance_list_repository.h" -#include "../zone_store.h" +#include "common/database.h" +#include "common/eqemu_logsys.h" +#include "common/repositories/instance_list_repository.h" +#include "common/rulesys.h" +#include "common/zone_store.h" +#include "glm/vec3.hpp" +#include WorldContentService::WorldContentService() { diff --git a/common/content/world_content_service.h b/common/content/world_content_service.h index 0f84682d7..5532d3f3b 100644 --- a/common/content/world_content_service.h +++ b/common/content/world_content_service.h @@ -1,11 +1,12 @@ -#ifndef EQEMU_WORLD_CONTENT_SERVICE_H -#define EQEMU_WORLD_CONTENT_SERVICE_H + +#pragma once + +#include "common/repositories/content_flags_repository.h" +#include "common/repositories/instance_list_repository.h" +#include "common/repositories/zone_repository.h" #include #include -#include "../repositories/content_flags_repository.h" -#include "../repositories/zone_repository.h" -#include "../repositories/instance_list_repository.h" class Database; @@ -199,5 +200,3 @@ private: WorldContentService *LoadStaticGlobalZoneInstances(); std::vector m_zone_static_instances; }; - -#endif //EQEMU_WORLD_CONTENT_SERVICE_H diff --git a/common/crash.cpp b/common/crash.cpp index b7dcac7a4..93eb739ea 100644 --- a/common/crash.cpp +++ b/common/crash.cpp @@ -1,16 +1,17 @@ -#include "global_define.h" -#include "eqemu_logsys.h" #include "crash.h" -#include "strings.h" -#include "process/process.h" -#include "http/httplib.h" -#include "http/uri.h" -#include "json/json.h" -#include "version.h" -#include "eqemu_config.h" -#include "serverinfo.h" -#include "rulesys.h" -#include "platform.h" + +#include "common/eqemu_config.h" +#include "common/eqemu_logsys.h" +#include "common/global_define.h" +#include "common/http/httplib.h" +#include "common/http/uri.h" +#include "common/json/json.h" +#include "common/platform.h" +#include "common/process/process.h" +#include "common/rulesys.h" +#include "common/serverinfo.h" +#include "common/strings.h" +#include "common/version.h" #include #include diff --git a/common/crash.h b/common/crash.h index ca53d620e..7da1b7a4a 100644 --- a/common/crash.h +++ b/common/crash.h @@ -1,6 +1,3 @@ -#ifndef __EQEMU_CRASH_H -#define __EQEMU_CRASH_H +#pragma once void set_exception_handler(); - -#endif diff --git a/common/crc16.cpp b/common/crc16.cpp index 9e79dc470..38c8ac7ea 100644 --- a/common/crc16.cpp +++ b/common/crc16.cpp @@ -1,4 +1,6 @@ -#include "crc32.h" +#include "crc16.h" + +#include "common/crc32.h" uint16 CRC16(const unsigned char *buf, int size, int key) { @@ -12,4 +14,3 @@ uint16 CRC16(const unsigned char *buf, int size, int key) crc = CRC32::Update(buf, size, crc); return CRC32::Finish(crc) & 0xffff; } - diff --git a/common/crc16.h b/common/crc16.h index 04de64e1e..f9059b492 100644 --- a/common/crc16.h +++ b/common/crc16.h @@ -1,7 +1,5 @@ -#ifndef _CRC16_H -#define _CRC16_H -#include "types.h" +#pragma once + +#include "common/types.h" uint16 CRC16(const unsigned char *buf, int size, int key); - -#endif diff --git a/common/crc32.cpp b/common/crc32.cpp index 0e9746a08..4d7bf89ed 100644 --- a/common/crc32.cpp +++ b/common/crc32.cpp @@ -1,5 +1,6 @@ #include "crc32.h" -#include + +#include #include uint32 CRC32Table[256] = diff --git a/common/crc32.h b/common/crc32.h index 3a391a564..023d63359 100644 --- a/common/crc32.h +++ b/common/crc32.h @@ -1,6 +1,6 @@ -#ifndef CRC32_H -#define CRC32_H -#include "types.h" +#pragma once + +#include "common/types.h" class CRC32 { public: @@ -17,4 +17,3 @@ public: private: static inline void Calc(const uint8 byte, uint32& crc32); }; -#endif diff --git a/common/cron/croncpp.h b/common/cron/croncpp.h index 3034dc952..40c37863f 100644 --- a/common/cron/croncpp.h +++ b/common/cron/croncpp.h @@ -1,13 +1,13 @@ #pragma once -#include -#include -#include +#include #include #include #include #include -#include +#include +#include +#include #if __cplusplus > 201402L #include diff --git a/common/data_bucket.cpp b/common/data_bucket.cpp index 0378c379f..e13832036 100644 --- a/common/data_bucket.cpp +++ b/common/data_bucket.cpp @@ -1,8 +1,11 @@ -#include "../common/data_bucket.h" -#include "database.h" -#include +#include "data_bucket.h" + +#include "common/data_bucket.h" +#include "common/database.h" +#include "common/json/json.hpp" + #include -#include "../common/json/json.hpp" +#include using json = nlohmann::json; diff --git a/common/data_bucket.h b/common/data_bucket.h index c93d98b2c..7625a545f 100644 --- a/common/data_bucket.h +++ b/common/data_bucket.h @@ -1,11 +1,11 @@ -#ifndef EQEMU_DATABUCKET_H -#define EQEMU_DATABUCKET_H +#pragma once + +#include "common/json/json_archive_single_line.h" +#include "common/repositories/data_buckets_repository.h" +#include "common/shareddb.h" +#include "common/types.h" #include -#include "types.h" -#include "repositories/data_buckets_repository.h" -#include "json/json_archive_single_line.h" -#include "shareddb.h" struct DataBucketKey { std::string key; @@ -69,5 +69,3 @@ public: static DataBucketsRepository::DataBuckets ExtractNestedValue(const DataBucketsRepository::DataBuckets &bucket, const std::string &full_key); }; - -#endif //EQEMU_DATABUCKET_H diff --git a/common/database.cpp b/common/database.cpp index 3052fd722..e0532037d 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -16,42 +16,56 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/global_define.h" -#include "../common/rulesys.h" +#include "common/data_verification.h" +#include "common/database_schema.h" +#include "common/database.h" +#include "common/eq_packet_structs.h" +#include "common/events/player_event_logs.h" +#include "common/extprofile.h" +#include "common/global_define.h" +#include "common/http/httplib.h" +#include "common/http/uri.h" +#include "common/repositories/account_repository.h" +#include "common/repositories/adventure_stats_repository.h" +#include "common/repositories/bot_data_repository.h" +#include "common/repositories/buyer_repository.h" +#include "common/repositories/character_bind_repository.h" +#include "common/repositories/character_data_repository.h" +#include "common/repositories/character_languages_repository.h" +#include "common/repositories/character_leadership_abilities_repository.h" +#include "common/repositories/character_parcels_repository.h" +#include "common/repositories/character_pet_name_repository.h" +#include "common/repositories/character_skills_repository.h" +#include "common/repositories/data_buckets_repository.h" +#include "common/repositories/group_id_repository.h" +#include "common/repositories/group_leaders_repository.h" +#include "common/repositories/guild_members_repository.h" +#include "common/repositories/instance_list_repository.h" +#include "common/repositories/inventory_snapshots_repository.h" +#include "common/repositories/ip_exemptions_repository.h" +#include "common/repositories/merchantlist_temp_repository.h" +#include "common/repositories/name_filter_repository.h" +#include "common/repositories/npc_types_repository.h" +#include "common/repositories/raid_details_repository.h" +#include "common/repositories/raid_members_repository.h" +#include "common/repositories/reports_repository.h" +#include "common/repositories/trader_repository.h" +#include "common/repositories/variables_repository.h" +#include "common/repositories/zone_repository.h" +#include "common/rulesys.h" +#include "common/strings.h" +#include "common/zone_store.h" + +#include "mysqld_error.h" #include +#include +#include +#include #include #include #include #include -#include -#include -#include -#include - -#include "../common/repositories/account_repository.h" -#include "../common/repositories/adventure_stats_repository.h" -#include "../common/repositories/character_bind_repository.h" -#include "../common/repositories/character_data_repository.h" -#include "../common/repositories/character_languages_repository.h" -#include "../common/repositories/character_leadership_abilities_repository.h" -#include "../common/repositories/character_parcels_repository.h" -#include "../common/repositories/character_skills_repository.h" -#include "../common/repositories/data_buckets_repository.h" -#include "../common/repositories/group_id_repository.h" -#include "../common/repositories/group_leaders_repository.h" -#include "../common/repositories/guild_members_repository.h" -#include "../common/repositories/instance_list_repository.h" -#include "../common/repositories/inventory_snapshots_repository.h" -#include "../common/repositories/ip_exemptions_repository.h" -#include "../common/repositories/name_filter_repository.h" -#include "../common/repositories/npc_types_repository.h" -#include "../common/repositories/raid_details_repository.h" -#include "../common/repositories/raid_members_repository.h" -#include "../common/repositories/reports_repository.h" -#include "../common/repositories/variables_repository.h" -#include "../common/repositories/character_pet_name_repository.h" -#include "../common/events/player_event_logs.h" // Disgrace: for windows compile #ifdef _WINDOWS @@ -63,25 +77,8 @@ #include "unix.h" #include #include - #endif -#include "database.h" -#include "data_verification.h" -#include "eq_packet_structs.h" -#include "extprofile.h" -#include "strings.h" -#include "database_schema.h" -#include "http/httplib.h" -#include "http/uri.h" - -#include "repositories/zone_repository.h" -#include "zone_store.h" -#include "repositories/merchantlist_temp_repository.h" -#include "repositories/bot_data_repository.h" -#include "repositories/trader_repository.h" -#include "repositories/buyer_repository.h" - extern Client client; Database::Database() { } diff --git a/common/database.h b/common/database.h index 9b81f66a0..8a0f333d0 100644 --- a/common/database.h +++ b/common/database.h @@ -15,25 +15,23 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef EQEMU_DATABASE_H -#define EQEMU_DATABASE_H -#define AUTHENTICATION_TIMEOUT 60 -#define INVALID_ID 0xFFFFFFFF +#pragma once -#include "global_define.h" -#include "eqemu_logsys.h" - -#include "types.h" -#include "dbcore.h" -#include "linked_list.h" -#include "eq_packet_structs.h" +#include "common/dbcore.h" +#include "common/eq_packet_structs.h" +#include "common/eqemu_logsys.h" +#include "common/global_define.h" +#include "common/linked_list.h" +#include "common/types.h" #include #include #include #include +#define AUTHENTICATION_TIMEOUT 60 +#define INVALID_ID 0xFFFFFFFF class MySQLRequestResult; class Client; @@ -292,5 +290,3 @@ private: void ClearAllRaidDetails(); void ClearAllRaidLeaders(); }; - -#endif diff --git a/common/database/database_dump_service.cpp b/common/database/database_dump_service.cpp index 6cbea2d48..dc36040ee 100644 --- a/common/database/database_dump_service.cpp +++ b/common/database/database_dump_service.cpp @@ -18,27 +18,26 @@ * */ -#include -#include -#include #include "database_dump_service.h" -#include "../eqemu_logsys.h" -#include "../strings.h" -#include "../eqemu_config.h" -#include "../database_schema.h" -#include "../file.h" -#include "../process/process.h" -#include "../termcolor/rang.hpp" +#include "common/database_schema.h" +#include "common/eqemu_config.h" +#include "common/eqemu_logsys.h" +#include "common/file.h" +#include "common/process/process.h" +#include "common/strings.h" +#include "common/termcolor/rang.hpp" + +#include #include +#include +#include #if _WIN32 #include #else - #include #include - #endif #define DATABASE_DUMP_PATH "backups/" diff --git a/common/database/database_dump_service.h b/common/database/database_dump_service.h index fde5dc218..6169011a1 100644 --- a/common/database/database_dump_service.h +++ b/common/database/database_dump_service.h @@ -18,9 +18,9 @@ * */ -#ifndef EQEMU_DATABASE_DUMP_SERVICE_H -#define EQEMU_DATABASE_DUMP_SERVICE_H +#pragma once +#include class DatabaseDumpService { public: @@ -97,6 +97,3 @@ private: void BuildCredentialsFile(); void RemoveCredentialsFile(); }; - - -#endif //EQEMU_DATABASE_DUMP_SERVICE_H diff --git a/common/database/database_update.cpp b/common/database/database_update.cpp index d1837b448..493da5918 100644 --- a/common/database/database_update.cpp +++ b/common/database/database_update.cpp @@ -1,14 +1,17 @@ -#include #include "database_update.h" -#include "../eqemu_logsys.h" -#include "../database.h" -#include "../strings.h" -#include "../rulesys.h" -#include "../http/httplib.h" -#include "database_dump_service.h" -#include "database_update_manifest.h" -#include "database_update_manifest_custom.h" -#include "database_update_manifest_bots.h" + +#include "common/database.h" +#include "common/database/database_dump_service.h" +#include "common/database/database_update_manifest_bots.h" +#include "common/database/database_update_manifest_custom.h" +#include "common/database/database_update_manifest.h" +#include "common/eqemu_logsys.h" +#include "common/http/httplib.h" +#include "common/rulesys.h" +#include "common/strings.h" + +#include + constexpr int BREAK_LENGTH = 70; diff --git a/common/database/database_update.h b/common/database/database_update.h index a445422bc..39084f4b5 100644 --- a/common/database/database_update.h +++ b/common/database/database_update.h @@ -1,7 +1,6 @@ -#ifndef EQEMU_DATABASE_UPDATE_H -#define EQEMU_DATABASE_UPDATE_H +#pragma once -#include "../database.h" +#include "common/database.h" struct ManifestEntry { int version{}; // database version of the migration @@ -47,7 +46,4 @@ private: static bool CheckVersionsUpToDate(DatabaseVersion v, DatabaseVersion b); void InjectBotsVersionColumn(); void InjectCustomVersionColumn(); - }; - -#endif //EQEMU_DATABASE_UPDATE_H diff --git a/common/database/database_update_manifest.h b/common/database/database_update_manifest.h index 6e88d0481..a32ec7db8 100644 --- a/common/database/database_update_manifest.h +++ b/common/database/database_update_manifest.h @@ -1,5 +1,9 @@ #pragma once +#include "common/database/database_update.h" + +#include + std::vector manifest_entries = { ManifestEntry{ .version = 9000, diff --git a/common/database/database_update_manifest_bots.h b/common/database/database_update_manifest_bots.h index 4f492bda7..6c58df274 100644 --- a/common/database/database_update_manifest_bots.h +++ b/common/database/database_update_manifest_bots.h @@ -1,5 +1,9 @@ #pragma once +#include "common/database/database_update.h" + +#include + std::vector bot_manifest_entries = { ManifestEntry{ .version = 9035, diff --git a/common/database/database_update_manifest_custom.h b/common/database/database_update_manifest_custom.h index 61bc10296..70d6dbb1c 100644 --- a/common/database/database_update_manifest_custom.h +++ b/common/database/database_update_manifest_custom.h @@ -1,5 +1,9 @@ #pragma once +#include "common/database/database_update.h" + +#include + std::vector manifest_entries_custom = { ManifestEntry{ .version = 1, diff --git a/common/database_instances.cpp b/common/database_instances.cpp index e32720f38..05af2aecc 100644 --- a/common/database_instances.cpp +++ b/common/database_instances.cpp @@ -16,24 +16,25 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/global_define.h" -#include "../common/rulesys.h" -#include "../common/strings.h" -#include "../common/timer.h" -#include "../common/repositories/character_corpses_repository.h" -#include "../common/repositories/dynamic_zone_members_repository.h" -#include "../common/repositories/dynamic_zones_repository.h" -#include "../common/repositories/group_id_repository.h" -#include "../common/repositories/instance_list_repository.h" -#include "../common/repositories/instance_list_player_repository.h" -#include "../common/repositories/raid_members_repository.h" -#include "../common/repositories/respawn_times_repository.h" -#include "../common/repositories/spawn_condition_values_repository.h" -#include "repositories/spawn2_disabled_repository.h" -#include "repositories/data_buckets_repository.h" -#include "repositories/zone_state_spawns_repository.h" #include "database.h" +#include "common/global_define.h" +#include "common/repositories/character_corpses_repository.h" +#include "common/repositories/data_buckets_repository.h" +#include "common/repositories/dynamic_zone_members_repository.h" +#include "common/repositories/dynamic_zones_repository.h" +#include "common/repositories/group_id_repository.h" +#include "common/repositories/instance_list_player_repository.h" +#include "common/repositories/instance_list_repository.h" +#include "common/repositories/raid_members_repository.h" +#include "common/repositories/respawn_times_repository.h" +#include "common/repositories/spawn_condition_values_repository.h" +#include "common/repositories/spawn2_disabled_repository.h" +#include "common/repositories/zone_state_spawns_repository.h" +#include "common/rulesys.h" +#include "common/strings.h" +#include "common/timer.h" + #include #include @@ -44,8 +45,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define strncasecmp _strnicmp #define strcasecmp _stricmp #else -#include "unix.h" -#include "../zone/zonedb.h" +#include "common/unix.h" +#include "zone/zonedb.h" #include #include #endif diff --git a/common/database_schema.h b/common/database_schema.h index de6f8472f..091e5a7ac 100644 --- a/common/database_schema.h +++ b/common/database_schema.h @@ -18,8 +18,7 @@ * */ -#ifndef EQEMU_DATABASE_SCHEMA_H -#define EQEMU_DATABASE_SCHEMA_H +#pragma once #include #include @@ -438,5 +437,3 @@ namespace DatabaseSchema { } } - -#endif //EQEMU_DATABASE_SCHEMA_H diff --git a/common/dbcore.cpp b/common/dbcore.cpp index bb233536c..6b8ae9dc4 100644 --- a/common/dbcore.cpp +++ b/common/dbcore.cpp @@ -1,30 +1,26 @@ -#ifdef _WINDOWS -#include -#endif - -#include "misc_functions.h" -#include "eqemu_logsys.h" -#include "timer.h" - #include "dbcore.h" -#include "mysql_stmt.h" + +#include "common/eqemu_logsys.h" +#include "common/misc_functions.h" +#include "common/mysql_stmt.h" +#include "common/strings.h" +#include "common/timer.h" + +#include "mysqld_error.h" #include #include -#include #include -#include "strings.h" #ifdef _WINDOWS #define snprintf _snprintf #define strncasecmp _strnicmp #define strcasecmp _stricmp #include +#include #else - -#include "unix.h" +#include "common/unix.h" #include - #endif #ifdef _EQDEBUG diff --git a/common/dbcore.h b/common/dbcore.h index 6d07f1bdb..978ab96bc 100644 --- a/common/dbcore.h +++ b/common/dbcore.h @@ -1,16 +1,11 @@ -#ifndef DBCORE_H -#define DBCORE_H +#pragma once -#ifdef _WINDOWS -#include -#include -#endif +#include "common/mutex.h" +#include "common/mysql_request_result.h" +#include "common/types.h" -#include "../common/mutex.h" -#include "../common/mysql_request_result.h" -#include "../common/types.h" +#include "mysql.h" -#include #include #include @@ -102,6 +97,3 @@ private: mysql_set_server_option(mysql, MYSQL_OPTION_MULTI_STATEMENTS_OFF); } }; - - -#endif diff --git a/common/deity.h b/common/deity.h index 370e009b6..6b676e2b7 100644 --- a/common/deity.h +++ b/common/deity.h @@ -17,10 +17,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_DEITY_H -#define COMMON_DEITY_H +#pragma once + +#include "common/types.h" -#include "types.h" #include #include #include @@ -113,5 +113,3 @@ static std::map deity_bitmasks = { { Deity::Tunare, Deity::Bitmask::Tunare }, { Deity::Veeshan, Deity::Bitmask::Veeshan } }; - -#endif /* COMMON_DEITY_H */ diff --git a/common/discord/discord.cpp b/common/discord/discord.cpp index ec75e0560..3f3c5e492 100644 --- a/common/discord/discord.cpp +++ b/common/discord/discord.cpp @@ -1,11 +1,13 @@ -#include -#include #include "discord.h" -#include "../http/httplib.h" -#include "../json/json.h" -#include "../strings.h" -#include "../eqemu_logsys.h" -#include "../events/player_event_logs.h" + +#include "common/eqemu_logsys.h" +#include "common/events/player_event_logs.h" +#include "common/http/httplib.h" +#include "common/json/json.h" +#include "common/strings.h" + +#include "cereal/archives/binary.hpp" +#include "cereal/archives/json.hpp" constexpr int MAX_RETRIES = 10; diff --git a/common/discord/discord.h b/common/discord/discord.h index 8b8a19290..47ab07569 100644 --- a/common/discord/discord.h +++ b/common/discord/discord.h @@ -1,19 +1,16 @@ -#ifndef EQEMU_DISCORD_H -#define EQEMU_DISCORD_H +#pragma once +#include "common/events/player_events.h" +#include "common/repositories/player_event_logs_repository.h" +#include "common/types.h" #include -#include "../types.h" -#include "../repositories/player_event_logs_repository.h" -#include "../events/player_events.h" -class Discord { +class Discord +{ public: static void SendWebhookMessage(const std::string& message, const std::string& webhook_url); static std::string FormatDiscordMessage(uint16 category_id, const std::string& message); static void SendPlayerEventMessage(const PlayerEvent::PlayerEventContainer& e, const std::string &webhook_url); static bool ValidateWebhookUrl(const std::string &webhook_url); }; - - -#endif //EQEMU_DISCORD_H diff --git a/common/discord/discord_manager.cpp b/common/discord/discord_manager.cpp index fef6debb4..5ff5810ab 100644 --- a/common/discord/discord_manager.cpp +++ b/common/discord/discord_manager.cpp @@ -1,6 +1,7 @@ #include "discord_manager.h" -#include "../../common/discord/discord.h" -#include "../events/player_event_logs.h" + +#include "common/discord/discord.h" +#include "common/events/player_event_logs.h" void DiscordManager::QueueWebhookMessage(uint32 webhook_id, const std::string &message) { diff --git a/common/discord/discord_manager.h b/common/discord/discord_manager.h index d02180859..611e3f03c 100644 --- a/common/discord/discord_manager.h +++ b/common/discord/discord_manager.h @@ -1,14 +1,16 @@ -#ifndef EQEMU_DISCORD_MANAGER_H -#define EQEMU_DISCORD_MANAGER_H -#include +#pragma once + +#include "common/events/player_events.h" +#include "common/repositories/player_event_logs_repository.h" +#include "common/types.h" + #include +#include #include -#include "../../common/types.h" -#include "../repositories/player_event_logs_repository.h" -#include "../events/player_events.h" -class DiscordManager { +class DiscordManager +{ public: void QueueWebhookMessage(uint32 webhook_id, const std::string& message); void ProcessMessageQueue(); @@ -23,6 +25,3 @@ private: std::mutex webhook_queue_lock{}; std::map> webhook_message_queue{}; }; - - -#endif diff --git a/common/dynamic_zone_base.cpp b/common/dynamic_zone_base.cpp index 4ad08c2db..0df0e2ba9 100644 --- a/common/dynamic_zone_base.cpp +++ b/common/dynamic_zone_base.cpp @@ -1,13 +1,14 @@ #include "dynamic_zone_base.h" -#include "database.h" -#include "eqemu_logsys.h" -#include "rulesys.h" -#include "servertalk.h" -#include "util/uuid.h" -#include "repositories/character_expedition_lockouts_repository.h" -#include "repositories/dynamic_zone_lockouts_repository.h" -#include "repositories/instance_list_repository.h" -#include "repositories/instance_list_player_repository.h" + +#include "common/database.h" +#include "common/eqemu_logsys.h" +#include "common/repositories/character_expedition_lockouts_repository.h" +#include "common/repositories/dynamic_zone_lockouts_repository.h" +#include "common/repositories/instance_list_player_repository.h" +#include "common/repositories/instance_list_repository.h" +#include "common/rulesys.h" +#include "common/servertalk.h" +#include "common/util/uuid.h" DynamicZoneBase::DynamicZoneBase(DynamicZonesRepository::DynamicZoneInstance&& entry) { diff --git a/common/dynamic_zone_base.h b/common/dynamic_zone_base.h index 6a43449f4..d0dfe9140 100644 --- a/common/dynamic_zone_base.h +++ b/common/dynamic_zone_base.h @@ -1,11 +1,11 @@ -#ifndef COMMON_DYNAMIC_ZONE_BASE_H -#define COMMON_DYNAMIC_ZONE_BASE_H +#pragma once + +#include "common/dynamic_zone_lockout.h" +#include "common/eq_constants.h" +#include "common/repositories/dynamic_zone_members_repository.h" +#include "common/repositories/dynamic_zone_templates_repository.h" +#include "common/repositories/dynamic_zones_repository.h" -#include "dynamic_zone_lockout.h" -#include "eq_constants.h" -#include "repositories/dynamic_zones_repository.h" -#include "repositories/dynamic_zone_members_repository.h" -#include "repositories/dynamic_zone_templates_repository.h" #include #include #include @@ -270,5 +270,3 @@ public: ); } }; - -#endif diff --git a/common/dynamic_zone_lockout.cpp b/common/dynamic_zone_lockout.cpp index a714dc101..a43e0e535 100644 --- a/common/dynamic_zone_lockout.cpp +++ b/common/dynamic_zone_lockout.cpp @@ -1,10 +1,11 @@ #include "dynamic_zone_lockout.h" -#include "strings.h" #include "rulesys.h" +#include "strings.h" #include "util/uuid.h" -#include -#include -#include + +#include "fmt/format.h" +#include "cereal/types/chrono.hpp" +#include "cereal/archives/binary.hpp" DzLockout::DzLockout(std::string uuid, std::string expedition, std::string event, uint64_t expire_time, uint32_t duration) : m_uuid(std::move(uuid)) diff --git a/common/dynamic_zone_lockout.h b/common/dynamic_zone_lockout.h index 72dc132bd..eb800067c 100644 --- a/common/dynamic_zone_lockout.h +++ b/common/dynamic_zone_lockout.h @@ -1,8 +1,9 @@ #pragma once +#include "repositories/base/base_dynamic_zone_lockouts_repository.h" + #include #include -#include "repositories/base/base_dynamic_zone_lockouts_repository.h" class DzLockout { diff --git a/common/emu_constants.cpp b/common/emu_constants.cpp index ecb1e4c58..8f783c17a 100644 --- a/common/emu_constants.cpp +++ b/common/emu_constants.cpp @@ -17,12 +17,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "emu_constants.h" -#include "bodytypes.h" -#include "data_verification.h" -#include "eqemu_logsys.h" -#include "eqemu_logsys_log_aliases.h" -#include "rulesys.h" +#include "common/bodytypes.h" +#include "common/data_verification.h" +#include "common/emu_constants.h" +#include "common/eqemu_logsys_log_aliases.h" +#include "common/eqemu_logsys.h" +#include "common/rulesys.h" int16 EQ::invtype::GetInvTypeSize(int16 inv_type) { static const int16 local_array[] = { diff --git a/common/emu_constants.h b/common/emu_constants.h index 0c762ffb8..e1f9840fe 100644 --- a/common/emu_constants.h +++ b/common/emu_constants.h @@ -17,14 +17,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_EMU_CONSTANTS_H -#define COMMON_EMU_CONSTANTS_H +#pragma once -#include "eq_limits.h" -#include "emu_versions.h" -#include "bodytypes.h" +#include "common/bodytypes.h" +#include "common/emu_versions.h" +#include "common/eq_limits.h" -#include +#include namespace AccountStatus { constexpr uint8 Player = 0; @@ -918,5 +917,3 @@ namespace PetType { std::string GetName(uint8 pet_type); bool IsValid(uint8 pet_type); } - -#endif /*COMMON_EMU_CONSTANTS_H*/ diff --git a/common/emu_limits.h b/common/emu_limits.h index c855f44ab..3d61c07eb 100644 --- a/common/emu_limits.h +++ b/common/emu_limits.h @@ -17,12 +17,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_EMU_LIMITS_H -#define COMMON_EMU_LIMITS_H +#pragma once -#include "types.h" +#include "common/types.h" -#include +#include namespace EntityLimits @@ -124,5 +123,3 @@ namespace EntityLimits } /*Pet*/ }; /*EntityLimits*/ - -#endif /*COMMON_EMU_LIMITS_H*/ diff --git a/common/emu_opcodes.cpp b/common/emu_opcodes.cpp index 00f45fa25..6e9ad93f8 100644 --- a/common/emu_opcodes.cpp +++ b/common/emu_opcodes.cpp @@ -16,8 +16,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 04111-1307 USA */ -#include "global_define.h" -#include "emu_opcodes.h" +#include "common/emu_opcodes.h" +#include "common/global_define.h" const char *OpcodeNames[_maxEmuOpcode+1] = { "OP_Unknown", @@ -30,9 +30,3 @@ const char *OpcodeNames[_maxEmuOpcode+1] = { "" }; - - - - - - diff --git a/common/emu_opcodes.h b/common/emu_opcodes.h index 9d5079bea..4c20ccf7b 100644 --- a/common/emu_opcodes.h +++ b/common/emu_opcodes.h @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 04111-1307 USA */ -#ifndef EMU_OPCODES_H -#define EMU_OPCODES_H + +#pragma once //this is the highest opcode possibly used in the regular EQ protocol #define MAX_EQ_OPCODE 0xFFFF @@ -47,6 +47,3 @@ typedef enum { //EQEmu internal opcodes list constexpr int format_as(EmuOpcode opcode) { return static_cast(opcode); } extern const char *OpcodeNames[_maxEmuOpcode+1]; - -#endif - diff --git a/common/emu_versions.cpp b/common/emu_versions.cpp index ea8ddba73..30447b300 100644 --- a/common/emu_versions.cpp +++ b/common/emu_versions.cpp @@ -17,8 +17,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "emu_versions.h" -#include "emu_constants.h" +#include "common/emu_versions.h" +#include "common/emu_constants.h" bool EQ::versions::IsValidClientVersion(ClientVersion client_version) diff --git a/common/emu_versions.h b/common/emu_versions.h index 75f6808c3..d78ac503f 100644 --- a/common/emu_versions.h +++ b/common/emu_versions.h @@ -17,13 +17,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_EMU_VERSIONS_H -#define COMMON_EMU_VERSIONS_H +#pragma once -#include "types.h" - -#include +#include "common/types.h" +#include namespace EQ { @@ -218,5 +216,3 @@ namespace EQ } /*expansions*/ } /*EQEmu*/ - -#endif /*COMMON_EMU_VERSIONS_H*/ diff --git a/common/eq_constants.h b/common/eq_constants.h index b577b9fb3..815073e15 100644 --- a/common/eq_constants.h +++ b/common/eq_constants.h @@ -17,11 +17,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_EQ_CONSTANTS_H -#define COMMON_EQ_CONSTANTS_H +#pragma once -#include "skills.h" -#include "types.h" +#include "common/skills.h" +#include "common/types.h" namespace AppearanceType { constexpr uint32 Die = 0; // Causes the client to keel over and zone to bind point (default action) @@ -1096,5 +1095,3 @@ enum ExpSource namespace DoorType { constexpr uint32 BuyerStall = 155; } - -#endif /*COMMON_EQ_CONSTANTS_H*/ diff --git a/common/eq_limits.cpp b/common/eq_limits.cpp index 1bfbb6d29..600d5dc36 100644 --- a/common/eq_limits.cpp +++ b/common/eq_limits.cpp @@ -17,9 +17,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "emu_constants.h" -#include "emu_limits.h" -#include "rulesys.h" +#include "common/emu_constants.h" +#include "common/emu_limits.h" +#include "common/rulesys.h" #include diff --git a/common/eq_limits.h b/common/eq_limits.h index 6c00e411e..4bed002b6 100644 --- a/common/eq_limits.h +++ b/common/eq_limits.h @@ -17,18 +17,17 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_EQ_LIMITS_H -#define COMMON_EQ_LIMITS_H +#pragma once -#include "types.h" -#include "eq_constants.h" -#include "emu_versions.h" -#include "../common/patches/titanium_limits.h" -#include "../common/patches/sof_limits.h" -#include "../common/patches/sod_limits.h" -#include "../common/patches/uf_limits.h" -#include "../common/patches/rof_limits.h" -#include "../common/patches/rof2_limits.h" +#include "common/emu_versions.h" +#include "common/eq_constants.h" +#include "common/patches/rof_limits.h" +#include "common/patches/rof2_limits.h" +#include "common/patches/sod_limits.h" +#include "common/patches/sof_limits.h" +#include "common/patches/titanium_limits.h" +#include "common/patches/uf_limits.h" +#include "common/types.h" namespace EQ @@ -268,5 +267,3 @@ namespace Client62 } // namespace constants } /*Client62*/ - -#endif /*COMMON_EQ_LIMITS_H*/ diff --git a/common/eq_packet.cpp b/common/eq_packet.cpp index b2c3f6062..f8797b67d 100644 --- a/common/eq_packet.cpp +++ b/common/eq_packet.cpp @@ -16,25 +16,19 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "crc16.h" -#include "global_define.h" #include "eq_packet.h" -#include "misc.h" -#include "op_codes.h" -#include "platform.h" -#include -#include -#include -#include +#include "common/global_define.h" +#include "common/misc.h" +#include "common/op_codes.h" #ifndef STATIC_OPCODE -#include "opcodemgr.h" +#include "common/opcodemgr.h" #endif +#include "common/packet_dump.h" +#include "common/packet_functions.h" +#include "common/platform.h" -#include "packet_dump.h" -#include "packet_functions.h" -#include -#include +#include EQPacket::EQPacket(EmuOpcode op, const unsigned char *buf, uint32 len) : BasePacket(buf, len), diff --git a/common/eq_packet.h b/common/eq_packet.h index 7eb79a75b..395a7d702 100644 --- a/common/eq_packet.h +++ b/common/eq_packet.h @@ -15,18 +15,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _EQPACKET_H -#define _EQPACKET_H -#include "base_packet.h" -#include "platform.h" -#include +#pragma once + +#include "common/base_packet.h" +#include "common/platform.h" #ifdef STATIC_OPCODE typedef unsigned short EmuOpcode; static const EmuOpcode OP_Unknown = 0; #else -#include "emu_opcodes.h" +#include "common/emu_opcodes.h" #endif class EQPacket : public BasePacket { @@ -152,5 +151,3 @@ protected: extern void DumpPacket(const EQApplicationPacket* app, bool iShowInfo = false); extern std::string DumpPacketToString(const EQApplicationPacket* app); - -#endif diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index cb0cc7732..4ea72a198 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -16,20 +16,20 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef EQ_PACKET_STRUCTS_H -#define EQ_PACKET_STRUCTS_H +#pragma once +#include "common/emu_constants.h" +#include "common/textures.h" +#include "common/types.h" +#include "common/version.h" + +#include "cereal/archives/binary.hpp" +#include "cereal/types/string.hpp" +#include "cereal/types/vector.hpp" #include -#include +#include #include -#include -#include -#include -#include -#include "../common/version.h" -#include "emu_constants.h" -#include "textures.h" -#include "types.h" +#include static const uint32 BUFF_COUNT = 42; static const uint32 PET_BUFF_COUNT = 30; @@ -45,6 +45,7 @@ static const uint32 ADVANCED_LORE_LENGTH = 8192; ** Compiler override to ensure ** byte aligned structures */ +#pragma pack(push) #pragma pack(1) struct LoginInfo { @@ -6562,7 +6563,4 @@ struct EvolveGetNextItem { }; // Restore structure packing to default -#pragma pack() - -#endif - +#pragma pack(pop) diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index d17ed54c0..5ae937137 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -16,31 +16,32 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "global_define.h" -#include "eqemu_logsys.h" -#include "eq_packet.h" #include "eq_stream.h" -#include "op_codes.h" -#include "crc16.h" -#include "platform.h" -#include "strings.h" -#include -#include -#include +#include "common/crc16.h" +#include "common/eq_packet.h" +#include "common/eqemu_logsys.h" +#include "common/global_define.h" +#include "common/op_codes.h" +#include "common/platform.h" +#include "common/strings.h" + #include +#include +#include +#include #ifdef _WINDOWS - #include +#include #else - #include - #include - #include - #include - #include - #include - #include - #include +#include +#include +#include +#include +#include +#include +#include +#include #endif //for logsys @@ -1437,4 +1438,3 @@ EQStream::MatchState EQStream::CheckSignature(const Signature *sig) { return(res); } - diff --git a/common/eq_stream.h b/common/eq_stream.h index a05fb5319..23ec89b7f 100644 --- a/common/eq_stream.h +++ b/common/eq_stream.h @@ -1,24 +1,22 @@ -#ifndef _EQSTREAM_H -#define _EQSTREAM_H +#pragma once -#include +#include "common/eq_packet.h" +#include "common/eq_stream_intf.h" +#include "common/eq_stream_type.h" +#include "common/misc.h" +#include "common/mutex.h" +#include "common/opcodemgr.h" +#include "common/timer.h" + +#include #include #include -#include +#include #ifndef WIN32 #include #endif -#include "../common/misc.h" -#include "../common/opcodemgr.h" -#include "../common/timer.h" - -#include "eq_packet.h" -#include "eq_stream_intf.h" -#include "eq_stream_type.h" -#include "mutex.h" - class EQApplicationPacket; class EQProtocolPacket; @@ -314,6 +312,3 @@ class EQStream : public EQStreamInterface { virtual MatchState CheckSignature(const Signature *sig); }; - -#endif - diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 429f258f6..470ac5b73 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -1,19 +1,18 @@ -#include "global_define.h" -#include "eqemu_logsys.h" #include "eq_stream_factory.h" +#include "common/global_define.h" #ifdef _WINDOWS - #include - #include - #include - #include +#include +#include +#include +#include #else - #include - #include - #include - #include - #include - #include +#include +#include +#include +#include +#include +#include #endif #include diff --git a/common/eq_stream_factory.h b/common/eq_stream_factory.h index 86ffff979..2aa2b56e4 100644 --- a/common/eq_stream_factory.h +++ b/common/eq_stream_factory.h @@ -1,14 +1,12 @@ -#ifndef _EQSTREAMFACTORY_H +#pragma once -#define _EQSTREAMFACTORY_H +#include "common/condition.h" +#include "common/eq_stream.h" +#include "common/timeoutmgr.h" +#include #include #include -#include - -#include "../common/eq_stream.h" -#include "../common/condition.h" -#include "../common/timeoutmgr.h" class EQStream; class Timer; @@ -57,5 +55,3 @@ class EQStreamFactory : private Timeoutable { void StopWriter() { MWriterRunning.lock(); WriterRunning=false; MWriterRunning.unlock(); WriterWork.Signal(); } void SignalWriter() { WriterWork.Signal(); } }; - -#endif diff --git a/common/eq_stream_ident.cpp b/common/eq_stream_ident.cpp index 8668b7220..f07a54533 100644 --- a/common/eq_stream_ident.cpp +++ b/common/eq_stream_ident.cpp @@ -1,10 +1,11 @@ -#include -#include "global_define.h" -#include "eqemu_logsys.h" -#include "eq_stream_ident.h" -#include "eq_stream_proxy.h" -#include "misc.h" +#include "common/eq_stream_ident.h" +#include "common/eq_stream_proxy.h" +#include "common/eqemu_logsys.h" +#include "common/global_define.h" +#include "common/misc.h" + +#include EQStreamIdentifier::~EQStreamIdentifier() { while(!m_identified.empty()) { @@ -162,4 +163,3 @@ EQStreamIdentifier::Record::Record(std::shared_ptr s) expire(STREAM_IDENT_WAIT_MS) { } - diff --git a/common/eq_stream_ident.h b/common/eq_stream_ident.h index e34db5879..fbce0cf5f 100644 --- a/common/eq_stream_ident.h +++ b/common/eq_stream_ident.h @@ -1,11 +1,11 @@ -#ifndef EQSTREAMIDENT_H_ -#define EQSTREAMIDENT_H_ +#pragma once + +#include "common/eq_stream_intf.h" +#include "common/timer.h" -#include "eq_stream_intf.h" -#include "timer.h" -#include -#include #include +#include +#include #define STREAM_IDENT_WAIT_MS 30000 @@ -47,5 +47,3 @@ protected: std::vector m_streams; //we own these objects, and the streams contained in them. std::queue m_identified; //we own these objects }; - -#endif /*EQSTREAMIDENT_H_*/ diff --git a/common/eq_stream_intf.h b/common/eq_stream_intf.h index 5b2d24c82..9431fbedf 100644 --- a/common/eq_stream_intf.h +++ b/common/eq_stream_intf.h @@ -1,12 +1,13 @@ -#ifndef EQSTREAMINTF_H_ -#define EQSTREAMINTF_H_ +#pragma once + +#include "common/emu_versions.h" +#include "common/eq_packet.h" +#include "common/net/reliable_stream_connection.h" + +#include //this is the only part of an EQStream that is seen by the application. -#include -#include "emu_versions.h" -#include "eq_packet.h" -#include "net/reliable_stream_connection.h" typedef enum { ESTABLISHED, @@ -106,5 +107,3 @@ public: virtual void ResetStats() = 0; virtual EQStreamManagerInterface* GetManager() const = 0; }; - -#endif /*EQSTREAMINTF_H_*/ diff --git a/common/eq_stream_locator.h b/common/eq_stream_locator.h index 5732c2ef1..17bdabdb4 100644 --- a/common/eq_stream_locator.h +++ b/common/eq_stream_locator.h @@ -15,16 +15,18 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _EQSTREAM_LOCATOR_H -#define _EQSTREAM_LOCATOR_H + +#pragma once + +#include "common/types.h" + +#include +#include /* This did not turn out nearly as nice as I hoped. */ -#include -#include - class EQStreamInfo { public: EQStreamInfo() {} @@ -168,5 +170,3 @@ public: protected: std::map streams; }; - -#endif diff --git a/common/eq_stream_proxy.cpp b/common/eq_stream_proxy.cpp index 824e68013..e2e088491 100644 --- a/common/eq_stream_proxy.cpp +++ b/common/eq_stream_proxy.cpp @@ -1,9 +1,10 @@ -#include "global_define.h" #include "eq_stream_proxy.h" -#include "struct_strategy.h" -#include "eqemu_logsys.h" -#include "opcodemgr.h" + +#include "common/eqemu_logsys.h" +#include "common/global_define.h" +#include "common/opcodemgr.h" +#include "common/struct_strategy.h" EQStreamProxy::EQStreamProxy(std::shared_ptr &stream, const StructStrategy *structs, OpcodeManager **opcodes) diff --git a/common/eq_stream_proxy.h b/common/eq_stream_proxy.h index fce5b557f..6be9241cc 100644 --- a/common/eq_stream_proxy.h +++ b/common/eq_stream_proxy.h @@ -1,9 +1,8 @@ -#ifndef EQSTREAMPROXY_H_ -#define EQSTREAMPROXY_H_ +#pragma once +#include "common/eq_stream_intf.h" +#include "common/types.h" -#include "types.h" -#include "eq_stream_intf.h" #include class StructStrategy; @@ -44,6 +43,3 @@ protected: OpcodeManager **const m_opcodes; //we do not own this object. }; - -#endif /*EQSTREAMPROXY_H_*/ - diff --git a/common/eq_stream_type.h b/common/eq_stream_type.h index 631963323..267dcf2b3 100644 --- a/common/eq_stream_type.h +++ b/common/eq_stream_type.h @@ -1,5 +1,4 @@ -#ifndef _EQSTREAMTYPE_H -#define _EQSTREAMTYPE_H +#pragma once typedef enum { UnknownStream=0, @@ -11,5 +10,3 @@ typedef enum { MailStream } EQStreamType; - -#endif diff --git a/common/eqdb.cpp b/common/eqdb.cpp index 74af89473..f2a4b8a52 100644 --- a/common/eqdb.cpp +++ b/common/eqdb.cpp @@ -15,10 +15,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "global_define.h" + #include "eqdb.h" -#include "database.h" -#include + +#include "common/database.h" +#include "common/global_define.h" + +#include "mysql.h" #include EQDB EQDB::s_EQDB; diff --git a/common/eqdb.h b/common/eqdb.h index 86000db8b..32492d607 100644 --- a/common/eqdb.h +++ b/common/eqdb.h @@ -15,15 +15,16 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef EQDB_H_ -#define EQDB_H_ +#pragma once + +#include "common/eqdb_res.h" +#include "common/types.h" + +#include "mysql.h" +#include #include #include -#include -#include "types.h" -#include "eqdb_res.h" -#include //this is the main object exported to perl. class EQDB { @@ -50,5 +51,3 @@ private: static EQDB s_EQDB; MYSQL *mysql_ref; }; - -#endif /*EQDB_H_*/ diff --git a/common/eqdb_res.cpp b/common/eqdb_res.cpp index 11d90459d..1fc7b2ecb 100644 --- a/common/eqdb_res.cpp +++ b/common/eqdb_res.cpp @@ -15,9 +15,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "global_define.h" + #include "eqdb_res.h" -#include + +#include "common/global_define.h" +#include "mysql.h" std::vector EQDBRes::fetch_row_array() { std::vector array; @@ -49,4 +51,3 @@ std::map EQDBRes::fetch_row_hash() { return rowhash; } - diff --git a/common/eqdb_res.h b/common/eqdb_res.h index 67ce5f869..5c774e532 100644 --- a/common/eqdb_res.h +++ b/common/eqdb_res.h @@ -15,15 +15,16 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef EQDBRes_H_ -#define EQDBRes_H_ +#pragma once + +#include "common/database.h" +#include "common/types.h" + +#include "mysql.h" #include #include #include -#include "types.h" -#include "database.h" -#include //this is the main object exported to perl. class EQDBRes { @@ -44,5 +45,3 @@ public: private: MYSQL_RES *res; }; - -#endif /*EQDBRes_H_*/ diff --git a/common/eqemu_config.cpp b/common/eqemu_config.cpp index e2f35106c..963607ace 100644 --- a/common/eqemu_config.cpp +++ b/common/eqemu_config.cpp @@ -16,16 +16,17 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/global_define.h" #include "eqemu_config.h" -#include "misc_functions.h" -#include "strings.h" -#include "eqemu_logsys.h" -#include "json/json.hpp" +#include "common/eqemu_logsys.h" +#include "common/global_define.h" +#include "common/json/json.hpp" +#include "common/misc_functions.h" +#include "common/strings.h" + +#include #include #include -#include std::string EQEmuConfig::ConfigFile = "eqemu_config.json"; EQEmuConfig *EQEmuConfig::_config = nullptr; diff --git a/common/eqemu_config.h b/common/eqemu_config.h index 94b0fea52..fcaf1326f 100644 --- a/common/eqemu_config.h +++ b/common/eqemu_config.h @@ -15,15 +15,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __EQEmuConfig_H -#define __EQEmuConfig_H -#include "json/json.h" -#include "linked_list.h" -#include "path_manager.h" +#pragma once + +#include "common/json/json.h" +#include "common/linked_list.h" +#include "common/path_manager.h" + +#include "fmt/format.h" #include -#include -#include struct LoginConfig { std::string LoginHost; @@ -211,5 +211,3 @@ class EQEmuConfig void Dump() const; void CheckUcsConfigConversion(); }; - -#endif diff --git a/common/eqemu_exception.h b/common/eqemu_exception.h index 9649c7a98..6970c1b4c 100644 --- a/common/eqemu_exception.h +++ b/common/eqemu_exception.h @@ -16,8 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _EQEMU_EQEMUEXCEPTION_H -#define _EQEMU_EQEMUEXCEPTION_H +#pragma once #include #include @@ -106,5 +105,3 @@ namespace EQ #ifndef EQ_EXCEPT #define EQ_EXCEPT(n, d) throw EQ::Exception(n, d, __FILE__, __LINE__) #endif - -#endif diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 0d735b407..8af9dcc6d 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -19,39 +19,37 @@ */ #include "eqemu_logsys.h" -#include "rulesys.h" -#include "platform.h" -#include "strings.h" -#include "repositories/discord_webhooks_repository.h" -#include "repositories/logsys_categories_repository.h" -#include "termcolor/rang.hpp" -#include "path_manager.h" -#include "file.h" -#include -#include -#include -#include - -std::ofstream process_log; +#include "common/file.h" +#include "common/path_manager.h" +#include "common/platform.h" +#include "common/repositories/discord_webhooks_repository.h" +#include "common/repositories/logsys_categories_repository.h" +#include "common/rulesys.h" +#include "common/strings.h" +#include "common/termcolor/rang.hpp" #include +#include +#include +#include +#include #ifdef _WINDOWS -#include #include -#include +#include #include -#include +#include #include +#include #else - -#include #include #include - +#include #endif +std::ofstream process_log; + /** * EQEmuLogSys Constructor */ diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 210d784f8..97b99361c 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -18,14 +18,16 @@ * */ -#ifndef EQEMU_LOGSYS_H -#define EQEMU_LOGSYS_H +#pragma once -#include -#include -#include -#include +#include "common/types.h" + +#include "fmt/format.h" #include +#include +#include +#include +#include #ifdef _WIN32 #ifdef utf16_to_utf8 @@ -33,10 +35,6 @@ #endif #endif -#include -#include -#include "types.h" - namespace Logs { enum DebugLevel { General = 1, // 1 - Low-Level general debugging, useful info on single line @@ -463,5 +461,3 @@ void OutF( do { \ ls->Out(debug_level, log_category, file, func, line, fmt::format(formatStr, ##__VA_ARGS__).c_str()); \ } while(0) - -#endif diff --git a/common/eqemu_logsys_log_aliases.h b/common/eqemu_logsys_log_aliases.h index a2c88a03f..261408c53 100644 --- a/common/eqemu_logsys_log_aliases.h +++ b/common/eqemu_logsys_log_aliases.h @@ -18,8 +18,9 @@ * */ -#ifndef EQEMU_EQEMU_LOGSYS_LOG_ALIASES_H -#define EQEMU_EQEMU_LOGSYS_LOG_ALIASES_H +#pragma once + +#include "common/eqemu_logsys.h" inline auto logsys = EQEmuLogSys::Instance(); @@ -935,6 +936,3 @@ inline auto logsys = EQEmuLogSys::Instance(); if (logsys->IsLogEnabled(debug_level, log_category))\ OutF(logsys, debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ } while (0) - - -#endif //EQEMU_EQEMU_LOGSYS_LOG_ALIASES_H diff --git a/common/eqtime.cpp b/common/eqtime.cpp index 1478dafd8..7fc34315c 100644 --- a/common/eqtime.cpp +++ b/common/eqtime.cpp @@ -16,13 +16,16 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "eqtime.h" + +#include "common/eq_packet_structs.h" +#include "common/eqemu_logsys.h" +#include "common/global_define.h" + #include -#include "../common/global_define.h" -#include "../common/eqemu_logsys.h" -#include "../common/eqtime.h" -#include "../common/eq_packet_structs.h" -#include #include +#include + /*#ifdef _CRTDBG_MAP_ALLOC #undef new #endif*/ diff --git a/common/eqtime.h b/common/eqtime.h index f79d274f8..960570b1a 100644 --- a/common/eqtime.h +++ b/common/eqtime.h @@ -1,7 +1,7 @@ -#ifndef EQTIME_H -#define EQTIME_H +#pragma once + +#include "common/eq_packet_structs.h" -#include "../common/eq_packet_structs.h" #include //Struct @@ -48,5 +48,3 @@ private: //This is our tz offset int32 timezone; }; - -#endif diff --git a/common/event/event_loop.h b/common/event/event_loop.h index 537c3280a..8d7ee6a0d 100644 --- a/common/event/event_loop.h +++ b/common/event/event_loop.h @@ -1,7 +1,8 @@ #pragma once + +#include "uv.h" + #include -#include -#include namespace EQ { diff --git a/common/event/task.h b/common/event/task.h index a58fd875a..e711ade7f 100644 --- a/common/event/task.h +++ b/common/event/task.h @@ -1,9 +1,11 @@ #pragma once -#include -#include -#include + #include "event_loop.h" +#include +#include +#include + namespace EQ { class Task { diff --git a/common/event/task_scheduler.h b/common/event/task_scheduler.h index 7f4c0401b..03e197d92 100644 --- a/common/event/task_scheduler.h +++ b/common/event/task_scheduler.h @@ -1,11 +1,12 @@ #pragma once -#include -#include -#include + #include #include -#include #include +#include +#include +#include +#include namespace EQ { diff --git a/common/event/timer.h b/common/event/timer.h index 73ac7af35..c9fe757d9 100644 --- a/common/event/timer.h +++ b/common/event/timer.h @@ -1,7 +1,9 @@ #pragma once -#include + #include "event_loop.h" +#include + namespace EQ { class Timer { diff --git a/common/event_sub.h b/common/event_sub.h index 389b4ed07..cd45314ea 100644 --- a/common/event_sub.h +++ b/common/event_sub.h @@ -1,7 +1,7 @@ #pragma once -#include #include +#include class EventSubscriptionWatcher { diff --git a/common/events/player_event_discord_formatter.cpp b/common/events/player_event_discord_formatter.cpp index b25680902..3b49c040a 100644 --- a/common/events/player_event_discord_formatter.cpp +++ b/common/events/player_event_discord_formatter.cpp @@ -1,11 +1,14 @@ #include "player_event_discord_formatter.h" -#include "../repositories/character_data_repository.h" -#include "../json/json_archive_single_line.h" + +#include "common/json/json_archive_single_line.h" +#include "common/repositories/character_data_repository.h" + +#include "cereal/archives/json.hpp" +#include "cereal/types/vector.hpp" +#include "fmt/format.h" +#include "fmt/ranges.h" + #include -#include -#include -#include -#include std::string PlayerEventDiscordFormatter::GetCurrentTimestamp() { diff --git a/common/events/player_event_discord_formatter.h b/common/events/player_event_discord_formatter.h index aef518ace..622a41cee 100644 --- a/common/events/player_event_discord_formatter.h +++ b/common/events/player_event_discord_formatter.h @@ -1,11 +1,12 @@ -#ifndef EQEMU_PLAYER_EVENT_DISCORD_FORMATTER_H -#define EQEMU_PLAYER_EVENT_DISCORD_FORMATTER_H +#pragma once + +#include "common/events/player_events.h" +#include "common/repositories/base/base_player_event_logs_repository.h" + +#include "cereal/archives/json.hpp" +#include "cereal/types/vector.hpp" #include -#include "player_events.h" -#include "../repositories/base/base_player_event_logs_repository.h" -#include -#include struct DiscordField { std::string name; @@ -209,6 +210,3 @@ public: std::vector &embeds ); }; - - -#endif //EQEMU_PLAYER_EVENT_DISCORD_FORMATTER_H diff --git a/common/events/player_event_logs.cpp b/common/events/player_event_logs.cpp index daa8cd17c..b06632a59 100644 --- a/common/events/player_event_logs.cpp +++ b/common/events/player_event_logs.cpp @@ -1,14 +1,16 @@ #include "player_event_logs.h" -#include -#include "../platform.h" -#include "../rulesys.h" -#include "player_event_discord_formatter.h" -#include "../repositories/player_event_loot_items_repository.h" -#include "../repositories/player_event_merchant_sell_repository.h" -#include "../repositories/player_event_merchant_purchase_repository.h" -#include "../repositories/player_event_npc_handin_repository.h" -#include "../repositories/player_event_npc_handin_entries_repository.h" +#include "common/events/player_event_discord_formatter.h" +#include "common/platform.h" +#include "common/repositories/player_event_loot_items_repository.h" +#include "common/repositories/player_event_merchant_purchase_repository.h" +#include "common/repositories/player_event_merchant_sell_repository.h" +#include "common/repositories/player_event_npc_handin_entries_repository.h" +#include "common/repositories/player_event_npc_handin_repository.h" +#include "common/rulesys.h" + +#include "cereal/archives/json.hpp" +#include "fmt/ranges.h" const uint32 PROCESS_RETENTION_TRUNCATION_TIMER_INTERVAL = 60 * 60 * 1000; // 1 hour diff --git a/common/events/player_event_logs.h b/common/events/player_event_logs.h index 3c22de4c0..a4bcba0a9 100644 --- a/common/events/player_event_logs.h +++ b/common/events/player_event_logs.h @@ -1,28 +1,26 @@ -#ifndef EQEMU_PLAYER_EVENT_LOGS_H -#define EQEMU_PLAYER_EVENT_LOGS_H +#pragma once -#include +#include "common/eqemu_config.h" +#include "common/json/json_archive_single_line.h" +#include "common/repositories/player_event_aa_purchase_repository.h" +#include "common/repositories/player_event_killed_named_npc_repository.h" +#include "common/repositories/player_event_killed_npc_repository.h" +#include "common/repositories/player_event_killed_raid_npc_repository.h" +#include "common/repositories/player_event_log_settings_repository.h" +#include "common/repositories/player_event_logs_repository.h" +#include "common/repositories/player_event_loot_items_repository.h" +#include "common/repositories/player_event_merchant_purchase_repository.h" +#include "common/repositories/player_event_merchant_sell_repository.h" +#include "common/repositories/player_event_npc_handin_entries_repository.h" +#include "common/repositories/player_event_npc_handin_repository.h" +#include "common/repositories/player_event_speech_repository.h" +#include "common/repositories/player_event_trade_entries_repository.h" +#include "common/repositories/player_event_trade_repository.h" +#include "common/servertalk.h" +#include "common/timer.h" + +#include "cereal/archives/json.hpp" #include -#include "../json/json_archive_single_line.h" -#include "../servertalk.h" -#include "../timer.h" -#include "../eqemu_config.h" - -#include "../repositories/player_event_log_settings_repository.h" -#include "../repositories/player_event_logs_repository.h" -#include "../repositories/player_event_loot_items_repository.h" -#include "../repositories/player_event_merchant_purchase_repository.h" -#include "../repositories/player_event_merchant_sell_repository.h" -#include "../repositories/player_event_npc_handin_repository.h" -#include "../repositories/player_event_npc_handin_entries_repository.h" -#include "../repositories/player_event_trade_repository.h" -#include "../repositories/player_event_trade_entries_repository.h" -#include "../repositories/player_event_speech_repository.h" -#include "../repositories/player_event_killed_npc_repository.h" -#include "../repositories/player_event_killed_named_npc_repository.h" -#include "../repositories/player_event_killed_raid_npc_repository.h" -#include "../repositories/player_event_aa_purchase_repository.h" - class PlayerEventLogs { @@ -134,5 +132,3 @@ private: public: std::map &GetEtlSettings() { return m_etl_settings;} }; - -#endif //EQEMU_PLAYER_EVENT_LOGS_H diff --git a/common/events/player_events.h b/common/events/player_events.h index 02ea2a26b..a3279b10c 100644 --- a/common/events/player_events.h +++ b/common/events/player_events.h @@ -1,11 +1,12 @@ -#ifndef EQEMU_PLAYER_EVENTS_H -#define EQEMU_PLAYER_EVENTS_H +#pragma once + +#include "common/repositories/player_event_logs_repository.h" +#include "common/rulesys.h" +#include "common/types.h" + +#include "cereal/cereal.hpp" #include -#include -#include "../types.h" -#include "../rulesys.h" -#include "../repositories/player_event_logs_repository.h" #define CEREAL_NVP_IF_NONZERO(ar, name) \ if ((name) != 0) ar(cereal::make_nvp(#name, name)) @@ -1753,8 +1754,6 @@ namespace PlayerEvent { }; } -#endif //EQEMU_PLAYER_EVENTS_H - #define RecordPlayerEventLog(event_type, event_data) do {\ if (PlayerEventLogs::Instance()->IsEventEnabled(event_type)) {\ if (RuleB(Logging, PlayerEventsQSProcess)) {\ diff --git a/common/evolving_items.cpp b/common/evolving_items.cpp index f14a733f3..e23e58599 100644 --- a/common/evolving_items.cpp +++ b/common/evolving_items.cpp @@ -1,7 +1,8 @@ #include "evolving_items.h" -#include "item_instance.h" -#include "events/player_event_logs.h" -#include "repositories/character_evolving_items_repository.h" + +#include "common/events/player_event_logs.h" +#include "common/item_instance.h" +#include "common/repositories/character_evolving_items_repository.h" EvolvingItemsManager::EvolvingItemsManager() { diff --git a/common/evolving_items.h b/common/evolving_items.h index 3bdb4d697..ec23f7ade 100644 --- a/common/evolving_items.h +++ b/common/evolving_items.h @@ -1,9 +1,8 @@ -#ifndef EVOLVING_H -#define EVOLVING_H +#pragma once -#include "shareddb.h" -#include "events/player_events.h" -#include "repositories/items_evolving_details_repository.h" +#include "common/events/player_events.h" +#include "common/repositories/items_evolving_details_repository.h" +#include "common/shareddb.h" namespace EQ { class ItemInstance; @@ -66,5 +65,3 @@ private: Database * m_db; Database * m_content_db; }; - -#endif //EVOLVING_H diff --git a/common/extprofile.cpp b/common/extprofile.cpp index f29ec1e6e..5fd4d4471 100644 --- a/common/extprofile.cpp +++ b/common/extprofile.cpp @@ -16,9 +16,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "global_define.h" #include "extprofile.h" +#include "common/global_define.h" + //Set defaults in the extended profile... void InitExtendedProfile(ExtendedProfile_Struct *p) { memset(p, 0, sizeof(ExtendedProfile_Struct)); @@ -49,4 +50,3 @@ bool SetExtendedProfile(ExtendedProfile_Struct *to, char *old, unsigned int len) return(false); } - diff --git a/common/extprofile.h b/common/extprofile.h index 5f69a449d..7bddcf6f7 100644 --- a/common/extprofile.h +++ b/common/extprofile.h @@ -15,12 +15,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef EXTENDED_PROFILE_H -#define EXTENDED_PROFILE_H -#include "eq_packet_structs.h" -#include "inventory_profile.h" +#pragma once +#include "common/eq_packet_structs.h" +#include "common/inventory_profile.h" + +#pragma pack(push) #pragma pack(1) /* @@ -58,10 +59,7 @@ struct ExtendedProfile_Struct { uint32 next_invsnapshot_time; /* Used */ }; -#pragma pack() +#pragma pack(pop) void InitExtendedProfile(ExtendedProfile_Struct *p); bool SetExtendedProfile(ExtendedProfile_Struct *to, char *old, unsigned int len); - - -#endif diff --git a/common/faction.cpp b/common/faction.cpp index 793991593..1432e94e0 100644 --- a/common/faction.cpp +++ b/common/faction.cpp @@ -17,8 +17,9 @@ */ #include "faction.h" -#include "races.h" -#include "rulesys.h" + +#include "common/races.h" +#include "common/rulesys.h" const char *FactionValueToString(FACTION_VALUE faction_value) { @@ -163,4 +164,3 @@ bool IsOfIndiffRace(int r1, int r2) } return false; } - diff --git a/common/faction.h b/common/faction.h index a4aac84a2..368a8dbc8 100755 --- a/common/faction.h +++ b/common/faction.h @@ -15,11 +15,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _EQEMU_FACTION_H -#define _EQEMU_FACTION_H -#include "types.h" -#include "features.h" +#pragma once + +#include "common/features.h" +#include "common/types.h" + #include #include @@ -75,4 +76,3 @@ struct NPCFaction const char *FactionValueToString(FACTION_VALUE faction_value); FACTION_VALUE CalculateFaction(FactionMods* fm, int32 tmpCharacter_value); -#endif diff --git a/common/features.h b/common/features.h index 0e157a652..e0fbc293e 100644 --- a/common/features.h +++ b/common/features.h @@ -15,8 +15,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef FEATURES_H -#define FEATURES_H + +#pragma once /* @@ -257,8 +257,3 @@ Developer configuration #define PROFILE_DUMP_TIME 180 #endif //EQPROFILE - - - -#endif - diff --git a/common/file.cpp b/common/file.cpp index df15255af..8d56470b1 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -18,9 +18,16 @@ * */ -#include #include "file.h" +#include "fmt/format.h" + +#include +#include +#include +#include +#include + #ifdef _WINDOWS #include #include @@ -29,18 +36,10 @@ #include #include #else - #include #include - #endif -#include -#include -#include -#include -#include -#include namespace fs = std::filesystem; diff --git a/common/file.h b/common/file.h index 7991101c4..ec99a1b36 100644 --- a/common/file.h +++ b/common/file.h @@ -18,8 +18,7 @@ * */ -#ifndef EQEMU_FILE_H -#define EQEMU_FILE_H +#pragma once #include @@ -40,5 +39,3 @@ public: }; bool Exists(const std::string& name); - -#endif //EQEMU_FILE_H diff --git a/common/fixed_memory_hash_set.h b/common/fixed_memory_hash_set.h index d02900260..17e8d9013 100644 --- a/common/fixed_memory_hash_set.h +++ b/common/fixed_memory_hash_set.h @@ -16,12 +16,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _EQEMU_FIXED_MEMORY_HASHSET_H -#define _EQEMU_FIXED_MEMORY_HASHSET_H +#pragma once + +#include "common/eqemu_exception.h" +#include "common/types.h" #include -#include "eqemu_exception.h" -#include "types.h" namespace EQ { @@ -247,6 +247,3 @@ namespace EQ { value_type *elements_; }; } // EQEmu - -#endif - diff --git a/common/fixed_memory_variable_hash_set.h b/common/fixed_memory_variable_hash_set.h index cc0f7979e..f04387c0c 100644 --- a/common/fixed_memory_variable_hash_set.h +++ b/common/fixed_memory_variable_hash_set.h @@ -16,12 +16,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _EQEMU_FIXED_MEMORY_VARIABLE_HASHSET_H -#define _EQEMU_FIXED_MEMORY_VARIABLE_HASHSET_H +#pragma once + +#include "common/eqemu_exception.h" +#include "common/types.h" #include -#include "eqemu_exception.h" -#include "types.h" namespace EQ { @@ -237,5 +237,3 @@ namespace EQ { byte *elements_; }; } // EQEmu - -#endif diff --git a/common/global_define.h b/common/global_define.h index e27f313af..8c4755d84 100644 --- a/common/global_define.h +++ b/common/global_define.h @@ -16,6 +16,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#pragma once + // WHY IS THIS UP HERE #if defined(_DEBUG) && defined(WIN32) #ifndef _CRTDBG_MAP_ALLOC @@ -24,12 +26,8 @@ #endif #endif -#ifndef EQDEBUG_H -#define EQDEBUG_H #ifdef _WINDOWS #include #include #endif - -#endif diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 3f34c3625..13c2af3c9 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -17,23 +17,21 @@ */ #include "guild_base.h" -#include "database.h" -#include "../common/rulesys.h" -#include "../common/repositories/guilds_repository.h" -#include "../common/repositories/guild_ranks_repository.h" -#include "../common/repositories/guild_permissions_repository.h" -#include "../common/repositories/guild_members_repository.h" -#include "../common/repositories/guild_bank_repository.h" -#include "../common/repositories/guild_tributes_repository.h" +#include "common/database.h" +#include "common/eq_packet_structs.h" +#include "common/repositories/guild_bank_repository.h" +#include "common/repositories/guild_members_repository.h" +#include "common/repositories/guild_permissions_repository.h" +#include "common/repositories/guild_ranks_repository.h" +#include "common/repositories/guild_tributes_repository.h" +#include "common/repositories/guilds_repository.h" +#include "common/rulesys.h" +#include "common/strings.h" -//#include "misc_functions.h" -#include "strings.h" #include #include -//until we move MAX_NUMBER_GUILDS -#include "eq_packet_structs.h" std::vector default_permissions = { {GUILD_ACTION_BANK_CHANGE_ITEM_PERMISSIONS, 128}, diff --git a/common/guild_base.h b/common/guild_base.h index 0cd4fe5f8..9554c0665 100644 --- a/common/guild_base.h +++ b/common/guild_base.h @@ -1,13 +1,13 @@ -#ifndef GUILD_BASE_H_ -#define GUILD_BASE_H_ +#pragma once + +#include "common/guilds.h" +#include "common/repositories/guild_members_repository.h" +#include "common/repositories/guilds_repository.h" +#include "common/timer.h" -#include "guilds.h" #include #include #include -#include "timer.h" -#include "../common/repositories/guild_members_repository.h" -#include "../common/repositories/guilds_repository.h" struct DefaultPermissionStruct { GuildAction id; @@ -210,6 +210,3 @@ class BaseGuildManager GuildInfo* _CreateGuild(uint32 guild_id, std::string guild_name, uint32 leader_char_id, uint8 minstatus, std::string guild_motd, std::string motd_setter, std::string Channel, std::string URL, uint32 favour); GuildsRepository::Guilds CreateGuildRepoFromGuildInfo(uint32 guild_id, BaseGuildManager::GuildInfo& in); }; -#endif /*GUILD_BASE_H_*/ - - diff --git a/common/guilds.cpp b/common/guilds.cpp index 408f28714..09e92f39b 100644 --- a/common/guilds.cpp +++ b/common/guilds.cpp @@ -16,12 +16,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/global_define.h" -#include "misc_functions.h" #include "guilds.h" -#include "database.h" -#include "eq_packet_structs.h" +#include "common/database.h" +#include "common/eq_packet_structs.h" +#include "common/global_define.h" +#include "common/misc_functions.h" #ifndef WIN32 #include //for htonl diff --git a/common/guilds.h b/common/guilds.h index 11a6af704..aca44a1cf 100644 --- a/common/guilds.h +++ b/common/guilds.h @@ -16,10 +16,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef GUILDS_H -#define GUILDS_H +#pragma once -#include "types.h" +#include "common/types.h" #define GUILD_NONE 0xFFFFFFFF // user has no guild @@ -82,5 +81,3 @@ typedef enum { } GuildAction; constexpr int format_as(GuildAction action) { return static_cast(action); } - -#endif diff --git a/common/inventory_profile.cpp b/common/inventory_profile.cpp index 7017184d9..6d16f50b0 100644 --- a/common/inventory_profile.cpp +++ b/common/inventory_profile.cpp @@ -17,20 +17,12 @@ */ #include "inventory_profile.h" -#include "textures.h" -#include "eqemu_logsys.h" -//#include "classes.h" -//#include "global_define.h" -//#include "item_instance.h" -//#include "races.h" -//#include "rulesys.h" -//#include "shareddb.h" -#include "strings.h" -#include "../common/light_source.h" -#include "data_verification.h" - -//#include +#include "common/data_verification.h" +#include "common/eqemu_logsys.h" +#include "common/light_source.h" +#include "common/strings.h" +#include "common/textures.h" #include diff --git a/common/inventory_profile.h b/common/inventory_profile.h index 577342785..1297be0d7 100644 --- a/common/inventory_profile.h +++ b/common/inventory_profile.h @@ -21,13 +21,11 @@ // These classes could be optimized with database reads/writes by storing // a status flag indicating how object needs to interact with database -#ifndef COMMON_INVENTORY_PROFILE_H -#define COMMON_INVENTORY_PROFILE_H +#pragma once - -#include "item_instance.h" -#include "classes.h" -#include "races.h" +#include "common/classes.h" +#include "common/item_instance.h" +#include "common/races.h" #include #include @@ -253,5 +251,3 @@ namespace EQ const inventory::LookupEntry* m_lookup; }; } - -#endif /*COMMON_INVENTORY_PROFILE_H*/ diff --git a/common/inventory_slot.cpp b/common/inventory_slot.cpp index a63512ae2..081147d8f 100644 --- a/common/inventory_slot.cpp +++ b/common/inventory_slot.cpp @@ -18,8 +18,9 @@ */ #include "inventory_slot.h" -#include "textures.h" -#include "strings.h" + +#include "common/textures.h" +#include "common/strings.h" int8 EQ::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index) diff --git a/common/inventory_slot.h b/common/inventory_slot.h index d61d8acb0..dc8576399 100644 --- a/common/inventory_slot.h +++ b/common/inventory_slot.h @@ -17,10 +17,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_INVENTORY_SLOT -#define COMMON_INVENTORY_SLOT +#pragma once -#include "emu_constants.h" +#include "common/emu_constants.h" namespace EQ @@ -129,5 +128,3 @@ namespace EQ bool operator!=(const InventorySlot& lhs, const InventorySlot& rhs) { return (!(lhs == rhs)); } } /*EQEmu*/ - -#endif /*COMMON_INVENTORY_SLOT*/ diff --git a/common/ip_util.cpp b/common/ip_util.cpp index c0316ea10..b5c18948f 100644 --- a/common/ip_util.cpp +++ b/common/ip_util.cpp @@ -18,18 +18,19 @@ * */ +#include "ip_util.h" + +#include "common/eqemu_logsys.h" +#include "common/event/event_loop.h" +#include "common/event/task_scheduler.h" +#include "common/http/httplib.h" +#include "common/http/uri.h" +#include "common/net/dns.h" + +#include "fmt/format.h" #include -#include -#include #include #include -#include "ip_util.h" -#include "http/httplib.h" -#include "http/uri.h" -#include "eqemu_logsys.h" -#include "event/event_loop.h" -#include "net/dns.h" -#include "event/task_scheduler.h" /** * @param ip diff --git a/common/ip_util.h b/common/ip_util.h index 3d96f219c..255167aff 100644 --- a/common/ip_util.h +++ b/common/ip_util.h @@ -18,11 +18,11 @@ * */ -#ifndef EQEMU_IP_UTIL_H -#define EQEMU_IP_UTIL_H +#pragma once -#include "types.h" -#include "iostream" +#include "common/types.h" + +#include class IpUtil { public: @@ -40,5 +40,3 @@ public: static bool IsPortInUse(const std::string& ip, int port); }; - -#endif //EQEMU_IP_UTIL_H diff --git a/common/ipc_mutex.cpp b/common/ipc_mutex.cpp index ebd13a693..48af9b388 100644 --- a/common/ipc_mutex.cpp +++ b/common/ipc_mutex.cpp @@ -17,20 +17,23 @@ */ #include "ipc_mutex.h" + +#include "common/eqemu_config.h" +#include "common/eqemu_exception.h" +#include "common/path_manager.h" +#include "common/types.h" + #ifdef _WINDOWS +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include -#undef WIN32_LEAN_AND_MEAN #else #include #include #include #include #endif -#include "types.h" -#include "eqemu_exception.h" -#include "eqemu_config.h" -#include "path_manager.h" namespace EQ { struct IPCMutex::Implementation { diff --git a/common/ipc_mutex.h b/common/ipc_mutex.h index 4418f9189..f4ef94ed2 100644 --- a/common/ipc_mutex.h +++ b/common/ipc_mutex.h @@ -16,8 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _MUTEX_H_ -#define _MUTEX_H_ +#pragma once #include @@ -61,5 +60,3 @@ namespace EQ { Implementation *imp_; }; } - -#endif diff --git a/common/item_data.cpp b/common/item_data.cpp index c31bad37c..f49dcf08b 100644 --- a/common/item_data.cpp +++ b/common/item_data.cpp @@ -18,9 +18,9 @@ */ #include "item_data.h" -#include "classes.h" -#include "races.h" -//#include "deity.h" + +#include "common/classes.h" +#include "common/races.h" uint32 EQ::item::ConvertAugTypeToAugTypeBit(uint8 aug_type) diff --git a/common/item_data.h b/common/item_data.h index 6967c218c..30ad2e459 100644 --- a/common/item_data.h +++ b/common/item_data.h @@ -17,9 +17,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 04111-1307 USA */ -#ifndef COMMON_ITEM_DATA_H -#define COMMON_ITEM_DATA_H +#pragma once +#include "common/emu_constants.h" /* * Note: (Doodman) @@ -44,9 +44,6 @@ * Made ya look! Ha! */ -#include "emu_constants.h" - - namespace EQ { namespace item { @@ -558,5 +555,3 @@ namespace EQ }; } /*EQEmu*/ - -#endif /*COMMON_ITEM_DATA_H*/ diff --git a/common/item_instance.cpp b/common/item_instance.cpp index bb048b1fb..c624140e0 100644 --- a/common/item_instance.cpp +++ b/common/item_instance.cpp @@ -17,22 +17,15 @@ */ #include "inventory_profile.h" -#include "../common/data_verification.h" -//#include "classes.h" -//#include "global_define.h" -//#include "item_instance.h" -//#include "races.h" -#include "rulesys.h" -#include "shareddb.h" -#include "strings.h" -#include "evolving_items.h" -//#include "../common/light_source.h" +#include "common/data_verification.h" +#include "common/evolving_items.h" +#include "common/rulesys.h" +#include "common/shareddb.h" +#include "common/strings.h" #include -//#include - int32 next_item_serial_number = 1; std::unordered_set guids{}; diff --git a/common/item_instance.h b/common/item_instance.h index 99edfb570..8c96de108 100644 --- a/common/item_instance.h +++ b/common/item_instance.h @@ -21,24 +21,22 @@ // These classes could be optimized with database reads/writes by storing // a status flag indicating how object needs to interact with database -#ifndef COMMON_ITEM_INSTANCE_H -#define COMMON_ITEM_INSTANCE_H -#include "evolving_items.h" +#pragma once +#include "common/bodytypes.h" +#include "common/deity.h" +#include "common/eq_constants.h" +#include "common/evolving_items.h" +#include "common/item_data.h" +#include "common/memory_buffer.h" +#include "common/repositories/character_evolving_items_repository.h" +#include "common/timer.h" + +#include class ItemParse; // Parses item packets class EvolveInfo; // Stores information about an evolving item family -#include "../common/eq_constants.h" -#include "../common/item_data.h" -#include "../common/timer.h" -#include "../common/bodytypes.h" -#include "../common/deity.h" -#include "../common/memory_buffer.h" -#include "../common/repositories/character_evolving_items_repository.h" - -#include - // Specifies usage type for item inside EQ::ItemInstance enum ItemInstTypes @@ -376,4 +374,3 @@ namespace EQ mutable std::map m_timers {}; }; } -#endif /*COMMON_ITEM_INSTANCE_H*/ diff --git a/common/json_config.cpp b/common/json_config.cpp index 5f4c47b71..b41a8fc5b 100644 --- a/common/json_config.cpp +++ b/common/json_config.cpp @@ -1,4 +1,5 @@ #include "json_config.h" + #include #include diff --git a/common/json_config.h b/common/json_config.h index aa4d2d8f6..29fbb86c5 100644 --- a/common/json_config.h +++ b/common/json_config.h @@ -2,6 +2,8 @@ #include "json/json.h" +#include + namespace EQ { class JsonConfigFile diff --git a/common/light_source.cpp b/common/light_source.cpp index 7aeb4d166..1574144ad 100644 --- a/common/light_source.cpp +++ b/common/light_source.cpp @@ -21,7 +21,6 @@ #include - uint8 EQ::lightsource::TypeToLevel(uint8 light_type) { switch (light_type) { diff --git a/common/light_source.h b/common/light_source.h index f68f7fe87..4c6d479f1 100644 --- a/common/light_source.h +++ b/common/light_source.h @@ -17,11 +17,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_LIGHT_SOURCE_H -#define COMMON_LIGHT_SOURCE_H - -#include "types.h" +#pragma once +#include "common/types.h" namespace EQ { @@ -111,5 +109,3 @@ namespace EQ }; } /*EQEmu*/ - -#endif /*COMMON_LIGHT_SOURCE_H*/ diff --git a/common/linked_list.h b/common/linked_list.h index 8ac4b51d8..0c7e39041 100644 --- a/common/linked_list.h +++ b/common/linked_list.h @@ -15,10 +15,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef LINKEDLIST_H -#define LINKEDLIST_H -#include "types.h" +#pragma once + +#include "common/types.h" enum direction{FORWARD,BACKWARD}; @@ -433,6 +433,3 @@ TYPE LinkedList::PeekTop() { return first->GetData(); return 0; } - -#endif - diff --git a/common/loot.h b/common/loot.h index 62baf1425..c386a4577 100644 --- a/common/loot.h +++ b/common/loot.h @@ -1,9 +1,9 @@ -#ifndef CODE_LOOT_H -#define CODE_LOOT_H +#pragma once + +#include "common/types.h" #include #include -#include "../common/types.h" struct LootItem { uint32 item_id; @@ -30,5 +30,3 @@ struct LootItem { typedef std::list LootItems; - -#endif //CODE_LOOT_H diff --git a/common/md5.cpp b/common/md5.cpp index ca2e38eb2..2326fc5e7 100644 --- a/common/md5.cpp +++ b/common/md5.cpp @@ -7,10 +7,13 @@ * MD5Update as needed on buffers full of bytes, and then call MD5Final, which * will fill a supplied 16-byte array with the digest. */ + +#include "md5.h" + +#include "common/strings.h" +#include "common/seperator.h" + #include /* for memcpy() */ -#include "../common/md5.h" -#include "../common/strings.h" -#include "../common/seperator.h" MD5::MD5() { memset(pMD5, 0, 16); diff --git a/common/md5.h b/common/md5.h index 13dfd5f9e..af4182823 100644 --- a/common/md5.h +++ b/common/md5.h @@ -1,9 +1,9 @@ -#ifndef MD5_H -#define MD5_H -#include "../common/types.h" +#pragma once +#include "common/types.h" -class MD5 { +class MD5 +{ public: struct MD5Context { uint32 hash[4]; @@ -42,4 +42,3 @@ private: static void Transform(uint32 hash[4], const uint32 input[16]); char pMD5String[33]; }; -#endif diff --git a/common/memory/ksm.hpp b/common/memory/ksm.hpp index 079b83f1a..ad9c4de5a 100644 --- a/common/memory/ksm.hpp +++ b/common/memory/ksm.hpp @@ -1,7 +1,7 @@ -#ifndef EQEMU_KSM_HPP -#define EQEMU_KSM_HPP +#pragma once + +#include "common/eqemu_logsys.h" -#include "../eqemu_logsys.h" #include #include #include @@ -214,7 +214,4 @@ namespace KSM { MarkMemoryForKSM(start, size); #endif } - } - -#endif // EQEMU_KSM_HPP diff --git a/common/memory_buffer.h b/common/memory_buffer.h index a2e19d364..bd191d4a5 100644 --- a/common/memory_buffer.h +++ b/common/memory_buffer.h @@ -17,15 +17,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_MEMORY_BUFFER -#define COMMON_MEMORY_BUFFER +#pragma once -#include "types.h" +#include "common/types.h" -#include +#include #include #include -#include +#include namespace EQ @@ -130,5 +129,3 @@ namespace EQ }; } /*EQEmu*/ - -#endif /*COMMON_MEMORY_BUFFER*/ diff --git a/common/memory_mapped_file.cpp b/common/memory_mapped_file.cpp index a1a16d5db..ed77f5bf7 100644 --- a/common/memory_mapped_file.cpp +++ b/common/memory_mapped_file.cpp @@ -17,6 +17,11 @@ */ #include "memory_mapped_file.h" + +#include "common/eqemu_exception.h" + +#include + #ifdef _WINDOWS #include #else @@ -28,12 +33,10 @@ #include #include #endif -#include "eqemu_exception.h" #ifdef FREEBSD #include #endif -#include namespace fs = std::filesystem; namespace EQ { diff --git a/common/memory_mapped_file.h b/common/memory_mapped_file.h index d3e832cef..f228db90c 100644 --- a/common/memory_mapped_file.h +++ b/common/memory_mapped_file.h @@ -16,11 +16,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _EQEMU_MEMORYMAPPEDFILE_H_ -#define _EQEMU_MEMORYMAPPEDFILE_H_ +#pragma once + +#include "common/types.h" #include -#include "types.h" namespace EQ { @@ -82,5 +82,3 @@ namespace EQ { Implementation *imp_; //!< Underlying implementation. }; } // EQEmu - -#endif diff --git a/common/misc.cpp b/common/misc.cpp index 4c5103fa3..5927dbb41 100644 --- a/common/misc.cpp +++ b/common/misc.cpp @@ -1,25 +1,21 @@ -#ifdef _WINDOWS - // VS6 doesn't like the length of STL generated names: disabling - #pragma warning(disable:4786) -#endif -#include "global_define.h" -#include +#include "misc.h" + +#include "common/global_define.h" +#include "common/strings.h" +#include "common/types.h" + +#include "zlib.h" +#include +#include +#include #include #include -#include -#include -#include - +#include +#include #ifndef WIN32 #include #endif -#include -#include "misc.h" -#include "types.h" -#include -#include "strings.h" - std::map DBFieldNames; #ifndef WIN32 diff --git a/common/misc.h b/common/misc.h index bb1c3550d..da827ca37 100644 --- a/common/misc.h +++ b/common/misc.h @@ -1,9 +1,8 @@ -#ifndef _MISC_H +#pragma once -#define _MISC_H +#include #include #include -#include #define ITEMFIELDCOUNT 116 @@ -28,6 +27,3 @@ int EQsprintf(char *buffer, const char *pattern, const char *arg1, const char *a std::string generate_key(int length); void build_hex_line(const char *buffer, unsigned long length, unsigned long offset, char *out_buffer, unsigned char padding=4); void print_hex(const char *buffer, unsigned long length); - -#endif - diff --git a/common/misc_functions.cpp b/common/misc_functions.cpp index dfa034944..8e1007386 100644 --- a/common/misc_functions.cpp +++ b/common/misc_functions.cpp @@ -16,45 +16,41 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#include "../common/global_define.h" #include "misc_functions.h" + +#include "common/global_define.h" +#include "common/seperator.h" +#include "common/strings.h" +#include "common/timer.h" + +#include +#include #include #include -#include "strings.h" -#ifndef WIN32 +#ifdef _WINDOWS +#include +#include + +#define snprintf _snprintf +#define strncasecmp _strnicmp +#define strcasecmp _stricmp +#else #include #include -#endif -#include -#include -#ifdef _WINDOWS - #include -#endif -#include "../common/timer.h" -#include "../common/seperator.h" - -#ifdef _WINDOWS - #include - - #define snprintf _snprintf - #define strncasecmp _strnicmp - #define strcasecmp _stricmp -#else - #include - #include - #include - #include - #include +#include +#include +#include +#include +#include #ifdef FREEBSD //Timothy Whitman - January 7, 2003 - #include - #include +#include +#include #endif - #include - #include - #include - #include +#include +#include +#include +#include #endif void CoutTimestamp(bool ms) { diff --git a/common/misc_functions.h b/common/misc_functions.h index 62a6745c1..2590877ca 100644 --- a/common/misc_functions.h +++ b/common/misc_functions.h @@ -15,10 +15,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef MISCFUNCTIONS_H -#define MISCFUNCTIONS_H -#include "types.h" +#pragma once + +#include "common/types.h" + #include #include @@ -86,6 +87,3 @@ public: InitWinsock(); ~InitWinsock(); }; - -#endif - diff --git a/common/mutex.cpp b/common/mutex.cpp index 1dfacb5bb..9f2fe3889 100644 --- a/common/mutex.cpp +++ b/common/mutex.cpp @@ -15,14 +15,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/global_define.h" -#include "../common/mutex.h" + +#include "mutex.h" + +#include "common/global_define.h" #include #define DEBUG_MUTEX_CLASS 0 #if DEBUG_MUTEX_CLASS >= 1 - #endif #ifdef _WINDOWS diff --git a/common/mutex.h b/common/mutex.h index 48f58bcac..d6bbac916 100644 --- a/common/mutex.h +++ b/common/mutex.h @@ -15,16 +15,18 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef MYMUTEX_H -#define MYMUTEX_H + +#pragma once + +#include "common/types.h" + #ifdef _WINDOWS - #include - #include +#include +#include #else - #include - #include "../common/unix.h" +#include "common/unix.h" +#include #endif -#include "../common/types.h" class Mutex { public: @@ -78,6 +80,3 @@ private: int32 wl; // write locks in effect (should never be more than 1) Mutex MCounters; }; - -#endif - diff --git a/common/mysql_request_result.h b/common/mysql_request_result.h index cb2a4e719..1cd1d2aa3 100644 --- a/common/mysql_request_result.h +++ b/common/mysql_request_result.h @@ -1,21 +1,10 @@ -#ifndef MYSQL_REQUEST_RESULT_H -#define MYSQL_REQUEST_RESULT_H +#pragma once -#ifdef _WINDOWS - #include - #include -#endif +#include "common/mysql_request_row.h" +#include "common/types.h" +#include "mysql.h" #include -#include -#include "types.h" -#include "mysql_request_row.h" - -#ifdef __FreeBSD__ - #include - #include - #include -#endif class MySQLRequestResult { private: @@ -73,7 +62,3 @@ private: void FreeInternals(); void ZeroOut(); }; - - -#endif - diff --git a/common/mysql_request_row.h b/common/mysql_request_row.h index 5f160ac63..eb19d7ee8 100644 --- a/common/mysql_request_row.h +++ b/common/mysql_request_row.h @@ -1,14 +1,9 @@ -#ifndef MYSQL_REQUEST_ROW_H -#define MYSQL_REQUEST_ROW_H +#pragma once -#ifdef _WINDOWS - #include - #include -#endif +#include "common/types.h" -#include +#include "mysql.h" #include -#include "types.h" class MySQLRequestRow { @@ -36,9 +31,4 @@ public: bool operator!=(const MySQLRequestRow& rhs); MySQLRequestRow operator*(); char* operator[](int index); - }; - - - -#endif diff --git a/common/mysql_stmt.cpp b/common/mysql_stmt.cpp index 872df0086..dba8eca62 100644 --- a/common/mysql_stmt.cpp +++ b/common/mysql_stmt.cpp @@ -1,7 +1,9 @@ #include "mysql_stmt.h" -#include "eqemu_logsys.h" -#include "mutex.h" -#include "timer.h" + +#include "common/eqemu_logsys.h" +#include "common/mutex.h" +#include "common/timer.h" + #include namespace mysql diff --git a/common/mysql_stmt.h b/common/mysql_stmt.h index eb1483f17..2592f19f7 100644 --- a/common/mysql_stmt.h +++ b/common/mysql_stmt.h @@ -6,8 +6,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/common/net/console_server.cpp b/common/net/console_server.cpp index 4cc2b2126..a737c5a4d 100644 --- a/common/net/console_server.cpp +++ b/common/net/console_server.cpp @@ -1,7 +1,8 @@ #include "console_server.h" -#include "../strings.h" -#include -#include + +#include "common/strings.h" + +#include "fmt/format.h" EQ::Net::ConsoleServer::ConsoleServer(const std::string &addr, int port) { diff --git a/common/net/console_server.h b/common/net/console_server.h index d28f43844..e984c884f 100644 --- a/common/net/console_server.h +++ b/common/net/console_server.h @@ -1,6 +1,7 @@ #pragma once #include "console_server_connection.h" + #include #include diff --git a/common/net/console_server_connection.cpp b/common/net/console_server_connection.cpp index 47e321b80..88be73d96 100644 --- a/common/net/console_server_connection.cpp +++ b/common/net/console_server_connection.cpp @@ -1,11 +1,12 @@ -#include "console_server.h" -#include "../util/uuid.h" -#include "../net/packet.h" -#include "../eqemu_logsys.h" -#include "../servertalk.h" -#include "../rulesys.h" -#include -#include +#include "console_server_connection.h" + +#include "common/util/uuid.h" +#include "common/net/console_server.h" +#include "common/net/packet.h" +#include "common/servertalk.h" +#include "common/rulesys.h" + +#include "fmt/format.h" EQ::Net::ConsoleServerConnection::ConsoleServerConnection(ConsoleServer *parent, std::shared_ptr connection) { diff --git a/common/net/console_server_connection.h b/common/net/console_server_connection.h index a49700841..ba9f47ff5 100644 --- a/common/net/console_server_connection.h +++ b/common/net/console_server_connection.h @@ -1,8 +1,9 @@ #pragma once #include "tcp_server.h" -#include + #include +#include struct ServerChannelMessage_Struct; diff --git a/common/net/crc32.cpp b/common/net/crc32.cpp index 6f6f277ce..52ec128ff 100644 --- a/common/net/crc32.cpp +++ b/common/net/crc32.cpp @@ -1,5 +1,4 @@ #include "crc32.h" -#include unsigned int CRC32EncodeTable[256] = { diff --git a/common/net/crc32.h b/common/net/crc32.h index b10f05c76..c4ab85c8b 100644 --- a/common/net/crc32.h +++ b/common/net/crc32.h @@ -1,9 +1,7 @@ #pragma once -#include - namespace EQ { int Crc32(const void *data, int size); int Crc32(const void *data, int size, int key); -} \ No newline at end of file +} diff --git a/common/net/dns.h b/common/net/dns.h index d43f41566..c76285563 100644 --- a/common/net/dns.h +++ b/common/net/dns.h @@ -1,8 +1,9 @@ #pragma once -#include "../event/event_loop.h" -#include +#include "common/event/event_loop.h" + #include +#include namespace EQ { diff --git a/common/net/endian.h b/common/net/endian.h index 8eb3caf2a..a4d28da1b 100644 --- a/common/net/endian.h +++ b/common/net/endian.h @@ -1,7 +1,7 @@ #pragma once -#include #include +#include #include namespace EQ diff --git a/common/net/eqstream.cpp b/common/net/eqstream.cpp index 633dea4c9..dfed5609b 100644 --- a/common/net/eqstream.cpp +++ b/common/net/eqstream.cpp @@ -1,5 +1,6 @@ #include "eqstream.h" -#include "../eqemu_logsys.h" + +#include "common/eqemu_logsys.h" EQ::Net::EQStreamManager::EQStreamManager(const EQStreamManagerInterfaceOptions &options) : EQStreamManagerInterface(options), m_reliable_stream(options.reliable_stream_options) { diff --git a/common/net/eqstream.h b/common/net/eqstream.h index 4a8e6ddd9..1f78523c7 100644 --- a/common/net/eqstream.h +++ b/common/net/eqstream.h @@ -1,12 +1,13 @@ #pragma once -#include "../eq_packet.h" -#include "../eq_stream_intf.h" -#include "../opcodemgr.h" -#include "reliable_stream_connection.h" -#include +#include "common/eq_packet.h" +#include "common/eq_stream_intf.h" +#include "common/net/reliable_stream_connection.h" +#include "common/opcodemgr.h" + #include #include +#include namespace EQ { diff --git a/common/net/packet.cpp b/common/net/packet.cpp index a4ec4b498..61e3749ae 100644 --- a/common/net/packet.cpp +++ b/common/net/packet.cpp @@ -1,8 +1,9 @@ #include "packet.h" -#include "endian.h" + +#include "common/net/endian.h" + +#include "fmt/format.h" #include -#include -#include void EQ::Net::Packet::PutInt8(size_t offset, int8_t value) { diff --git a/common/net/packet.h b/common/net/packet.h index 4ff5f8510..e84693407 100644 --- a/common/net/packet.h +++ b/common/net/packet.h @@ -1,12 +1,14 @@ #pragma once +#include "common/util/memory_stream.h" + +#include "cereal/archives/binary.hpp" +#include "cereal/cereal.hpp" + #include -#include -#include #include -#include "../util/memory_stream.h" -#include -#include +#include +#include namespace EQ { namespace Net { diff --git a/common/net/reliable_stream_connection.cpp b/common/net/reliable_stream_connection.cpp index c75bfe77a..0c93a7245 100644 --- a/common/net/reliable_stream_connection.cpp +++ b/common/net/reliable_stream_connection.cpp @@ -1,10 +1,11 @@ #include "reliable_stream_connection.h" -#include "../event/event_loop.h" -#include "../data_verification.h" -#include "crc32.h" -#include -#include -#include + +#include "common/event/event_loop.h" +#include "common/data_verification.h" +#include "common/net/crc32.h" + +#include "zlib.h" +#include "fmt/format.h" // observed client receive window is 300 packets, 140KB constexpr size_t MAX_CLIENT_RECV_PACKETS_PER_WINDOW = 300; diff --git a/common/net/reliable_stream_connection.h b/common/net/reliable_stream_connection.h index 97e1982c7..e3f4f16d2 100644 --- a/common/net/reliable_stream_connection.h +++ b/common/net/reliable_stream_connection.h @@ -1,16 +1,18 @@ #pragma once -#include "../random.h" -#include "packet.h" -#include "reliable_stream_structs.h" -#include "reliable_stream_pooling.h" -#include +#include "common/random.h" +#include "common/net/packet.h" +#include "common/net/reliable_stream_structs.h" +#include "common/net/reliable_stream_pooling.h" + +#include "uv.h" + #include #include -#include -#include -#include #include +#include +#include +#include namespace EQ { diff --git a/common/net/reliable_stream_pooling.h b/common/net/reliable_stream_pooling.h index e374ecdc7..37b1655f6 100644 --- a/common/net/reliable_stream_pooling.h +++ b/common/net/reliable_stream_pooling.h @@ -1,14 +1,15 @@ #pragma once -#include +#include "common/eqemu_logsys.h" + +#include "uv.h" + +#include #include #include -#include -#include #include -#include -#include "../eqemu_logsys.h" -#include +#include +#include constexpr size_t UDP_BUFFER_SIZE = 512; diff --git a/common/net/reliable_stream_structs.h b/common/net/reliable_stream_structs.h index f48e1f9c3..1c8904947 100644 --- a/common/net/reliable_stream_structs.h +++ b/common/net/reliable_stream_structs.h @@ -1,8 +1,9 @@ #pragma once -#include +#include "common/net/endian.h" + +#include "cereal/cereal.hpp" #include -#include "endian.h" namespace EQ { diff --git a/common/net/servertalk_client_connection.cpp b/common/net/servertalk_client_connection.cpp index 524c9d496..5f6e8b179 100644 --- a/common/net/servertalk_client_connection.cpp +++ b/common/net/servertalk_client_connection.cpp @@ -1,6 +1,7 @@ #include "servertalk_client_connection.h" -#include "dns.h" -#include "../eqemu_logsys.h" + +#include "common/eqemu_logsys.h" +#include "common/net/dns.h" EQ::Net::ServertalkClient::ServertalkClient(const std::string &addr, int port, bool ipv6, const std::string &identifier, const std::string &credentials) : m_timer(std::make_unique(100, true, std::bind(&EQ::Net::ServertalkClient::Connect, this))) diff --git a/common/net/servertalk_client_connection.h b/common/net/servertalk_client_connection.h index 5a1e3db32..988797884 100644 --- a/common/net/servertalk_client_connection.h +++ b/common/net/servertalk_client_connection.h @@ -1,9 +1,9 @@ #pragma once -#include "tcp_connection.h" -#include "../event/timer.h" -#include "servertalk_common.h" -#include "packet.h" +#include "common/event/timer.h" +#include "common/net/packet.h" +#include "common/net/servertalk_common.h" +#include "common/net/tcp_connection.h" namespace EQ { diff --git a/common/net/servertalk_common.h b/common/net/servertalk_common.h index aa779b5ed..91d1d6914 100644 --- a/common/net/servertalk_common.h +++ b/common/net/servertalk_common.h @@ -1,6 +1,6 @@ #pragma once -#include "../servertalk.h" +#include "common/servertalk.h" namespace EQ { diff --git a/common/net/servertalk_legacy_client_connection.cpp b/common/net/servertalk_legacy_client_connection.cpp index deba4a464..d745b7c58 100644 --- a/common/net/servertalk_legacy_client_connection.cpp +++ b/common/net/servertalk_legacy_client_connection.cpp @@ -1,6 +1,7 @@ #include "servertalk_legacy_client_connection.h" -#include "dns.h" -#include "../eqemu_logsys.h" + +#include "common/net/dns.h" +#include "common/eqemu_logsys.h" EQ::Net::ServertalkLegacyClient::ServertalkLegacyClient(const std::string &addr, int port, bool ipv6) : m_timer(std::make_unique(100, true, std::bind(&EQ::Net::ServertalkLegacyClient::Connect, this))) diff --git a/common/net/servertalk_legacy_client_connection.h b/common/net/servertalk_legacy_client_connection.h index f773de12b..9fa75b10a 100644 --- a/common/net/servertalk_legacy_client_connection.h +++ b/common/net/servertalk_legacy_client_connection.h @@ -1,9 +1,9 @@ #pragma once -#include "tcp_connection.h" -#include "../event/timer.h" -#include "servertalk_common.h" -#include "packet.h" +#include "common/event/timer.h" +#include "common/net/tcp_connection.h" +#include "common/net/packet.h" +#include "common/net/servertalk_common.h" namespace EQ { diff --git a/common/net/servertalk_server.h b/common/net/servertalk_server.h index f58243e98..863772830 100644 --- a/common/net/servertalk_server.h +++ b/common/net/servertalk_server.h @@ -1,9 +1,10 @@ #pragma once -#include "tcp_server.h" -#include "servertalk_server_connection.h" -#include +#include "common/net/servertalk_server_connection.h" +#include "common/net/tcp_server.h" + #include +#include namespace EQ { diff --git a/common/net/servertalk_server_connection.cpp b/common/net/servertalk_server_connection.cpp index efc2d572e..a429ddb69 100644 --- a/common/net/servertalk_server_connection.cpp +++ b/common/net/servertalk_server_connection.cpp @@ -1,7 +1,8 @@ #include "servertalk_server_connection.h" -#include "servertalk_server.h" -#include "../eqemu_logsys.h" -#include "../util/uuid.h" + +#include "common/eqemu_logsys.h" +#include "common/net/servertalk_server.h" +#include "common/util/uuid.h" EQ::Net::ServertalkServerConnection::ServertalkServerConnection(std::shared_ptr c, EQ::Net::ServertalkServer *parent) { diff --git a/common/net/servertalk_server_connection.h b/common/net/servertalk_server_connection.h index 8e262baa1..17686c204 100644 --- a/common/net/servertalk_server_connection.h +++ b/common/net/servertalk_server_connection.h @@ -1,8 +1,9 @@ #pragma once -#include "tcp_connection.h" -#include "servertalk_common.h" -#include "packet.h" +#include "common/net/packet.h" +#include "common/net/servertalk_common.h" +#include "common/net/tcp_connection.h" + #include namespace EQ diff --git a/common/net/tcp_connection.cpp b/common/net/tcp_connection.cpp index f277e95e8..f57a1838c 100644 --- a/common/net/tcp_connection.cpp +++ b/common/net/tcp_connection.cpp @@ -1,5 +1,7 @@ #include "tcp_connection.h" -#include "../event/event_loop.h" + +#include "common/event/event_loop.h" + #include WriteReqPool tcp_write_pool; diff --git a/common/net/tcp_connection.h b/common/net/tcp_connection.h index d64695dd2..f8fe21142 100644 --- a/common/net/tcp_connection.h +++ b/common/net/tcp_connection.h @@ -1,10 +1,11 @@ #pragma once -#include "tcp_connection_pooling.h" +#include "common/net/tcp_connection_pooling.h" + +#include "uv.h" #include -#include #include -#include +#include namespace EQ { diff --git a/common/net/tcp_connection_pooling.h b/common/net/tcp_connection_pooling.h index 44f0abe92..4166b5ed6 100644 --- a/common/net/tcp_connection_pooling.h +++ b/common/net/tcp_connection_pooling.h @@ -1,14 +1,15 @@ #pragma once -#include "../eqemu_logsys.h" -#include +#include "common/eqemu_logsys.h" + +#include "uv.h" #include #include -#include -#include -#include -#include #include +#include +#include +#include +#include namespace EQ { namespace Net { class TCPConnection; } } diff --git a/common/net/tcp_server.cpp b/common/net/tcp_server.cpp index 777c92be5..40761e540 100644 --- a/common/net/tcp_server.cpp +++ b/common/net/tcp_server.cpp @@ -1,5 +1,6 @@ #include "tcp_server.h" -#include "../event/event_loop.h" + +#include "common/event/event_loop.h" void on_close_tcp_server_handle(uv_handle_t* handle) { delete (uv_tcp_t *)handle; diff --git a/common/net/tcp_server.h b/common/net/tcp_server.h index 6f8280d3c..9350b66a6 100644 --- a/common/net/tcp_server.h +++ b/common/net/tcp_server.h @@ -1,6 +1,6 @@ #pragma once -#include "tcp_connection.h" +#include "common/net/tcp_connection.h" namespace EQ { @@ -22,4 +22,4 @@ namespace EQ uv_tcp_t *m_socket; }; } -} \ No newline at end of file +} diff --git a/common/net/websocket_server.cpp b/common/net/websocket_server.cpp index 1e8b80b64..dcbab2f04 100644 --- a/common/net/websocket_server.cpp +++ b/common/net/websocket_server.cpp @@ -1,12 +1,13 @@ #include "websocket_server.h" -#include "../event/event_loop.h" -#include "../event/timer.h" -#include -#include + +#include "common/emu_constants.h" +#include "common/event/event_loop.h" +#include "common/event/timer.h" + +#include "fmt/format.h" +#include #include #include -#include -#include "../emu_constants.h" struct MethodHandlerEntry { diff --git a/common/net/websocket_server.h b/common/net/websocket_server.h index 4d5df580b..37e057431 100644 --- a/common/net/websocket_server.h +++ b/common/net/websocket_server.h @@ -1,11 +1,11 @@ #pragma once -#include "websocket_server_connection.h" +#include "common/json/json.h" +#include "common/net/websocket_server_connection.h" -#include "../json/json.h" -#include -#include #include +#include +#include namespace EQ { diff --git a/common/net/websocket_server_connection.cpp b/common/net/websocket_server_connection.cpp index 36e85eb74..0fc913d2e 100644 --- a/common/net/websocket_server_connection.cpp +++ b/common/net/websocket_server_connection.cpp @@ -1,10 +1,11 @@ #include "websocket_server_connection.h" -#include "websocket_server.h" -#include "../timer.h" -#include "../util/uuid.h" + +#include "common/net/websocket_server.h" +#include "common/timer.h" +#include "common/util/uuid.h" + +#include "fmt/format.h" #include -#include -#include struct EQ::Net::WebsocketServerConnection::Impl { WebsocketServer *parent; diff --git a/common/net/websocket_server_connection.h b/common/net/websocket_server_connection.h index 5ea8b4029..9d7588261 100644 --- a/common/net/websocket_server_connection.h +++ b/common/net/websocket_server_connection.h @@ -1,10 +1,11 @@ #pragma once -#include "tcp_server.h" -#include "../types.h" -#include "../json/json-forwards.h" -#include -#include +#include "common/json/json-forwards.h" +#include "common/net/tcp_server.h" +#include "common/types.h" + +#include "websocketpp/config/core.hpp" +#include "websocketpp/server.hpp" namespace EQ { diff --git a/common/op_codes.h b/common/op_codes.h index 4142c61f3..b9554aa73 100644 --- a/common/op_codes.h +++ b/common/op_codes.h @@ -1,6 +1,5 @@ -#ifndef _OP_CODES_H +#pragma once -#define _OP_CODES_H static const char OP_SessionRequest = 0x01; static const char OP_SessionResponse = 0x02; @@ -15,5 +14,3 @@ static const char OP_OutOfOrderAck = 0x11; static const char OP_Ack = 0x15; static const char OP_AppCombined = 0x19; static const char OP_OutOfSession = 0x1d; - -#endif diff --git a/common/opcode_map.cpp b/common/opcode_map.cpp index c0556cf2a..8d1aae5b7 100644 --- a/common/opcode_map.cpp +++ b/common/opcode_map.cpp @@ -1,4 +1,5 @@ -#include "global_define.h" +#include "common/global_define.h" + #include #include diff --git a/common/opcodemgr.cpp b/common/opcodemgr.cpp index 70bcff702..771fb439c 100644 --- a/common/opcodemgr.cpp +++ b/common/opcodemgr.cpp @@ -16,10 +16,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "eqemu_logsys.h" -#include "emu_opcodes.h" #include "opcodemgr.h" +#include "common/emu_opcodes.h" +#include "common/eqemu_logsys.h" + #include #include #include diff --git a/common/opcodemgr.h b/common/opcodemgr.h index 138fadd97..8846ed619 100644 --- a/common/opcodemgr.h +++ b/common/opcodemgr.h @@ -16,12 +16,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef OPCODE_MANAGER_H -#define OPCODE_MANAGER_H +#pragma once -#include "types.h" -#include "mutex.h" -#include "emu_opcodes.h" +#include "common/emu_opcodes.h" +#include "common/mutex.h" +#include "common/types.h" #include @@ -158,6 +157,3 @@ protected: std::map emu_to_eq; std::map eq_to_emu; }; - -#endif - diff --git a/common/packet_dump.cpp b/common/packet_dump.cpp index a4ecba781..33c719605 100644 --- a/common/packet_dump.cpp +++ b/common/packet_dump.cpp @@ -16,14 +16,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "packet_dump.h" + +#include "common/servertalk.h" + #include #include #include #include -#include "packet_dump.h" -#include "../common/servertalk.h" - void DumpPacketAscii(const uchar* buf, uint32 size, uint32 cols, uint32 skip) { // Output as ASCII for(uint32 i=skip; i #include diff --git a/common/packet_dump_file.h b/common/packet_dump_file.h index aa50b0420..c3f3dcc17 100644 --- a/common/packet_dump_file.h +++ b/common/packet_dump_file.h @@ -15,13 +15,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef PACKET_DUMP_FILE_H -#define PACKET_DUMP_FILE_H + +#pragma once + +#include "common/types.h" #include -#include "../common/types.h" - class EQApplicationPacket; void FileDumpPacketAscii(const char* filename, const uchar* buf, uint32 size, uint32 cols=16, uint32 skip=0); @@ -32,5 +32,3 @@ void FileDumpPacket(const char* filename, const uchar* buf, uint32 size); void FileDumpPacket(const char* filename, const EQApplicationPacket* app); void FilePrintLine(const char* filename, bool prefix_timestamp = false, const char* text = 0, ...); void FilePrint(const char* filename, bool newline = true, bool prefix_timestamp = false, const char* text = 0, ...); -#endif - diff --git a/common/packet_functions.cpp b/common/packet_functions.cpp index dbd10f14f..a882107f2 100644 --- a/common/packet_functions.cpp +++ b/common/packet_functions.cpp @@ -15,16 +15,18 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/global_define.h" -#include -#include -#include -#include -#include "packet_dump.h" + #include "packet_functions.h" +#include "common/global_define.h" +#include "common/packet_dump.h" + +#include "zlib.h" +#include +#include +#include #ifndef WIN32 - #include +#include #endif void EncryptProfilePacket(EQApplicationPacket* app) { diff --git a/common/packet_functions.h b/common/packet_functions.h index 3746c7c79..8c400534d 100644 --- a/common/packet_functions.h +++ b/common/packet_functions.h @@ -15,9 +15,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef PACKET_FUNCTIONS_H -#define PACKET_FUNCTIONS_H -#include "types.h" + +#pragma once + +#include "common/types.h" class EQApplicationPacket; @@ -39,5 +40,3 @@ void EncryptZoneSpawnPacket(uchar* pBuffer, uint32 size); int DeflatePacket(const unsigned char* in_data, int in_length, unsigned char* out_data, int max_out_length); uint32 InflatePacket(const uchar* indata, uint32 indatalen, uchar* outdata, uint32 outdatalen, bool iQuiet = false); uint32 GenerateCRC(uint32 b, uint32 bufsize, uchar *buf); - -#endif diff --git a/common/packetfile.cpp b/common/packetfile.cpp index 5885382ff..eea6ef374 100644 --- a/common/packetfile.cpp +++ b/common/packetfile.cpp @@ -1,16 +1,12 @@ -#ifndef WIN32 -#include -#else -#include -#endif +#include "packetfile.h" + +#include "common/eq_opcodes.h" +#include "common/eq_packet_structs.h" +#include "common/misc.h" #include #include #include -#include "packetfile.h" -#include "../common/eq_opcodes.h" -#include "../common/eq_packet_structs.h" -#include "../common/misc.h" #include PacketFileWriter::PacketFileWriter(bool _force_flush) { diff --git a/common/packetfile.h b/common/packetfile.h index bacbbc2b4..953ad7380 100644 --- a/common/packetfile.h +++ b/common/packetfile.h @@ -1,10 +1,9 @@ -#ifndef PACKET_FILE_H -#define PACKET_FILE_H +#pragma once + +#include "common/types.h" -#include "../common/types.h" #include #include -//#include //constants used in the packet file header #define PACKET_FILE_MAGIC 0x93a7b6f6 diff --git a/common/patches/patches.cpp b/common/patches/patches.cpp index 775e4e3dc..615849972 100644 --- a/common/patches/patches.cpp +++ b/common/patches/patches.cpp @@ -17,15 +17,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../global_define.h" #include "patches.h" -#include "titanium.h" -#include "uf.h" -#include "sof.h" -#include "sod.h" -#include "rof.h" -#include "rof2.h" +#include "common/global_define.h" +#include "common/patches/rof.h" +#include "common/patches/rof2.h" +#include "common/patches/sod.h" +#include "common/patches/sof.h" +#include "common/patches/titanium.h" +#include "common/patches/uf.h" void RegisterAllPatches(EQStreamIdentifier &into) diff --git a/common/patches/patches.h b/common/patches/patches.h index 38fd549be..d5a5661b5 100644 --- a/common/patches/patches.h +++ b/common/patches/patches.h @@ -17,8 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_PATCHES_H -#define COMMON_PATCHES_H +#pragma once /*enum { @@ -31,5 +30,3 @@ class EQStreamIdentifier; void RegisterAllPatches(EQStreamIdentifier &into); void ReloadAllPatches(); - -#endif /*COMMON_PATCHES_H*/ diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 15b745b16..0e6f48861 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -17,24 +17,23 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../global_define.h" -#include "../eqemu_config.h" -#include "../eqemu_logsys.h" #include "rof.h" -#include "../opcodemgr.h" - -#include "../eq_stream_ident.h" -#include "../crc32.h" - -#include "../eq_packet_structs.h" -#include "../misc_functions.h" -#include "../strings.h" -#include "../inventory_profile.h" #include "rof_structs.h" -#include "../rulesys.h" -#include "../path_manager.h" -#include "../races.h" -#include "../raid.h" + +#include "common/crc32.h" +#include "common/eq_packet_structs.h" +#include "common/eq_stream_ident.h" +#include "common/eqemu_config.h" +#include "common/eqemu_logsys.h" +#include "common/global_define.h" +#include "common/inventory_profile.h" +#include "common/misc_functions.h" +#include "common/opcodemgr.h" +#include "common/path_manager.h" +#include "common/races.h" +#include "common/raid.h" +#include "common/rulesys.h" +#include "common/strings.h" #include #include diff --git a/common/patches/rof.h b/common/patches/rof.h index 21a525192..a2d6f8fda 100644 --- a/common/patches/rof.h +++ b/common/patches/rof.h @@ -17,10 +17,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_ROF_H -#define COMMON_ROF_H +#pragma once -#include "../struct_strategy.h" +#include "common/struct_strategy.h" class EQStreamIdentifier; @@ -50,6 +49,4 @@ namespace RoF #include "rof_ops.h" }; -}; /*RoF*/ - -#endif /*COMMON_ROF_H*/ +} /*RoF*/ diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index b250a5de6..ecefc4632 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -17,31 +17,30 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../global_define.h" -#include "../eqemu_config.h" -#include "../eqemu_logsys.h" #include "rof2.h" -#include "../opcodemgr.h" - -#include "../eq_stream_ident.h" -#include "../crc32.h" - -#include "../eq_packet_structs.h" -#include "../misc_functions.h" -#include "../strings.h" -#include "../inventory_profile.h" #include "rof2_structs.h" -#include "../rulesys.h" -#include "../path_manager.h" -#include "../classes.h" -#include "../races.h" -#include "../raid.h" -#include -#include -#include +#include "common/classes.h" +#include "common/crc32.h" +#include "common/eq_packet_structs.h" +#include "common/eq_stream_ident.h" +#include "common/eqemu_config.h" +#include "common/eqemu_logsys.h" +#include "common/global_define.h" +#include "common/inventory_profile.h" +#include "common/misc_functions.h" +#include "common/opcodemgr.h" +#include "common/path_manager.h" +#include "common/races.h" +#include "common/raid.h" +#include "common/rulesys.h" +#include "common/strings.h" + #include #include +#include +#include +#include namespace RoF2 diff --git a/common/patches/rof2.h b/common/patches/rof2.h index f5f00db47..7775fff00 100644 --- a/common/patches/rof2.h +++ b/common/patches/rof2.h @@ -17,10 +17,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_ROF2_H -#define COMMON_ROF2_H +#pragma once -#include "../struct_strategy.h" +#include "common/struct_strategy.h" class EQStreamIdentifier; @@ -51,5 +50,3 @@ namespace RoF2 }; }; /*RoF2*/ - -#endif /*COMMON_ROF2_H*/ diff --git a/common/patches/rof2_limits.cpp b/common/patches/rof2_limits.cpp index 6df113f51..4cd5a6944 100644 --- a/common/patches/rof2_limits.cpp +++ b/common/patches/rof2_limits.cpp @@ -19,7 +19,7 @@ #include "rof2_limits.h" -#include "../strings.h" +#include "common/strings.h" int16 RoF2::invtype::GetInvTypeSize(int16 inv_type) diff --git a/common/patches/rof2_limits.h b/common/patches/rof2_limits.h index 668b0df74..fbf4fc677 100644 --- a/common/patches/rof2_limits.h +++ b/common/patches/rof2_limits.h @@ -17,12 +17,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_ROF2_LIMITS_H -#define COMMON_ROF2_LIMITS_H +#pragma once -#include "../types.h" -#include "../emu_versions.h" -#include "../skills.h" +#include "common/emu_versions.h" +#include "common/skills.h" +#include "common/types.h" namespace RoF2 @@ -360,6 +359,4 @@ namespace RoF2 } /*spells*/ -}; /*RoF2*/ - -#endif /*COMMON_ROF2_LIMITS_H*/ +} /*RoF2*/ diff --git a/common/patches/rof2_structs.h b/common/patches/rof2_structs.h index b6ad6bbf1..84c026d5d 100644 --- a/common/patches/rof2_structs.h +++ b/common/patches/rof2_structs.h @@ -17,18 +17,24 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_ROF2_STRUCTS_H -#define COMMON_ROF2_STRUCTS_H +#pragma once + +#include "common/eq_packet_structs.h" +#include "common/patches/rof2_limits.h" +#include "common/strings.h" +#include "common/textures.h" +#include "common/types.h" + +#include "fmt/format.h" -namespace RoF2 -{ - namespace structs { +namespace RoF2 { namespace structs { /* ** Compiler override to ensure ** byte aligned structures */ +#pragma pack(push) #pragma pack(1) struct LoginInfo_Struct { @@ -5426,7 +5432,8 @@ struct Parcel_Struct /*216*/ uint32 unknown_216; /*220*/ uint32 unknown_220; }; - }; /*structs*/ + +} /*structs*/ struct EvolveItemToggle_Struct { uint32 action; @@ -5454,6 +5461,6 @@ struct EvolveXPWindowSendDetails_Struct { /*030*/ char serialize_data[]; }; -}; /*RoF2*/ +#pragma pack(pop) -#endif /*COMMON_ROF2_STRUCTS_H*/ +} /*RoF2*/ diff --git a/common/patches/rof_limits.cpp b/common/patches/rof_limits.cpp index beb2bdbbc..0011c9dce 100644 --- a/common/patches/rof_limits.cpp +++ b/common/patches/rof_limits.cpp @@ -19,7 +19,7 @@ #include "rof_limits.h" -#include "../strings.h" +#include "common/strings.h" int16 RoF::invtype::GetInvTypeSize(int16 inv_type) diff --git a/common/patches/rof_limits.h b/common/patches/rof_limits.h index 4df54d1c2..e8f4637f8 100644 --- a/common/patches/rof_limits.h +++ b/common/patches/rof_limits.h @@ -17,12 +17,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_ROF_LIMITS_H -#define COMMON_ROF_LIMITS_H +#pragma once -#include "../types.h" -#include "../emu_versions.h" -#include "../skills.h" +#include "common/emu_versions.h" +#include "common/skills.h" +#include "common/types.h" namespace RoF @@ -314,6 +313,4 @@ namespace RoF } /*spells*/ -}; /*RoF*/ - -#endif /*COMMON_ROF_LIMITS_H*/ +} /*RoF*/ diff --git a/common/patches/rof_structs.h b/common/patches/rof_structs.h index d065a2b04..ec00432e2 100644 --- a/common/patches/rof_structs.h +++ b/common/patches/rof_structs.h @@ -17,18 +17,19 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_ROF_STRUCTS_H -#define COMMON_ROF_STRUCTS_H +#pragma once +#include "common/patches/rof_limits.h" +#include "common/textures.h" +#include "common/types.h" -namespace RoF -{ - namespace structs { +namespace RoF { namespace structs { /* ** Compiler override to ensure ** byte aligned structures */ +#pragma pack(push) #pragma pack(1) struct LoginInfo_Struct { @@ -5139,8 +5140,7 @@ struct SayLinkBodyFrame_Struct { /*055*/ }; - }; /*structs*/ +#pragma pack(pop) -}; /*RoF*/ - -#endif /*COMMON_ROF_STRUCTS_H*/ +} /*structs*/ +} /*RoF*/ diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 72a3a3c48..01bf5f8cf 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -17,24 +17,23 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../global_define.h" -#include "../eqemu_config.h" -#include "../eqemu_logsys.h" #include "sod.h" -#include "../opcodemgr.h" - -#include "../eq_stream_ident.h" -#include "../crc32.h" - -#include "../eq_packet_structs.h" -#include "../misc_functions.h" -#include "../strings.h" -#include "../item_instance.h" #include "sod_structs.h" -#include "../rulesys.h" -#include "../path_manager.h" -#include "../races.h" -#include "../raid.h" + +#include "common/crc32.h" +#include "common/eq_packet_structs.h" +#include "common/eq_stream_ident.h" +#include "common/eqemu_config.h" +#include "common/eqemu_logsys.h" +#include "common/global_define.h" +#include "common/item_instance.h" +#include "common/misc_functions.h" +#include "common/opcodemgr.h" +#include "common/path_manager.h" +#include "common/races.h" +#include "common/raid.h" +#include "common/rulesys.h" +#include "common/strings.h" #include #include diff --git a/common/patches/sod.h b/common/patches/sod.h index 1a0188f6e..d8e2cd882 100644 --- a/common/patches/sod.h +++ b/common/patches/sod.h @@ -17,10 +17,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_SOD_H -#define COMMON_SOD_H +#pragma once -#include "../struct_strategy.h" +#include "common/struct_strategy.h" class EQStreamIdentifier; @@ -50,6 +49,4 @@ namespace SoD #include "sod_ops.h" }; -}; /*SoD*/ - -#endif /*COMMON_SOD_H*/ +} /*SoD*/ diff --git a/common/patches/sod_limits.cpp b/common/patches/sod_limits.cpp index 87acff88a..9141e08e2 100644 --- a/common/patches/sod_limits.cpp +++ b/common/patches/sod_limits.cpp @@ -19,7 +19,7 @@ #include "sod_limits.h" -#include "../strings.h" +#include "common/strings.h" int16 SoD::invtype::GetInvTypeSize(int16 inv_type) diff --git a/common/patches/sod_limits.h b/common/patches/sod_limits.h index 46d8293fe..bcf566bda 100644 --- a/common/patches/sod_limits.h +++ b/common/patches/sod_limits.h @@ -17,12 +17,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_SOD_LIMITS_H -#define COMMON_SOD_LIMITS_H +#pragma once -#include "../types.h" -#include "../emu_versions.h" -#include "../skills.h" +#include "common/emu_versions.h" +#include "common/skills.h" +#include "common/types.h" namespace SoD @@ -339,6 +338,4 @@ namespace SoD } /*spells*/ -}; /*SoD*/ - -#endif /*COMMON_SOD_LIMITS_H*/ +} /*SoD*/ diff --git a/common/patches/sod_structs.h b/common/patches/sod_structs.h index 03648c116..5519e5b7d 100644 --- a/common/patches/sod_structs.h +++ b/common/patches/sod_structs.h @@ -17,13 +17,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_SOD_STRUCTS_H -#define COMMON_SOD_STRUCTS_H +#pragma once +#include "common/eq_packet_structs.h" +#include "common/patches/sod_limits.h" +#include "common/textures.h" +#include "common/types.h" -namespace SoD -{ - namespace structs { +namespace SoD { namespace structs { static const uint32 BUFF_COUNT = 25; @@ -32,6 +33,7 @@ static const uint32 BUFF_COUNT = 25; ** Compiler override to ensure ** byte aligned structures */ +#pragma pack(push) #pragma pack(1) struct LoginInfo_Struct { @@ -4528,8 +4530,7 @@ struct SayLinkBodyFrame_Struct { /*050*/ }; - }; /*structs*/ +#pragma pack(pop) -}; /*SoD*/ - -#endif /*COMMON_SOD_STRUCTS_H*/ +} /*structs*/ +} /*SoD*/ diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 444b33b35..1ae60f054 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -17,23 +17,22 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../global_define.h" -#include "../eqemu_config.h" -#include "../eqemu_logsys.h" #include "sof.h" -#include "../opcodemgr.h" - -#include "../eq_stream_ident.h" -#include "../crc32.h" - -#include "../eq_packet_structs.h" -#include "../misc_functions.h" -#include "../strings.h" -#include "../item_instance.h" #include "sof_structs.h" -#include "../rulesys.h" -#include "../path_manager.h" -#include "../raid.h" + +#include "common/crc32.h" +#include "common/eq_packet_structs.h" +#include "common/eq_stream_ident.h" +#include "common/eqemu_config.h" +#include "common/eqemu_logsys.h" +#include "common/global_define.h" +#include "common/item_instance.h" +#include "common/misc_functions.h" +#include "common/opcodemgr.h" +#include "common/path_manager.h" +#include "common/raid.h" +#include "common/rulesys.h" +#include "common/strings.h" #include #include diff --git a/common/patches/sof.h b/common/patches/sof.h index 47a6433ac..e240d7c61 100644 --- a/common/patches/sof.h +++ b/common/patches/sof.h @@ -17,10 +17,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_SOF_H -#define COMMON_SOF_H +#pragma once -#include "../struct_strategy.h" +#include "common/struct_strategy.h" class EQStreamIdentifier; @@ -50,6 +49,4 @@ namespace SoF #include "sof_ops.h" }; -}; /*SoF*/ - -#endif /*COMMON_SOF_H*/ +} /*SoF*/ diff --git a/common/patches/sof_limits.cpp b/common/patches/sof_limits.cpp index a646991da..8af38cc49 100644 --- a/common/patches/sof_limits.cpp +++ b/common/patches/sof_limits.cpp @@ -19,7 +19,7 @@ #include "sof_limits.h" -#include "../strings.h" +#include "common/strings.h" int16 SoF::invtype::GetInvTypeSize(int16 inv_type) diff --git a/common/patches/sof_limits.h b/common/patches/sof_limits.h index 063644e18..16aab91bc 100644 --- a/common/patches/sof_limits.h +++ b/common/patches/sof_limits.h @@ -17,12 +17,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_SOF_LIMITS_H -#define COMMON_SOF_LIMITS_H +#pragma once -#include "../types.h" -#include "../emu_versions.h" -#include "../skills.h" +#include "common/emu_versions.h" +#include "common/skills.h" +#include "common/types.h" namespace SoF @@ -344,6 +343,4 @@ namespace SoF } /*spells*/ -}; /*SoF*/ - -#endif /*COMMON_SOF_LIMITS_H*/ +} /*SoF*/ diff --git a/common/patches/sof_structs.h b/common/patches/sof_structs.h index 918f8e32a..8224910e3 100644 --- a/common/patches/sof_structs.h +++ b/common/patches/sof_structs.h @@ -17,13 +17,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_SOF_STRUCTS_H -#define COMMON_SOF_STRUCTS_H +#pragma once +#include "common/eq_packet_structs.h" +#include "common/patches/sof_limits.h" +#include "common/textures.h" +#include "common/types.h" -namespace SoF -{ - namespace structs { +namespace SoF { namespace structs { static const uint32 BUFF_COUNT = 25; @@ -32,6 +33,7 @@ static const uint32 BUFF_COUNT = 25; ** Compiler override to ensure ** byte aligned structures */ +#pragma pack(push) #pragma pack(1) struct LoginInfo_Struct { @@ -4298,8 +4300,7 @@ struct SayLinkBodyFrame_Struct { /*050*/ }; - }; /*structs*/ +#pragma pack(pop) -}; /*SoF*/ - -#endif /*COMMON_SOF_STRUCTS_H*/ +} /*structs*/ +} /*SoF*/ diff --git a/common/patches/template.cpp b/common/patches/template.cpp index 5e075ea8a..14fe92145 100644 --- a/common/patches/template.cpp +++ b/common/patches/template.cpp @@ -1,12 +1,12 @@ #include "TEMPLATE.h" -#include "../opcodemgr.h" -#include "../logsys.h" -#include "../eq_stream_ident.h" - -#include "../eq_packet_structs.h" #include "TEMPLATE_structs.h" +#include "common/eq_packet_structs.h" +#include "common/eq_stream_ident.h" +#include "common/logsys.h" +#include "common/opcodemgr.h" + namespace TEMPLATE { static const char *name = "CHANGEME"; @@ -146,30 +146,4 @@ DECODE(OP_SetServerFilter) { FINISH_DIRECT_DECODE(); } - - - - - - - - - - - - - - - - - - - - -} //end namespace TEMPLATE - - - - - - +} // namespace TEMPLATE diff --git a/common/patches/template.h b/common/patches/template.h index f264cf3fd..990a474fa 100644 --- a/common/patches/template.h +++ b/common/patches/template.h @@ -1,8 +1,6 @@ -#ifndef TEMPLATE_H_ -#define TEMPLATE_H_ +#pragma once -#include "../struct_strategy.h" -#include "../eqemu_config_extern.h" +#include "common/struct_strategy.h" class EQStreamIdentifier; @@ -32,7 +30,3 @@ namespace TEMPLATE { }; }; - - - -#endif /*TEMPLATE_H_*/ diff --git a/common/patches/template_limits.h b/common/patches/template_limits.h index 54690d3c1..901055da7 100644 --- a/common/patches/template_limits.h +++ b/common/patches/template_limits.h @@ -17,8 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_TEMPLATE_LIMITS_H -#define COMMON_TEMPLATE_LIMITS_H +#pragma once namespace TEMPLATE @@ -27,5 +26,3 @@ namespace TEMPLATE // put constants here and #include appropriately }; /* TEMPLATE */ - -#endif /*COMMON_TEMPLATE_LIMITS_H*/ diff --git a/common/patches/template_structs.h b/common/patches/template_structs.h index 78d085f91..8da39d72b 100644 --- a/common/patches/template_structs.h +++ b/common/patches/template_structs.h @@ -1,28 +1,11 @@ -#ifndef TEMPLATE_STRUCTS_H_ -#define TEMPLATE_STRUCTS_H_ +#pragma once -namespace TEMPLATE { - namespace structs { +namespace TEMPLATE { namespace structs { //paste contents of eq_packet_structs.h here... - }; //end namespace structs -}; //end namespace TEMPLATE - - - - -#endif /*TEMPLATE_STRUCTS_H_*/ - - - - - - - - - - +} // namespace structs +} // namespace TEMPLATE diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index c93b92581..3852c8808 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -17,25 +17,24 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../global_define.h" -#include "../eqemu_config.h" -#include "../eqemu_logsys.h" #include "titanium.h" -#include "../opcodemgr.h" - -#include "../eq_stream_ident.h" -#include "../crc32.h" -#include "../races.h" - -#include "../eq_packet_structs.h" -#include "../misc_functions.h" -#include "../strings.h" -#include "../item_instance.h" #include "titanium_structs.h" -#include "../rulesys.h" -#include "../path_manager.h" -#include "../raid.h" -#include "../guilds.h" + +#include "common/crc32.h" +#include "common/eq_packet_structs.h" +#include "common/eq_stream_ident.h" +#include "common/eqemu_config.h" +#include "common/eqemu_logsys.h" +#include "common/global_define.h" +#include "common/guilds.h" +#include "common/item_instance.h" +#include "common/misc_functions.h" +#include "common/opcodemgr.h" +#include "common/path_manager.h" +#include "common/races.h" +#include "common/raid.h" +#include "common/rulesys.h" +#include "common/strings.h" #include diff --git a/common/patches/titanium.h b/common/patches/titanium.h index 9e5cc7af5..25362503c 100644 --- a/common/patches/titanium.h +++ b/common/patches/titanium.h @@ -17,10 +17,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_TITANIUM_H -#define COMMON_TITANIUM_H +#pragma once -#include "../struct_strategy.h" +#include "common/struct_strategy.h" class EQStreamIdentifier; @@ -50,6 +49,4 @@ namespace Titanium #include "titanium_ops.h" }; -}; /*Titanium*/ - -#endif /*COMMON_TITANIUM_H*/ +} /*Titanium*/ diff --git a/common/patches/titanium_limits.cpp b/common/patches/titanium_limits.cpp index 76da83b63..dbe6e82da 100644 --- a/common/patches/titanium_limits.cpp +++ b/common/patches/titanium_limits.cpp @@ -19,7 +19,7 @@ #include "titanium_limits.h" -#include "../strings.h" +#include "common/strings.h" int16 Titanium::invtype::GetInvTypeSize(int16 inv_type) diff --git a/common/patches/titanium_limits.h b/common/patches/titanium_limits.h index cd7d9e5d8..2ed5337e6 100644 --- a/common/patches/titanium_limits.h +++ b/common/patches/titanium_limits.h @@ -17,12 +17,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_TITANIUM_LIMITS_H -#define COMMON_TITANIUM_LIMITS_H +#pragma once -#include "../types.h" -#include "../emu_versions.h" -#include "../skills.h" +#include "common/emu_versions.h" +#include "common/skills.h" +#include "common/types.h" namespace Titanium @@ -340,6 +339,4 @@ namespace Titanium } /*spells*/ -}; /*Titanium*/ - -#endif /*COMMON_TITANIUM_LIMITS_H*/ +} /*Titanium*/ diff --git a/common/patches/titanium_structs.h b/common/patches/titanium_structs.h index 2d9275942..ff3ad0272 100644 --- a/common/patches/titanium_structs.h +++ b/common/patches/titanium_structs.h @@ -17,13 +17,15 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_TITANIUM_STRUCTS_H -#define COMMON_TITANIUM_STRUCTS_H +#pragma once + +#include "common/eq_packet_structs.h" +#include "common/patches/titanium_limits.h" +#include "common/textures.h" +#include "common/types.h" -namespace Titanium -{ - namespace structs { +namespace Titanium { namespace structs { static const uint32 BUFF_COUNT = 25; @@ -32,6 +34,7 @@ static const uint32 BUFF_COUNT = 25; ** Compiler override to ensure ** byte aligned structures */ +#pragma pack(push) #pragma pack(1) struct LoginInfo_Struct { @@ -3774,8 +3777,7 @@ enum TiBazaarTraderBuyerActions { ReconcileItems = 20 }; - }; /*structs*/ +#pragma pack(pop) -}; /*Titanium*/ - -#endif /*COMMON_TITANIUM_STRUCTS_H*/ +} /*structs*/ +} /*Titanium*/ diff --git a/common/patches/uf.cpp b/common/patches/uf.cpp index c414b3353..d2ba9c20c 100644 --- a/common/patches/uf.cpp +++ b/common/patches/uf.cpp @@ -17,29 +17,27 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../global_define.h" -#include "../eqemu_config.h" -#include "../eqemu_logsys.h" #include "uf.h" -#include "../opcodemgr.h" - -#include "../eq_stream_ident.h" -#include "../crc32.h" - -#include "../eq_packet_structs.h" -#include "../misc_functions.h" -#include "../strings.h" -#include "../item_instance.h" #include "uf_structs.h" -#include "../rulesys.h" -#include "../path_manager.h" -#include "../classes.h" -#include "../races.h" -#include "../raid.h" -#include "../guilds.h" -//#include "../repositories/trader_repository.h" -#include +#include "common/classes.h" +#include "common/crc32.h" +#include "common/eq_packet_structs.h" +#include "common/eq_stream_ident.h" +#include "common/eqemu_config.h" +#include "common/eqemu_logsys.h" +#include "common/global_define.h" +#include "common/guilds.h" +#include "common/item_instance.h" +#include "common/misc_functions.h" +#include "common/opcodemgr.h" +#include "common/path_manager.h" +#include "common/races.h" +#include "common/raid.h" +#include "common/rulesys.h" +#include "common/strings.h" + +#include "cereal/types/vector.hpp" #include #include @@ -2716,7 +2714,7 @@ namespace UF buf.WriteString(new_message); - auto outapp = new EQApplicationPacket(OP_SpecialMesg, buf); + auto outapp = new EQApplicationPacket(OP_SpecialMesg, std::move(buf)); dest->FastQueuePacket(&outapp, ack_req); delete in; diff --git a/common/patches/uf.h b/common/patches/uf.h index 465f32e74..8eb4e3488 100644 --- a/common/patches/uf.h +++ b/common/patches/uf.h @@ -17,10 +17,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_UF_H -#define COMMON_UF_H +#pragma once -#include "../struct_strategy.h" +#include "common/struct_strategy.h" class EQStreamIdentifier; @@ -51,5 +50,3 @@ namespace UF }; }; /*UF*/ - -#endif /*COMMON_UF_H*/ diff --git a/common/patches/uf_limits.cpp b/common/patches/uf_limits.cpp index f0083d086..6f75f4474 100644 --- a/common/patches/uf_limits.cpp +++ b/common/patches/uf_limits.cpp @@ -19,7 +19,7 @@ #include "uf_limits.h" -#include "../strings.h" +#include "common/strings.h" int16 UF::invtype::GetInvTypeSize(int16 inv_type) diff --git a/common/patches/uf_limits.h b/common/patches/uf_limits.h index 29eb2495b..ccde46428 100644 --- a/common/patches/uf_limits.h +++ b/common/patches/uf_limits.h @@ -17,12 +17,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_UF_LIMITS_H -#define COMMON_UF_LIMITS_H +#pragma once -#include "../types.h" -#include "../emu_versions.h" -#include "../skills.h" +#include "common/emu_versions.h" +#include "common/skills.h" +#include "common/types.h" namespace UF @@ -343,6 +342,4 @@ namespace UF } /*spells*/ -}; /*UF*/ - -#endif /*COMMON_UF_LIMITS_H*/ +} /*UF*/ diff --git a/common/patches/uf_structs.h b/common/patches/uf_structs.h index 7f48929c5..40d7e5691 100644 --- a/common/patches/uf_structs.h +++ b/common/patches/uf_structs.h @@ -17,13 +17,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_UF_STRUCTS_H -#define COMMON_UF_STRUCTS_H +#pragma once +#include "common/eq_packet_structs.h" +#include "common/patches/uf_limits.h" +#include "common/textures.h" +#include "common/types.h" -namespace UF -{ - namespace structs { +namespace UF { namespace structs { static const uint32 BUFF_COUNT = 30; @@ -32,6 +33,7 @@ static const uint32 BUFF_COUNT = 30; ** Compiler override to ensure ** byte aligned structures */ +#pragma pack(push) #pragma pack(1) struct LoginInfo_Struct { @@ -4710,8 +4712,7 @@ enum UFBazaarTraderBuyerActions { ReconcileItems = 20 }; - }; /*structs*/ +#pragma pack(pop) -}; /*UF*/ - -#endif /*COMMON_UF_STRUCTS_H*/ +} /*structs*/ +} /*UF*/ diff --git a/common/path_manager.cpp b/common/path_manager.cpp index c63835854..18dd1eb1d 100644 --- a/common/path_manager.cpp +++ b/common/path_manager.cpp @@ -1,8 +1,9 @@ #include "path_manager.h" -#include "file.h" -#include "eqemu_logsys.h" -#include "eqemu_config.h" -#include "strings.h" + +#include "common/eqemu_config.h" +#include "common/eqemu_logsys.h" +#include "common/file.h" +#include "common/strings.h" #include diff --git a/common/path_manager.h b/common/path_manager.h index 67919511e..7bf2fa280 100644 --- a/common/path_manager.h +++ b/common/path_manager.h @@ -1,6 +1,4 @@ -#ifndef EQEMU_PATH_MANAGER_H -#define EQEMU_PATH_MANAGER_H - +#pragma once #include #include @@ -43,5 +41,3 @@ private: std::string m_server_path; std::string m_shared_memory_path; }; - -#endif //EQEMU_PATH_MANAGER_H diff --git a/common/pch/app-pch.h b/common/pch/app-pch.h index aa2244f13..32d2b070d 100644 --- a/common/pch/app-pch.h +++ b/common/pch/app-pch.h @@ -1,9 +1,9 @@ #pragma once -#include "../types.h" -#include "../database.h" -#include "../strings.h" -#include "../eqemu_logsys.h" -#include "../eqemu_logsys_log_aliases.h" -#include "../features.h" -#include "../global_define.h" +#include "common/types.h" +#include "common/database.h" +#include "common/strings.h" +#include "common/eqemu_logsys.h" +#include "common/eqemu_logsys_log_aliases.h" +#include "common/features.h" +#include "common/global_define.h" diff --git a/common/pch/std-pch.h b/common/pch/std-pch.h index 3b1b9faad..77ca1ce6f 100644 --- a/common/pch/std-pch.h +++ b/common/pch/std-pch.h @@ -1,14 +1,14 @@ #pragma once -// Lightweight, widely used -#include -#include -#include -#include -#include -#include -#include -#include - // fmt -#include +#include "fmt/format.h" + +// Lightweight, widely used +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/common/perl_eqdb.cpp b/common/perl_eqdb.cpp index 1aea51c0d..53f3059df 100644 --- a/common/perl_eqdb.cpp +++ b/common/perl_eqdb.cpp @@ -28,9 +28,9 @@ typedef const char Const_char; #ifdef EMBPERL -#include "global_define.h" -#include "eqdb.h" -#include "useperl.h" +#include "common/global_define.h" +#include "common/eqdb.h" +#include "common/useperl.h" #ifdef THIS /* this macro seems to leak out on some systems */ #undef THIS diff --git a/common/perl_eqdb_res.cpp b/common/perl_eqdb_res.cpp index 185c4456b..32a588ece 100644 --- a/common/perl_eqdb_res.cpp +++ b/common/perl_eqdb_res.cpp @@ -28,9 +28,9 @@ typedef const char Const_char; #ifdef EMBPERL -#include "global_define.h" -#include "eqdb_res.h" -#include "useperl.h" +#include "common/global_define.h" +#include "common/eqdb_res.h" +#include "common/useperl.h" XS(XS_EQDBRes_num_rows); /* prototype to pass -Wmissing-prototypes */ diff --git a/common/platform.h b/common/platform.h index 81bd55a29..626eb4b17 100644 --- a/common/platform.h +++ b/common/platform.h @@ -18,10 +18,9 @@ * */ -#ifndef EQEMU_PLATFORM_H -#define EQEMU_PLATFORM_H +#pragma once -#include "iostream" +#include enum EQEmuExePlatform { @@ -47,5 +46,3 @@ int GetExecutablePlatformInt(); std::string GetPlatformName(); bool IsWorld(); bool IsQueryServ(); - -#endif diff --git a/common/proc_launcher.cpp b/common/proc_launcher.cpp index 9f8757326..0be460a8e 100644 --- a/common/proc_launcher.cpp +++ b/common/proc_launcher.cpp @@ -16,25 +16,26 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "proc_launcher.h" + +#include "common/global_define.h" +#include "common/types.h" + #include #include - -#include "global_define.h" -#include "types.h" -#include "proc_launcher.h" #ifdef _WINDOWS - #include +#include #else - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif ProcLauncher ProcLauncher::s_launcher; @@ -353,4 +354,3 @@ ProcLauncher::Spec &ProcLauncher::Spec::operator=(const Spec &other) { logFile = other.logFile; return(*this); } - diff --git a/common/proc_launcher.h b/common/proc_launcher.h index 23b7e523c..15ff0dd73 100644 --- a/common/proc_launcher.h +++ b/common/proc_launcher.h @@ -15,14 +15,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef PROCLAUNCHER_H_ -#define PROCLAUNCHER_H_ -#include "global_define.h" +#pragma once +#include "common/global_define.h" + +#include #include #include -#include #ifdef __FreeBSD__ #include @@ -92,6 +92,3 @@ private: static void HandleSigChild(int signum); #endif }; - -#endif /*PROCLAUNCHER_H_*/ - diff --git a/common/process.cpp b/common/process.cpp index 3563d57e2..152fc2d18 100644 --- a/common/process.cpp +++ b/common/process.cpp @@ -1,8 +1,9 @@ -#include -#include -#include #include "process.h" +#include +#include +#include + inline std::string random_string(size_t length) { auto randchar = []() -> char { diff --git a/common/process.h b/common/process.h index 15affd5ef..c9f62b4e9 100644 --- a/common/process.h +++ b/common/process.h @@ -1,10 +1,6 @@ -#ifndef EQEMU_PROCESS_H -#define EQEMU_PROCESS_H +#pragma once class Process { public: static std::string execute(const std::string &cmd, bool return_result = true); }; - - -#endif //EQEMU_PROCESS_H diff --git a/common/process/process.cpp b/common/process/process.cpp index 92bf757f4..ddd620cbe 100644 --- a/common/process/process.cpp +++ b/common/process/process.cpp @@ -1,8 +1,8 @@ +#include "process.h" + +#include "fmt/format.h" #include #include -#include "process.h" -#include -#include std::string Process::execute(const std::string &cmd) { diff --git a/common/process/process.h b/common/process/process.h index 34dbb27c6..a357674ad 100644 --- a/common/process/process.h +++ b/common/process/process.h @@ -1,7 +1,6 @@ -#ifndef EQEMU_PROCESS_H -#define EQEMU_PROCESS_H +#pragma once -#include "../strings.h" +#include "common/strings.h" #include @@ -14,6 +13,3 @@ class Process { public: static std::string execute(const std::string &cmd); }; - - -#endif //EQEMU_PROCESS_H diff --git a/common/profanity_manager.cpp b/common/profanity_manager.cpp index e522681f6..b25445996 100644 --- a/common/profanity_manager.cpp +++ b/common/profanity_manager.cpp @@ -18,13 +18,14 @@ */ #include "profanity_manager.h" -#include "eqemu_logsys.h" -#include "dbcore.h" -#include "strings.h" -#include -#include +#include "common/dbcore.h" +#include "common/eqemu_logsys.h" +#include "common/strings.h" + #include +#include +#include static std::list profanity_list; diff --git a/common/profanity_manager.h b/common/profanity_manager.h index 165b6516e..c2f2ed91e 100644 --- a/common/profanity_manager.h +++ b/common/profanity_manager.h @@ -17,13 +17,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_PROFANITY_MANAGER_H -#define COMMON_PROFANITY_MANAGER_H +#pragma once -#include +#include "fmt/format.h" #include -#include -#include +#include class DBcore; @@ -58,5 +56,3 @@ namespace EQ }; } /*EQEmu*/ - -#endif /*COMMON_PROFANITY_MANAGER_H*/ diff --git a/common/profiler.h b/common/profiler.h index a66e3ac88..c0b1e5eb4 100644 --- a/common/profiler.h +++ b/common/profiler.h @@ -15,13 +15,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef PROFILER_H -#define PROFILER_H + +#pragma once #ifdef EQPROFILE -#include "../common/rdtsc.h" -#include "../common/types.h" +#include "common/rdtsc.h" +#include "common/types.h" class ScopedProfiler; @@ -88,5 +88,3 @@ protected: #define _GP(obj, pkg, name) ; #endif - -#endif diff --git a/common/ptimer.cpp b/common/ptimer.cpp index d5f6ca162..dfba5f6f9 100644 --- a/common/ptimer.cpp +++ b/common/ptimer.cpp @@ -16,23 +16,23 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "global_define.h" - -#include "timer.h" #include "ptimer.h" -#include "database.h" -#include "strings.h" + +#include "common/database.h" +#include "common/global_define.h" +#include "common/strings.h" +#include "common/timer.h" #ifdef _WINDOWS - #include - #include - int gettimeofday (timeval *tp, ...); +#include +#include +int gettimeofday (timeval *tp, ...); #else - #include +#include #endif #if EQDEBUG > 10 - #define DEBUG_PTIMERS +#define DEBUG_PTIMERS #endif diff --git a/common/ptimer.h b/common/ptimer.h index ad5e5a8c8..fa116f84d 100644 --- a/common/ptimer.h +++ b/common/ptimer.h @@ -15,10 +15,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef PTIMER_H -#define PTIMER_H -#include "types.h" +#pragma once + +#include "common/types.h" + #include #include @@ -144,5 +145,3 @@ protected: std::map _list; }; - -#endif diff --git a/common/queue.h b/common/queue.h index 00dd48cac..b7e6515df 100644 --- a/common/queue.h +++ b/common/queue.h @@ -15,8 +15,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef QUEUE_H -#define QUEUE_H + +#pragma once template class MyQueue; @@ -122,5 +122,3 @@ private: MyQueueNode* head; MyQueueNode* tail; }; - -#endif diff --git a/common/races.cpp b/common/races.cpp index a01597640..603c775f8 100644 --- a/common/races.cpp +++ b/common/races.cpp @@ -16,8 +16,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/races.h" -#include "data_verification.h" +#include "races.h" + +#include "common/data_verification.h" const char* GetRaceIDName(uint16 race_id) { diff --git a/common/races.h b/common/races.h index 3d9d9f8d3..86a296ca8 100644 --- a/common/races.h +++ b/common/races.h @@ -16,9 +16,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef RACES_H -#define RACES_H -#include "../common/types.h" +#pragma once + +#include "common/types.h" + #include const char* GetRaceIDName(uint16 race_id); @@ -863,6 +864,3 @@ namespace RaceAppearance { constexpr int DrakkinMale = (Race::Drakkin << 8) | Gender::Male; constexpr int DrakkinFemale = (Race::Drakkin << 8) | Gender::Female; } - -#endif - diff --git a/common/raid.h b/common/raid.h index 605636fd4..e2dbe9c2c 100644 --- a/common/raid.h +++ b/common/raid.h @@ -16,8 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef RAID_H -#define RAID_H +#pragma once enum { //raid packet types: raidAdd = 0, @@ -67,6 +66,3 @@ enum { //raid command types RaidCommandSetMotd = 35, RaidCommandSetNote = 36, }; - - -#endif diff --git a/common/random.h b/common/random.h index 73b14369e..a55dece0f 100644 --- a/common/random.h +++ b/common/random.h @@ -16,8 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __random_h__ -#define __random_h__ +#pragma once #include #include @@ -36,7 +35,7 @@ #endif #ifdef USE_ADDITIVE_LFIB_PRNG -#include "additive_lagged_fibonacci_engine.h" +#include "common/additive_lagged_fibonacci_engine.h" #elif defined(USE_SFMT19937) #include #endif @@ -143,6 +142,3 @@ namespace EQ { m_gen; }; } - -#endif /* !__random_h__ */ - diff --git a/common/rdtsc.cpp b/common/rdtsc.cpp index 53962f1d5..fc3bdfd3d 100644 --- a/common/rdtsc.cpp +++ b/common/rdtsc.cpp @@ -17,14 +17,15 @@ */ #include "rdtsc.h" -#include "types.h" + +#include "common/types.h" #ifdef _WINDOWS - #include - #include "../common/timer.h" +#include +#include "common/timer.h" #else - #include - #include +#include +#include #endif #ifdef i386 diff --git a/common/rdtsc.h b/common/rdtsc.h index 2a36cac0f..44861f18d 100644 --- a/common/rdtsc.h +++ b/common/rdtsc.h @@ -15,9 +15,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef RDTSC_H -#define RDTSC_H +#pragma once + +#include "common/types.h" #define CALIBRATE_LOOPS 3 #define SLEEP_TIME 10 //in ms @@ -33,8 +34,6 @@ All calculations are carried out in 64 bit integers. */ -#include "types.h" - class RDTSC_Timer { public: RDTSC_Timer(); @@ -82,5 +81,3 @@ protected: int64 _sum; int64 _count; }; - -#endif diff --git a/common/rulesys.cpp b/common/rulesys.cpp index 3e6f833a8..27c5724f4 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -17,16 +17,16 @@ */ #include "rulesys.h" -#include "eqemu_logsys.h" -#include "database.h" -#include "strings.h" + +#include "common/database.h" +#include "common/eqemu_logsys.h" +#include "common/repositories/rule_sets_repository.h" +#include "common/repositories/rule_values_repository.h" +#include "common/strings.h" + +#include "fmt/format.h" #include #include -#include -#include - -#include "../common/repositories/rule_sets_repository.h" -#include "../common/repositories/rule_values_repository.h" const char *RuleManager::s_categoryNames[_CatCount + 1] = { #define RULE_CATEGORY(category_name) \ diff --git a/common/rulesys.h b/common/rulesys.h index eab3af6b8..f6e780136 100644 --- a/common/rulesys.h +++ b/common/rulesys.h @@ -15,8 +15,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef RULESYS_H_ -#define RULESYS_H_ + +#pragma once + +#include "common/types.h" + +#include +#include +#include /* * Access to the rules system in normal code is done with three calls: @@ -40,12 +46,6 @@ RuleManager::Instance()->GetStringRule( RuleManager::String__##rule_name ) -#include -#include -#include - -#include "types.h" - class Database; class RuleManager { @@ -193,5 +193,3 @@ private: } RuleInfo; static const RuleInfo s_RuleInfo[]; }; - -#endif /*RULESYS_H_*/ diff --git a/common/say_link.cpp b/common/say_link.cpp index 8edc536f9..ff6718588 100644 --- a/common/say_link.cpp +++ b/common/say_link.cpp @@ -18,12 +18,13 @@ */ #include "say_link.h" -#include "emu_constants.h" -#include "strings.h" -#include "item_instance.h" -#include "item_data.h" -#include "../zone/zonedb.h" +#include "common/emu_constants.h" +#include "common/strings.h" +#include "common/item_instance.h" +#include "common/item_data.h" +#include "zone/zonedb.h" + #include // static bucket global diff --git a/common/say_link.h b/common/say_link.h index 4f37e6c82..ee1e6566d 100644 --- a/common/say_link.h +++ b/common/say_link.h @@ -17,14 +17,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_SAY_LINK_H -#define COMMON_SAY_LINK_H +#pragma once -#include "types.h" +#include "common/loot.h" +#include "common/repositories/saylink_repository.h" +#include "common/types.h" #include -#include "repositories/saylink_repository.h" -#include "loot.h" struct LootItem; @@ -133,5 +132,3 @@ public: static std::string Create(const std::string &saylink_text, bool silent = false, const std::string &link_name = ""); static std::string Silent(const std::string &saylink_text, const std::string &link_name = ""); }; - -#endif /*COMMON_SAY_LINK_H*/ diff --git a/common/seperator.h b/common/seperator.h index 11ddfef26..f4d6ac380 100644 --- a/common/seperator.h +++ b/common/seperator.h @@ -20,10 +20,11 @@ // Seperator.argplus[i] is a pointer to the original string so it doesnt end at the div // Written by Quagmire -#ifndef SEPERATOR_H -#define SEPERATOR_H -#include "types.h" +#pragma once + +#include "common/types.h" + #include #include @@ -154,5 +155,3 @@ public: private: uint16 maxargnum; }; - -#endif diff --git a/common/serialize_buffer.h b/common/serialize_buffer.h index 65ae36f70..c05456f05 100644 --- a/common/serialize_buffer.h +++ b/common/serialize_buffer.h @@ -1,10 +1,10 @@ -#ifndef SERIALIZE_BUFFER_H -#define SERIALIZE_BUFFER_H -#include +#pragma once + #include #include #include +#include class SerializeBuffer { @@ -195,5 +195,3 @@ private: size_t m_capacity; size_t m_pos; }; - -#endif /* !SERIALIZE_BUFFER_H */ diff --git a/common/server_event_scheduler.cpp b/common/server_event_scheduler.cpp index 039da168f..5e964f38b 100644 --- a/common/server_event_scheduler.cpp +++ b/common/server_event_scheduler.cpp @@ -1,7 +1,9 @@ -#include "../common/database.h" -#include "../common/strings.h" #include "server_event_scheduler.h" -#include "../common/cron/croncpp.h" + +#include "common/cron/croncpp.h" +#include "common/database.h" +#include "common/strings.h" + #include #include #include diff --git a/common/server_event_scheduler.h b/common/server_event_scheduler.h index a198e73fa..a3c48e9fd 100644 --- a/common/server_event_scheduler.h +++ b/common/server_event_scheduler.h @@ -1,7 +1,7 @@ -#ifndef EQEMU_SERVER_EVENT_SCHEDULER_H -#define EQEMU_SERVER_EVENT_SCHEDULER_H +#pragma once + +#include "common/repositories/server_scheduled_events_repository.h" -#include "../common/repositories/server_scheduled_events_repository.h" #include #include @@ -53,5 +53,3 @@ protected: Database *m_database; bool ValidateDatabaseConnection(); }; - -#endif //EQEMU_SERVER_EVENT_SCHEDULER_H diff --git a/common/server_reload_types.h b/common/server_reload_types.h index af42bec36..2446c10f6 100644 --- a/common/server_reload_types.h +++ b/common/server_reload_types.h @@ -1,9 +1,10 @@ -#ifndef EQEMU_SERVER_RELOAD_TYPES_H -#define EQEMU_SERVER_RELOAD_TYPES_H +#pragma once +#include "common/types.h" + +#include #include #include -#include namespace ServerReload { enum Type { @@ -141,5 +142,3 @@ namespace ServerReload { uint32_t zone_server_id = 0; }; } - -#endif //EQEMU_SERVER_RELOAD_TYPES_H diff --git a/common/serverinfo.cpp b/common/serverinfo.cpp index db31e9561..b80a95aa1 100644 --- a/common/serverinfo.cpp +++ b/common/serverinfo.cpp @@ -17,7 +17,8 @@ */ #include "serverinfo.h" -#include + +#include "uv.h" size_t EQ::GetRSS() { diff --git a/common/serverinfo.h b/common/serverinfo.h index d62549f11..e3301dfa5 100644 --- a/common/serverinfo.h +++ b/common/serverinfo.h @@ -17,9 +17,9 @@ */ #pragma once +#include #include #include -#include typedef struct eq_cpu_info_s { std::string model; diff --git a/common/servertalk.h b/common/servertalk.h index 9985c875c..121d6d7de 100644 --- a/common/servertalk.h +++ b/common/servertalk.h @@ -1,17 +1,17 @@ -#ifndef EQ_SOPCODES_H -#define EQ_SOPCODES_H +#pragma once -#include "../common/types.h" -#include "../common/packet_functions.h" -#include "../common/eq_packet_structs.h" -#include "../common/net/packet.h" -#include "../common/guilds.h" -#include -#include -#include -#include -#include -#include +#include "common/eq_packet_structs.h" +#include "common/guilds.h" +#include "common/net/packet.h" +#include "common/packet_functions.h" +#include "common/types.h" + +#include "cereal/cereal.hpp" +#include "cereal/archives/binary.hpp" +#include "cereal/types/chrono.hpp" +#include "cereal/types/string.hpp" +#include "cereal/types/vector.hpp" +#include "glm/vec4.hpp" #define SERVER_TIMEOUT 45000 // how often keepalive gets sent #define INTERSERVER_TIMER 10000 @@ -1779,7 +1779,4 @@ struct BazaarPurchaseMessaging_Struct { uint32 id; }; - -#pragma pack() - -#endif +#pragma pack(pop) diff --git a/common/shared_tasks.cpp b/common/shared_tasks.cpp index 62b24350c..deb76340b 100644 --- a/common/shared_tasks.cpp +++ b/common/shared_tasks.cpp @@ -1,5 +1,7 @@ #include "shared_tasks.h" -#include "repositories/character_data_repository.h" + +#include "common/repositories/character_data_repository.h" + #include std::vector SharedTask::GetActivityState() const diff --git a/common/shared_tasks.h b/common/shared_tasks.h index b12053a4c..7b2255834 100644 --- a/common/shared_tasks.h +++ b/common/shared_tasks.h @@ -1,17 +1,16 @@ -#ifndef EQEMU_SHARED_TASKS_H -#define EQEMU_SHARED_TASKS_H +#pragma once + +#include "common/database.h" +#include "common/repositories/character_data_repository.h" +#include "common/repositories/shared_tasks_repository.h" +#include "common/repositories/task_activities_repository.h" +#include "common/repositories/tasks_repository.h" +#include "common/tasks.h" +#include "common/timer.h" +#include "common/types.h" -#include "database.h" -#include "timer.h" -#include "tasks.h" -#include "types.h" -#include "repositories/character_data_repository.h" -#include "repositories/tasks_repository.h" -#include "repositories/task_activities_repository.h" -#include "repositories/shared_tasks_repository.h" -#include #include -#include +#include // ops #define ServerOP_SharedTaskRequest 0x0300 // zone -> world. Player trying to get task. Relayed world -> zone on confirmation @@ -232,5 +231,3 @@ protected: TasksRepository::Tasks m_task_data; std::vector m_task_activity_data; }; - -#endif //EQEMU_SHARED_TASKS_H diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 89da73410..a38bc8e30 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -16,46 +16,35 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include - -#if defined(_MSC_VER) && _MSC_VER >= 1800 - #include -#endif - -#include "classes.h" -#include "eq_packet_structs.h" -#include "faction.h" -#include "features.h" -#include "ipc_mutex.h" -#include "inventory_profile.h" -#include "memory_mapped_file.h" -#include "mysql.h" -#include "rulesys.h" #include "shareddb.h" -#include "strings.h" -#include "eqemu_config.h" -#include "data_verification.h" -#include "evolving_items.h" -#include "repositories/criteria/content_filter_criteria.h" -#include "repositories/account_repository.h" -#include "repositories/faction_association_repository.h" -#include "repositories/starting_items_repository.h" -#include "path_manager.h" -#include "../zone/client.h" -#include "repositories/loottable_repository.h" -#include "repositories/character_item_recast_repository.h" -#include "repositories/character_corpses_repository.h" -#include "repositories/skill_caps_repository.h" -#include "repositories/inventory_repository.h" -#include "repositories/books_repository.h" -#include "repositories/sharedbank_repository.h" -#include "repositories/character_inspect_messages_repository.h" -#include "repositories/spells_new_repository.h" -#include "repositories/damageshieldtypes_repository.h" -#include "repositories/items_repository.h" + +#include "common/classes.h" +#include "common/data_verification.h" +#include "common/eq_packet_structs.h" +#include "common/eqemu_config.h" +#include "common/evolving_items.h" +#include "common/faction.h" +#include "common/inventory_profile.h" +#include "common/ipc_mutex.h" +#include "common/memory_mapped_file.h" +#include "common/path_manager.h" +#include "common/repositories/account_repository.h" +#include "common/repositories/books_repository.h" +#include "common/repositories/character_corpses_repository.h" +#include "common/repositories/character_inspect_messages_repository.h" +#include "common/repositories/character_item_recast_repository.h" +#include "common/repositories/criteria/content_filter_criteria.h" +#include "common/repositories/damageshieldtypes_repository.h" +#include "common/repositories/inventory_repository.h" +#include "common/repositories/items_repository.h" +#include "common/repositories/sharedbank_repository.h" +#include "common/repositories/starting_items_repository.h" +#include "common/rulesys.h" +#include "common/strings.h" +#include "zone/client.h" + +#include "fmt/format.h" +#include SharedDatabase::SharedDatabase() : Database() diff --git a/common/shareddb.h b/common/shareddb.h index 2a78be670..559570fc9 100644 --- a/common/shareddb.h +++ b/common/shareddb.h @@ -18,18 +18,17 @@ * */ -#ifndef SHAREDDB_H_ -#define SHAREDDB_H_ +#pragma once -#include "database.h" -#include "skills.h" -#include "spdat.h" -#include "fixed_memory_hash_set.h" -#include "fixed_memory_variable_hash_set.h" -#include "say_link.h" -#include "repositories/command_subsettings_repository.h" -#include "repositories/items_evolving_details_repository.h" -#include "../common/repositories/character_evolving_items_repository.h" +#include "common/database.h" +#include "common/fixed_memory_hash_set.h" +#include "common/fixed_memory_variable_hash_set.h" +#include "common/repositories/character_evolving_items_repository.h" +#include "common/repositories/command_subsettings_repository.h" +#include "common/repositories/items_evolving_details_repository.h" +#include "common/say_link.h" +#include "common/skills.h" +#include "common/spdat.h" #include #include @@ -203,5 +202,3 @@ protected: uint32 m_shared_items_count = 0; uint32 m_shared_spells_count = 0; }; - -#endif /*SHAREDDB_H_*/ diff --git a/common/skill_caps.cpp b/common/skill_caps.cpp index c8b75c4f5..b7436a3a6 100644 --- a/common/skill_caps.cpp +++ b/common/skill_caps.cpp @@ -1,5 +1,6 @@ #include "skill_caps.h" -#include "timer.h" + +#include "common/timer.h" // cache the skill cap max level in the database std::map skill_max_level = {}; diff --git a/common/skill_caps.h b/common/skill_caps.h index 6566a1104..a83d183e1 100644 --- a/common/skill_caps.h +++ b/common/skill_caps.h @@ -1,10 +1,9 @@ -#ifndef CODE_SKILL_CAPS_H -#define CODE_SKILL_CAPS_H +#pragma once -#include "repositories/skill_caps_repository.h" -#include "types.h" -#include "classes.h" -#include "skills.h" +#include "common/classes.h" +#include "common/repositories/skill_caps_repository.h" +#include "common/skills.h" +#include "common/types.h" class SkillCaps { public: @@ -26,6 +25,3 @@ private: Database *m_content_database{}; std::map m_skill_caps = {}; }; - - -#endif //CODE_SKILL_CAPS_H diff --git a/common/skills.cpp b/common/skills.cpp index 80562184d..85fae5a27 100644 --- a/common/skills.cpp +++ b/common/skills.cpp @@ -18,7 +18,8 @@ */ #include "skills.h" -#include "classes.h" + +#include "common/classes.h" #include diff --git a/common/skills.h b/common/skills.h index e9b280d53..2f61c2314 100644 --- a/common/skills.h +++ b/common/skills.h @@ -17,13 +17,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_SKILLS_H -#define COMMON_SKILLS_H +#pragma once -#include "types.h" +#include "common/types.h" -#include #include +#include #include namespace EQ @@ -309,5 +308,3 @@ namespace EQ }; } /*EQEmu*/ - -#endif /*COMMON_SKILLS_H*/ diff --git a/common/spdat.cpp b/common/spdat.cpp index f4d3df255..6c5eaf62e 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -16,6 +16,17 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "spdat.h" + +#include "common/classes.h" +#include "common/eqemu_logsys.h" +#include "common/rulesys.h" +#include "common/strings.h" + +#ifndef WIN32 +#include "common/unix.h" +#endif +#include /* @@ -71,19 +82,6 @@ */ - -#include "../common/eqemu_logsys.h" - -#include "classes.h" -#include "spdat.h" -#include "../common/rulesys.h" -#include "../common/strings.h" - -#ifndef WIN32 -#include -#include "unix.h" -#endif - /////////////////////////////////////////////////////////////////////////////// // spell property testing functions diff --git a/common/spdat.h b/common/spdat.h index 11130d6a4..ca3573401 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -15,12 +15,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef SPDAT_H -#define SPDAT_H -#include "classes.h" -#include "skills.h" -#include "item_data.h" +#pragma once + +#include "common/classes.h" +#include "common/item_data.h" +#include "common/skills.h" #define SPELL_UNKNOWN 0xFFFF #define POISON_PROC 0xFFFE @@ -1917,5 +1917,3 @@ bool IsDamageShieldOnlySpell(uint16 spell_id); bool IsDamageShieldAndResistSpell(uint16 spell_id); bool IsHateSpell(uint16 spell_id); bool IsDisciplineTome(const EQ::ItemData* item); - -#endif diff --git a/common/spdat_bot.cpp b/common/spdat_bot.cpp index 3a9ecf71e..23b7f5040 100644 --- a/common/spdat_bot.cpp +++ b/common/spdat_bot.cpp @@ -1,5 +1,6 @@ #include "spdat.h" -#include "../zone/bot.h" + +#include "zone/bot.h" bool IsBotSpellTypeDetrimental(uint16 spell_type) { switch (spell_type) { diff --git a/common/strings.cpp b/common/strings.cpp index 62aec2975..024d8e441 100644 --- a/common/strings.cpp +++ b/common/strings.cpp @@ -34,24 +34,18 @@ */ #include "strings.h" -#include -#include -#include + +#include "cereal/external/rapidjson/document.h" +#include "fmt/format.h" #include #include - -#include -#include -#include -#include - -#include -#include - -#ifdef _WINDOWS -#include +#include +#include #include -#endif +#include +#include +#include +#include std::string Strings::Random(size_t length) { diff --git a/common/strings.h b/common/strings.h index 8ae8fee25..e00c11ab0 100644 --- a/common/strings.h +++ b/common/strings.h @@ -32,22 +32,19 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _STRINGUTIL_H_ -#define _STRINGUTIL_H_ +#pragma once + +#include "common/types.h" + +#include #include +#include #include #include #include -#include -#include #include - -#ifdef _WIN32 -#include -#endif - -#include "types.h" +#include class Strings { public: @@ -133,5 +130,3 @@ void RemoveApostrophes(std::string &s); std::string FormatName(const std::string &char_name); bool IsAllowedWorldServerCharacterList(char c); void SanitizeWorldServerName(char *name); - -#endif diff --git a/common/strings_legacy.cpp b/common/strings_legacy.cpp index e1d324d45..a98d69c08 100644 --- a/common/strings_legacy.cpp +++ b/common/strings_legacy.cpp @@ -1,23 +1,18 @@ -#include -#include "strings.h" -#include +#include "common/strings.h" + +#include "fmt/format.h" #include #include #include - +#include +#include +#include +#include #ifdef _WINDOWS #include - -#define snprintf _snprintf -#define strncasecmp _strnicmp -#define strcasecmp _stricmp - -#else - -#include -#include -#include - +#define snprintf _snprintf +#define strncasecmp _strnicmp +#define strcasecmp _stricmp #endif #ifndef va_copy diff --git a/common/strings_misc.cpp b/common/strings_misc.cpp index 08355e15e..bd21ecc5b 100644 --- a/common/strings_misc.cpp +++ b/common/strings_misc.cpp @@ -1,22 +1,17 @@ -#include #include "strings.h" -#include + +#include "fmt/format.h" #include #include - +#include +#include +#include +#include #ifdef _WINDOWS #include - -#define snprintf _snprintf -#define strncasecmp _strnicmp -#define strcasecmp _stricmp - -#else - -#include -#include -#include - +#define snprintf _snprintf +#define strncasecmp _strnicmp +#define strcasecmp _stricmp #endif #ifndef va_copy diff --git a/common/struct_strategy.cpp b/common/struct_strategy.cpp index ca633143a..12372a6e2 100644 --- a/common/struct_strategy.cpp +++ b/common/struct_strategy.cpp @@ -1,10 +1,10 @@ - -#include "global_define.h" -#include "eqemu_logsys.h" #include "struct_strategy.h" -#include "eq_stream_intf.h" -#include "opcodemgr.h" +#include "common/eq_stream_intf.h" +#include "common/eqemu_logsys.h" +#include "common/global_define.h" +#include "common/opcodemgr.h" + #include #include @@ -72,28 +72,3 @@ namespace StructStrategyFactory { } }; - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/struct_strategy.h b/common/struct_strategy.h index d3f7327ab..73df1d178 100644 --- a/common/struct_strategy.h +++ b/common/struct_strategy.h @@ -1,13 +1,14 @@ -#ifndef STRUCTSTRATEGY_H_ -#define STRUCTSTRATEGY_H_ +#pragma once + +#include "common/emu_opcodes.h" +#include "common/emu_versions.h" + +#include +#include + class EQApplicationPacket; class EQStreamInterface; -#include "emu_opcodes.h" -#include "emu_versions.h" - -#include -#include class StructStrategy { public: @@ -44,30 +45,3 @@ protected: namespace StructStrategyFactory { void RegisterPatch(EmuOpcode first_opcode, const StructStrategy *structs); }; - - -#endif /*STRUCTSTRATEGY_H_*/ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/common/tasks.h b/common/tasks.h index 8cf98335b..ad8887ecc 100644 --- a/common/tasks.h +++ b/common/tasks.h @@ -1,8 +1,10 @@ -#ifndef EQEMU_TASKS_H -#define EQEMU_TASKS_H +#pragma once + +#include "common/emu_versions.h" +#include "common/eqemu_logsys.h" +#include "common/serialize_buffer.h" +#include "common/strings.h" -#include "../common/strings.h" -#include "serialize_buffer.h" #include #include @@ -564,5 +566,3 @@ namespace TaskStr { return "Unknown EQStr"; } } - -#endif //EQEMU_TASKS_H diff --git a/common/textures.h b/common/textures.h index 919a5fed4..2f45f5eec 100644 --- a/common/textures.h +++ b/common/textures.h @@ -17,11 +17,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef COMMON_TEXTURES_H -#define COMMON_TEXTURES_H - -#include "types.h" +#pragma once +#include "common/types.h" namespace EQ { @@ -160,5 +158,3 @@ namespace EQ }; } /*EQEmu*/ - -#endif /*COMMON_TEXTURES_H*/ diff --git a/common/timeoutmgr.cpp b/common/timeoutmgr.cpp index f8ee62869..ab0746d16 100644 --- a/common/timeoutmgr.cpp +++ b/common/timeoutmgr.cpp @@ -15,12 +15,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/global_define.h" - -//#define TIMEOUT_DEBUG #include "timeoutmgr.h" +#include "common/global_define.h" + +//#define TIMEOUT_DEBUG + Timeoutable::Timeoutable(uint32 check_frequency) : next_check(check_frequency) { diff --git a/common/timeoutmgr.h b/common/timeoutmgr.h index 4e5224a30..e8a466d8d 100644 --- a/common/timeoutmgr.h +++ b/common/timeoutmgr.h @@ -15,19 +15,19 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef TIMEOUT_MANAGER_H -#define TIMEOUT_MANAGER_H + +#pragma once + +#include "common/timer.h" +#include "common/types.h" + +#include //ms between checking all timeouts //timeouts are generally somewhat large, so its safe to use a //value on the order of seconds here. #define TIMEOUT_GRANULARITY 1000 -#include "types.h" -#include "timer.h" - -#include - //timeoutable objects automatically register themselves //with the global TimeoutManager object class TimeoutManager; @@ -62,5 +62,3 @@ protected: }; extern TimeoutManager timeout_manager; - -#endif diff --git a/common/timer.cpp b/common/timer.cpp index 191074618..32911f9d9 100644 --- a/common/timer.cpp +++ b/common/timer.cpp @@ -16,6 +16,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "timer.h" + // Disgrace: for windows compile #ifndef WIN32 #include @@ -23,8 +25,6 @@ #include #endif -#include "timer.h" - uint32 current_time = 0; uint32 last_time = 0; diff --git a/common/timer.h b/common/timer.h index cd550c9df..9a2e2765a 100644 --- a/common/timer.h +++ b/common/timer.h @@ -15,11 +15,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef TIMER_H -#define TIMER_H -#include "types.h" -#include +#pragma once + +#include "common/types.h" // Disgrace: for windows compile #ifdef _WINDOWS @@ -27,6 +26,8 @@ int gettimeofday (timeval *tp, ...); #endif +#include + class Timer { public: @@ -93,5 +94,3 @@ struct BenchTimer private: std::chrono::time_point start_time; }; - -#endif diff --git a/common/types.h b/common/types.h index 8124d9f3d..bb4b39a83 100644 --- a/common/types.h +++ b/common/types.h @@ -15,10 +15,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef TYPES_H -#define TYPES_H -#include +#pragma once + +#include typedef uint8_t byte; typedef uint8_t uint8; typedef uint16_t uint16; @@ -97,5 +97,3 @@ typedef const char Const_char; //for perl XS # define htonll(x) htobe64(x) # define ntohll(x) be64toh(x) #endif - -#endif diff --git a/common/unix.cpp b/common/unix.cpp index 0e69a3b69..45702280c 100644 --- a/common/unix.cpp +++ b/common/unix.cpp @@ -18,6 +18,7 @@ #ifndef _WINDOWS #include "unix.h" + #include #include @@ -42,7 +43,5 @@ char* strlwr(char* tmp) { return tmp; } -#else - int joe = 1; #endif /* !WIN32 */ diff --git a/common/unix.h b/common/unix.h index d4155f946..e593e3776 100644 --- a/common/unix.h +++ b/common/unix.h @@ -16,6 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _WINDOWS + #ifndef __UNIX_H__ #define __UNIX_H__ #include @@ -28,5 +29,5 @@ char* strupr(char* tmp); char* strlwr(char* tmp); #endif #endif -#endif +#endif diff --git a/common/useperl.h b/common/useperl.h index fb638be57..5816944e6 100644 --- a/common/useperl.h +++ b/common/useperl.h @@ -1,6 +1,4 @@ -#ifndef EMU_PERL_H_ -#define EMU_PERL_H_ - +#pragma once //headers from the Perl distribution #include @@ -64,6 +62,3 @@ extern "C" { //the perl headers dont do this for us... #undef do_close #endif #endif - -#endif /*EMU_PERL_H_*/ - diff --git a/common/util/directory.cpp b/common/util/directory.cpp index 9bc075bbe..f8ed6b149 100644 --- a/common/util/directory.cpp +++ b/common/util/directory.cpp @@ -1,7 +1,7 @@ #include "directory.h" #ifdef _WIN32 -#include "win_dirent.h" +#include "common/util/win_dirent.h" #else #include #endif diff --git a/common/util/memory_stream.h b/common/util/memory_stream.h index f6792458c..9fc99d601 100644 --- a/common/util/memory_stream.h +++ b/common/util/memory_stream.h @@ -1,8 +1,8 @@ #pragma once -#include #include #include +#include namespace EQ { diff --git a/common/util/uuid.cpp b/common/util/uuid.cpp index 1e221b5b9..0a6375ddb 100644 --- a/common/util/uuid.cpp +++ b/common/util/uuid.cpp @@ -1,8 +1,8 @@ #include "uuid.h" +#include "fmt/format.h" + #include -#include -#include #ifdef _WIN32 #include diff --git a/common/util/uuid.h b/common/util/uuid.h index d1e49a0e7..7a7c96d42 100644 --- a/common/util/uuid.h +++ b/common/util/uuid.h @@ -1,8 +1,8 @@ #pragma once +#include #include #include -#include namespace EQ { diff --git a/common/version.h b/common/version.h index c119346d4..34958bcef 100644 --- a/common/version.h +++ b/common/version.h @@ -18,8 +18,7 @@ * */ -#ifndef EQEMU_VERSION_H -#define EQEMU_VERSION_H +#pragma once #define EQEMU_PROTOCOL_VERSION "0.3.10" @@ -45,6 +44,3 @@ #define CURRENT_BINARY_DATABASE_VERSION 9328 #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9054 #define CUSTOM_BINARY_DATABASE_VERSION 0 - -#endif - diff --git a/common/zone_store.cpp b/common/zone_store.cpp index fa64bd492..1b3d1164e 100644 --- a/common/zone_store.cpp +++ b/common/zone_store.cpp @@ -17,6 +17,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ + +#include "zone_store.h" + +#include "common/content/world_content_service.h" +#include "common/stacktrace/backward.hpp" + #define DEFAULT_MINIMUM_CLIP 50.0f #define DEFAULT_MAXIMUM_CLIP 175.0f @@ -41,10 +47,6 @@ #define SNOW_SLOT_THREE 3 #define SNOW_SLOT_FOUR 4 -#include "zone_store.h" -#include "../common/content/world_content_service.h" -#include "stacktrace/backward.hpp" - ZoneStore::ZoneStore() = default; ZoneStore::~ZoneStore() = default; diff --git a/common/zone_store.h b/common/zone_store.h index 4a6940f4d..48bded65c 100644 --- a/common/zone_store.h +++ b/common/zone_store.h @@ -18,13 +18,12 @@ * */ -#ifndef EQEMU_ZONE_STORE_H -#define EQEMU_ZONE_STORE_H +#pragma once -#include "../common/repositories/zone_repository.h" -#include "../common/repositories/base/base_content_flags_repository.h" +#include "common/repositories/base/base_content_flags_repository.h" +#include "common/repositories/zone_repository.h" -#include +#include "glm/vec4.hpp" class ZoneStore { public: @@ -149,5 +148,3 @@ inline ZoneRepository::Zone *GetZoneVersionWithFallback(uint32 zone_id, int vers version ); }; - -#endif //EQEMU_ZONE_STORE_H