From ed2344dc99238809621f2d4e4cc6ef0ef845b34b Mon Sep 17 00:00:00 2001 From: brainiac Date: Thu, 18 Dec 2025 00:27:40 -0800 Subject: [PATCH] normalize includes: ucs --- ucs/CMakeLists.txt | 1 + ucs/chatchannel.cpp | 12 ++++++----- ucs/chatchannel.h | 11 ++++------ ucs/clientlist.cpp | 26 +++++++++++------------ ucs/clientlist.h | 14 ++++++------ ucs/database.cpp | 52 +++++++++++++++++---------------------------- ucs/database.h | 31 ++++++++++++--------------- ucs/ucs.cpp | 44 ++++++++++++++++++-------------------- ucs/ucsconfig.cpp | 2 -- ucs/ucsconfig.h | 8 ++----- ucs/worldserver.cpp | 41 +++++++++++++++++------------------ ucs/worldserver.h | 11 +++++----- 12 files changed, 110 insertions(+), 143 deletions(-) diff --git a/ucs/CMakeLists.txt b/ucs/CMakeLists.txt index 73a78abb8..f33fa9a51 100644 --- a/ucs/CMakeLists.txt +++ b/ucs/CMakeLists.txt @@ -24,6 +24,7 @@ install(TARGETS ucs RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) add_definitions(-DUCS) target_link_libraries(ucs common) +target_include_directories(ucs PRIVATE ..) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) set_property(TARGET ucs PROPERTY FOLDER executables/servers) diff --git a/ucs/chatchannel.cpp b/ucs/chatchannel.cpp index 1e0e0598f..001bf58b7 100644 --- a/ucs/chatchannel.cpp +++ b/ucs/chatchannel.cpp @@ -17,13 +17,15 @@ */ -#include "../common/eqemu_logsys.h" -#include "../common/strings.h" #include "chatchannel.h" -#include "clientlist.h" -#include "database.h" -#include + +#include "common/eqemu_logsys.h" +#include "common/strings.h" +#include "ucs/clientlist.h" +#include "ucs/database.h" + #include +#include extern UCSDatabase database; extern uint32 ChatMessagesSent; diff --git a/ucs/chatchannel.h b/ucs/chatchannel.h index f9bba0c95..260a0a0eb 100644 --- a/ucs/chatchannel.h +++ b/ucs/chatchannel.h @@ -1,9 +1,8 @@ -#ifndef CHATCHANNEL_H -#define CHATCHANNEL_H +#pragma once + +#include "common/linked_list.h" +#include "common/timer.h" -//#include "clientlist.h" -#include "../common/linked_list.h" -#include "../common/timer.h" #include #include @@ -102,5 +101,3 @@ private: }; std::string CapitaliseName(const std::string& inString); - -#endif diff --git a/ucs/clientlist.cpp b/ucs/clientlist.cpp index 749b9276f..03ab79073 100644 --- a/ucs/clientlist.cpp +++ b/ucs/clientlist.cpp @@ -17,22 +17,20 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/global_define.h" -#include "../common/strings.h" -#include "../common/eqemu_logsys.h" -#include "../common/misc_functions.h" +#include "common/eqemu_logsys.h" +#include "common/misc_functions.h" +#include "common/path_manager.h" +#include "common/strings.h" +#include "ucs/chatchannel.h" +#include "ucs/clientlist.h" +#include "ucs/database.h" +#include "ucs/ucsconfig.h" -#include "ucsconfig.h" -#include "clientlist.h" -#include "database.h" -#include "chatchannel.h" -#include "../common/path_manager.h" - -#include -#include -#include -#include #include +#include +#include +#include +#include extern UCSDatabase database; extern std::string WorldShortName; diff --git a/ucs/clientlist.h b/ucs/clientlist.h index feb136e2b..90d9fa193 100644 --- a/ucs/clientlist.h +++ b/ucs/clientlist.h @@ -17,13 +17,13 @@ */ -#ifndef CHATSERVER_CLIENTLIST_H -#define CHATSERVER_CLIENTLIST_H +#pragma once + +#include "common/net/eqstream.h" +#include "common/opcodemgr.h" +#include "common/rulesys.h" +#include "ucs/chatchannel.h" -#include "../common/opcodemgr.h" -#include "../common/net/eqstream.h" -#include "../common/rulesys.h" -#include "chatchannel.h" #include #include @@ -197,5 +197,3 @@ private: OpcodeManager *ChatOpMgr; }; - -#endif diff --git a/ucs/database.cpp b/ucs/database.cpp index 356180a2e..21df0c40b 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -17,40 +17,26 @@ */ - -#include "../common/global_define.h" -#include "../common/eqemu_logsys.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Disgrace: for windows compile -#ifdef _WINDOWS -#include -#define snprintf _snprintf -#define strncasecmp _strnicmp -#define strcasecmp _stricmp -#else - -#include "../common/unix.h" -#include - -#endif - #include "database.h" -#include "../common/eq_packet_structs.h" -#include "../common/misc_functions.h" -#include "../common/strings.h" -#include "chatchannel.h" -#include "../common/repositories/chatchannel_reserved_names_repository.h" -#include "../common/repositories/chatchannels_repository.h" -#include "../common/repositories/name_filter_repository.h" + +#include "common/eq_packet_structs.h" +#include "common/eqemu_logsys.h" +#include "common/misc_functions.h" +#include "common/platform/platform.h" +#include "common/repositories/chatchannel_reserved_names_repository.h" +#include "common/repositories/chatchannels_repository.h" +#include "common/repositories/name_filter_repository.h" +#include "common/strings.h" +#include "ucs/chatchannel.h" + +#include "mysqld_error.h" +#include +#include +#include +#include +#include +#include +#include extern Clientlist *g_Clientlist; extern std::string GetMailPrefix(); diff --git a/ucs/database.h b/ucs/database.h index 3a5860348..6bfbbeea9 100644 --- a/ucs/database.h +++ b/ucs/database.h @@ -17,25 +17,23 @@ */ -#ifndef CHATSERVER_DATABASE_H -#define CHATSERVER_DATABASE_H +#pragma once + +#include "common/database.h" +#include "common/database.h" +#include "common/linked_list.h" +#include "common/shareddb.h" +#include "common/types.h" +#include "ucs/chatchannel.h" +#include "ucs/clientlist.h" + +#include +#include +#include #define AUTHENTICATION_TIMEOUT 60 #define INVALID_ID 0xFFFFFFFF -#include "../common/global_define.h" -#include "../common/types.h" -#include "../common/database.h" -#include "../common/linked_list.h" -#include "../common/database.h" -#include "clientlist.h" -#include "chatchannel.h" -#include "../common/shareddb.h" -#include -#include -#include - - class UCSDatabase : public Database { public: int FindAccount(const char *CharacterName, Client *c); @@ -62,6 +60,3 @@ public: void RemoveFriendOrIgnore(const int& char_id, const int& type, const std::string& name); void GetFriendsAndIgnore(const int& char_id, std::vector &Friends, std::vector &Ignorees); }; - -#endif - diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index f74bb79c1..57b4630be 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -17,30 +17,28 @@ */ -#include "../common/eqemu_logsys.h" -#include "../common/global_define.h" -#include "clientlist.h" -#include "../common/opcodemgr.h" -#include "../common/rulesys.h" -#include "../common/servertalk.h" -#include "../common/platform.h" -#include "../common/crash.h" -#include "../common/event/event_loop.h" -#include "database.h" -#include "ucsconfig.h" -#include "chatchannel.h" -#include "worldserver.h" -#include -#include -#include -#include +#include "common/crash.h" +#include "common/discord/discord_manager.h" +#include "common/eqemu_logsys.h" +#include "common/event/event_loop.h" +#include "common/events/player_event_logs.h" +#include "common/net/servertalk_client_connection.h" +#include "common/net/tcp_server.h" +#include "common/opcodemgr.h" +#include "common/path_manager.h" +#include "common/platform.h" +#include "common/rulesys.h" +#include "common/servertalk.h" +#include "common/zone_store.h" +#include "ucs/chatchannel.h" +#include "ucs/clientlist.h" +#include "ucs/database.h" +#include "ucs/ucsconfig.h" +#include "ucs/worldserver.h" -#include "../common/net/tcp_server.h" -#include "../common/net/servertalk_client_connection.h" -#include "../common/discord/discord_manager.h" -#include "../common/path_manager.h" -#include "../common/zone_store.h" -#include "../common/events/player_event_logs.h" +#include +#include +#include ChatChannelList *ChannelList; Clientlist *g_Clientlist; diff --git a/ucs/ucsconfig.cpp b/ucs/ucsconfig.cpp index dd8c73ab8..2d9d17783 100644 --- a/ucs/ucsconfig.cpp +++ b/ucs/ucsconfig.cpp @@ -17,7 +17,6 @@ */ -#include "../common/global_define.h" #include "ucsconfig.h" ucsconfig *ucsconfig::_chat_config = nullptr; @@ -25,4 +24,3 @@ ucsconfig *ucsconfig::_chat_config = nullptr; std::string ucsconfig::GetByName(const std::string &var_name) const { return(EQEmuConfig::GetByName(var_name)); } - diff --git a/ucs/ucsconfig.h b/ucs/ucsconfig.h index 887ff821b..a6b8dc778 100644 --- a/ucs/ucsconfig.h +++ b/ucs/ucsconfig.h @@ -17,10 +17,9 @@ */ -#ifndef __ucsconfig_H -#define __ucsconfig_H +#pragma once -#include "../common/eqemu_config.h" +#include "common/eqemu_config.h" class ucsconfig : public EQEmuConfig { public: @@ -50,6 +49,3 @@ public: } }; - -#endif - diff --git a/ucs/worldserver.cpp b/ucs/worldserver.cpp index 48e85f181..c3ee7a0ca 100644 --- a/ucs/worldserver.cpp +++ b/ucs/worldserver.cpp @@ -15,28 +15,27 @@ 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 02111-1307 USA */ -#include "../common/global_define.h" -#include "../common/eqemu_logsys.h" -#include "../common/servertalk.h" -#include "../common/misc_functions.h" -#include "../common/packet_functions.h" -#include "../common/md5.h" -#include "../common/strings.h" -#include "worldserver.h" -#include "clientlist.h" -#include "ucsconfig.h" -#include "database.h" -#include "../common/discord/discord_manager.h" -#include "../common/events/player_event_logs.h" -#include "../common/server_reload_types.h" -#include -#include -#include -#include -#include -#include -#include +#include "worldserver.h" + +#include "common/discord/discord_manager.h" +#include "common/eqemu_logsys.h" +#include "common/events/player_event_logs.h" +#include "common/md5.h" +#include "common/misc_functions.h" +#include "common/packet_functions.h" +#include "common/server_reload_types.h" +#include "common/servertalk.h" +#include "common/strings.h" +#include "ucs/clientlist.h" +#include "ucs/database.h" +#include "ucs/ucsconfig.h" + +#include +#include +#include +#include +#include extern WorldServer worldserver; extern Clientlist *g_Clientlist; diff --git a/ucs/worldserver.h b/ucs/worldserver.h index 9617a1f95..b42582069 100644 --- a/ucs/worldserver.h +++ b/ucs/worldserver.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 WORLDSERVER_H -#define WORLDSERVER_H -#include "../common/net/servertalk_client_connection.h" -#include "../common/eq_packet_structs.h" +#pragma once + +#include "common/eq_packet_structs.h" +#include "common/net/servertalk_client_connection.h" + #include class WorldServer @@ -33,5 +34,3 @@ private: std::unique_ptr m_connection; }; -#endif -