summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/HPMDataCheck.h4
-rw-r--r--src/common/HPMSymbols.inc.h2
-rw-r--r--src/common/mmo.h27
-rw-r--r--src/common/nullpo.h9
-rw-r--r--src/common/sql.c99
-rw-r--r--src/common/sql.h2
6 files changed, 95 insertions, 48 deletions
diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h
index 7480269e5..6f241bcd6 100644
--- a/src/common/HPMDataCheck.h
+++ b/src/common/HPMDataCheck.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2014-2017 Hercules Dev Team
+ * Copyright (C) 2014-2018 Hercules Dev Team
*
* Hercules is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -325,6 +325,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "packet_CA_LOGIN3", sizeof(struct packet_CA_LOGIN3), SERVER_TYPE_LOGIN },
{ "packet_CA_LOGIN4", sizeof(struct packet_CA_LOGIN4), SERVER_TYPE_LOGIN },
{ "packet_CA_LOGIN_HAN", sizeof(struct packet_CA_LOGIN_HAN), SERVER_TYPE_LOGIN },
+ { "packet_CA_LOGIN_OTP", sizeof(struct packet_CA_LOGIN_OTP), SERVER_TYPE_LOGIN },
{ "packet_CA_LOGIN_PCBANG", sizeof(struct packet_CA_LOGIN_PCBANG), SERVER_TYPE_LOGIN },
{ "packet_CA_SSO_LOGIN_REQ", sizeof(struct packet_CA_SSO_LOGIN_REQ), SERVER_TYPE_LOGIN },
{ "packet_SC_NOTIFY_BAN", sizeof(struct packet_SC_NOTIFY_BAN), SERVER_TYPE_LOGIN },
@@ -574,6 +575,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "PACKET_ZC_MAIL_LIST", sizeof(struct PACKET_ZC_MAIL_LIST), SERVER_TYPE_MAP },
{ "PACKET_ZC_NOTIFY_UNREADMAIL", sizeof(struct PACKET_ZC_NOTIFY_UNREADMAIL), SERVER_TYPE_MAP },
{ "PACKET_ZC_READ_MAIL", sizeof(struct PACKET_ZC_READ_MAIL), SERVER_TYPE_MAP },
+ { "PACKET_ZC_SKILL_SCALE", sizeof(struct PACKET_ZC_SKILL_SCALE), SERVER_TYPE_MAP },
{ "PACKET_ZC_WRITE_MAIL_RESULT", sizeof(struct PACKET_ZC_WRITE_MAIL_RESULT), SERVER_TYPE_MAP },
{ "mail_item", sizeof(struct mail_item), SERVER_TYPE_MAP },
{ "maillistinfo", sizeof(struct maillistinfo), SERVER_TYPE_MAP },
diff --git a/src/common/HPMSymbols.inc.h b/src/common/HPMSymbols.inc.h
index 5ee8a014b..58540ee36 100644
--- a/src/common/HPMSymbols.inc.h
+++ b/src/common/HPMSymbols.inc.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2017 Hercules Dev Team
+ * Copyright (C) 2013-2018 Hercules Dev Team
*
* Hercules is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/src/common/mmo.h b/src/common/mmo.h
index fe67d6efb..7fd4ca6ea 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -74,6 +74,13 @@
#undef ENABLE_PACKETVER_RE
#endif // DISABLE_PACKETVER_RE
+//Uncomment the following line if your client is zero ragexe instead of normal kro clients
+//#define ENABLE_PACKETVER_ZERO
+#ifdef ENABLE_PACKETVER_ZERO
+ #define PACKETVER_ZERO
+ #undef ENABLE_PACKETVER_ZERO
+#endif // DISABLE_PACKETVER_ZERO
+
// Client support for experimental RagexeRE UI present in 2012-04-10 and 2012-04-18
#if defined(PACKETVER_RE) && ( PACKETVER == 20120410 || PACKETVER == 20120418 )
#define PARTY_RECRUIT
@@ -139,8 +146,8 @@
#endif
#define MAX_FAME 1000000000
#define MAX_CART 100
-#ifndef MAX_SKILL
-#define MAX_SKILL 1510
+#ifndef MAX_SKILL_DB
+#define MAX_SKILL_DB 1510 ///< Maximum number of skills in the skill DB (compacted array size)
#endif
#ifndef MAX_SKILL_ID
#define MAX_SKILL_ID 10015 // [Ind/Hercules] max used skill ID
@@ -276,7 +283,11 @@ STATIC_ASSERT(MAX_ITEM_OPTIONS <= 5, "This value is limited by the client and da
#define RODEX_BODY_LENGTH (500 + 1)
#define RODEX_MAX_ITEM (5)
#define RODEX_EXPIRE (1 * 15 * 24 * 60 * 60)
+#if PACKETVER >= 20170419
+#define RODEX_MAIL_PER_PAGE 32
+#else
#define RODEX_MAIL_PER_PAGE 7
+#endif
// The following system marks a different job ID system used by the map server,
// which makes a lot more sense than the normal one. [Skotlex]
@@ -418,7 +429,7 @@ enum e_item_bound_type {
#endif
};
-enum {
+enum e_option {
OPTION_NOTHING = 0x00000000,
OPTION_SIGHT = 0x00000001,
OPTION_HIDE = 0x00000002,
@@ -548,6 +559,7 @@ struct s_homunculus { //[orn]
int luk_value;
int8 spiritball; //for homun S [lighta]
+ int autofeed;
};
struct s_mercenary {
@@ -631,7 +643,7 @@ struct mmo_charstatus {
struct point last_point,save_point,memo_point[MAX_MEMOPOINTS];
struct item inventory[MAX_INVENTORY],cart[MAX_CART];
- struct s_skill skill[MAX_SKILL];
+ struct s_skill skill[MAX_SKILL_DB];
struct s_friend friends[MAX_FRIENDS]; //New friend system [Skotlex]
#ifdef HOTKEY_SAVING
@@ -851,6 +863,7 @@ enum rodex_opentype {
RODEX_OPENTYPE_MAIL = 0,
RODEX_OPENTYPE_ACCOUNT = 1,
RODEX_OPENTYPE_RETURN = 2,
+ RODEX_OPENTYPE_UNSET = 3,
};
enum MAIL_TYPE {
@@ -917,7 +930,7 @@ enum {
};
//These mark the ID of the jobs, as expected by the client. [Skotlex]
-enum {
+enum e_class {
JOB_NOVICE,
JOB_SWORDMAN,
JOB_MAGE,
@@ -1198,4 +1211,8 @@ enum hz_char_ask_name_answer {
#error MAX_SLOTS it too small
#endif
+#ifdef MAX_SKILL
+#error MAX_SKILL has been replaced by MAX_SKILL_DB. Please update your custom definitions.
+#endif
+
#endif /* COMMON_MMO_H */
diff --git a/src/common/nullpo.h b/src/common/nullpo.h
index 28d058dc0..ae0c82364 100644
--- a/src/common/nullpo.h
+++ b/src/common/nullpo.h
@@ -23,15 +23,10 @@
#include "common/hercules.h"
-// enabled by default on debug builds
-#if defined(DEBUG) && !defined(NULLPO_CHECK)
+// if need disable nullpo checks this line can be commented
#define NULLPO_CHECK
-#endif
-
-// Skip assert checks on release builds
-#if !defined(RELEASE) && !defined(ASSERT_CHECK)
+// if need disable asserts checks this line can be commented
#define ASSERT_CHECK
-#endif
/** Assert */
diff --git a/src/common/sql.c b/src/common/sql.c
index 235be3aca..7f526cff6 100644
--- a/src/common/sql.c
+++ b/src/common/sql.c
@@ -423,68 +423,99 @@ static int Sql_P_BindSqlDataType(MYSQL_BIND* bind, enum SqlDataType buffer_type,
memset(bind, 0, sizeof(MYSQL_BIND));
switch( buffer_type )
{
- case SQLDT_NULL: bind->buffer_type = MYSQL_TYPE_NULL;
+ case SQLDT_NULL:
+ bind->buffer_type = MYSQL_TYPE_NULL;
buffer_len = 0;// FIXME length = ? [FlavioJS]
break;
// fixed size
- case SQLDT_UINT8: bind->is_unsigned = 1;
+ case SQLDT_UINT8:
+ bind->is_unsigned = 1;
FALLTHROUGH
- case SQLDT_INT8: bind->buffer_type = MYSQL_TYPE_TINY;
- buffer_len = 1;
+ case SQLDT_INT8:
+ bind->buffer_type = MYSQL_TYPE_TINY;
+ Assert_retr(SQL_ERROR, buffer_len == 1);
break;
- case SQLDT_UINT16: bind->is_unsigned = 1;
+ case SQLDT_UINT16:
+ bind->is_unsigned = 1;
FALLTHROUGH
- case SQLDT_INT16: bind->buffer_type = MYSQL_TYPE_SHORT;
- buffer_len = 2;
+ case SQLDT_INT16:
+ bind->buffer_type = MYSQL_TYPE_SHORT;
+ Assert_retr(SQL_ERROR, buffer_len == 2);
break;
- case SQLDT_UINT32: bind->is_unsigned = 1;
+ case SQLDT_UINT32:
+ bind->is_unsigned = 1;
FALLTHROUGH
- case SQLDT_INT32: bind->buffer_type = MYSQL_TYPE_LONG;
- buffer_len = 4;
+ case SQLDT_INT32:
+ bind->buffer_type = MYSQL_TYPE_LONG;
+ Assert_retr(SQL_ERROR, buffer_len == 4);
break;
- case SQLDT_UINT64: bind->is_unsigned = 1;
+ case SQLDT_UINT64:
+ bind->is_unsigned = 1;
FALLTHROUGH
- case SQLDT_INT64: bind->buffer_type = MYSQL_TYPE_LONGLONG;
- buffer_len = 8;
+ case SQLDT_INT64:
+ bind->buffer_type = MYSQL_TYPE_LONGLONG;
+ Assert_retr(SQL_ERROR, buffer_len == 8);
break;
// platform dependent size
- case SQLDT_UCHAR: bind->is_unsigned = 1;
+ case SQLDT_UCHAR:
+ bind->is_unsigned = 1;
FALLTHROUGH
- case SQLDT_CHAR: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(char));
- buffer_len = sizeof(char);
+ case SQLDT_CHAR:
+ bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(char));
+ Assert_retr(SQL_ERROR, buffer_len == sizeof(char));
break;
- case SQLDT_USHORT: bind->is_unsigned = 1;
+ case SQLDT_USHORT:
+ bind->is_unsigned = 1;
FALLTHROUGH
- case SQLDT_SHORT: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(short));
- buffer_len = sizeof(short);
+ case SQLDT_SHORT:
+ bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(short));
+ Assert_retr(SQL_ERROR, buffer_len == sizeof(short));
break;
- case SQLDT_UINT: bind->is_unsigned = 1;
+ case SQLDT_UINT:
+ bind->is_unsigned = 1;
FALLTHROUGH
- case SQLDT_INT: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(int));
- buffer_len = sizeof(int);
+ case SQLDT_INT:
+ bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(int));
+ Assert_retr(SQL_ERROR, buffer_len == sizeof(int));
break;
- case SQLDT_ULONG: bind->is_unsigned = 1;
+ case SQLDT_ULONG:
+ bind->is_unsigned = 1;
FALLTHROUGH
- case SQLDT_LONG: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(long));
- buffer_len = sizeof(long);
+ case SQLDT_LONG:
+ bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(long));
+ Assert_retr(SQL_ERROR, buffer_len == sizeof(long));
break;
- case SQLDT_ULONGLONG: bind->is_unsigned = 1;
+ case SQLDT_ULONGLONG:
+ bind->is_unsigned = 1;
FALLTHROUGH
- case SQLDT_LONGLONG: bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(int64));
- buffer_len = sizeof(int64);
+ case SQLDT_LONGLONG:
+ bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(long long));
+ Assert_retr(SQL_ERROR, buffer_len == sizeof(long long));
+ break;
+ case SQLDT_BOOL:
+ bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(bool));
+ Assert_retr(SQL_ERROR, buffer_len == sizeof(bool));
+ break;
+ case SQLDT_TIME:
+ bind->buffer_type = Sql_P_SizeToMysqlIntType(sizeof(time_t));
+ Assert_retr(SQL_ERROR, buffer_len == sizeof(time_t));
break;
// floating point
- case SQLDT_FLOAT: bind->buffer_type = MYSQL_TYPE_FLOAT;
- buffer_len = 4;
+ case SQLDT_FLOAT:
+ bind->buffer_type = MYSQL_TYPE_FLOAT;
+ Assert_retr(SQL_ERROR, buffer_len == 4);
break;
- case SQLDT_DOUBLE: bind->buffer_type = MYSQL_TYPE_DOUBLE;
- buffer_len = 8;
+ case SQLDT_DOUBLE:
+ bind->buffer_type = MYSQL_TYPE_DOUBLE;
+ Assert_retr(SQL_ERROR, buffer_len == 8);
break;
// other
case SQLDT_STRING:
- case SQLDT_ENUM: bind->buffer_type = MYSQL_TYPE_STRING;
+ case SQLDT_ENUM:
+ bind->buffer_type = MYSQL_TYPE_STRING;
break;
- case SQLDT_BLOB: bind->buffer_type = MYSQL_TYPE_BLOB;
+ case SQLDT_BLOB:
+ bind->buffer_type = MYSQL_TYPE_BLOB;
break;
default:
ShowDebug("Sql_P_BindSqlDataType: unsupported buffer type (%u)\n", buffer_type);
diff --git a/src/common/sql.h b/src/common/sql.h
index 4d9a12cc1..11127c66c 100644
--- a/src/common/sql.h
+++ b/src/common/sql.h
@@ -59,6 +59,8 @@ enum SqlDataType {
SQLDT_UINT,
SQLDT_ULONG,
SQLDT_ULONGLONG,
+ SQLDT_BOOL,
+ SQLDT_TIME,
// floating point
SQLDT_FLOAT,
SQLDT_DOUBLE,