diff options
author | Jedzkie <jedzkie13@rocketmail.com> | 2020-06-23 08:00:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-23 08:00:00 +0800 |
commit | 520863eaeda83da14b88d09f6378cd8abd5a5174 (patch) | |
tree | 2496ea36744dc2f51d264741a78699e719ceeb3b /src/common | |
parent | 0b7768837bed2aa521de5b9b76b2348943d7db20 (diff) | |
parent | 9b89425550094f51d633e5b5d6e86af65bffbf39 (diff) | |
download | hercules-520863eaeda83da14b88d09f6378cd8abd5a5174.tar.gz hercules-520863eaeda83da14b88d09f6378cd8abd5a5174.tar.bz2 hercules-520863eaeda83da14b88d09f6378cd8abd5a5174.tar.xz hercules-520863eaeda83da14b88d09f6378cd8abd5a5174.zip |
Merge branch 'master' into jedzkie-pr03
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/HPMDataCheck.h | 1 | ||||
-rw-r--r-- | src/common/cbasetypes.h | 5 | ||||
-rw-r--r-- | src/common/mmo.h | 21 | ||||
-rw-r--r-- | src/common/packets/packets2020_len_main.h | 20 | ||||
-rw-r--r-- | src/common/packets/packets2020_len_zero.h | 20 |
5 files changed, 65 insertions, 2 deletions
diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index 72ae64525..821d68569 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -966,6 +966,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = { { "skill_cd_entry", sizeof(struct skill_cd_entry), SERVER_TYPE_MAP }, { "skill_condition", sizeof(struct skill_condition), SERVER_TYPE_MAP }, { "skill_interface", sizeof(struct skill_interface), SERVER_TYPE_MAP }, + { "skill_required_item_data", sizeof(struct skill_required_item_data), SERVER_TYPE_MAP }, { "skill_timerskill", sizeof(struct skill_timerskill), SERVER_TYPE_MAP }, { "skill_unit", sizeof(struct skill_unit), SERVER_TYPE_MAP }, { "skill_unit_group", sizeof(struct skill_unit_group), SERVER_TYPE_MAP }, diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h index 6053d86d9..31d89d66b 100644 --- a/src/common/cbasetypes.h +++ b/src/common/cbasetypes.h @@ -410,13 +410,16 @@ typedef char bool; #define ISALPHA(c) (isalpha((unsigned char)(c))) #define ISCNTRL(c) (iscntrl((unsigned char)(c))) #define ISDIGIT(c) (isdigit((unsigned char)(c))) +#define ISXDIGIT(c) (isxdigit((unsigned char)(c))) +#define ISBDIGIT(c) ((unsigned char)(c) == '0' || (unsigned char)(c) == '1') +#define ISODIGIT(c) ((unsigned char)(c) >= '0' && (unsigned char)(c) <= '7') +#define ISNSEPARATOR(c) ((unsigned char)(c) == '_') #define ISGRAPH(c) (isgraph((unsigned char)(c))) #define ISLOWER(c) (islower((unsigned char)(c))) #define ISPRINT(c) (isprint((unsigned char)(c))) #define ISPUNCT(c) (ispunct((unsigned char)(c))) #define ISSPACE(c) (isspace((unsigned char)(c))) #define ISUPPER(c) (isupper((unsigned char)(c))) -#define ISXDIGIT(c) (isxdigit((unsigned char)(c))) #define TOASCII(c) (toascii((unsigned char)(c))) #define TOLOWER(c) (tolower((unsigned char)(c))) #define TOUPPER(c) (toupper((unsigned char)(c))) diff --git a/src/common/mmo.h b/src/common/mmo.h index 9421f6e35..e4b5a8bd5 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -132,7 +132,9 @@ #endif // PACKETVER_RE && (PACKETVER == 20120410 || PACKETVER == 10120418) // Comment the following line to disable sc_data saving. [Skotlex] +#ifndef ENABLE_SC_SAVING #define ENABLE_SC_SAVING +#endif #if PACKETVER_MAIN_NUM >= 20070711 || PACKETVER_RE_NUM >= 20080827 || PACKETVER_AD_NUM >= 20070711 || PACKETVER_SAK_NUM >= 20070628 || defined(PACKETVER_ZERO) // Comment the following like to disable server-side hot-key saving support. [Skotlex] @@ -174,7 +176,9 @@ #else #define MAX_BASE_CARTS 5 #endif +#ifndef MAX_CARTS #define MAX_CARTS (MAX_BASE_CARTS + MAX_CARTDECORATION_CARTS) +#endif #ifndef MAX_INVENTORY #if PACKETVER_MAIN_NUM >= 20181219 || PACKETVER_RE_NUM >= 20181219 || PACKETVER_ZERO_NUM >= 20181212 @@ -204,19 +208,31 @@ #endif //Number of slots carded equipment can have. Never set to less than 4 as they are also used to keep the data of forged items/equipment. [Skotlex] //Note: The client seems unable to receive data for more than 4 slots due to all related packets having a fixed size. +#ifndef MAX_SLOTS #define MAX_SLOTS 4 +#endif //Max amount of a single stacked item +#ifndef MAX_AMOUNT #define MAX_AMOUNT 30000 +#endif +#ifndef MAX_ZENY #define MAX_ZENY INT_MAX +#endif //Official Limit: 2.1b ( the var that stores the money doesn't go much higher than this by default ) +#ifndef MAX_BANK_ZENY #define MAX_BANK_ZENY INT_MAX +#endif #ifndef MAX_LEVEL #define MAX_LEVEL 175 #endif +#ifndef MAX_FAME #define MAX_FAME 1000000000 +#endif +#ifndef MAX_CART #define MAX_CART 100 +#endif #ifndef MAX_SKILL_DB #define MAX_SKILL_DB 1314 ///< Maximum number of skills in the skill DB (compacted array size) #endif @@ -380,7 +396,10 @@ STATIC_ASSERT(MAX_ITEM_OPTIONS <= 5, "This value is limited by the client and da #define JOBL_BABY 0x2000 #define JOBL_THIRD 0x4000 -#define SCRIPT_VARNAME_LENGTH 32 ///< Maximum length of a script variable +#define SCRIPT_VARNAME_LENGTH 32 ///< Maximum length of a script variable's name including affixes and excluding NULL-terminator. +STATIC_ASSERT(SCRIPT_VARNAME_LENGTH <= 32, "This value is limited by the inter-server communication and database layout and should only be increased if you know the consequences."); +#define SCRIPT_STRING_VAR_LENGTH 255 ///< Maximum length of strings stored in script variables excluding NULL-terminator. +STATIC_ASSERT(SCRIPT_STRING_VAR_LENGTH <= 255, "This value is limited by the inter-server communication and database layout and should only be increased if you know the consequences."); #define INFINITE_DURATION (-1) // Infinite duration for status changes diff --git a/src/common/packets/packets2020_len_main.h b/src/common/packets/packets2020_len_main.h index d3adf8405..4b7273775 100644 --- a/src/common/packets/packets2020_len_main.h +++ b/src/common/packets/packets2020_len_main.h @@ -4655,5 +4655,25 @@ packetLen(0x0b75, 1026) packetLen(0x0b76, 77) #endif +// Packet: 0x0b77 +#if PACKETVER >= 20200506 +packetLen(0x0b77, -1) +#endif + +// Packet: 0x0b78 +#if PACKETVER >= 20200506 +packetLen(0x0b78, -1) +#endif + +// Packet: 0x0b79 +#if PACKETVER >= 20200506 +packetLen(0x0b79, -1) +#endif + +// Packet: 0x0b7a +#if PACKETVER >= 20200506 +packetLen(0x0b7a, -1) +#endif + #endif /* COMMON_PACKETS2020_LEN_MAIN_H */ diff --git a/src/common/packets/packets2020_len_zero.h b/src/common/packets/packets2020_len_zero.h index 888d7999b..2aa2ccc96 100644 --- a/src/common/packets/packets2020_len_zero.h +++ b/src/common/packets/packets2020_len_zero.h @@ -4655,5 +4655,25 @@ packetLen(0x0b75, 1026) packetLen(0x0b76, 77) #endif +// Packet: 0x0b77 +#if PACKETVER >= 20200506 +packetLen(0x0b77, -1) +#endif + +// Packet: 0x0b78 +#if PACKETVER >= 20200506 +packetLen(0x0b78, -1) +#endif + +// Packet: 0x0b79 +#if PACKETVER >= 20200506 +packetLen(0x0b79, -1) +#endif + +// Packet: 0x0b7a +#if PACKETVER >= 20200506 +packetLen(0x0b7a, -1) +#endif + #endif /* COMMON_PACKETS2020_LEN_ZERO_H */ |