From 53169ae217ae064cad2f7fb6cfff91f569bb733d Mon Sep 17 00:00:00 2001 From: Alex King <89047260+Kinglykrab@users.noreply.github.com> Date: Sat, 30 Dec 2023 11:21:57 -0500 Subject: [PATCH] [Cleanup] Delete errmsg.h in common and zone (#3821) * [Cleanup] Delete errmsg.h in common and zone # Notes - These files were mostly unused. - Moved the stuff that was used to the `dbcore.h` file since it's already used. * Remove references --- common/CMakeLists.txt | 1 - common/dbcore.cpp | 1 - common/dbcore.h | 3 +++ common/errmsg.h | 59 ----------------------------------------- queryserv/database.cpp | 1 - ucs/database.cpp | 3 +-- zone/CMakeLists.txt | 1 - zone/errmsg.h | 60 ------------------------------------------ 8 files changed, 4 insertions(+), 125 deletions(-) delete mode 100644 common/errmsg.h delete mode 100644 zone/errmsg.h diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index d21fa0c79..05d5a10c5 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -541,7 +541,6 @@ SET(common_headers events/player_event_logs.h events/player_event_discord_formatter.h events/player_events.h - errmsg.h event_sub.h expedition_lockout_timer.h extprofile.h diff --git a/common/dbcore.cpp b/common/dbcore.cpp index ab7cd945a..2fad0f2a7 100644 --- a/common/dbcore.cpp +++ b/common/dbcore.cpp @@ -8,7 +8,6 @@ #include "dbcore.h" -#include #include #include #include diff --git a/common/dbcore.h b/common/dbcore.h index 30f5d1304..3cc206012 100644 --- a/common/dbcore.h +++ b/common/dbcore.h @@ -14,6 +14,9 @@ #include #include +#define CR_SERVER_GONE_ERROR 2006 +#define CR_SERVER_LOST 2013 + class DBcore { public: enum eStatus { diff --git a/common/errmsg.h b/common/errmsg.h deleted file mode 100644 index f884d7ab2..000000000 --- a/common/errmsg.h +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ - -/* Error messages for mysql clients */ -/* error messages for the demon is in share/language/errmsg.sys */ - -#ifdef __cplusplus -extern "C" { -#endif -void init_client_errs(void); -extern const char *client_errors[]; /* Error messages */ -#ifdef __cplusplus -} -#endif - -#define CR_MIN_ERROR 2000 /* For easier client code */ -#define CR_MAX_ERROR 2999 -#if defined(OS2) && defined( MYSQL_SERVER) -#define CER(X) client_errors[(X)-CR_MIN_ERROR] -#else -#define ER(X) client_errors[(X)-CR_MIN_ERROR] -#endif -#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */ - -#define CR_UNKNOWN_ERROR 2000 -#define CR_SOCKET_CREATE_ERROR 2001 -#define CR_CONNECTION_ERROR 2002 -#define CR_CONN_HOST_ERROR 2003 -#define CR_IPSOCK_ERROR 2004 -#define CR_UNKNOWN_HOST 2005 -#define CR_SERVER_GONE_ERROR 2006 -#define CR_VERSION_ERROR 2007 -#define CR_OUT_OF_MEMORY 2008 -#define CR_WRONG_HOST_INFO 2009 -#define CR_LOCALHOST_CONNECTION 2010 -#define CR_TCP_CONNECTION 2011 -#define CR_SERVER_HANDSHAKE_ERR 2012 -#define CR_SERVER_LOST 2013 -#define CR_COMMANDS_OUT_OF_SYNC 2014 -#define CR_NAMEDPIPE_CONNECTION 2015 -#define CR_NAMEDPIPEWAIT_ERROR 2016 -#define CR_NAMEDPIPEOPEN_ERROR 2017 -#define CR_NAMEDPIPESETSTATE_ERROR 2018 -#define CR_CANT_READ_CHARSET 2019 -#define CR_NET_PACKET_TOO_LARGE 2020 diff --git a/queryserv/database.cpp b/queryserv/database.cpp index 7a442ae4c..5bd21ac5e 100644 --- a/queryserv/database.cpp +++ b/queryserv/database.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/ucs/database.cpp b/ucs/database.cpp index 25941d1a8..356180a2e 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -160,7 +159,7 @@ bool UCSDatabase::VerifyMailKey(const std::string& characterName, int IPAddress, LogInfo("No mailkeys found for [{}].", characterName.c_str()); return false; } - + auto row = results.begin(); // The key is the client's IP address (expressed as 8 hex digits) and an 8 hex digit random string generated diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt index faa976ab9..84a3258a6 100644 --- a/zone/CMakeLists.txt +++ b/zone/CMakeLists.txt @@ -191,7 +191,6 @@ SET(zone_headers embperl.h encounter.h entity.h - errmsg.h event_codes.h expedition.h expedition_database.h diff --git a/zone/errmsg.h b/zone/errmsg.h deleted file mode 100644 index 0b65671a1..000000000 --- a/zone/errmsg.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ - -/* Error messages for mysql clients */ -/* error messages for the demon is in share/language/errmsg.sys */ - -#ifdef __cplusplus -extern "C" { -#endif -void init_client_errs(void); -extern const char *client_errors[]; /* Error messages */ -#ifdef __cplusplus -} -#endif - -#define CR_MIN_ERROR 2000 /* For easier client code */ -#define CR_MAX_ERROR 2999 -#if defined(OS2) && defined( MYSQL_SERVER) -#define CER(X) client_errors[(X)-CR_MIN_ERROR] -#else -#define ER(X) client_errors[(X)-CR_MIN_ERROR] -#endif -#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */ - -#define CR_UNKNOWN_ERROR 2000 -#define CR_SOCKET_CREATE_ERROR 2001 -#define CR_CONNECTION_ERROR 2002 -#define CR_CONN_HOST_ERROR 2003 -#define CR_IPSOCK_ERROR 2004 -#define CR_UNKNOWN_HOST 2005 -#define CR_SERVER_GONE_ERROR 2006 -#define CR_VERSION_ERROR 2007 -#define CR_OUT_OF_MEMORY 2008 -#define CR_WRONG_HOST_INFO 2009 -#define CR_LOCALHOST_CONNECTION 2010 -#define CR_TCP_CONNECTION 2011 -#define CR_SERVER_HANDSHAKE_ERR 2012 -#define CR_SERVER_LOST 2013 -#define CR_COMMANDS_OUT_OF_SYNC 2014 -#define CR_NAMEDPIPE_CONNECTION 2015 -#define CR_NAMEDPIPEWAIT_ERROR 2016 -#define CR_NAMEDPIPEOPEN_ERROR 2017 -#define CR_NAMEDPIPESETSTATE_ERROR 2018 -#define CR_CANT_READ_CHARSET 2019 -#define CR_NET_PACKET_TOO_LARGE 2020 -