summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/HPMDataCheck.h39
-rw-r--r--src/common/HPMSymbols.inc.h14
-rw-r--r--src/common/mmo.h62
-rw-r--r--src/common/packets/packets2019_len_main.h158
-rw-r--r--src/common/packets/packets2019_len_re.h158
-rw-r--r--src/common/packets/packets2019_len_zero.h135
-rw-r--r--src/common/socket.c24
-rw-r--r--src/common/socket.h3
-rw-r--r--src/common/sysinfo.c8
9 files changed, 527 insertions, 74 deletions
diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h
index ecbfc9f2c..1e1d8068f 100644
--- a/src/common/HPMDataCheck.h
+++ b/src/common/HPMDataCheck.h
@@ -230,6 +230,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "party_member", sizeof(struct party_member), SERVER_TYPE_ALL },
{ "point", sizeof(struct point), SERVER_TYPE_ALL },
{ "quest", sizeof(struct quest), SERVER_TYPE_ALL },
+ { "rodex_item", sizeof(struct rodex_item), SERVER_TYPE_ALL },
{ "rodex_maillist", sizeof(struct rodex_maillist), SERVER_TYPE_ALL },
{ "rodex_message", sizeof(struct rodex_message), SERVER_TYPE_ALL },
{ "s_elemental", sizeof(struct s_elemental), SERVER_TYPE_ALL },
@@ -465,7 +466,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "hCSData", sizeof(struct hCSData), SERVER_TYPE_MAP },
{ "merge_item", sizeof(struct merge_item), SERVER_TYPE_MAP },
{ "s_packet_db", sizeof(struct s_packet_db), SERVER_TYPE_MAP },
- { "stylist_data_entry", sizeof(struct stylist_data_entry), SERVER_TYPE_MAP },
#else
#define MAP_CLIF_H
#endif // MAP_CLIF_H
@@ -571,9 +571,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "mapcell", sizeof(struct mapcell), SERVER_TYPE_MAP },
{ "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
#define MAP_MAP_H
@@ -591,8 +588,12 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "mob_chat", sizeof(struct mob_chat), SERVER_TYPE_MAP },
{ "mob_data", sizeof(struct mob_data), SERVER_TYPE_MAP },
{ "mob_db", sizeof(struct mob_db), SERVER_TYPE_MAP },
+ { "mob_drop", sizeof(struct mob_drop), SERVER_TYPE_MAP },
{ "mob_interface", sizeof(struct mob_interface), SERVER_TYPE_MAP },
{ "mob_skill", sizeof(struct mob_skill), SERVER_TYPE_MAP },
+ { "optdrop_group", sizeof(struct optdrop_group), SERVER_TYPE_MAP },
+ { "optdrop_group_option", sizeof(struct optdrop_group_option), SERVER_TYPE_MAP },
+ { "optdrop_group_optslot", sizeof(struct optdrop_group_optslot), SERVER_TYPE_MAP },
{ "spawn_info", sizeof(struct spawn_info), SERVER_TYPE_MAP },
#else
#define MAP_MOB_H
@@ -667,6 +668,8 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "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 },
+ { "PACKET_ZC_ACK_REQNAME_TITLE", sizeof(struct PACKET_ZC_ACK_REQNAME_TITLE), SERVER_TYPE_MAP },
+ { "PACKET_ZC_ACK_REQNAMEALL", sizeof(struct PACKET_ZC_ACK_REQNAMEALL), SERVER_TYPE_MAP },
{ "PACKET_ZC_ACK_SCHEDULER_CASHITEM", sizeof(struct PACKET_ZC_ACK_SCHEDULER_CASHITEM), SERVER_TYPE_MAP },
{ "PACKET_ZC_ACK_SCHEDULER_CASHITEM_sub", sizeof(struct PACKET_ZC_ACK_SCHEDULER_CASHITEM_sub), SERVER_TYPE_MAP },
{ "PACKET_ZC_ACK_TOUSESKILL", sizeof(struct PACKET_ZC_ACK_TOUSESKILL), SERVER_TYPE_MAP },
@@ -677,6 +680,8 @@ 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_BAN_LIST", sizeof(struct PACKET_ZC_BAN_LIST), SERVER_TYPE_MAP },
+ { "PACKET_ZC_BAN_LIST_sub", sizeof(struct PACKET_ZC_BAN_LIST_sub), 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 },
@@ -725,6 +730,7 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "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_ROLE_CHANGE", sizeof(struct PACKET_ZC_ROLE_CHANGE), SERVER_TYPE_MAP },
{ "PACKET_ZC_SEARCH_STORE_INFO_ACK", sizeof(struct PACKET_ZC_SEARCH_STORE_INFO_ACK), SERVER_TYPE_MAP },
{ "PACKET_ZC_SEARCH_STORE_INFO_ACK_sub", sizeof(struct PACKET_ZC_SEARCH_STORE_INFO_ACK_sub), SERVER_TYPE_MAP },
{ "PACKET_ZC_SKILL_SCALE", sizeof(struct PACKET_ZC_SKILL_SCALE), SERVER_TYPE_MAP },
@@ -772,7 +778,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "packet_equipitem_ack", sizeof(struct packet_equipitem_ack), SERVER_TYPE_MAP },
{ "packet_gm_monster_item", sizeof(struct packet_gm_monster_item), SERVER_TYPE_MAP },
{ "packet_graffiti_entry", sizeof(struct packet_graffiti_entry), SERVER_TYPE_MAP },
- { "packet_hotkey", sizeof(struct packet_hotkey), SERVER_TYPE_MAP },
{ "packet_idle_unit", sizeof(struct packet_idle_unit), SERVER_TYPE_MAP },
{ "packet_idle_unit2", sizeof(struct packet_idle_unit2), SERVER_TYPE_MAP },
{ "packet_item_drop_announce", sizeof(struct packet_item_drop_announce), SERVER_TYPE_MAP },
@@ -795,7 +800,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "packet_quest_update_header", sizeof(struct packet_quest_update_header), SERVER_TYPE_MAP },
{ "packet_quest_update_hunt", sizeof(struct packet_quest_update_hunt), SERVER_TYPE_MAP },
{ "packet_reqname_ack", sizeof(struct packet_reqname_ack), SERVER_TYPE_MAP },
- { "packet_reqnameall_ack", sizeof(struct packet_reqnameall_ack), SERVER_TYPE_MAP },
{ "packet_roulette_close_ack", sizeof(struct packet_roulette_close_ack), SERVER_TYPE_MAP },
{ "packet_roulette_generate_ack", sizeof(struct packet_roulette_generate_ack), SERVER_TYPE_MAP },
{ "packet_roulette_info_ack", sizeof(struct packet_roulette_info_ack), SERVER_TYPE_MAP },
@@ -881,9 +885,25 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
{ "quest_dropitem", sizeof(struct quest_dropitem), SERVER_TYPE_MAP },
{ "quest_interface", sizeof(struct quest_interface), SERVER_TYPE_MAP },
{ "quest_objective", sizeof(struct quest_objective), 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 },
#else
#define MAP_QUEST_H
#endif // MAP_QUEST_H
+ #ifdef MAP_REFINE_H
+ { "refine_interface", sizeof(struct refine_interface), SERVER_TYPE_MAP },
+ { "s_refine_requirement", sizeof(struct s_refine_requirement), SERVER_TYPE_MAP },
+ #else
+ #define MAP_REFINE_H
+ #endif // MAP_REFINE_H
+ #ifdef MAP_REFINE_P_H
+ { "refine_interface_dbs", sizeof(struct refine_interface_dbs), SERVER_TYPE_MAP },
+ { "refine_interface_private", sizeof(struct refine_interface_private), SERVER_TYPE_MAP },
+ { "s_refine_info", sizeof(struct s_refine_info), SERVER_TYPE_MAP },
+ #else
+ #define MAP_REFINE_P_H
+ #endif // MAP_REFINE_P_H
#ifdef MAP_RODEX_H
{ "rodex_interface", sizeof(struct rodex_interface), SERVER_TYPE_MAP },
#else
@@ -946,7 +966,6 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#ifdef MAP_STATUS_H
{ "regen_data", sizeof(struct regen_data), SERVER_TYPE_MAP },
{ "regen_data_sub", sizeof(struct regen_data_sub), SERVER_TYPE_MAP },
- { "s_refine_info", sizeof(struct s_refine_info), SERVER_TYPE_MAP },
{ "s_status_dbs", sizeof(struct s_status_dbs), SERVER_TYPE_MAP },
{ "sc_display_entry", sizeof(struct sc_display_entry), SERVER_TYPE_MAP },
{ "status_change", sizeof(struct status_change), SERVER_TYPE_MAP },
@@ -963,6 +982,12 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#else
#define MAP_STORAGE_H
#endif // MAP_STORAGE_H
+ #ifdef MAP_STYLIST_H
+ { "stylist_data_entry", sizeof(struct stylist_data_entry), SERVER_TYPE_MAP },
+ { "stylist_interface", sizeof(struct stylist_interface), SERVER_TYPE_MAP },
+ #else
+ #define MAP_STYLIST_H
+ #endif // MAP_STYLIST_H
#ifdef MAP_TRADE_H
{ "trade_interface", sizeof(struct trade_interface), SERVER_TYPE_MAP },
#else
diff --git a/src/common/HPMSymbols.inc.h b/src/common/HPMSymbols.inc.h
index 6b02b005a..f92899114 100644
--- a/src/common/HPMSymbols.inc.h
+++ b/src/common/HPMSymbols.inc.h
@@ -245,6 +245,9 @@ struct pincode_interface *pincode;
#ifdef MAP_QUEST_H /* quest */
struct quest_interface *quest;
#endif // MAP_QUEST_H
+#ifdef MAP_REFINE_H /* refine */
+struct refine_interface *refine;
+#endif // MAP_REFINE_H
#ifdef COMMON_RANDOM_H /* rnd */
struct rnd_interface *rnd;
#endif // COMMON_RANDOM_H
@@ -281,6 +284,9 @@ struct stringbuf_interface *StrBuf;
#ifdef COMMON_STRLIB_H /* strlib */
struct strlib_interface *strlib;
#endif // COMMON_STRLIB_H
+#ifdef MAP_STYLIST_H /* stylist */
+struct stylist_interface *stylist;
+#endif // MAP_STYLIST_H
#ifdef COMMON_STRLIB_H /* sv */
struct sv_interface *sv;
#endif // COMMON_STRLIB_H
@@ -598,6 +604,10 @@ HPExport const char *HPM_shared_symbols(int server_type)
if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("quest", quest))
return "quest";
#endif // MAP_QUEST_H
+#ifdef MAP_REFINE_H /* refine */
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("refine", refine))
+ return "refine";
+#endif // MAP_REFINE_H
#ifdef COMMON_RANDOM_H /* rnd */
if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("rnd", rnd))
return "rnd";
@@ -646,6 +656,10 @@ HPExport const char *HPM_shared_symbols(int server_type)
if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("strlib", strlib))
return "strlib";
#endif // COMMON_STRLIB_H
+#ifdef MAP_STYLIST_H /* stylist */
+ if ((server_type&(SERVER_TYPE_MAP)) != 0 && !HPM_SYMBOL("stylist", stylist))
+ return "stylist";
+#endif // MAP_STYLIST_H
#ifdef COMMON_STRLIB_H /* sv */
if ((server_type&(SERVER_TYPE_ALL)) != 0 && !HPM_SYMBOL("sv", sv))
return "sv";
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 3a0f73520..545d180fd 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -134,22 +134,33 @@
// Comment the following line to disable sc_data saving. [Skotlex]
#define ENABLE_SC_SAVING
-#if PACKETVER >= 20070227
+#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]
// Note that newer clients no longer save hotkeys in the registry!
#define HOTKEY_SAVING
-#if PACKETVER < 20090603
- // (27 = 9 skills x 3 bars) (0x02b9,191)
- #define MAX_HOTKEYS 27
-#elif PACKETVER < 20090617
- // (36 = 9 skills x 4 bars) (0x07d9,254)
- #define MAX_HOTKEYS 36
-#else // >= 20090617
- // (38 = 9 skills x 4 bars & 2 Quickslots)(0x07d9,268)
- #define MAX_HOTKEYS 38
-#endif // 20090603
-#endif // 20070227
+#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515
+#define MAX_HOTKEYS 38
+#elif PACKETVER_MAIN_NUM >= 20141022 || PACKETVER_RE_NUM >= 20141015 || defined(PACKETVER_ZERO)
+// (38 = 9 skills x 4 bars & 2 Quickslots)(0x07d9,268)
+#define MAX_HOTKEYS 38
+#elif PACKETVER_MAIN_NUM >= 20090617 || PACKETVER_RE_NUM >= 20090617 || PACKETVER_SAK_NUM >= 20090617
+// (38 = 9 skills x 4 bars & 2 Quickslots)(0x07d9,268)
+#define MAX_HOTKEYS 38
+#elif PACKETVER_MAIN_NUM >= 20090603 || PACKETVER_RE_NUM >= 20090603 || PACKETVER_SAK_NUM >= 20090603
+// (36 = 9 skills x 4 bars) (0x07d9,254)
+#define MAX_HOTKEYS 36
+#elif PACKETVER_MAIN_NUM >= 20070711 || PACKETVER_RE_NUM >= 20080827 || PACKETVER_AD_NUM >= 20070711 || PACKETVER_SAK_NUM >= 20070628
+// (27 = 9 skills x 3 bars) (0x02b9,191)
+#define MAX_HOTKEYS 27
+#endif
+#endif // PACKETVER_MAIN_NUM >= 20070711 || PACKETVER_RE_NUM >= 20080827 || PACKETVER_AD_NUM >= 20070711 || PACKETVER_SAK_NUM >= 20070628 || defined(PACKETVER_ZERO)
+
+#if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190515
+#define MAX_HOTKEYS_DB ((MAX_HOTKEYS) * 2)
+#else
+#define MAX_HOTKEYS_DB MAX_HOTKEYS
+#endif
#if PACKETVER >= 20150805 /* Cart Decoration */
#define CART_DECORATION
@@ -487,6 +498,7 @@ enum e_mmo_charstatus_opt {
OPT_NONE = 0x0,
OPT_SHOW_EQUIP = 0x1,
OPT_ALLOW_PARTY = 0x2,
+ OPT_ALLOW_CALL = 0x4,
};
enum e_item_bound_type {
@@ -731,9 +743,11 @@ struct mmo_charstatus {
struct s_friend friends[MAX_FRIENDS]; //New friend system [Skotlex]
#ifdef HOTKEY_SAVING
- struct hotkey hotkeys[MAX_HOTKEYS];
+ struct hotkey hotkeys[MAX_HOTKEYS_DB];
#endif
- bool show_equip, allow_party;
+ bool show_equip;
+ bool allow_party;
+ bool allow_call;
unsigned short rename;
unsigned short slotchange;
@@ -750,6 +764,7 @@ struct mmo_charstatus {
short attendance_count;
unsigned char hotkey_rowshift;
+ unsigned char hotkey_rowshift2;
int32 title_id; // Achievement Title[Dastgir/Hercules]
};
@@ -853,6 +868,7 @@ struct guild_expulsion {
char name[NAME_LENGTH];
char mes[40];
int account_id;
+ int char_id;
};
struct guild_skill {
@@ -975,6 +991,11 @@ enum fame_list_type {
RANKTYPE_PK = 3, //Not supported yet
};
+struct rodex_item {
+ struct item item;
+ int idx;
+};
+
struct rodex_message {
int64 id;
int sender_id;
@@ -984,10 +1005,7 @@ struct rodex_message {
char receiver_name[NAME_LENGTH];
char title[RODEX_TITLE_LENGTH];
char body[RODEX_BODY_LENGTH];
- struct {
- struct item item;
- int idx;
- } items[RODEX_MAX_ITEM];
+ struct rodex_item items[RODEX_MAX_ITEM];
int64 zeny;
uint8 type;
int8 opentype;
@@ -1360,6 +1378,10 @@ enum questinfo_type {
#define MAX_ITEMLIST MAX_STORAGE
#endif
+#ifndef MAX_REFINE_REQUIREMENTS
+ #define MAX_REFINE_REQUIREMENTS 4
+#endif
+
// sanity checks...
#if MAX_ZENY > INT_MAX
#error MAX_ZENY is too big
@@ -1373,4 +1395,8 @@ enum questinfo_type {
#error MAX_SKILL has been replaced by MAX_SKILL_DB. Please update your custom definitions.
#endif
+#if MAX_REFINE_REQUIREMENTS > 4
+#error MAX_REFINE_REQUIREMENTS is bigger than allowed, this is a hardcoded limit in the client
+#endif
+
#endif /* COMMON_MMO_H */
diff --git a/src/common/packets/packets2019_len_main.h b/src/common/packets/packets2019_len_main.h
index f7ad59577..0382a72d3 100644
--- a/src/common/packets/packets2019_len_main.h
+++ b/src/common/packets/packets2019_len_main.h
@@ -2,8 +2,8 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2019 Hercules Dev Team
- * Copyright (C) 2019 Andrei Karas (4144)
+ * Copyright (C) 2018-2019 Hercules Dev Team
+ * Copyright (C) 2018-2019 Andrei Karas (4144)
*
* Hercules is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -3787,13 +3787,13 @@ packetLen(0x0a43, 85) // ZC_ADD_MEMBER_TO_GROUP
packetLen(0x0a44, -1) // ZC_GROUP_LIST
// Packet: 0x0a46
-packetLen(0x0a46, 14)
+packetLen(0x0a46, 14) // CZ_REQ_STYLE_CHANGE
// Packet: 0x0a47
packetLen(0x0a47, 3) // ZC_STYLE_CHANGE_RES
// Packet: 0x0a48
-packetLen(0x0a48, 2)
+packetLen(0x0a48, 2) // CZ_STYLE_CLOSE
// Packet: 0x0a49
packetLen(0x0a49, 22) // CZ_PRIVATE_AIRSHIP_REQUEST
@@ -3946,10 +3946,10 @@ packetLen(0x0a85, 82)
packetLen(0x0a86, -1)
// Packet: 0x0a87
-packetLen(0x0a87, -1)
+packetLen(0x0a87, -1) // ZC_BAN_LIST
// Packet: 0x0a88
-packetLen(0x0a88, 2)
+packetLen(0x0a88, 2) // CZ_COOLDOWN_RESET
// Packet: 0x0a89
packetLen(0x0a89, 61) // ZC_NOTIFY_OFFLINE_STORE
@@ -3994,13 +3994,13 @@ packetLen(0x0a95, 4)
packetLen(0x0a96, 61) // ZC_ADD_EXCHANGE_ITEM4
// Packet: 0x0a97
-packetLen(0x0a97, 8) // CZ_ALT_EQUIPMENT_EQUIP
+packetLen(0x0a97, 8) // CZ_ALT_EQUIPMENT_ADD
// Packet: 0x0a98
packetLen(0x0a98, 10) // ZC_ALT_EQUIPMENT_EQUIP
// Packet: 0x0a99
-packetLen(0x0a99, 4)
+packetLen(0x0a99, 4) // CZ_ALT_EQUIPMENT_REMOVE
// Packet: 0x0a9a
packetLen(0x0a9a, 10) // ZC_ALT_EQUIPMENT_REMOVE
@@ -4009,10 +4009,10 @@ packetLen(0x0a9a, 10) // ZC_ALT_EQUIPMENT_REMOVE
packetLen(0x0a9b, -1) // ZC_ALT_EQUIPMENT_ITEMS
// Packet: 0x0a9c
-packetLen(0x0a9c, 2)
+packetLen(0x0a9c, 2) // CZ_ALT_EQUIPMENT_SWITCH
// Packet: 0x0a9d
-packetLen(0x0a9d, 4)
+packetLen(0x0a9d, 4) // ZC_ALT_EQUIPMENT_SWITCH_ACK
// Packet: 0x0a9e
packetLen(0x0a9e, 2)
@@ -4168,7 +4168,7 @@ packetLen(0x0acf, 68) // CA_LOGIN_OTP
packetLen(0x0ad0, 11) // CA_OTP_CODE
// Packet: 0x0ad1
-packetLen(0x0ad1, -1)
+packetLen(0x0ad1, -1) // AC_LOGIN_OTP
// Packet: 0x0ad2
packetLen(0x0ad2, 30)
@@ -4210,7 +4210,7 @@ packetLen(0x0add, 24) // ZC_ITEM_FALL_ENTRY
packetLen(0x0ade, 6) // ZC_OVERWEIGHT_PERCENT
// Packet: 0x0adf
-packetLen(0x0adf, 58) // ZC_ACK_REQNAME
+packetLen(0x0adf, 58) // ZC_ACK_REQNAME_TITLE
// Packet: 0x0ae0
packetLen(0x0ae0, 30)
@@ -4288,7 +4288,7 @@ packetLen(0x0afa, 54)
packetLen(0x0afb, -1) // ZC_AUTOSPELLLIST
// Packet: 0x0afc
-packetLen(0x0afc, 16)
+packetLen(0x0afc, 16) // CZ_REQ_STYLE_CHANGE2
// Packet: 0x0afd
packetLen(0x0afd, -1) // ZC_GUILD_POSITION
@@ -4375,7 +4375,137 @@ packetLen(0x0b18, 4) // ZC_INVENTORY_EXPANSION_INFO
packetLen(0x0b19, 2) // CZ_INVENTORY_EXPAND_REJECTED
// Packet: 0x0b1a
-packetLen(0x0b1a, 29)
+packetLen(0x0b1a, 29) // ZC_USESKILL_ACK3
+
+// Packet: 0x0b1b
+#if PACKETVER >= 20190213
+packetLen(0x0b1b, 2) // ZC_ALT_PING
+#endif
+
+// Packet: 0x0b1c
+#if PACKETVER >= 20190227
+packetLen(0x0b1c, 2) // CZ_PING
+#endif
+
+// Packet: 0x0b1d
+#if PACKETVER >= 20190227
+packetLen(0x0b1d, 2) // ZC_PING
+#endif
+
+// Packet: 0x0b1e
+#if PACKETVER >= 20190227
+packetLen(0x0b1e, 10)
+#endif
+
+// Packet: 0x0b1f
+#if PACKETVER >= 20190306
+packetLen(0x0b1f, 10)
+#endif
+
+// Packet: 0x0b20
+#if PACKETVER >= 20190403
+packetLen(0x0b20, 271) // ZC_SHORTCUT_KEY_LIST_V4
+#endif
+
+// Packet: 0x0b21
+#if PACKETVER >= 20190403
+packetLen(0x0b21, 13) // CZ_SHORTCUT_KEY_CHANGE
+#elif PACKETVER >= 20190306
+// removed
+#elif PACKETVER >= 20190227
+packetLen(0x0b21, 10) // CZ_SHORTCUT_KEY_CHANGE
+#endif
+
+// Packet: 0x0b22
+#if PACKETVER >= 20190403
+packetLen(0x0b22, 5) // CZ_SHORTCUTKEYBAR_ROTATE
+#elif PACKETVER >= 20190306
+// removed
+#elif PACKETVER >= 20190227
+packetLen(0x0b22, 6) // CZ_SHORTCUTKEYBAR_ROTATE
+#endif
+
+// Packet: 0x0b23
+#if PACKETVER >= 20190417
+packetLen(0x0b23, 6)
+#elif PACKETVER >= 20190306
+// removed
+#elif PACKETVER >= 20190227
+packetLen(0x0b23, 10)
+#endif
+
+// Packet: 0x0b24
+#if PACKETVER >= 20190417
+packetLen(0x0b24, 6)
+#endif
+
+// Packet: 0x0b25
+#if PACKETVER >= 20190417
+packetLen(0x0b25, 6)
+#endif
+
+// Packet: 0x0b26
+#if PACKETVER >= 20190522
+// removed
+#elif PACKETVER >= 20190508
+packetLen(0x0b26, 16)
+#elif PACKETVER >= 20190417
+packetLen(0x0b26, 18)
+#endif
+
+// Packet: 0x0b27
+#if PACKETVER >= 20190508
+packetLen(0x0b27, -1)
+#endif
+
+// Packet: 0x0b28
+#if PACKETVER >= 20190522
+packetLen(0x0b28, 3)
+#elif PACKETVER >= 20190508
+packetLen(0x0b28, 22)
+#endif
+
+// Packet: 0x0b29
+#if PACKETVER >= 20190508
+packetLen(0x0b29, 6)
+#endif
+
+// Packet: 0x0b2a
+#if PACKETVER >= 20190522
+packetLen(0x0b2a, 40)
+#elif PACKETVER >= 20190508
+packetLen(0x0b2a, 6)
+#endif
+
+// Packet: 0x0b2b
+#if PACKETVER >= 20190522
+packetLen(0x0b2b, 11)
+#endif
+
+// Packet: 0x0b2c
+#if PACKETVER >= 20190522
+packetLen(0x0b2c, 3)
+#endif
+
+// Packet: 0x0b2d
+#if PACKETVER >= 20190522
+packetLen(0x0b2d, 11)
+#endif
+
+// Packet: 0x0b2e
+#if PACKETVER >= 20190522
+packetLen(0x0b2e, 4)
+#endif
+
+// Packet: 0x0b2f
+#if PACKETVER >= 20190529
+packetLen(0x0b2f, 73)
+#endif
+
+// Packet: 0x0b30
+#if PACKETVER >= 20190529
+packetLen(0x0b30, -1)
+#endif
#endif /* COMMON_PACKETS2019_LEN_MAIN_H */
diff --git a/src/common/packets/packets2019_len_re.h b/src/common/packets/packets2019_len_re.h
index 134102bac..c553d9324 100644
--- a/src/common/packets/packets2019_len_re.h
+++ b/src/common/packets/packets2019_len_re.h
@@ -2,8 +2,8 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2019 Hercules Dev Team
- * Copyright (C) 2019 Andrei Karas (4144)
+ * Copyright (C) 2018-2019 Hercules Dev Team
+ * Copyright (C) 2018-2019 Andrei Karas (4144)
*
* Hercules is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -3793,13 +3793,13 @@ packetLen(0x0a43, 85) // ZC_ADD_MEMBER_TO_GROUP
packetLen(0x0a44, -1) // ZC_GROUP_LIST
// Packet: 0x0a46
-packetLen(0x0a46, 14)
+packetLen(0x0a46, 14) // CZ_REQ_STYLE_CHANGE
// Packet: 0x0a47
packetLen(0x0a47, 3) // ZC_STYLE_CHANGE_RES
// Packet: 0x0a48
-packetLen(0x0a48, 2)
+packetLen(0x0a48, 2) // CZ_STYLE_CLOSE
// Packet: 0x0a49
packetLen(0x0a49, 22) // CZ_PRIVATE_AIRSHIP_REQUEST
@@ -3952,10 +3952,10 @@ packetLen(0x0a85, 82)
packetLen(0x0a86, -1)
// Packet: 0x0a87
-packetLen(0x0a87, -1)
+packetLen(0x0a87, -1) // ZC_BAN_LIST
// Packet: 0x0a88
-packetLen(0x0a88, 2)
+packetLen(0x0a88, 2) // CZ_COOLDOWN_RESET
// Packet: 0x0a89
packetLen(0x0a89, 61) // ZC_NOTIFY_OFFLINE_STORE
@@ -4000,13 +4000,13 @@ packetLen(0x0a95, 4)
packetLen(0x0a96, 61) // ZC_ADD_EXCHANGE_ITEM4
// Packet: 0x0a97
-packetLen(0x0a97, 8) // CZ_ALT_EQUIPMENT_EQUIP
+packetLen(0x0a97, 8) // CZ_ALT_EQUIPMENT_ADD
// Packet: 0x0a98
packetLen(0x0a98, 10) // ZC_ALT_EQUIPMENT_EQUIP
// Packet: 0x0a99
-packetLen(0x0a99, 4)
+packetLen(0x0a99, 4) // CZ_ALT_EQUIPMENT_REMOVE
// Packet: 0x0a9a
packetLen(0x0a9a, 10) // ZC_ALT_EQUIPMENT_REMOVE
@@ -4015,10 +4015,10 @@ packetLen(0x0a9a, 10) // ZC_ALT_EQUIPMENT_REMOVE
packetLen(0x0a9b, -1) // ZC_ALT_EQUIPMENT_ITEMS
// Packet: 0x0a9c
-packetLen(0x0a9c, 2)
+packetLen(0x0a9c, 2) // CZ_ALT_EQUIPMENT_SWITCH
// Packet: 0x0a9d
-packetLen(0x0a9d, 4)
+packetLen(0x0a9d, 4) // ZC_ALT_EQUIPMENT_SWITCH_ACK
// Packet: 0x0a9e
packetLen(0x0a9e, 2)
@@ -4174,7 +4174,7 @@ packetLen(0x0acf, 68) // CA_LOGIN_OTP
packetLen(0x0ad0, 11) // CA_OTP_CODE
// Packet: 0x0ad1
-packetLen(0x0ad1, -1)
+packetLen(0x0ad1, -1) // AC_LOGIN_OTP
// Packet: 0x0ad2
packetLen(0x0ad2, 30)
@@ -4216,7 +4216,7 @@ packetLen(0x0add, 24) // ZC_ITEM_FALL_ENTRY
packetLen(0x0ade, 6) // ZC_OVERWEIGHT_PERCENT
// Packet: 0x0adf
-packetLen(0x0adf, 58) // ZC_ACK_REQNAME
+packetLen(0x0adf, 58) // ZC_ACK_REQNAME_TITLE
// Packet: 0x0ae0
packetLen(0x0ae0, 30)
@@ -4294,7 +4294,7 @@ packetLen(0x0afa, 54)
packetLen(0x0afb, -1) // ZC_AUTOSPELLLIST
// Packet: 0x0afc
-packetLen(0x0afc, 16)
+packetLen(0x0afc, 16) // CZ_REQ_STYLE_CHANGE2
// Packet: 0x0afd
packetLen(0x0afd, -1) // ZC_GUILD_POSITION
@@ -4381,7 +4381,137 @@ packetLen(0x0b18, 4) // ZC_INVENTORY_EXPANSION_INFO
packetLen(0x0b19, 2) // CZ_INVENTORY_EXPAND_REJECTED
// Packet: 0x0b1a
-packetLen(0x0b1a, 29)
+packetLen(0x0b1a, 29) // ZC_USESKILL_ACK3
+
+// Packet: 0x0b1b
+#if PACKETVER >= 20190213
+packetLen(0x0b1b, 2) // ZC_ALT_PING
+#endif
+
+// Packet: 0x0b1c
+#if PACKETVER >= 20190220
+packetLen(0x0b1c, 2) // CZ_PING
+#endif
+
+// Packet: 0x0b1d
+#if PACKETVER >= 20190220
+packetLen(0x0b1d, 2) // ZC_PING
+#endif
+
+// Packet: 0x0b1e
+#if PACKETVER >= 20190227
+packetLen(0x0b1e, 10)
+#endif
+
+// Packet: 0x0b1f
+#if PACKETVER >= 20190306
+packetLen(0x0b1f, 10)
+#endif
+
+// Packet: 0x0b20
+#if PACKETVER >= 20190403
+packetLen(0x0b20, 271) // ZC_SHORTCUT_KEY_LIST_V4
+#endif
+
+// Packet: 0x0b21
+#if PACKETVER >= 20190403
+packetLen(0x0b21, 13) // CZ_SHORTCUT_KEY_CHANGE
+#elif PACKETVER >= 20190306
+// removed
+#elif PACKETVER >= 20190227
+packetLen(0x0b21, 10) // CZ_SHORTCUT_KEY_CHANGE
+#endif
+
+// Packet: 0x0b22
+#if PACKETVER >= 20190403
+packetLen(0x0b22, 5) // CZ_SHORTCUTKEYBAR_ROTATE
+#elif PACKETVER >= 20190306
+// removed
+#elif PACKETVER >= 20190227
+packetLen(0x0b22, 6) // CZ_SHORTCUTKEYBAR_ROTATE
+#endif
+
+// Packet: 0x0b23
+#if PACKETVER >= 20190417
+packetLen(0x0b23, 6)
+#elif PACKETVER >= 20190306
+// removed
+#elif PACKETVER >= 20190227
+packetLen(0x0b23, 10)
+#endif
+
+// Packet: 0x0b24
+#if PACKETVER >= 20190417
+packetLen(0x0b24, 6)
+#endif
+
+// Packet: 0x0b25
+#if PACKETVER >= 20190417
+packetLen(0x0b25, 6)
+#endif
+
+// Packet: 0x0b26
+#if PACKETVER >= 20190522
+// removed
+#elif PACKETVER >= 20190508
+packetLen(0x0b26, 16)
+#elif PACKETVER >= 20190417
+packetLen(0x0b26, 18)
+#endif
+
+// Packet: 0x0b27
+#if PACKETVER >= 20190508
+packetLen(0x0b27, -1)
+#endif
+
+// Packet: 0x0b28
+#if PACKETVER >= 20190522
+packetLen(0x0b28, 3)
+#elif PACKETVER >= 20190508
+packetLen(0x0b28, 22)
+#endif
+
+// Packet: 0x0b29
+#if PACKETVER >= 20190508
+packetLen(0x0b29, 6)
+#endif
+
+// Packet: 0x0b2a
+#if PACKETVER >= 20190522
+packetLen(0x0b2a, 40)
+#elif PACKETVER >= 20190508
+packetLen(0x0b2a, 6)
+#endif
+
+// Packet: 0x0b2b
+#if PACKETVER >= 20190522
+packetLen(0x0b2b, 11)
+#endif
+
+// Packet: 0x0b2c
+#if PACKETVER >= 20190522
+packetLen(0x0b2c, 3)
+#endif
+
+// Packet: 0x0b2d
+#if PACKETVER >= 20190522
+packetLen(0x0b2d, 11)
+#endif
+
+// Packet: 0x0b2e
+#if PACKETVER >= 20190522
+packetLen(0x0b2e, 4)
+#endif
+
+// Packet: 0x0b2f
+#if PACKETVER >= 20190529
+packetLen(0x0b2f, 73)
+#endif
+
+// Packet: 0x0b30
+#if PACKETVER >= 20190529
+packetLen(0x0b30, -1)
+#endif
#endif /* COMMON_PACKETS2019_LEN_RE_H */
diff --git a/src/common/packets/packets2019_len_zero.h b/src/common/packets/packets2019_len_zero.h
index 08e83f59f..3295b26d9 100644
--- a/src/common/packets/packets2019_len_zero.h
+++ b/src/common/packets/packets2019_len_zero.h
@@ -3787,13 +3787,13 @@ packetLen(0x0a43, 85) // ZC_ADD_MEMBER_TO_GROUP
packetLen(0x0a44, -1) // ZC_GROUP_LIST
// Packet: 0x0a46
-packetLen(0x0a46, 14)
+packetLen(0x0a46, 14) // CZ_REQ_STYLE_CHANGE
// Packet: 0x0a47
packetLen(0x0a47, 3) // ZC_STYLE_CHANGE_RES
// Packet: 0x0a48
-packetLen(0x0a48, 2)
+packetLen(0x0a48, 2) // CZ_STYLE_CLOSE
// Packet: 0x0a49
packetLen(0x0a49, 22) // CZ_PRIVATE_AIRSHIP_REQUEST
@@ -3946,10 +3946,10 @@ packetLen(0x0a85, 82)
packetLen(0x0a86, -1)
// Packet: 0x0a87
-packetLen(0x0a87, -1)
+packetLen(0x0a87, -1) // ZC_BAN_LIST
// Packet: 0x0a88
-packetLen(0x0a88, 2)
+packetLen(0x0a88, 2) // CZ_COOLDOWN_RESET
// Packet: 0x0a89
packetLen(0x0a89, 61) // ZC_NOTIFY_OFFLINE_STORE
@@ -4168,7 +4168,7 @@ packetLen(0x0acf, 68) // CA_LOGIN_OTP
packetLen(0x0ad0, 11) // CA_OTP_CODE
// Packet: 0x0ad1
-packetLen(0x0ad1, -1)
+packetLen(0x0ad1, -1) // AC_LOGIN_OTP
// Packet: 0x0ad2
packetLen(0x0ad2, 30)
@@ -4210,7 +4210,7 @@ packetLen(0x0add, 24) // ZC_ITEM_FALL_ENTRY
packetLen(0x0ade, 6) // ZC_OVERWEIGHT_PERCENT
// Packet: 0x0adf
-packetLen(0x0adf, 58) // ZC_ACK_REQNAME
+packetLen(0x0adf, 58) // ZC_ACK_REQNAME_TITLE
// Packet: 0x0ae0
packetLen(0x0ae0, 30)
@@ -4288,7 +4288,7 @@ packetLen(0x0afa, 54)
packetLen(0x0afb, -1) // ZC_AUTOSPELLLIST
// Packet: 0x0afc
-packetLen(0x0afc, 16)
+packetLen(0x0afc, 16) // CZ_REQ_STYLE_CHANGE2
// Packet: 0x0afd
packetLen(0x0afd, -1) // ZC_GUILD_POSITION
@@ -4375,11 +4375,128 @@ packetLen(0x0b18, 4) // ZC_INVENTORY_EXPANSION_INFO
packetLen(0x0b19, 2) // CZ_INVENTORY_EXPAND_REJECTED
// Packet: 0x0b1a
-packetLen(0x0b1a, 29)
+packetLen(0x0b1a, 29) // ZC_USESKILL_ACK3
// Packet: 0x0b1b
#if PACKETVER >= 20190130
-packetLen(0x0b1b, 2)
+packetLen(0x0b1b, 2) // ZC_ALT_PING
+#endif
+
+// Packet: 0x0b1c
+#if PACKETVER >= 20190220
+packetLen(0x0b1c, 2) // CZ_PING
+#endif
+
+// Packet: 0x0b1d
+#if PACKETVER >= 20190220
+packetLen(0x0b1d, 2) // ZC_PING
+#endif
+
+// Packet: 0x0b1e
+#if PACKETVER >= 20190313
+packetLen(0x0b1e, 10)
+#endif
+
+// Packet: 0x0b1f
+#if PACKETVER >= 20190313
+packetLen(0x0b1f, 10)
+#endif
+
+// Packet: 0x0b20
+#if PACKETVER >= 20190327
+packetLen(0x0b20, 271) // ZC_SHORTCUT_KEY_LIST_V4
+#endif
+
+// Packet: 0x0b21
+#if PACKETVER >= 20190327
+packetLen(0x0b21, 13) // CZ_SHORTCUT_KEY_CHANGE
+#endif
+
+// Packet: 0x0b22
+#if PACKETVER >= 20190327
+packetLen(0x0b22, 5) // CZ_SHORTCUTKEYBAR_ROTATE
+#endif
+
+// Packet: 0x0b23
+#if PACKETVER >= 20190410
+packetLen(0x0b23, 6)
+#endif
+
+// Packet: 0x0b24
+#if PACKETVER >= 20190424
+packetLen(0x0b24, 6)
+#endif
+
+// Packet: 0x0b25
+#if PACKETVER >= 20190424
+packetLen(0x0b25, 6)
+#endif
+
+// Packet: 0x0b26
+#if PACKETVER >= 20190515
+// removed
+#elif PACKETVER >= 20190424
+packetLen(0x0b26, 16)
+#endif
+
+// Packet: 0x0b27
+#if PACKETVER >= 20190502
+packetLen(0x0b27, -1)
+#elif PACKETVER >= 20190424
+packetLen(0x0b27, 2)
+#endif
+
+// Packet: 0x0b28
+#if PACKETVER >= 20190515
+packetLen(0x0b28, 3)
+#elif PACKETVER >= 20190502
+packetLen(0x0b28, 22)
+#elif PACKETVER >= 20190424
+packetLen(0x0b28, -1)
+#endif
+
+// Packet: 0x0b29
+#if PACKETVER >= 20190502
+packetLen(0x0b29, 6)
+#elif PACKETVER >= 20190424
+packetLen(0x0b29, 3)
+#endif
+
+// Packet: 0x0b2a
+#if PACKETVER >= 20190529
+packetLen(0x0b2a, 40)
+#elif PACKETVER >= 20190502
+packetLen(0x0b2a, 6)
+#endif
+
+// Packet: 0x0b2b
+#if PACKETVER >= 20190515
+packetLen(0x0b2b, 11)
+#endif
+
+// Packet: 0x0b2c
+#if PACKETVER >= 20190515
+packetLen(0x0b2c, 3)
+#endif
+
+// Packet: 0x0b2d
+#if PACKETVER >= 20190515
+packetLen(0x0b2d, 11)
+#endif
+
+// Packet: 0x0b2e
+#if PACKETVER >= 20190515
+packetLen(0x0b2e, 4)
+#endif
+
+// Packet: 0x0b2f
+#if PACKETVER >= 20190529
+packetLen(0x0b2f, 73)
+#endif
+
+// Packet: 0x0b30
+#if PACKETVER >= 20190529
+packetLen(0x0b30, -1)
#endif
diff --git a/src/common/socket.c b/src/common/socket.c
index 95d8bf578..8ee4f06e2 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -79,8 +79,6 @@
static struct socket_interface sockt_s;
struct socket_interface *sockt;
-static const char *SOCKET_CONF_FILENAME = "conf/common/socket.conf";
-
#ifdef SEND_SHORTLIST
// Add a fd to the shortlist so that it'll be recognized as a fd that needs
// sending done on it.
@@ -462,7 +460,7 @@ static int recv_to_fifo(int fd)
socket_data_ci += len;
}
#endif // SHOW_SERVER_STATS
- return 0;
+ return (int)len;
}
static int send_from_fifo(int fd)
@@ -490,11 +488,12 @@ static int send_from_fifo(int fd)
return 0;
}
- if( len > 0 )
+ if (len > 0)
{
+ sockt->session[fd]->wdata_tick = sockt->last_tick;
// some data could not be transferred?
// shift unsent data to the beginning of the queue
- if( (size_t)len < sockt->session[fd]->wdata_size )
+ if ((size_t)len < sockt->session[fd]->wdata_size)
memmove(sockt->session[fd]->wdata, sockt->session[fd]->wdata + len, sockt->session[fd]->wdata_size - len);
sockt->session[fd]->wdata_size -= len;
@@ -648,9 +647,10 @@ static int make_listen_bind(uint32 ip, uint16 port)
if(sockt->fd_max <= fd) sockt->fd_max = fd + 1;
- create_session(fd, connect_client, null_send, null_parse);
+ create_session(fd, sockt->connect_client, null_send, null_parse);
sockt->session[fd]->client_addr = 0; // just listens
sockt->session[fd]->rdata_tick = 0; // disable timeouts on this socket
+ sockt->session[fd]->wdata_tick = 0;
return fd;
}
@@ -733,6 +733,7 @@ static int create_session(int fd, RecvFunc func_recv, SendFunc func_send, ParseF
sockt->session[fd]->func_send = func_send;
sockt->session[fd]->func_parse = func_parse;
sockt->session[fd]->rdata_tick = sockt->last_tick;
+ sockt->session[fd]->wdata_tick = sockt->last_tick;
sockt->session[fd]->session_data = NULL;
sockt->session[fd]->hdata = NULL;
return 0;
@@ -1505,7 +1506,7 @@ static bool socket_config_read(const char *filename, bool imported)
// import should overwrite any previous configuration, so it should be called last
if (libconfig->lookup_string(&config, "import", &import) == CONFIG_TRUE) {
- if (strcmp(import, filename) == 0 || strcmp(import, SOCKET_CONF_FILENAME) == 0) {
+ if (strcmp(import, filename) == 0 || strcmp(import, sockt->SOCKET_CONF_FILENAME) == 0) {
ShowWarning("socket_config_read: Loop detected! Skipping 'import'...\n");
} else {
if (!socket_config_read(import, true))
@@ -1714,7 +1715,7 @@ static void socket_init(void)
// Get initial local ips
sockt->naddr_ = sockt->getips(sockt->addr_,16);
- socket_config_read(SOCKET_CONF_FILENAME, false);
+ socket_config_read(sockt->SOCKET_CONF_FILENAME, false);
#ifndef SOCKET_EPOLL
// Select based Event Dispatcher:
@@ -1855,7 +1856,7 @@ static void socket_datasync(int fd, bool send)
WFIFOL(fd, 4 + ( i * 4 ) ) = data_list[i].length;
}
- WFIFOSET(fd, p_len);
+ WFIFOSET2(fd, p_len);
} else {
for( i = 0; i < alen; i++ ) {
if( RFIFOL(fd, 4 + (i * 4) ) != data_list[i].length ) {
@@ -1864,7 +1865,7 @@ static void socket_datasync(int fd, bool send)
WFIFOW(fd, 0) = 0x2b0a;
WFIFOW(fd, 2) = 8;
WFIFOL(fd, 4) = 0;
- WFIFOSET(fd, 8);
+ WFIFOSET2(fd, 8);
sockt->flush(fd);
/* shut down */
ShowFatalError("Servers are out of sync! recompile from scratch (%d)\n",i);
@@ -2143,6 +2144,8 @@ void socket_defaults(void)
{
sockt = &sockt_s;
+ sockt->SOCKET_CONF_FILENAME = "conf/common/socket.conf";
+
sockt->fd_max = 0;
/* */
sockt->stall_time = 60;
@@ -2177,6 +2180,7 @@ void socket_defaults(void)
/* */
sockt->flush = flush_fifo;
sockt->flush_fifos = flush_fifos;
+ sockt->connect_client = connect_client;
sockt->set_nonblocking = set_nonblocking;
sockt->set_defaultparse = set_defaultparse;
sockt->host2ip = host2ip;
diff --git a/src/common/socket.h b/src/common/socket.h
index 5e4251989..b20b0b07e 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -130,6 +130,7 @@ struct socket_data {
size_t rdata_pos;
uint32 last_head_size;
time_t rdata_tick; // time of last recv (for detecting timeouts); zero when timeout is disabled
+ time_t wdata_tick; // time of last send (for detecting timeouts);
RecvFunc func_recv;
SendFunc func_send;
@@ -178,6 +179,7 @@ struct socket_interface {
time_t stall_time;
time_t last_tick;
+ const char *SOCKET_CONF_FILENAME;
/* */
uint32 addr_[16]; // ip addresses of local host (host byte order)
int naddr_; // # of ip addresses
@@ -212,6 +214,7 @@ struct socket_interface {
/* */
void (*flush) (int fd);
void (*flush_fifos) (void);
+ int (*connect_client) (int listen_fd);
void (*set_nonblocking) (int fd, unsigned long yes);
void (*set_defaultparse) (ParseFunc defaultparse);
/* hostname/ip conversion functions */
diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c
index b8cb2a90a..e3977f440 100644
--- a/src/common/sysinfo.c
+++ b/src/common/sysinfo.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2013-2015 Hercules Dev Team
+ * Copyright (C) 2013-2019 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -221,8 +221,12 @@ enum windows_ver_suite {
#define SYSINFO_COMPILER "Microsoft Visual C++ 2012 (v" EXPAND_AND_QUOTE(_MSC_VER) ")"
#elif _MSC_VER >= 1800 && _MSC_VER < 1900
#define SYSINFO_COMPILER "Microsoft Visual C++ 2013 (v" EXPAND_AND_QUOTE(_MSC_VER) ")"
-#elif _MSC_VER >= 1900 && _MSC_VER < 2000
+#elif _MSC_VER >= 1900 && _MSC_VER < 1910
#define SYSINFO_COMPILER "Microsoft Visual C++ 2015 (v" EXPAND_AND_QUOTE(_MSC_VER) ")"
+#elif _MSC_VER >= 1910 && _MSC_VER < 1920
+#define SYSINFO_COMPILER "Microsoft Visual C++ 2017 (v" EXPAND_AND_QUOTE(_MSC_VER) ")"
+#elif _MSC_VER >= 1920 && _MSC_VER < 2000
+#define SYSINFO_COMPILER "Microsoft Visual C++ 2019 (v" EXPAND_AND_QUOTE(_MSC_VER) ")"
#else // < 1300 || >= 2000
#define SYSINFO_COMPILER "Microsoft Visual C++ v" EXPAND_AND_QUOTE(_MSC_VER)
#endif