summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/HPMDataCheck.h22
-rw-r--r--src/common/Makefile.in16
-rw-r--r--src/common/cbasetypes.h6
-rw-r--r--src/common/console.c23
-rw-r--r--src/common/core.c42
-rw-r--r--src/common/memmgr.h5
-rw-r--r--src/common/mmo.h34
-rw-r--r--src/common/socket.c27
-rw-r--r--src/common/strlib.h21
9 files changed, 97 insertions, 99 deletions
diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h
index 28c6e3b1d..ecdc83740 100644
--- a/src/common/HPMDataCheck.h
+++ b/src/common/HPMDataCheck.h
@@ -557,6 +557,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "mapflag_skill_adjust", sizeof(struct mapflag_skill_adjust), SERVER_TYPE_MAP },
{ "mapit_interface", sizeof(struct mapit_interface), SERVER_TYPE_MAP },
{ "questinfo", sizeof(struct questinfo), SERVER_TYPE_MAP },
+ { "questinfo_itemreq", sizeof(struct questinfo_itemreq), SERVER_TYPE_MAP },
{ "questinfo_qreq", sizeof(struct questinfo_qreq), SERVER_TYPE_MAP },
{ "spawn_data", sizeof(struct spawn_data), SERVER_TYPE_MAP },
#else
@@ -606,6 +607,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "NORMALITEM_INFO", sizeof(struct NORMALITEM_INFO), SERVER_TYPE_MAP },
{ "PACKET_CZ_ADD_ITEM_TO_MAIL", sizeof(struct PACKET_CZ_ADD_ITEM_TO_MAIL), SERVER_TYPE_MAP },
{ "PACKET_CZ_CHECKNAME", sizeof(struct PACKET_CZ_CHECKNAME), SERVER_TYPE_MAP },
+ { "PACKET_CZ_MEMORIALDUNGEON_COMMAND", sizeof(struct PACKET_CZ_MEMORIALDUNGEON_COMMAND), SERVER_TYPE_MAP },
{ "PACKET_CZ_OPEN_UI", sizeof(struct PACKET_CZ_OPEN_UI), SERVER_TYPE_MAP },
{ "PACKET_CZ_PC_BUY_CASH_POINT_ITEM", sizeof(struct PACKET_CZ_PC_BUY_CASH_POINT_ITEM), SERVER_TYPE_MAP },
{ "PACKET_CZ_PC_BUY_CASH_POINT_ITEM_sub", sizeof(struct PACKET_CZ_PC_BUY_CASH_POINT_ITEM_sub), SERVER_TYPE_MAP },
@@ -626,6 +628,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "PACKET_CZ_REQ_REFRESH_MAIL_LIST", sizeof(struct PACKET_CZ_REQ_REFRESH_MAIL_LIST), SERVER_TYPE_MAP },
{ "PACKET_CZ_REQ_REMOVE_ITEM_MAIL", sizeof(struct PACKET_CZ_REQ_REMOVE_ITEM_MAIL), SERVER_TYPE_MAP },
{ "PACKET_CZ_REQ_STYLE_CHANGE", sizeof(struct PACKET_CZ_REQ_STYLE_CHANGE), SERVER_TYPE_MAP },
+ { "PACKET_CZ_REQ_STYLE_CHANGE2", sizeof(struct PACKET_CZ_REQ_STYLE_CHANGE2), SERVER_TYPE_MAP },
{ "PACKET_CZ_REQ_TRADE_BUYING_STORE", sizeof(struct PACKET_CZ_REQ_TRADE_BUYING_STORE), SERVER_TYPE_MAP },
{ "PACKET_CZ_REQ_TRADE_BUYING_STORE_sub", sizeof(struct PACKET_CZ_REQ_TRADE_BUYING_STORE_sub), SERVER_TYPE_MAP },
{ "PACKET_CZ_REQ_ZENY_FROM_MAIL", sizeof(struct PACKET_CZ_REQ_ZENY_FROM_MAIL), SERVER_TYPE_MAP },
@@ -634,11 +637,16 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "PACKET_CZ_SEARCH_STORE_INFO_item", sizeof(struct PACKET_CZ_SEARCH_STORE_INFO_item), SERVER_TYPE_MAP },
{ "PACKET_CZ_SEND_MAIL", sizeof(struct PACKET_CZ_SEND_MAIL), SERVER_TYPE_MAP },
{ "PACKET_CZ_SSILIST_ITEM_CLICK", sizeof(struct PACKET_CZ_SSILIST_ITEM_CLICK), SERVER_TYPE_MAP },
+ { "PACKET_ZC_ACK_BAN_GUILD1", sizeof(struct PACKET_ZC_ACK_BAN_GUILD1), SERVER_TYPE_MAP },
+ { "PACKET_ZC_ACK_BAN_GUILD2", sizeof(struct PACKET_ZC_ACK_BAN_GUILD2), SERVER_TYPE_MAP },
+ { "PACKET_ZC_ACK_BAN_GUILD3", sizeof(struct PACKET_ZC_ACK_BAN_GUILD3), SERVER_TYPE_MAP },
{ "PACKET_ZC_ACK_CLAN_LEAVE", sizeof(struct PACKET_ZC_ACK_CLAN_LEAVE), SERVER_TYPE_MAP },
{ "PACKET_ZC_ACK_DELETE_MAIL", sizeof(struct PACKET_ZC_ACK_DELETE_MAIL), SERVER_TYPE_MAP },
{ "PACKET_ZC_ACK_ITEM_FROM_MAIL", sizeof(struct PACKET_ZC_ACK_ITEM_FROM_MAIL), SERVER_TYPE_MAP },
{ "PACKET_ZC_ACK_ITEMLIST_BUYING_STORE", sizeof(struct PACKET_ZC_ACK_ITEMLIST_BUYING_STORE), SERVER_TYPE_MAP },
{ "PACKET_ZC_ACK_ITEMLIST_BUYING_STORE_sub", sizeof(struct PACKET_ZC_ACK_ITEMLIST_BUYING_STORE_sub), SERVER_TYPE_MAP },
+ { "PACKET_ZC_ACK_LEAVE_GUILD1", sizeof(struct PACKET_ZC_ACK_LEAVE_GUILD1), SERVER_TYPE_MAP },
+ { "PACKET_ZC_ACK_LEAVE_GUILD2", sizeof(struct PACKET_ZC_ACK_LEAVE_GUILD2), SERVER_TYPE_MAP },
{ "PACKET_ZC_ACK_OPEN_WRITE_MAIL", sizeof(struct PACKET_ZC_ACK_OPEN_WRITE_MAIL), SERVER_TYPE_MAP },
{ "PACKET_ZC_ACK_REMOVE_ITEM_MAIL", sizeof(struct PACKET_ZC_ACK_REMOVE_ITEM_MAIL), SERVER_TYPE_MAP },
{ "PACKET_ZC_ACK_REQMAKINGITEM", sizeof(struct PACKET_ZC_ACK_REQMAKINGITEM), SERVER_TYPE_MAP },
@@ -652,6 +660,9 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "PACKET_ZC_ADD_ITEM_TO_MAIL", sizeof(struct PACKET_ZC_ADD_ITEM_TO_MAIL), SERVER_TYPE_MAP },
{ "PACKET_ZC_ADD_ITEM_TO_STORE", sizeof(struct PACKET_ZC_ADD_ITEM_TO_STORE), SERVER_TYPE_MAP },
{ "PACKET_ZC_ADD_MEMBER_TO_GROUP", sizeof(struct PACKET_ZC_ADD_MEMBER_TO_GROUP), SERVER_TYPE_MAP },
+ { "PACKET_ZC_AUTOSPELLLIST1", sizeof(struct PACKET_ZC_AUTOSPELLLIST1), SERVER_TYPE_MAP },
+ { "PACKET_ZC_AUTOSPELLLIST2", sizeof(struct PACKET_ZC_AUTOSPELLLIST2), SERVER_TYPE_MAP },
+ { "PACKET_ZC_CAMERA_INFO", sizeof(struct PACKET_ZC_CAMERA_INFO), SERVER_TYPE_MAP },
{ "PACKET_ZC_CASH_ITEM_DELETE", sizeof(struct PACKET_ZC_CASH_ITEM_DELETE), SERVER_TYPE_MAP },
{ "PACKET_ZC_CASH_TIME_COUNTER", sizeof(struct PACKET_ZC_CASH_TIME_COUNTER), SERVER_TYPE_MAP },
{ "PACKET_ZC_CHECKNAME", sizeof(struct PACKET_ZC_CHECKNAME), SERVER_TYPE_MAP },
@@ -660,11 +671,15 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "PACKET_ZC_FEED_MER", sizeof(struct PACKET_ZC_FEED_MER), SERVER_TYPE_MAP },
{ "PACKET_ZC_FEED_PET", sizeof(struct PACKET_ZC_FEED_PET), SERVER_TYPE_MAP },
{ "PACKET_ZC_FORMATSTRING_MSG", sizeof(struct PACKET_ZC_FORMATSTRING_MSG), SERVER_TYPE_MAP },
+ { "PACKET_ZC_FORMATSTRING_MSG_COLOR", sizeof(struct PACKET_ZC_FORMATSTRING_MSG_COLOR), SERVER_TYPE_MAP },
{ "PACKET_ZC_GROUP_ISALIVE", sizeof(struct PACKET_ZC_GROUP_ISALIVE), SERVER_TYPE_MAP },
{ "PACKET_ZC_GROUP_LIST", sizeof(struct PACKET_ZC_GROUP_LIST), SERVER_TYPE_MAP },
{ "PACKET_ZC_GROUP_LIST_SUB", sizeof(struct PACKET_ZC_GROUP_LIST_SUB), SERVER_TYPE_MAP },
+ { "PACKET_ZC_GUILD_POSITION", sizeof(struct PACKET_ZC_GUILD_POSITION), SERVER_TYPE_MAP },
+ { "PACKET_ZC_INVENTORY_MOVE_FAILED", sizeof(struct PACKET_ZC_INVENTORY_MOVE_FAILED), SERVER_TYPE_MAP },
{ "PACKET_ZC_ITEM_ENTRY", sizeof(struct PACKET_ZC_ITEM_ENTRY), SERVER_TYPE_MAP },
{ "PACKET_ZC_ITEM_PICKUP_PARTY", sizeof(struct PACKET_ZC_ITEM_PICKUP_PARTY), SERVER_TYPE_MAP },
+ { "PACKET_ZC_ITEM_PREVIEW", sizeof(struct PACKET_ZC_ITEM_PREVIEW), SERVER_TYPE_MAP },
{ "PACKET_ZC_MAIL_LIST", sizeof(struct PACKET_ZC_MAIL_LIST), SERVER_TYPE_MAP },
{ "PACKET_ZC_MAKABLEITEMLIST", sizeof(struct PACKET_ZC_MAKABLEITEMLIST), SERVER_TYPE_MAP },
{ "PACKET_ZC_MAKABLEITEMLIST_sub", sizeof(struct PACKET_ZC_MAKABLEITEMLIST_sub), SERVER_TYPE_MAP },
@@ -696,6 +711,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "PACKET_ZC_PRIVATE_AIRSHIP_RESPONSE", sizeof(struct PACKET_ZC_PRIVATE_AIRSHIP_RESPONSE), SERVER_TYPE_MAP },
{ "PACKET_ZC_PROPERTY_HOMUN", sizeof(struct PACKET_ZC_PROPERTY_HOMUN), SERVER_TYPE_MAP },
{ "PACKET_ZC_READ_MAIL", sizeof(struct PACKET_ZC_READ_MAIL), SERVER_TYPE_MAP },
+ { "PACKET_ZC_REMOVE_EFFECT", sizeof(struct PACKET_ZC_REMOVE_EFFECT), SERVER_TYPE_MAP },
{ "PACKET_ZC_REPAIRITEMLIST", sizeof(struct PACKET_ZC_REPAIRITEMLIST), SERVER_TYPE_MAP },
{ "PACKET_ZC_REPAIRITEMLIST_sub", sizeof(struct PACKET_ZC_REPAIRITEMLIST_sub), SERVER_TYPE_MAP },
{ "PACKET_ZC_SEARCH_STORE_INFO_ACK", sizeof(struct PACKET_ZC_SEARCH_STORE_INFO_ACK), SERVER_TYPE_MAP },
@@ -709,7 +725,11 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "PACKET_ZC_WARPLIST", sizeof(struct PACKET_ZC_WARPLIST), SERVER_TYPE_MAP },
{ "PACKET_ZC_WARPLIST_sub", sizeof(struct PACKET_ZC_WARPLIST_sub), SERVER_TYPE_MAP },
{ "PACKET_ZC_WRITE_MAIL_RESULT", sizeof(struct PACKET_ZC_WRITE_MAIL_RESULT), SERVER_TYPE_MAP },
+ { "ZC_INVENTORY_END", sizeof(struct ZC_INVENTORY_END), SERVER_TYPE_MAP },
+ { "ZC_INVENTORY_START", sizeof(struct ZC_INVENTORY_START), SERVER_TYPE_MAP },
{ "ZC_PROGRESS_ACTOR", sizeof(struct ZC_PROGRESS_ACTOR), SERVER_TYPE_MAP },
+ { "ZC_STORE_ITEMLIST_EQUIP", sizeof(struct ZC_STORE_ITEMLIST_EQUIP), SERVER_TYPE_MAP },
+ { "ZC_STORE_ITEMLIST_NORMAL", sizeof(struct ZC_STORE_ITEMLIST_NORMAL), SERVER_TYPE_MAP },
{ "ach_list_info", sizeof(struct ach_list_info), SERVER_TYPE_MAP },
{ "mail_item", sizeof(struct mail_item), SERVER_TYPE_MAP },
{ "maillistinfo", sizeof(struct maillistinfo), SERVER_TYPE_MAP },
@@ -780,8 +800,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "packet_status_change", sizeof(struct packet_status_change), SERVER_TYPE_MAP },
{ "packet_status_change2", sizeof(struct packet_status_change2), SERVER_TYPE_MAP },
{ "packet_status_change_end", sizeof(struct packet_status_change_end), SERVER_TYPE_MAP },
- { "packet_storelist_equip", sizeof(struct packet_storelist_equip), SERVER_TYPE_MAP },
- { "packet_storelist_normal", sizeof(struct packet_storelist_normal), SERVER_TYPE_MAP },
{ "packet_unequipitem_ack", sizeof(struct packet_unequipitem_ack), SERVER_TYPE_MAP },
{ "packet_unit_walking", sizeof(struct packet_unit_walking), SERVER_TYPE_MAP },
{ "packet_viewequip_ack", sizeof(struct packet_viewequip_ack), SERVER_TYPE_MAP },
diff --git a/src/common/Makefile.in b/src/common/Makefile.in
index f65138521..67fe9c0d4 100644
--- a/src/common/Makefile.in
+++ b/src/common/Makefile.in
@@ -44,8 +44,6 @@ COMMON_C = $(COMMON_SHARED_C)
COMMON_SHARED_OBJ = $(patsubst %.c,%.o,$(COMMON_SHARED_C))
COMMON_OBJ = $(addprefix obj_all/, $(COMMON_SHARED_OBJ) \
console.o core.o memmgr.o socket.o)
-COMMON_MINI_OBJ = $(addprefix obj_all/, $(COMMON_SHARED_OBJ) \
- miniconsole.o minicore.o minimemmgr.o minisocket.o)
COMMON_C += console.c core.c memmgr.c socket.c
COMMON_H = atomic.h cbasetypes.h conf.h console.h core.h db.h des.h ers.h \
grfio.h hercules.h HPM.h HPMi.h memmgr.h mapindex.h md5calc.h \
@@ -61,7 +59,7 @@ SYSINFO_INC = sysinfo.inc
HAVE_MYSQL=@HAVE_MYSQL@
ifeq ($(HAVE_MYSQL),yes)
- SQL_DEPENDS=common common_sql common_mini
+ SQL_DEPENDS=common common_sql
else
SQL_DEPENDS=needs_mysql
endif
@@ -72,7 +70,7 @@ CC = @CC@
export CC
#####################################################################
-.PHONY: all sql common common_sql common_mini clean buildclean help
+.PHONY: all sql common common_sql clean buildclean help
all: sql
@@ -119,18 +117,12 @@ obj_all/common.a: $(COMMON_OBJ) Makefile
@echo " AR $@"
@@AR@ rcs obj_all/common.a $(COMMON_OBJ)
-obj_all/common_mini.a: $(COMMON_MINI_OBJ) Makefile
- @echo " AR $@"
- @@AR@ rcs obj_all/common_mini.a $(COMMON_MINI_OBJ)
-
obj_sql/common_sql.a: $(COMMON_SQL_OBJ) Makefile
@echo " AR $@"
@@AR@ rcs obj_sql/common_sql.a $(COMMON_SQL_OBJ)
common: $(COMMON_OBJ) $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) obj_all/common.a Makefile
-common_mini: $(COMMON_MINI_OBJ) $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) obj_all/common_mini.a Makefile
-
common_sql: $(COMMON_SQL_OBJ) obj_sql/common_sql.a Makefile
# missing object files
@@ -150,10 +142,6 @@ obj_all/%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSIN
@echo " CC $<"
@$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
-obj_all/mini%.o: %.c $$(filter %.p.h, $(COMMON_PH)) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all
- @echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) -DMINICORE @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
-
obj_sql/%.o: %.c $$(filter %.p.h, $(COMMON_PH)) $(COMMON_H) $(COMMON_SQL_H) $(CONFIG_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_sql
@echo " CC $<"
@$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h
index 3fc41bb23..89f7f8588 100644
--- a/src/common/cbasetypes.h
+++ b/src/common/cbasetypes.h
@@ -460,12 +460,6 @@ typedef char bool;
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
// C11 version
#define STATIC_ASSERT(ex, msg) _Static_assert(ex, msg)
-#elif __has_feature(c_static_assert)
-// Clang support (as per http://clang.llvm.org/docs/LanguageExtensions.html)
-#define STATIC_ASSERT(ex, msg) _Static_assert(ex, msg)
-#elif defined(__GNUC__) && GCC_VERSION >= 40700
-// GCC >= 4.7 is known to support it
-#define STATIC_ASSERT(ex, msg) _Static_assert(ex, msg)
#elif defined(_MSC_VER)
// MSVC doesn't support it, but it accepts the C++ style version
#define STATIC_ASSERT(ex, msg) static_assert(ex, msg)
diff --git a/src/common/console.c b/src/common/console.c
index 55a9815f5..a990d86b3 100644
--- a/src/common/console.c
+++ b/src/common/console.c
@@ -23,23 +23,21 @@
#include "config/core.h" // CONSOLE_INPUT, MAX_CONSOLE_INPUT
#include "console.h"
+#include "common/atomic.h"
#include "common/cbasetypes.h"
#include "common/core.h"
+#include "common/ers.h"
+#include "common/memmgr.h"
+#include "common/mmo.h"
+#include "common/mutex.h"
#include "common/nullpo.h"
#include "common/showmsg.h"
+#include "common/spinlock.h"
+#include "common/sql.h"
+#include "common/strlib.h"
#include "common/sysinfo.h"
-
-#ifndef MINICORE
-# include "common/atomic.h"
-# include "common/ers.h"
-# include "common/memmgr.h"
-# include "common/mutex.h"
-# include "common/spinlock.h"
-# include "common/sql.h"
-# include "common/strlib.h"
-# include "common/thread.h"
-# include "common/timer.h"
-#endif
+#include "common/thread.h"
+#include "common/timer.h"
#include <stdio.h>
#include <stdlib.h>
@@ -93,6 +91,7 @@ static void display_title(void)
ShowInfo("Compiled with %s\n", sysinfo->compiler());
ShowInfo("Compile Flags: %s\n", sysinfo->cflags());
ShowInfo("Timer Function Type: %s\n", sysinfo->time());
+ ShowInfo("Packet version: %d " PACKETTYPE "\n", PACKETVER);
}
/**
diff --git a/src/common/core.c b/src/common/core.c
index 9fd33c4e0..1ecf1df83 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -23,32 +23,29 @@
#include "config/core.h"
#include "core.h"
+#include "common/HPM.h"
#include "common/cbasetypes.h"
+#include "common/conf.h"
#include "common/console.h"
#include "common/db.h"
#include "common/des.h"
+#include "common/ers.h"
#include "common/grfio.h"
+#include "common/md5calc.h"
#include "common/memmgr.h"
#include "common/mmo.h"
+#include "common/mutex.h"
#include "common/nullpo.h"
+#include "common/random.h"
#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/sql.h"
#include "common/strlib.h"
#include "common/sysinfo.h"
+#include "common/thread.h"
#include "common/timer.h"
#include "common/utils.h"
-#ifndef MINICORE
-# include "common/HPM.h"
-# include "common/conf.h"
-# include "common/ers.h"
-# include "common/md5calc.h"
-# include "common/mutex.h"
-# include "common/random.h"
-# include "common/socket.h"
-# include "common/sql.h"
-# include "common/thread.h"
-#endif
-
#ifndef _WIN32
# include <unistd.h>
#else
@@ -83,7 +80,6 @@
static struct core_interface core_s;
struct core_interface *core = &core_s;
-#ifndef MINICORE // minimalist Core
// Added by Gabuzomeu
//
// This is an implementation of signal() using sigaction() for portability.
@@ -196,7 +192,6 @@ static void signals_init(void)
compat_signal(SIGTRAP, SIG_DFL);
#endif
}
-#endif
/**
* Warns the user if executed as superuser (root)
@@ -250,10 +245,8 @@ static bool usercheck(void)
static void core_defaults(void)
{
nullpo_defaults();
-#ifndef MINICORE
hpm_defaults();
HCache_defaults();
-#endif
sysinfo_defaults();
console_defaults();
strlib_defaults();
@@ -262,7 +255,6 @@ static void core_defaults(void)
cmdline_defaults();
des_defaults();
grfio_defaults(); // Note: grfio is lazily loaded. grfio->init() and grfio->final() are not automatically called.
-#ifndef MINICORE
mutex_defaults();
libconfig_defaults();
sql_defaults();
@@ -272,7 +264,6 @@ static void core_defaults(void)
rnd_defaults();
md5_defaults();
thread_defaults();
-#endif
}
/**
@@ -280,12 +271,8 @@ static void core_defaults(void)
*/
static const char *cmdline_arg_source(struct CmdlineArgData *arg)
{
-#ifdef MINICORE
- return "core";
-#else // !MINICORE
nullpo_retr(NULL, arg);
return HPM->pid2name(arg->pluginID);
-#endif // MINICORE
}
/**
@@ -446,15 +433,9 @@ static int cmdline_exec(int argc, char **argv, unsigned int options)
*/
static void cmdline_init(void)
{
-#ifdef MINICORE
- // Minicore has no HPM. This value isn't used, but the arg_add function requires it, so we're (re)defining it here
-#define HPM_PID_CORE ((unsigned int)-1)
-#endif
CMDLINEARG_DEF(help, 'h', "Displays this help screen", CMDLINE_OPT_NORMAL);
CMDLINEARG_DEF(version, 'v', "Displays the server's version.", CMDLINE_OPT_NORMAL);
-#ifndef MINICORE
CMDLINEARG_DEF2(load-plugin, loadplugin, "Loads an additional plugin (can be repeated).", CMDLINE_OPT_PARAM|CMDLINE_OPT_PREINIT);
-#endif // !MINICORE
cmdline_args_init_local();
}
@@ -521,10 +502,6 @@ int main(int argc, char **argv)
if (!usercheck())
return EXIT_FAILURE;
-#ifdef MINICORE // minimalist Core
- do_init(argc,argv);
- do_final();
-#else// not MINICORE
set_server_type();
Sql_Init();
@@ -567,7 +544,6 @@ int main(int argc, char **argv)
thread->final();
ers_final();
rnd->final();
-#endif
cmdline->final();
//sysinfo->final(); Called by iMalloc->final()
diff --git a/src/common/memmgr.h b/src/common/memmgr.h
index 90c35f244..c7147cc5e 100644
--- a/src/common/memmgr.h
+++ b/src/common/memmgr.h
@@ -42,11 +42,6 @@
// Enable memory manager logging by default
#define LOG_MEMMGR
-// no logging for minicore
-#if defined(MINICORE) && defined(LOG_MEMMGR)
- #undef LOG_MEMMGR
-#endif
-
# define aMalloc(n) (iMalloc->malloc((n),ALC_MARK))
# define aCalloc(m,n) (iMalloc->calloc((m),(n),ALC_MARK))
# define aRealloc(p,n) (iMalloc->realloc((p),(n),ALC_MARK))
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 7e0d915eb..9bcf82cc7 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -81,21 +81,50 @@
#undef ENABLE_PACKETVER_ZERO
#endif // DISABLE_PACKETVER_ZERO
-#if !defined(PACKETVER_RE) && !defined(PACKETVER_ZERO)
+//Uncomment the following line if your client is sakexe
+//#define ENABLE_PACKETVER_SAK
+#ifdef ENABLE_PACKETVER_SAK
+ #define PACKETVER_SAK
+ #undef ENABLE_PACKETVER_SAK
+#endif // DISABLE_PACKETVER_SAK
+
+//Uncomment the following line if your client is ragexeAD
+//#define ENABLE_PACKETVER_AD
+#ifdef ENABLE_PACKETVER_AD
+ #define PACKETVER_AD
+ #undef ENABLE_PACKETVER_AD
+#endif // DISABLE_PACKETVER_AD
+
+#if !defined(PACKETVER_RE) && !defined(PACKETVER_ZERO) && !defined(PACKETVER_SAK) && !defined(PACKETVER_AD)
#define PACKETVER_MAIN_NUM PACKETVER
+ #define PACKETTYPE "main"
#else
#define PACKETVER_MAIN_NUM 0
#endif
#ifdef PACKETVER_RE
#define PACKETVER_RE_NUM PACKETVER
+ #define PACKETTYPE "RE"
#else
#define PACKETVER_RE_NUM 0
#endif
#ifdef PACKETVER_ZERO
#define PACKETVER_ZERO_NUM PACKETVER
+ #define PACKETTYPE "zero"
#else
#define PACKETVER_ZERO_NUM 0
#endif
+#ifdef PACKETVER_SAK
+ #define PACKETVER_SAK_NUM PACKETVER
+ #define PACKETTYPE "sak"
+#else
+ #define PACKETVER_SAK_NUM 0
+#endif
+#ifdef PACKETVER_AD
+ #define PACKETVER_AD_NUM PACKETVER
+ #define PACKETTYPE "ad"
+#else
+ #define PACKETVER_AD_NUM 0
+#endif
// Client support for experimental RagexeRE UI present in 2012-04-10 and 2012-04-18
#if defined(PACKETVER_RE) && ( PACKETVER == 20120410 || PACKETVER == 20120418 )
@@ -1302,7 +1331,8 @@ enum questinfo_type {
QINFO_ITEM,
QINFO_HOMUN_LEVEL,
QINFO_HOMUN_TYPE,
- QINFO_QUEST
+ QINFO_QUEST,
+ QINFO_MERCENARY_CLASS
};
/* packet size constant for itemlist */
diff --git a/src/common/socket.c b/src/common/socket.c
index 290c7a1b3..fd86414d6 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -301,10 +301,8 @@ static uint32 send_shortlist_set[(FD_SETSIZE+31)/32];// to know if specific fd's
static int create_session(int fd, RecvFunc func_recv, SendFunc func_send, ParseFunc func_parse);
-#ifndef MINICORE
- static int ip_rules = 1;
- static int connect_check(uint32 ip);
-#endif // MINICORE
+static int ip_rules = 1;
+static int connect_check(uint32 ip);
static const char *error_msg(void)
{
@@ -556,12 +554,10 @@ static int connect_client(int listen_fd)
setsocketopts(fd,NULL);
sockt->set_nonblocking(fd, 1);
-#ifndef MINICORE
if( ip_rules && !connect_check(ntohl(client_address.sin_addr.s_addr)) ) {
sockt->close(fd);
return -1;
}
-#endif // MINICORE
#ifndef SOCKET_EPOLL
// Select Based Event Dispatcher
@@ -1065,9 +1061,6 @@ static int do_sockets(int next)
return 0;
}
-//////////////////////////////
-#ifndef MINICORE
-//////////////////////////////
// IP rules and DDoS protection
struct connect_history {
@@ -1326,11 +1319,6 @@ static bool access_list_add(struct config_setting_t *setting, const char *list_n
return true;
}
-//////////////////////////////
-#endif // MINICORE
-//////////////////////////////
-
-#ifndef MINICORE
/**
* Reads 'socket_configuration/ip_rules' and initializes required variables.
*
@@ -1387,9 +1375,7 @@ static bool socket_config_read_iprules(const char *filename, struct config_t *co
return true;
}
-#endif // ! MINICORE
-#ifndef MINICORE
/**
* Reads 'socket_configuration/ddos' and initializes required variables.
*
@@ -1419,7 +1405,6 @@ static bool socket_config_read_ddos(const char *filename, struct config_t *confi
return true;
}
-#endif // ! MINICORE
/**
* Reads 'socket_configuration' and initializes required variables.
@@ -1464,7 +1449,6 @@ static bool socket_config_read(const char *filename, bool imported)
}
#endif // SOCKET_EPOLL
-#ifndef MINICORE
{
uint32 ui32 = 0;
libconfig->setting_lookup_bool(setting, "debug", &access_debug);
@@ -1477,7 +1461,6 @@ static bool socket_config_read(const char *filename, bool imported)
retval = false;
if (!socket_config_read_ddos(filename, &config, imported))
retval = false;
-#endif // MINICORE
// import should overwrite any previous configuration, so it should be called last
if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
@@ -1496,12 +1479,10 @@ static bool socket_config_read(const char *filename, bool imported)
static void socket_final(void)
{
int i;
-#ifndef MINICORE
if( connect_history )
db_destroy(connect_history);
VECTOR_CLEAR(access_allow);
VECTOR_CLEAR(access_deny);
-#endif // MINICORE
for( i = 1; i < sockt->fd_max; i++ )
if(sockt->session[i])
@@ -1686,10 +1667,8 @@ static void socket_init(void)
}
#endif // defined(HAVE_SETRLIMIT) && !defined(CYGWIN)
-#ifndef MINICORE
VECTOR_INIT(access_allow);
VECTOR_INIT(access_deny);
-#endif // ! MINICORE
// Get initial local ips
sockt->naddr_ = sockt->getips(sockt->addr_,16);
@@ -1729,12 +1708,10 @@ static void socket_init(void)
// should hold enough buffer (it is a vacuum so to speak) as it is never flushed. [Skotlex]
create_session(0, null_recv, null_send, null_parse);
-#ifndef MINICORE
// Delete old connection history every 5 minutes
connect_history = uidb_alloc(DB_OPT_RELEASE_DATA);
timer->add_func_list(connect_check_clear, "connect_check_clear");
timer->add_interval(timer->gettick()+1000, connect_check_clear, 0, 0, 5*60*1000);
-#endif // MINICORE
ShowInfo("Server supports up to '"CL_WHITE"%"PRIu64""CL_RESET"' concurrent connections.\n", rlim_cur);
}
diff --git a/src/common/strlib.h b/src/common/strlib.h
index 5ea4f4763..006bbd14b 100644
--- a/src/common/strlib.h
+++ b/src/common/strlib.h
@@ -49,6 +49,27 @@
#define safesnprintf(buf,sz,fmt,...) (strlib->safesnprintf_((buf),(sz),(fmt),##__VA_ARGS__))
#define strline(str,pos) (strlib->strline_((str),(pos)))
#define bin2hex(output,input,count) (strlib->bin2hex_((output),(input),(count)))
+#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L)
+#if defined(__GNUC__) && !defined(__clang__) && GCC_VERSION < 40900
+// _Generic is only supported starting with GCC 4.9
+#else
+#ifdef strchr
+#undef strchr
+#endif // strchr
+#define strchr(src, chr) _Generic((src), \
+ const char * : ((const char *)(strchr)((src), (chr))), \
+ char * : ((strchr)((src), (chr))) \
+ )
+#define strrchr(src, chr) _Generic((src), \
+ const char * : ((const char *)(strrchr)((src), (chr))), \
+ char * : ((strrchr)((src), (chr))) \
+ )
+#define strstr(haystack, needle) _Generic((haystack), \
+ const char * : ((const char *)(strstr)((haystack), (needle))), \
+ char * : ((strstr)((haystack), (needle))) \
+ )
+#endif
+#endif
/// Bitfield determining the behavior of sv_parse and sv_split.
typedef enum e_svopt {