diff options
38 files changed, 13245 insertions, 2034 deletions
diff --git a/src/char/char.cpp b/src/char/char.cpp index d36eb80..33ee2b9 100644 --- a/src/char/char.cpp +++ b/src/char/char.cpp @@ -2464,15 +2464,12 @@ void parse_char(Session *s) sd->login_id2 = fixed.login_id2; sd->packet_tmw_version = fixed.packet_tmw_version; sd->sex = fixed.sex; - // send back account_id - // TODO put this into a proper packet - Little32 account_id_net; - if (!native_to_network(&account_id_net, account_id) - || !packet_send(s, reinterpret_cast<const Byte *>(&account_id_net), 4)) - { - s->set_eof(); - return; - } + + // formerly: send back account_id + Packet_Payload<0x8000> special; + special.magic_packet_length = 4; + send_ppacket<0x8000>(s, special); + // search authentification for (AuthFifoEntry& afi : auth_fifo) { diff --git a/src/login/login.cpp b/src/login/login.cpp index 8d893f9..6edaeef 100644 --- a/src/login/login.cpp +++ b/src/login/login.cpp @@ -69,8 +69,6 @@ #include "../proto2/login-char.hpp" #include "../proto2/login-user.hpp" -#include "types.hpp" - #include "../poison.hpp" constexpr int MAX_SERVERS = 30; diff --git a/src/login/login.hpp b/src/login/login.hpp index 9c17c55..dc817cc 100644 --- a/src/login/login.hpp +++ b/src/login/login.hpp @@ -21,4 +21,6 @@ # include "fwd.hpp" +# include "login.t.hpp" + #endif // TMWA_LOGIN_LOGIN_HPP diff --git a/src/login/types.hpp b/src/login/login.t.hpp index ef12f36..b49fc4b 100644 --- a/src/login/types.hpp +++ b/src/login/login.t.hpp @@ -1,6 +1,6 @@ -#ifndef TMWA_LOGIN_TYPES_HPP -#define TMWA_LOGIN_TYPES_HPP -// types.hpp - externally useful types from login +#ifndef TMWA_LOGIN_LOGIN_T_HPP +#define TMWA_LOGIN_LOGIN_T_HPP +// login.t.hpp - externally useful types from login // // Copyright © ????-2004 Athena Dev Teams // Copyright © 2004-2011 The Mana World Development Team @@ -40,4 +40,4 @@ ENUM_BITWISE_OPERATORS(VERSION_2) } using e::VERSION_2; -#endif // TMWA_LOGIN_TYPES_HPP +#endif // TMWA_LOGIN_LOGIN_T_HPP diff --git a/src/map/battle.hpp b/src/map/battle.hpp index b448073..5bf7dde 100644 --- a/src/map/battle.hpp +++ b/src/map/battle.hpp @@ -31,7 +31,7 @@ # include "../net/timer.t.hpp" -# include "magic-interpreter.t.hpp" +# include "clif.t.hpp" # include "map.t.hpp" # include "skill.t.hpp" diff --git a/src/map/battle.t.hpp b/src/map/battle.t.hpp index d0d3389..09e2512 100644 --- a/src/map/battle.t.hpp +++ b/src/map/battle.t.hpp @@ -240,14 +240,4 @@ earray<Races, Race, Race::COUNT> race_shift //= Races::other, }}; -enum class DamageType : uint8_t -{ - NORMAL = 0x00, - TAKEITEM = 0x01, - RETURNED = 0x04, - DOUBLED = 0x08, - CRITICAL = 0x0a, - FLEE2 = 0x0b, -}; - #endif // TMWA_MAP_BATTLE_T_HPP diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 218c00b..3548324 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -39,9 +39,13 @@ #include "../io/write.hpp" #include "../net/ip.hpp" +#include "../net/packets.hpp" #include "../net/socket.hpp" #include "../net/timer.hpp" -#include "../net/vomit.hpp" + +#include "../proto2/any-user.hpp" +#include "../proto2/char-map.hpp" +#include "../proto2/map-user.hpp" #include "../mmo/md5more.hpp" #include "../mmo/utils.hpp" @@ -65,8 +69,6 @@ #include "../poison.hpp" -#define DUMP_UNKNOWN_PACKET 1 - constexpr int EMOTE_IGNORED = 0x0e; // functions list. Rate is how many milliseconds are required between @@ -74,20 +76,20 @@ constexpr int EMOTE_IGNORED = 0x0e; // map.h must be the same length as this table. rate 0 is default // rate -1 is unlimited -typedef void (*clif_func)(Session *s, dumb_ptr<map_session_data> sd); +typedef RecvResult (*clif_func)(Session *s, dumb_ptr<map_session_data> sd); struct func_table { interval_t rate; - int len; + uint16_t len_unused; clif_func func; // ctor exists because interval_t must be explicit - func_table(int r, int l, clif_func f) - : rate(r), len(l), func(f) + func_table(int r, uint16_t l, clif_func f) + : rate(r), len_unused(l), func(f) {} }; -constexpr int VAR = -1; +constexpr uint16_t VAR = 1; extern // not really - defined below func_table clif_parse_func_table[0x0220]; @@ -110,36 +112,6 @@ enum class SendWho SELF, }; -inline -void WBUFPOS(uint8_t *p, size_t pos, uint16_t x, uint16_t y) -{ - p += pos; - p[0] = x >> 2; - p[1] = (x << 6) | ((y >> 4) & 0x3f); - p[2] = y << 4; -} -inline -void WBUFPOS2(uint8_t *p, size_t pos, uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) -{ - p += pos; - p[0] = x0 >> 2; - p[1] = (x0 << 6) | ((y0 >> 4) & 0x3f); - p[2] = (y0 << 4) | ((x1 >> 6) & 0x0f); - p[3] = (x1 << 2) | ((y1 >> 8) & 0x03); - p[4] = y1; -} - -inline -void WFIFOPOS(Session *s, size_t pos, uint16_t x, uint16_t y) -{ - WBUFPOS(static_cast<uint8_t *>(WFIFOP(s, pos)), 0, x, y); -} -inline -void WFIFOPOS2(Session *s, size_t pos, uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) -{ - WBUFPOS2(static_cast<uint8_t *>(WFIFOP(s, pos)), 0, x0, y0, x1, y1); -} - static IP4Address map_ip; static @@ -268,14 +240,14 @@ enum class ChatType }; static -AString clif_validate_chat(dumb_ptr<map_session_data> sd, ChatType type); +AString clif_validate_chat(dumb_ptr<map_session_data> sd, ChatType type, XString buf); /*========================================== * clif_sendでSendWho::AREA*指定時用 *------------------------------------------ */ static -void clif_send_sub(dumb_ptr<block_list> bl, const unsigned char *buf, int len, +void clif_send_sub(dumb_ptr<block_list> bl, const Buffer& buf, dumb_ptr<block_list> src_bl, SendWho type) { nullpo_retv(bl); @@ -305,11 +277,8 @@ void clif_send_sub(dumb_ptr<block_list> bl, const unsigned char *buf, int len, if (sd->sess != NULL) { { - if (clif_parse_func_table[RBUFW(buf, 0)].len) { - // packet must exist - WFIFO_BUF_CLONE(sd->sess, buf, len); - WFIFOSET(sd->sess, len); + send_buffer(sd->sess, buf); } } } @@ -320,7 +289,7 @@ void clif_send_sub(dumb_ptr<block_list> bl, const unsigned char *buf, int len, *------------------------------------------ */ static -int clif_send(const uint8_t *buf, int len, dumb_ptr<block_list> bl, SendWho type) +int clif_send(const Buffer& buf, dumb_ptr<block_list> bl, SendWho type) { PartyPair p; int x0 = 0, x1 = 0, y0 = 0, y1 = 0; @@ -363,11 +332,8 @@ int clif_send(const uint8_t *buf, int len, dumb_ptr<block_list> bl, SendWho type dumb_ptr<map_session_data> sd = dumb_ptr<map_session_data>(static_cast<map_session_data *>(s->session_data.get())); if (sd && sd->state.auth) { - if (clif_parse_func_table[RBUFW(buf, 0)].len) { - // packet must exist - WFIFO_BUF_CLONE(s, buf, len); - WFIFOSET(s, len); + send_buffer(s, buf); } } } @@ -381,25 +347,22 @@ int clif_send(const uint8_t *buf, int len, dumb_ptr<block_list> bl, SendWho type dumb_ptr<map_session_data> sd = dumb_ptr<map_session_data>(static_cast<map_session_data *>(s->session_data.get())); if (sd && sd->state.auth && sd->bl_m == bl->bl_m) { - if (clif_parse_func_table[RBUFW(buf, 0)].len) { - // packet must exist - WFIFO_BUF_CLONE(s, buf, len); - WFIFOSET(s, len); + send_buffer(s, buf); } } } break; case SendWho::AREA: case SendWho::AREA_WOS: - map_foreachinarea(std::bind(clif_send_sub, ph::_1, buf, len, bl, type), + map_foreachinarea(std::bind(clif_send_sub, ph::_1, buf, bl, type), bl->bl_m, bl->bl_x - AREA_SIZE, bl->bl_y - AREA_SIZE, bl->bl_x + AREA_SIZE, bl->bl_y + AREA_SIZE, BL::PC); break; case SendWho::AREA_CHAT_WOC: - map_foreachinarea(std::bind(clif_send_sub, ph::_1, buf, len, bl, SendWho::AREA_CHAT_WOC), + map_foreachinarea(std::bind(clif_send_sub, ph::_1, buf, bl, SendWho::AREA_CHAT_WOC), bl->bl_m, bl->bl_x - (AREA_SIZE), bl->bl_y - (AREA_SIZE), bl->bl_x + (AREA_SIZE), bl->bl_y + (AREA_SIZE), @@ -447,11 +410,8 @@ int clif_send(const uint8_t *buf, int len, dumb_ptr<block_list> bl, SendWho type (sd->bl_x < x0 || sd->bl_y < y0 || sd->bl_x > x1 || sd->bl_y > y1)) continue; - if (clif_parse_func_table[RBUFW(buf, 0)].len) { - // packet must exist - WFIFO_BUF_CLONE(sd->sess, buf, len); - WFIFOSET(sd->sess, len); + send_buffer(sd->sess, buf); } } } @@ -465,11 +425,8 @@ int clif_send(const uint8_t *buf, int len, dumb_ptr<block_list> bl, SendWho type { if (sd->partyspy == p.party_id) { - if (clif_parse_func_table[RBUFW(buf, 0)].len) { - // packet must exist - WFIFO_BUF_CLONE(sd->sess, buf, len); - WFIFOSET(sd->sess, len); + send_buffer(sd->sess, buf); } } } @@ -479,11 +436,9 @@ int clif_send(const uint8_t *buf, int len, dumb_ptr<block_list> bl, SendWho type case SendWho::SELF: { dumb_ptr<map_session_data> sd = bl->is_player(); - if (clif_parse_func_table[RBUFW(buf, 0)].len) + { - // packet must exist - WFIFO_BUF_CLONE(sd->sess, buf, len); - WFIFOSET(sd->sess, len); + send_buffer(sd->sess, buf); } } break; @@ -516,12 +471,12 @@ int clif_authok(dumb_ptr<map_session_data> sd) Session *s = sd->sess; - WFIFOW(s, 0) = 0x73; - WFIFOL(s, 2) = gettick().time_since_epoch().count(); - WFIFOPOS(s, 6, sd->bl_x, sd->bl_y); - WFIFOB(s, 9) = 5; - WFIFOB(s, 10) = 5; - WFIFOSET(s, clif_parse_func_table[0x73].len); + Packet_Fixed<0x0073> fixed_73; + fixed_73.tick = gettick(); + fixed_73.pos = Position1{static_cast<uint16_t>(sd->bl_x), static_cast<uint16_t>(sd->bl_y), DIR::S}; + fixed_73.five1 = 5; + fixed_73.five2 = 5; + send_fpacket<0x0073, 11>(s, fixed_73); return 0; } @@ -535,9 +490,9 @@ int clif_authfail_fd(Session *s, int type) if (!s) return 0; - WFIFOW(s, 0) = 0x81; - WFIFOL(s, 2) = type; - WFIFOSET(s, clif_parse_func_table[0x81].len); + Packet_Fixed<0x0081> fixed_81; + fixed_81.error_code = type; + send_fpacket<0x0081, 3>(s, fixed_81); clif_setwaitclose(s); @@ -559,9 +514,9 @@ int clif_charselectok(BlockId id) return 1; Session *s = sd->sess; - WFIFOW(s, 0) = 0xb3; - WFIFOB(s, 2) = 1; - WFIFOSET(s, clif_parse_func_table[0xb3].len); + Packet_Fixed<0x00b3> fixed_b3; + fixed_b3.one = 1; + send_fpacket<0x00b3, 3>(s, fixed_b3); return 0; } @@ -571,22 +526,21 @@ int clif_charselectok(BlockId id) *------------------------------------------ */ static -int clif_set009e(dumb_ptr<flooritem_data> fitem, uint8_t *buf) +void clif_set009e(dumb_ptr<flooritem_data> fitem, Buffer& buf) { - nullpo_ret(fitem); + nullpo_retv(fitem); - //009e <ID>.l <name ID>.w <identify flag>.B <X>.w <Y>.w <subX>.B <subY>.B <amount>.w - WBUFW(buf, 0) = 0x9e; - WBUFL(buf, 2) = unwrap<BlockId>(fitem->bl_id); - WBUFW(buf, 6) = unwrap<ItemNameId>(fitem->item_data.nameid); - WBUFB(buf, 8) = 1; //identify; - WBUFW(buf, 9) = fitem->bl_x; - WBUFW(buf, 11) = fitem->bl_y; - WBUFB(buf, 13) = fitem->subx; - WBUFB(buf, 14) = fitem->suby; - WBUFW(buf, 15) = fitem->item_data.amount; + Packet_Fixed<0x009e> fixed_9e; + fixed_9e.block_id = fitem->bl_id; + fixed_9e.name_id = fitem->item_data.nameid; + fixed_9e.identify = 1; + fixed_9e.x = fitem->bl_x; + fixed_9e.y = fitem->bl_y; + fixed_9e.subx = fitem->subx; + fixed_9e.suby = fitem->suby; + fixed_9e.amount = fitem->item_data.amount; - return clif_parse_func_table[0x9e].len; + buf = create_fpacket<0x009e, 17>(fixed_9e); } /*========================================== @@ -595,14 +549,14 @@ int clif_set009e(dumb_ptr<flooritem_data> fitem, uint8_t *buf) */ int clif_dropflooritem(dumb_ptr<flooritem_data> fitem) { - uint8_t buf[64]; - nullpo_ret(fitem); if (!fitem->item_data.nameid) return 0; + + Buffer buf; clif_set009e(fitem, buf); - clif_send(buf, clif_parse_func_table[0x9e].len, fitem, SendWho::AREA); + clif_send(buf, fitem, SendWho::AREA); return 0; } @@ -613,21 +567,19 @@ int clif_dropflooritem(dumb_ptr<flooritem_data> fitem) */ int clif_clearflooritem(dumb_ptr<flooritem_data> fitem, Session *s) { - unsigned char buf[16]; - nullpo_ret(fitem); - WBUFW(buf, 0) = 0xa1; - WBUFL(buf, 2) = unwrap<BlockId>(fitem->bl_id); + Packet_Fixed<0x00a1> fixed_a1; + fixed_a1.block_id = fitem->bl_id; if (!s) { - clif_send(buf, clif_parse_func_table[0xa1].len, fitem, SendWho::AREA); + Buffer buf = create_fpacket<0x00a1, 6>(fixed_a1); + clif_send(buf, fitem, SendWho::AREA); } else { - WFIFO_BUF_CLONE(s, buf, 6); - WFIFOSET(s, clif_parse_func_table[0xa1].len); + send_fpacket<0x00a1, 6>(s, fixed_a1); } return 0; @@ -639,21 +591,21 @@ int clif_clearflooritem(dumb_ptr<flooritem_data> fitem, Session *s) */ int clif_clearchar(dumb_ptr<block_list> bl, BeingRemoveWhy type) { - unsigned char buf[16]; - nullpo_ret(bl); - WBUFW(buf, 0) = 0x80; - WBUFL(buf, 2) = unwrap<BlockId>(bl->bl_id); + Packet_Fixed<0x0080> fixed_80; + fixed_80.block_id = bl->bl_id; + Buffer buf = create_fpacket<0x0080, 7>(fixed_80); + if (type == BeingRemoveWhy::DISGUISE) { - WBUFB(buf, 6) = static_cast<uint8_t>(BeingRemoveWhy::GONE); - clif_send(buf, clif_parse_func_table[0x80].len, bl, SendWho::AREA); + fixed_80.type = BeingRemoveWhy::GONE; + clif_send(buf, bl, SendWho::AREA); } else { - WBUFB(buf, 6) = static_cast<uint8_t>(type); - clif_send(buf, clif_parse_func_table[0x80].len, bl, + fixed_80.type = type; + clif_send(buf, bl, type == BeingRemoveWhy::DEAD ? SendWho::AREA : SendWho::AREA_WOS); } @@ -697,10 +649,10 @@ int clif_clearchar_delay(tick_t tick, */ void clif_clearchar_id(BlockId id, BeingRemoveWhy type, Session *s) { - WFIFOW(s, 0) = 0x80; - WFIFOL(s, 2) = unwrap<BlockId>(id); - WFIFOB(s, 6) = static_cast<uint8_t>(type); - WFIFOSET(s, clif_parse_func_table[0x80].len); + Packet_Fixed<0x0080> fixed_80; + fixed_80.block_id = id; + fixed_80.type = type; + send_fpacket<0x0080, 7>(s, fixed_80); } /*========================================== @@ -708,59 +660,111 @@ void clif_clearchar_id(BlockId id, BeingRemoveWhy type, Session *s) *------------------------------------------ */ static -int clif_set0078(dumb_ptr<map_session_data> sd, unsigned char *buf) +void clif_set0078_main_1d8(dumb_ptr<map_session_data> sd, Buffer& buf) { - nullpo_ret(sd); + nullpo_retv(sd); - WBUFW(buf, 0) = 0x1d8; - WBUFL(buf, 2) = unwrap<BlockId>(sd->bl_id); - WBUFW(buf, 6) = static_cast<uint16_t>(sd->speed.count()); - WBUFW(buf, 8) = static_cast<uint16_t>(sd->opt1); - WBUFW(buf, 10) = static_cast<uint16_t>(sd->opt2); - WBUFW(buf, 12) = static_cast<uint16_t>(sd->status.option); - WBUFW(buf, 14) = unwrap<Species>(sd->status.species); - WBUFW(buf, 16) = sd->status.hair; + Packet_Fixed<0x01d8> fixed_1d8; + fixed_1d8.block_id = sd->bl_id; + fixed_1d8.speed = sd->speed; + fixed_1d8.opt1 = sd->opt1; + fixed_1d8.opt2 = sd->opt2; + fixed_1d8.option = sd->status.option; + fixed_1d8.species = sd->status.species; + fixed_1d8.hair_style = sd->status.hair; int widx = sd->equip_index_maybe[EQUIP::WEAPON]; int sidx = sd->equip_index_maybe[EQUIP::SHIELD]; if (sd->attack_spell_override) - WBUFW(buf, 18) = sd->attack_spell_look_override; + fixed_1d8.weapon = sd->attack_spell_look_override; else { if (widx >= 0 && sd->inventory_data[widx]) { - WBUFW(buf, 18) = unwrap<ItemNameId>(sd->status.inventory[widx].nameid); + fixed_1d8.weapon = sd->status.inventory[widx].nameid; } else - WBUFW(buf, 18) = unwrap<ItemNameId>(ItemNameId()); + fixed_1d8.weapon = ItemNameId(); } if (sidx >= 0 && sidx != widx && sd->inventory_data[sidx]) { - WBUFW(buf, 20) = unwrap<ItemNameId>(sd->status.inventory[sidx].nameid); + fixed_1d8.shield = sd->status.inventory[sidx].nameid; } else - WBUFW(buf, 20) = unwrap<ItemNameId>(ItemNameId()); - WBUFW(buf, 22) = unwrap<ItemNameId>(sd->status.head_bottom); - WBUFW(buf, 24) = unwrap<ItemNameId>(sd->status.head_top); - WBUFW(buf, 26) = unwrap<ItemNameId>(sd->status.head_mid); - WBUFW(buf, 28) = sd->status.hair_color; - WBUFW(buf, 30) = sd->status.clothes_color; - WBUFW(buf, 32) = static_cast<uint8_t>(sd->head_dir); - WBUFL(buf, 34) = 0 /*guild_id*/; - WBUFW(buf, 38) = 0 /*guild_emblem_id*/; - WBUFW(buf, 40) = sd->status.manner; - WBUFW(buf, 42) = static_cast<uint16_t>(sd->opt3); - WBUFB(buf, 44) = sd->status.karma; - WBUFB(buf, 45) = static_cast<uint8_t>(sd->sex); - WBUFPOS(buf, 46, sd->bl_x, sd->bl_y); - // work around ICE in gcc 4.6 - uint8_t dir = static_cast<uint8_t>(sd->dir); - WBUFB(buf, 48) |= dir; - WBUFW(buf, 49) = pc_isGM(sd).get_public_word(); - WBUFB(buf, 51) = sd->state.dead_sit; - WBUFW(buf, 52) = 0; - - return clif_parse_func_table[0x1d8].len; + fixed_1d8.shield = ItemNameId(); + fixed_1d8.head_bottom = sd->status.head_bottom; + fixed_1d8.head_top = sd->status.head_top; + fixed_1d8.head_mid = sd->status.head_mid; + fixed_1d8.hair_color = sd->status.hair_color; + fixed_1d8.clothes_color = sd->status.clothes_color; + fixed_1d8.head_dir = sd->head_dir; + fixed_1d8.guild_id = 0; + fixed_1d8.guild_emblem_id = 0; + fixed_1d8.manner = sd->status.manner; + fixed_1d8.opt3 = sd->opt3; + fixed_1d8.karma = sd->status.karma; + fixed_1d8.sex = sd->sex; + fixed_1d8.pos.x = sd->bl_x; + fixed_1d8.pos.y = sd->bl_y; + fixed_1d8.pos.dir = sd->dir; + fixed_1d8.gm_bits = pc_isGM(sd).get_public_word(); + fixed_1d8.dead_sit = sd->state.dead_sit; + fixed_1d8.unused = 0; + + buf = create_fpacket<0x01d8, 54>(fixed_1d8); +} +static +void clif_set0078_alt_1d9(dumb_ptr<map_session_data> sd, Buffer& buf) +{ + nullpo_retv(sd); + + Packet_Fixed<0x01d9> fixed_1d8; // LIES + fixed_1d8.block_id = sd->bl_id; + fixed_1d8.speed = sd->speed; + fixed_1d8.opt1 = sd->opt1; + fixed_1d8.opt2 = sd->opt2; + fixed_1d8.option = sd->status.option; + fixed_1d8.species = sd->status.species; + fixed_1d8.hair_style = sd->status.hair; + + int widx = sd->equip_index_maybe[EQUIP::WEAPON]; + int sidx = sd->equip_index_maybe[EQUIP::SHIELD]; + if (sd->attack_spell_override) + fixed_1d8.weapon = sd->attack_spell_look_override; + else + { + if (widx >= 0 && sd->inventory_data[widx]) + { + fixed_1d8.weapon = sd->status.inventory[widx].nameid; + } + else + fixed_1d8.weapon = ItemNameId(); + } + if (sidx >= 0 && sidx != widx && sd->inventory_data[sidx]) + { + fixed_1d8.shield = sd->status.inventory[sidx].nameid; + } + else + fixed_1d8.shield = ItemNameId(); + fixed_1d8.head_bottom = sd->status.head_bottom; + fixed_1d8.head_top = sd->status.head_top; + fixed_1d8.head_mid = sd->status.head_mid; + fixed_1d8.hair_color = sd->status.hair_color; + fixed_1d8.clothes_color = sd->status.clothes_color; + fixed_1d8.head_dir = sd->head_dir; + fixed_1d8.guild_id = 0; + fixed_1d8.guild_emblem_id = 0; + fixed_1d8.manner = sd->status.manner; + fixed_1d8.opt3 = sd->opt3; + fixed_1d8.karma = sd->status.karma; + fixed_1d8.sex = sd->sex; + fixed_1d8.pos.x = sd->bl_x; + fixed_1d8.pos.y = sd->bl_y; + fixed_1d8.pos.dir = sd->dir; + fixed_1d8.gm_bits = pc_isGM(sd).get_public_word(); + fixed_1d8.unused = 0; + + buf = create_fpacket<0x01d9, 53>(fixed_1d8); } /*========================================== @@ -768,51 +772,54 @@ int clif_set0078(dumb_ptr<map_session_data> sd, unsigned char *buf) *------------------------------------------ */ static -int clif_set007b(dumb_ptr<map_session_data> sd, unsigned char *buf) +void clif_set007b(dumb_ptr<map_session_data> sd, Buffer& buf) { - nullpo_ret(sd); + nullpo_retv(sd); - WBUFW(buf, 0) = 0x1da; - WBUFL(buf, 2) = unwrap<BlockId>(sd->bl_id); - WBUFW(buf, 6) = static_cast<uint16_t>(sd->speed.count()); - WBUFW(buf, 8) = static_cast<uint16_t>(sd->opt1); - WBUFW(buf, 10) = static_cast<uint16_t>(sd->opt2); - WBUFW(buf, 12) = static_cast<uint16_t>(sd->status.option); - WBUFW(buf, 14) = unwrap<Species>(sd->status.species); - WBUFW(buf, 16) = sd->status.hair; + Packet_Fixed<0x01da> fixed_1da; + fixed_1da.block_id = sd->bl_id; + fixed_1da.speed = sd->speed; + fixed_1da.opt1 = sd->opt1; + fixed_1da.opt2 = sd->opt2; + fixed_1da.option = sd->status.option; + fixed_1da.species = sd->status.species; + fixed_1da.hair_style = sd->status.hair; int widx = sd->equip_index_maybe[EQUIP::WEAPON]; int sidx = sd->equip_index_maybe[EQUIP::SHIELD]; if (widx >= 0 && sd->inventory_data[widx]) { - WBUFW(buf, 18) = unwrap<ItemNameId>(sd->status.inventory[widx].nameid); + fixed_1da.weapon = sd->status.inventory[widx].nameid; } else - WBUFW(buf, 18) = unwrap<ItemNameId>(ItemNameId()); + fixed_1da.weapon = ItemNameId(); if (sidx >= 0 && sidx != widx && sd->inventory_data[sidx]) { - WBUFW(buf, 20) = unwrap<ItemNameId>(sd->status.inventory[sidx].nameid); + fixed_1da.shield = sd->status.inventory[sidx].nameid; } else - WBUFW(buf, 20) = unwrap<ItemNameId>(ItemNameId()); - WBUFW(buf, 22) = unwrap<ItemNameId>(sd->status.head_bottom); - WBUFL(buf, 24) = gettick().time_since_epoch().count(); - WBUFW(buf, 28) = unwrap<ItemNameId>(sd->status.head_top); - WBUFW(buf, 30) = unwrap<ItemNameId>(sd->status.head_mid); - WBUFW(buf, 32) = sd->status.hair_color; - WBUFW(buf, 34) = sd->status.clothes_color; - WBUFW(buf, 36) = static_cast<uint8_t>(sd->head_dir); - WBUFL(buf, 38) = 0/*guild_id*/; - WBUFW(buf, 42) = 0/*guild_emblem_id*/; - WBUFW(buf, 44) = sd->status.manner; - WBUFW(buf, 46) = static_cast<uint16_t>(sd->opt3); - WBUFB(buf, 48) = sd->status.karma; - WBUFB(buf, 49) = static_cast<uint8_t>(sd->sex); - WBUFPOS2(buf, 50, sd->bl_x, sd->bl_y, sd->to_x, sd->to_y); - WBUFW(buf, 55) = pc_isGM(sd).get_public_word(); - WBUFB(buf, 57) = 5; - WBUFW(buf, 58) = 0; - - return clif_parse_func_table[0x1da].len; + fixed_1da.shield = ItemNameId(); + fixed_1da.head_bottom = sd->status.head_bottom; + fixed_1da.tick = gettick(); + fixed_1da.head_top = sd->status.head_top; + fixed_1da.head_mid = sd->status.head_mid; + fixed_1da.hair_color = sd->status.hair_color; + fixed_1da.clothes_color = sd->status.clothes_color; + fixed_1da.head_dir = sd->head_dir; + fixed_1da.guild_id = 0; + fixed_1da.guild_emblem_id = 0; + fixed_1da.manner = sd->status.manner; + fixed_1da.opt3 = sd->opt3; + fixed_1da.karma = sd->status.karma; + fixed_1da.sex = sd->sex; + fixed_1da.pos2.x0 = sd->bl_x; + fixed_1da.pos2.y0 = sd->bl_y; + fixed_1da.pos2.x1 = sd->to_x; + fixed_1da.pos2.y1 = sd->to_y; + fixed_1da.gm_bits = pc_isGM(sd).get_public_word(); + fixed_1da.five = 5; + fixed_1da.unused = 0; + + buf = create_fpacket<0x01da, 60>(fixed_1da); } /*========================================== @@ -820,30 +827,27 @@ int clif_set007b(dumb_ptr<map_session_data> sd, unsigned char *buf) *------------------------------------------ */ static -int clif_mob0078(dumb_ptr<mob_data> md, unsigned char *buf) +void clif_mob0078(dumb_ptr<mob_data> md, Buffer& buf) { - really_memset0(buf, clif_parse_func_table[0x78].len); - - nullpo_ret(md); + nullpo_retv(md); - WBUFW(buf, 0) = 0x78; - WBUFL(buf, 2) = unwrap<BlockId>(md->bl_id); - WBUFW(buf, 6) = static_cast<uint16_t>(battle_get_speed(md).count()); - WBUFW(buf, 8) = static_cast<uint16_t>(md->opt1); - WBUFW(buf, 10) = static_cast<uint16_t>(md->opt2); - WBUFW(buf, 12) = static_cast<uint16_t>(md->option); - WBUFW(buf, 14) = unwrap<Species>(md->mob_class); + Packet_Fixed<0x0078> fixed_78; + fixed_78.block_id = md->bl_id; + fixed_78.speed = battle_get_speed(md); + fixed_78.opt1 = md->opt1; + fixed_78.opt2 = md->opt2; + fixed_78.option = md->option; + fixed_78.species = md->mob_class; // snip: stuff do do with disguise as a PC - WBUFPOS(buf, 46, md->bl_x, md->bl_y); - // work around ICE in gcc 4.6 - uint8_t dir = static_cast<uint8_t>(md->dir); - WBUFB(buf, 48) |= dir; - WBUFB(buf, 49) = 5; - WBUFB(buf, 50) = 5; + fixed_78.pos.x = md->bl_x; + fixed_78.pos.y = md->bl_y; + fixed_78.pos.dir = md->dir; + fixed_78.five1 = 5; + fixed_78.five2 = 5; int level = battle_get_lv(md); - WBUFW(buf, 52) = (level > battle_config.max_lv) ? battle_config.max_lv : level; + fixed_78.level = (level > battle_config.max_lv) ? battle_config.max_lv : level; - return clif_parse_func_table[0x78].len; + buf = create_fpacket<0x0078, 54>(fixed_78); } /*========================================== @@ -851,29 +855,30 @@ int clif_mob0078(dumb_ptr<mob_data> md, unsigned char *buf) *------------------------------------------ */ static -int clif_mob007b(dumb_ptr<mob_data> md, unsigned char *buf) +void clif_mob007b(dumb_ptr<mob_data> md, Buffer& buf) { - really_memset0(buf, clif_parse_func_table[0x7b].len); - - nullpo_ret(md); + nullpo_retv(md); - WBUFW(buf, 0) = 0x7b; - WBUFL(buf, 2) = unwrap<BlockId>(md->bl_id); - WBUFW(buf, 6) = static_cast<uint16_t>(battle_get_speed(md).count()); - WBUFW(buf, 8) = static_cast<uint16_t>(md->opt1); - WBUFW(buf, 10) = static_cast<uint16_t>(md->opt2); - WBUFW(buf, 12) = static_cast<uint16_t>(md->option); - WBUFW(buf, 14) = unwrap<Species>(md->mob_class); + Packet_Fixed<0x007b> fixed_7b; + fixed_7b.block_id = md->bl_id; + fixed_7b.speed = battle_get_speed(md); + fixed_7b.opt1 = md->opt1; + fixed_7b.opt2 = md->opt2; + fixed_7b.option = md->option; + fixed_7b.mob_class = md->mob_class; // snip: stuff for monsters disguised as PCs - WBUFL(buf, 22) = gettick().time_since_epoch().count(); - - WBUFPOS2(buf, 50, md->bl_x, md->bl_y, md->to_x, md->to_y); - WBUFB(buf, 56) = 5; - WBUFB(buf, 57) = 5; + fixed_7b.tick_and_maybe_part_of_guild_emblem = gettick(); + + fixed_7b.pos2.x0 = md->bl_x; + fixed_7b.pos2.y0 = md->bl_y; + fixed_7b.pos2.x1 = md->to_x; + fixed_7b.pos2.y1 = md->to_y; + fixed_7b.five1 = 5; + fixed_7b.five2 = 5; int level = battle_get_lv(md); - WBUFW(buf, 58) = (level > battle_config.max_lv) ? battle_config.max_lv : level; + fixed_7b.level = (level > battle_config.max_lv) ? battle_config.max_lv : level; - return clif_parse_func_table[0x7b].len; + buf = create_fpacket<0x007b, 60>(fixed_7b); } /*========================================== @@ -881,24 +886,23 @@ int clif_mob007b(dumb_ptr<mob_data> md, unsigned char *buf) *------------------------------------------ */ static -int clif_npc0078(dumb_ptr<npc_data> nd, unsigned char *buf) +void clif_npc0078(dumb_ptr<npc_data> nd, Buffer& buf) { - nullpo_ret(nd); - - really_memset0(buf, clif_parse_func_table[0x78].len); + nullpo_retv(nd); - WBUFW(buf, 0) = 0x78; - WBUFL(buf, 2) = unwrap<BlockId>(nd->bl_id); - WBUFW(buf, 6) = static_cast<uint16_t>(nd->speed.count()); - WBUFW(buf, 14) = nd->npc_class; - WBUFPOS(buf, 46, nd->bl_x, nd->bl_y); - // work around ICE in gcc 4.6 - uint8_t dir = static_cast<uint8_t>(nd->dir); - WBUFB(buf, 48) |= dir; - WBUFB(buf, 49) = 5; - WBUFB(buf, 50) = 5; + Packet_Fixed<0x0078> fixed_78; + fixed_78.block_id = nd->bl_id; + fixed_78.speed = nd->speed; + fixed_78.species = nd->npc_class; + fixed_78.pos.x = nd->bl_x; + fixed_78.pos.y = nd->bl_y; + fixed_78.pos.dir = nd->dir; + fixed_78.five1 = 5; + fixed_78.five2 = 5; + fixed_78.zero = 0; + fixed_78.level = 0; - return clif_parse_func_table[0x78].len; + buf = create_fpacket<0x0078, 54>(fixed_78); } /* These indices are derived from equip_pos in pc.c and some guesswork */ @@ -927,15 +931,12 @@ earray<EQUIP, LOOK, LOOK::COUNT> equip_points //= */ int clif_spawnpc(dumb_ptr<map_session_data> sd) { - unsigned char buf[128]; - nullpo_ret(sd); - clif_set0078(sd, buf); + Buffer buf; + clif_set0078_alt_1d9(sd, buf); - WBUFW(buf, 0) = 0x1d9; - WBUFW(buf, 51) = 0; - clif_send(buf, clif_parse_func_table[0x1d9].len, sd, SendWho::AREA_WOS); + clif_send(buf, sd, SendWho::AREA_WOS); if (sd->bl_m->flag.get(MapFlag::SNOW)) clif_specialeffect(sd, 162, 1); @@ -959,26 +960,23 @@ int clif_spawnpc(dumb_ptr<map_session_data> sd) */ int clif_spawnnpc(dumb_ptr<npc_data> nd) { - unsigned char buf[64]; - int len; - nullpo_ret(nd); - if (nd->npc_class < 0 || nd->flag & 1 || nd->npc_class == INVISIBLE_CLASS) + if (nd->npc_class == NEGATIVE_SPECIES || nd->flag & 1 || nd->npc_class == INVISIBLE_CLASS) return 0; - really_memset0(buf, clif_parse_func_table[0x7c].len); - - WBUFW(buf, 0) = 0x7c; - WBUFL(buf, 2) = unwrap<BlockId>(nd->bl_id); - WBUFW(buf, 6) = static_cast<uint16_t>(nd->speed.count()); - WBUFW(buf, 20) = nd->npc_class; - WBUFPOS(buf, 36, nd->bl_x, nd->bl_y); + Packet_Fixed<0x007c> fixed_7c; + fixed_7c.block_id = nd->bl_id; + fixed_7c.speed = nd->speed; + fixed_7c.species = nd->npc_class; + fixed_7c.pos.x = nd->bl_x; + fixed_7c.pos.y = nd->bl_y; - clif_send(buf, clif_parse_func_table[0x7c].len, nd, SendWho::AREA); + Buffer buf = create_fpacket<0x007c, 41>(fixed_7c); + clif_send(buf, nd, SendWho::AREA); - len = clif_npc0078(nd, buf); - clif_send(buf, len, nd, SendWho::AREA); + clif_npc0078(nd, buf); + clif_send(buf, nd, SendWho::AREA); return 0; } @@ -992,29 +990,34 @@ int clif_spawn_fake_npc_for_player(dumb_ptr<map_session_data> sd, BlockId fake_n if (!s) return 0; - WFIFOW(s, 0) = 0x7c; - WFIFOL(s, 2) = unwrap<BlockId>(fake_npc_id); - WFIFOW(s, 6) = 0; - WFIFOW(s, 8) = 0; - WFIFOW(s, 10) = 0; - WFIFOW(s, 12) = 0; - WFIFOW(s, 20) = 127; - WFIFOPOS(s, 36, sd->bl_x, sd->bl_y); - WFIFOSET(s, clif_parse_func_table[0x7c].len); - - WFIFOW(s, 0) = 0x78; - WFIFOL(s, 2) = unwrap<BlockId>(fake_npc_id); - WFIFOW(s, 6) = 0; - WFIFOW(s, 8) = 0; - WFIFOW(s, 10) = 0; - WFIFOW(s, 12) = 0; - WFIFOW(s, 14) = 127; // identifies as NPC - WFIFOW(s, 20) = 127; - WFIFOPOS(s, 46, sd->bl_x, sd->bl_y); - WFIFOPOS(s, 36, sd->bl_x, sd->bl_y); - WFIFOB(s, 49) = 5; - WFIFOB(s, 50) = 5; - WFIFOSET(s, clif_parse_func_table[0x78].len); + Packet_Fixed<0x007c> fixed_7c; + fixed_7c.block_id = fake_npc_id; + fixed_7c.speed = interval_t(); + fixed_7c.opt1 = Opt1::ZERO; + fixed_7c.opt2 = Opt2::ZERO; + fixed_7c.option = Option::ZERO; + fixed_7c.species = FAKE_NPC_CLASS; + fixed_7c.pos.x = sd->bl_x; + fixed_7c.pos.y = sd->bl_y; + send_fpacket<0x007c, 41>(s, fixed_7c); + + Packet_Fixed<0x0078> fixed_78; + fixed_78.block_id = fake_npc_id; + fixed_78.speed = interval_t(); + fixed_78.opt1 = Opt1::ZERO; + fixed_78.opt2 = Opt2::ZERO; + fixed_78.option = Option::ZERO; + fixed_78.species = FAKE_NPC_CLASS; + fixed_78.unused_head_bottom_or_species_again = unwrap<Species>(FAKE_NPC_CLASS); + fixed_78.pos.x = sd->bl_x; + fixed_78.pos.y = sd->bl_y; + fixed_78.unused_pos_again.x = sd->bl_x; + fixed_78.unused_pos_again.y = sd->bl_y; + fixed_78.five1 = 5; + fixed_78.five2 = 5; + fixed_78.zero = 0; + fixed_78.level = 0; + send_fpacket<0x0078, 54>(s, fixed_78); return 0; } @@ -1025,27 +1028,25 @@ int clif_spawn_fake_npc_for_player(dumb_ptr<map_session_data> sd, BlockId fake_n */ int clif_spawnmob(dumb_ptr<mob_data> md) { - unsigned char buf[64]; - int len; - nullpo_ret(md); { - really_memset0(buf, clif_parse_func_table[0x7c].len); - - WBUFW(buf, 0) = 0x7c; - WBUFL(buf, 2) = unwrap<BlockId>(md->bl_id); - WBUFW(buf, 6) = md->stats[mob_stat::SPEED]; - WBUFW(buf, 8) = static_cast<uint16_t>(md->opt1); - WBUFW(buf, 10) = static_cast<uint16_t>(md->opt2); - WBUFW(buf, 12) = static_cast<uint16_t>(md->option); - WBUFW(buf, 20) = unwrap<Species>(md->mob_class); - WBUFPOS(buf, 36, md->bl_x, md->bl_y); - clif_send(buf, clif_parse_func_table[0x7c].len, md, SendWho::AREA); + Packet_Fixed<0x007c> fixed_7c; + fixed_7c.block_id = md->bl_id; + fixed_7c.speed = interval_t(md->stats[mob_stat::SPEED]); + fixed_7c.opt1 = md->opt1; + fixed_7c.opt2 = md->opt2; + fixed_7c.option = md->option; + fixed_7c.species = md->mob_class; + fixed_7c.pos.x = md->bl_x; + fixed_7c.pos.y = md->bl_y; + Buffer buf = create_fpacket<0x007c, 41>(fixed_7c); + clif_send(buf, md, SendWho::AREA); } - len = clif_mob0078(md, buf); - clif_send(buf, len, md, SendWho::AREA); + Buffer buf; + clif_mob0078(md, buf); + clif_send(buf, md, SendWho::AREA); return 0; } @@ -1060,9 +1061,9 @@ int clif_servertick(dumb_ptr<map_session_data> sd) nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0x7f; - WFIFOL(s, 2) = sd->server_tick.time_since_epoch().count(); - WFIFOSET(s, clif_parse_func_table[0x7f].len); + Packet_Fixed<0x007f> fixed_7f; + fixed_7f.tick = gettick(); + send_fpacket<0x007f, 6>(s, fixed_7f); return 0; } @@ -1076,11 +1077,14 @@ int clif_walkok(dumb_ptr<map_session_data> sd) nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0x87; - WFIFOL(s, 2) = gettick().time_since_epoch().count(); - WFIFOPOS2(s, 6, sd->bl_x, sd->bl_y, sd->to_x, sd->to_y); - WFIFOB(s, 11) = 0; - WFIFOSET(s, clif_parse_func_table[0x87].len); + Packet_Fixed<0x0087> fixed_87; + fixed_87.tick = gettick(); + fixed_87.pos2.x0 = sd->bl_x; + fixed_87.pos2.y0 = sd->bl_y; + fixed_87.pos2.x1 = sd->to_x; + fixed_87.pos2.y1 = sd->to_y; + fixed_87.zero = 0; + send_fpacket<0x0087, 12>(s, fixed_87); return 0; } @@ -1091,14 +1095,12 @@ int clif_walkok(dumb_ptr<map_session_data> sd) */ int clif_movechar(dumb_ptr<map_session_data> sd) { - int len; - unsigned char buf[256]; - nullpo_ret(sd); - len = clif_set007b(sd, buf); + Buffer buf; + clif_set007b(sd, buf); - clif_send(buf, len, sd, SendWho::AREA_WOS); + clif_send(buf, sd, SendWho::AREA_WOS); if (battle_config.save_clothcolor == 1 && sd->status.clothes_color > 0) clif_changelook(sd, LOOK::CLOTHES_COLOR, @@ -1150,11 +1152,11 @@ void clif_changemap(dumb_ptr<map_session_data> sd, MapName mapname, int x, int y Session *s = sd->sess; - WFIFOW(s, 0) = 0x91; - WFIFO_STRING(s, 2, mapname, 16); - WFIFOW(s, 18) = x; - WFIFOW(s, 20) = y; - WFIFOSET(s, clif_parse_func_table[0x91].len); + Packet_Fixed<0x0091> fixed_91; + fixed_91.map_name = mapname; + fixed_91.x = x; + fixed_91.y = y; + send_fpacket<0x0091, 22>(s, fixed_91); } /*========================================== @@ -1167,13 +1169,13 @@ void clif_changemapserver(dumb_ptr<map_session_data> sd, nullpo_retv(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0x92; - WFIFO_STRING(s, 2, mapname, 16); - WFIFOW(s, 18) = x; - WFIFOW(s, 20) = y; - WFIFOIP(s, 22) = ip; - WFIFOW(s, 26) = port; - WFIFOSET(s, clif_parse_func_table[0x92].len); + Packet_Fixed<0x0092> fixed_92; + fixed_92.map_name = mapname; + fixed_92.x = x; + fixed_92.y = y; + fixed_92.ip = ip; + fixed_92.port = port; + send_fpacket<0x0092, 28>(s, fixed_92); } /*========================================== @@ -1182,16 +1184,15 @@ void clif_changemapserver(dumb_ptr<map_session_data> sd, */ void clif_fixpos(dumb_ptr<block_list> bl) { - uint8_t buf[16]; - nullpo_retv(bl); - WBUFW(buf, 0) = 0x88; - WBUFL(buf, 2) = unwrap<BlockId>(bl->bl_id); - WBUFW(buf, 6) = bl->bl_x; - WBUFW(buf, 8) = bl->bl_y; + Packet_Fixed<0x0088> fixed_88; + fixed_88.block_id = bl->bl_id; + fixed_88.x = bl->bl_x; + fixed_88.y = bl->bl_y; - clif_send(buf, clif_parse_func_table[0x88].len, bl, SendWho::AREA); + Buffer buf = create_fpacket<0x0088, 10>(fixed_88); + clif_send(buf, bl, SendWho::AREA); } /*========================================== @@ -1203,9 +1204,9 @@ int clif_npcbuysell(dumb_ptr<map_session_data> sd, BlockId id) nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xc4; - WFIFOL(s, 2) = unwrap<BlockId>(id); - WFIFOSET(s, clif_parse_func_table[0xc4].len); + Packet_Fixed<0x00c4> fixed_c4; + fixed_c4.block_id = id; + send_fpacket<0x00c4, 6>(s, fixed_c4); return 0; } @@ -1223,18 +1224,17 @@ int clif_buylist(dumb_ptr<map_session_data> sd, dumb_ptr<npc_data_shop> nd) nullpo_ret(nd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xc6; + std::vector<Packet_Repeat<0x00c6>> repeat_c6(nd->shop_items.size()); for (i = 0; i < nd->shop_items.size(); i++) { id = itemdb_search(nd->shop_items[i].nameid); val = nd->shop_items[i].value; - WFIFOL(s, 4 + i * 11) = val; // base price - WFIFOL(s, 8 + i * 11) = val; // actual price - WFIFOB(s, 12 + i * 11) = static_cast<uint8_t>(id->type); - WFIFOW(s, 13 + i * 11) = unwrap<ItemNameId>(nd->shop_items[i].nameid); + repeat_c6[i].base_price = val; // base price + repeat_c6[i].actual_price = val; // actual price + repeat_c6[i].type = id->type; + repeat_c6[i].name_id = nd->shop_items[i].nameid; } - WFIFOW(s, 2) = i * 11 + 4; - WFIFOSET(s, WFIFOW(s, 2)); + send_packet_repeatonly<0x00c6, 4, 11>(s, repeat_c6); return 0; } @@ -1245,12 +1245,12 @@ int clif_buylist(dumb_ptr<map_session_data> sd, dumb_ptr<npc_data_shop> nd) */ int clif_selllist(dumb_ptr<map_session_data> sd) { - int i, c = 0, val; + int i, val; nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xc7; + std::vector<Packet_Repeat<0x00c7>> repeat_c7; for (i = 0; i < MAX_INVENTORY; i++) { if (sd->status.inventory[i].nameid && sd->inventory_data[i]) @@ -1258,14 +1258,14 @@ int clif_selllist(dumb_ptr<map_session_data> sd) val = sd->inventory_data[i]->value_sell; if (val < 0) continue; - WFIFOW(s, 4 + c * 10) = i + 2; - WFIFOL(s, 6 + c * 10) = val; // base price - WFIFOL(s, 10 + c * 10) = val; // actual price - c++; + Packet_Repeat<0x00c7> info; + info.ioff2 = i + 2; + info.base_price = val; + info.actual_price = val; + repeat_c7.push_back(info); } } - WFIFOW(s, 2) = c * 10 + 4; - WFIFOSET(s, WFIFOW(s, 2)); + send_packet_repeatonly<0x00c7, 4, 10>(s, repeat_c7); return 0; } @@ -1280,12 +1280,9 @@ void clif_scriptmes(dumb_ptr<map_session_data> sd, BlockId npcid, XString mes) Session *s = sd->sess; - size_t len = mes.size() + 1; - WFIFOW(s, 0) = 0xb4; - WFIFOW(s, 2) = len + 8; - WFIFOL(s, 4) = unwrap<BlockId>(npcid); - WFIFO_STRING(s, 8, mes, len); - WFIFOSET(s, WFIFOW(s, 2)); + Packet_Head<0x00b4> head_b4; + head_b4.block_id = npcid; + send_vpacket<0x00b4, 8, 1>(s, head_b4, mes); } /*========================================== @@ -1297,9 +1294,9 @@ void clif_scriptnext(dumb_ptr<map_session_data> sd, BlockId npcid) nullpo_retv(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xb5; - WFIFOL(s, 2) = unwrap<BlockId>(npcid); - WFIFOSET(s, clif_parse_func_table[0xb5].len); + Packet_Fixed<0x00b5> fixed_b5; + fixed_b5.block_id = npcid; + send_fpacket<0x00b5, 6>(s, fixed_b5); } /*========================================== @@ -1311,9 +1308,9 @@ void clif_scriptclose(dumb_ptr<map_session_data> sd, BlockId npcid) nullpo_retv(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xb6; - WFIFOL(s, 2) = unwrap<BlockId>(npcid); - WFIFOSET(s, clif_parse_func_table[0xb6].len); + Packet_Fixed<0x00b6> fixed_b6; + fixed_b6.block_id = npcid; + send_fpacket<0x00b6, 6>(s, fixed_b6); } /*========================================== @@ -1325,12 +1322,9 @@ void clif_scriptmenu(dumb_ptr<map_session_data> sd, BlockId npcid, XString mes) nullpo_retv(sd); Session *s = sd->sess; - size_t len = mes.size() + 1; - WFIFOW(s, 0) = 0xb7; - WFIFOW(s, 2) = len + 8; - WFIFOL(s, 4) = unwrap<BlockId>(npcid); - WFIFO_STRING(s, 8, mes, len); - WFIFOSET(s, WFIFOW(s, 2)); + Packet_Head<0x00b7> head_b7; + head_b7.block_id = npcid; + send_vpacket<0x00b7, 8, 1>(s, head_b7, mes); } /*========================================== @@ -1342,9 +1336,9 @@ void clif_scriptinput(dumb_ptr<map_session_data> sd, BlockId npcid) nullpo_retv(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0x142; - WFIFOL(s, 2) = unwrap<BlockId>(npcid); - WFIFOSET(s, clif_parse_func_table[0x142].len); + Packet_Fixed<0x0142> fixed_142; + fixed_142.block_id = npcid; + send_fpacket<0x0142, 6>(s, fixed_142); } /*========================================== @@ -1356,9 +1350,9 @@ void clif_scriptinputstr(dumb_ptr<map_session_data> sd, BlockId npcid) nullpo_retv(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0x1d4; - WFIFOL(s, 2) = unwrap<BlockId>(npcid); - WFIFOSET(s, clif_parse_func_table[0x1d4].len); + Packet_Fixed<0x01d4> fixed_1d4; + fixed_1d4.block_id = npcid; + send_fpacket<0x01d4, 6>(s, fixed_1d4); } /*========================================== @@ -1370,22 +1364,13 @@ int clif_additem(dumb_ptr<map_session_data> sd, int n, int amount, PickupFail fa nullpo_ret(sd); Session *s = sd->sess; + Packet_Fixed<0x00a0> fixed_a0; if (fail != PickupFail::OKAY) { - WFIFOW(s, 0) = 0xa0; - WFIFOW(s, 2) = n + 2; - WFIFOW(s, 4) = amount; - WFIFOW(s, 6) = 0; - WFIFOB(s, 8) = 0; - WFIFOB(s, 9) = 0; - WFIFOB(s, 10) = 0; - WFIFOW(s, 11) = 0; - WFIFOW(s, 13) = 0; - WFIFOW(s, 15) = 0; - WFIFOW(s, 17) = 0; - WFIFOW(s, 19) = 0; - WFIFOB(s, 21) = 0; - WFIFOB(s, 22) = static_cast<uint8_t>(fail); + fixed_a0.ioff2 = n + 2; + fixed_a0.amount = amount; + fixed_a0.name_id = ItemNameId(); + fixed_a0.pickup_fail = fail; } else { @@ -1393,27 +1378,26 @@ int clif_additem(dumb_ptr<map_session_data> sd, int n, int amount, PickupFail fa || sd->inventory_data[n] == NULL) return 1; - WFIFOW(s, 0) = 0xa0; - WFIFOW(s, 2) = n + 2; - WFIFOW(s, 4) = amount; - WFIFOW(s, 6) = unwrap<ItemNameId>(sd->status.inventory[n].nameid); - WFIFOB(s, 8) = 1; //identify; - WFIFOB(s, 9) = 0; // broken or attribute; - WFIFOB(s, 10) = 0; //refine; + fixed_a0.ioff2 = n + 2; + fixed_a0.amount = amount; + fixed_a0.name_id = sd->status.inventory[n].nameid; + fixed_a0.identify = 1; + fixed_a0.broken_or_attribute = 0; + fixed_a0.refine = 0; { - WFIFOW(s, 11) = 0; //card[0]; - WFIFOW(s, 13) = 0; //card[1]; - WFIFOW(s, 15) = 0; //card[2]; - WFIFOW(s, 17) = 0; //card[3]; + fixed_a0.card0 = 0; + fixed_a0.card1 = 0; + fixed_a0.card2 = 0; + fixed_a0.card3 = 0; } - WFIFOW(s, 19) = static_cast<uint16_t>(pc_equippoint(sd, n)); - WFIFOB(s, 21) = static_cast<uint8_t>(sd->inventory_data[n]->type == ItemType::_7 + fixed_a0.epos = pc_equippoint(sd, n); + fixed_a0.item_type = (sd->inventory_data[n]->type == ItemType::_7 ? ItemType::WEAPON : sd->inventory_data[n]->type); - WFIFOB(s, 22) = static_cast<uint8_t>(fail); + fixed_a0.pickup_fail = fail; } - WFIFOSET(s, clif_parse_func_table[0xa0].len); + send_fpacket<0x00a0, 23>(s, fixed_a0); return 0; } @@ -1426,11 +1410,11 @@ void clif_delitem(dumb_ptr<map_session_data> sd, int n, int amount) nullpo_retv(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xaf; - WFIFOW(s, 2) = n + 2; - WFIFOW(s, 4) = amount; + Packet_Fixed<0x00af> fixed_af; + fixed_af.ioff2 = n + 2; + fixed_af.amount = amount; - WFIFOSET(s, clif_parse_func_table[0xaf].len); + send_fpacket<0x00af, 6>(s, fixed_af); } /*========================================== @@ -1441,39 +1425,38 @@ void clif_itemlist(dumb_ptr<map_session_data> sd) { nullpo_retv(sd); - int n = 0; int arrow = -1; Session *s = sd->sess; - WFIFOW(s, 0) = 0x1ee; + std::vector<Packet_Repeat<0x01ee>> repeat_1ee; for (int i = 0; i < MAX_INVENTORY; i++) { if (!sd->status.inventory[i].nameid || sd->inventory_data[i] == NULL || itemdb_isequip2(sd->inventory_data[i])) continue; - WFIFOW(s, n * 18 + 4) = i + 2; - WFIFOW(s, n * 18 + 6) = unwrap<ItemNameId>(sd->status.inventory[i].nameid); - WFIFOB(s, n * 18 + 8) = static_cast<uint8_t>(sd->inventory_data[i]->type); - WFIFOB(s, n * 18 + 9) = 1; //identify; - WFIFOW(s, n * 18 + 10) = sd->status.inventory[i].amount; + Packet_Repeat<0x01ee> info; + info.ioff2 = i + 2; + info.name_id = sd->status.inventory[i].nameid; + info.item_type = sd->inventory_data[i]->type; + info.identify = 1; + info.amount = sd->status.inventory[i].amount; if (sd->inventory_data[i]->equip == EPOS::ARROW) { - WFIFOW(s, n * 18 + 12) = static_cast<uint16_t>(EPOS::ARROW); + info.epos = EPOS::ARROW; if (bool(sd->status.inventory[i].equip)) arrow = i; // ついでに矢装備チェック } else - WFIFOW(s, n * 18 + 12) = static_cast<uint16_t>(EPOS::ZERO); - WFIFOW(s, n * 18 + 14) = 0; //card[0]; - WFIFOW(s, n * 18 + 16) = 0; //card[1]; - WFIFOW(s, n * 18 + 18) = 0; //card[2]; - WFIFOW(s, n * 18 + 20) = 0; //card[3]; - n++; + info.epos = EPOS::ZERO; + info.card0 = 0; + info.card1 = 0; + info.card2 = 0; + info.card3 = 0; + repeat_1ee.push_back(info); } - if (n) + if (!repeat_1ee.empty()) { - WFIFOW(s, 2) = 4 + n * 18; - WFIFOSET(s, WFIFOW(s, 2)); + send_packet_repeatonly<0x01ee, 4, 18>(s, repeat_1ee); } if (arrow >= 0) clif_arrowequip(sd, arrow); @@ -1488,37 +1471,36 @@ void clif_equiplist(dumb_ptr<map_session_data> sd) nullpo_retv(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xa4; - int n = 0; + std::vector<Packet_Repeat<0x00a4>> repeat_a4; for (int i = 0; i < MAX_INVENTORY; i++) { if (!sd->status.inventory[i].nameid || sd->inventory_data[i] == NULL || !itemdb_isequip2(sd->inventory_data[i])) continue; - WFIFOW(s, n * 20 + 4) = i + 2; - WFIFOW(s, n * 20 + 6) = unwrap<ItemNameId>(sd->status.inventory[i].nameid); - WFIFOB(s, n * 20 + 8) = static_cast<uint8_t>( + Packet_Repeat<0x00a4> info; + info.ioff2 = i + 2; + info.name_id = sd->status.inventory[i].nameid; + info.item_type = ( sd->inventory_data[i]->type == ItemType::_7 ? ItemType::WEAPON : sd->inventory_data[i]->type); - WFIFOB(s, n * 20 + 9) = 0; //identify; - WFIFOW(s, n * 20 + 10) = static_cast<uint16_t>(pc_equippoint(sd, i)); - WFIFOW(s, n * 20 + 12) = static_cast<uint16_t>(sd->status.inventory[i].equip); - WFIFOB(s, n * 20 + 14) = 0; //broken or attribute; - WFIFOB(s, n * 20 + 15) = 0; //refine; + info.identify = 0; + info.epos_pc = pc_equippoint(sd, i); + info.epos_inv = sd->status.inventory[i].equip; + info.broken_or_attribute = 0; + info.refine = 0; { - WFIFOW(s, n * 20 + 16) = 0; //card[0]; - WFIFOW(s, n * 20 + 18) = 0; //card[1]; - WFIFOW(s, n * 20 + 20) = 0; //card[2]; - WFIFOW(s, n * 20 + 22) = 0; //card[3]; + info.card0 = 0; + info.card1 = 0; + info.card2 = 0; + info.card3 = 0; } - n++; + repeat_a4.push_back(info); } - if (n) + if (!repeat_a4.empty()) { - WFIFOW(s, 2) = 4 + n * 20; - WFIFOSET(s, WFIFOW(s, 2)); + send_packet_repeatonly<0x00a4, 4, 20>(s, repeat_a4); } } @@ -1532,8 +1514,7 @@ int clif_storageitemlist(dumb_ptr<map_session_data> sd, Storage *stor) nullpo_ret(stor); Session *s = sd->sess; - WFIFOW(s, 0) = 0x1f0; - int n = 0; + std::vector<Packet_Repeat<0x01f0>> repeat_1f0; for (int i = 0; i < MAX_STORAGE; i++) { if (!stor->storage_[i].nameid) @@ -1545,22 +1526,22 @@ int clif_storageitemlist(dumb_ptr<map_session_data> sd, Storage *stor) if (itemdb_isequip2(id)) continue; - WFIFOW(s, n * 18 + 4) = i + 1; - WFIFOW(s, n * 18 + 6) = unwrap<ItemNameId>(stor->storage_[i].nameid); - WFIFOB(s, n * 18 + 8) = static_cast<uint8_t>(id->type); - WFIFOB(s, n * 18 + 9) = 0; //identify; - WFIFOW(s, n * 18 + 10) = stor->storage_[i].amount; - WFIFOW(s, n * 18 + 12) = 0; - WFIFOW(s, n * 18 + 14) = 0; //card[0]; - WFIFOW(s, n * 18 + 16) = 0; //card[1]; - WFIFOW(s, n * 18 + 18) = 0; //card[2]; - WFIFOW(s, n * 18 + 20) = 0; //card[3]; - n++; + Packet_Repeat<0x01f0> info; + info.soff1 = i + 1; + info.name_id = stor->storage_[i].nameid; + info.item_type = id->type; + info.identify = 0; + info.amount = stor->storage_[i].amount; + info.epos_zero = EPOS::ZERO; + info.card0 = 0; + info.card1 = 0; + info.card2 = 0; + info.card3 = 0; + repeat_1f0.push_back(info); } - if (n) + if (!repeat_1f0.empty()) { - WFIFOW(s, 2) = 4 + n * 18; - WFIFOSET(s, WFIFOW(s, 2)); + send_packet_repeatonly<0x01f0, 4, 18>(s, repeat_1f0); } return 0; } @@ -1575,8 +1556,7 @@ int clif_storageequiplist(dumb_ptr<map_session_data> sd, Storage *stor) nullpo_ret(stor); Session *s = sd->sess; - WFIFOW(s, 0) = 0xa6; - int n = 0; + std::vector<Packet_Repeat<0x00a6>> repeat_a6; for (int i = 0; i < MAX_STORAGE; i++) { if (!stor->storage_[i].nameid) @@ -1587,26 +1567,26 @@ int clif_storageequiplist(dumb_ptr<map_session_data> sd, Storage *stor) nullpo_ret(id); if (!itemdb_isequip2(id)) continue; - WFIFOW(s, n * 20 + 4) = i + 1; - WFIFOW(s, n * 20 + 6) = unwrap<ItemNameId>(stor->storage_[i].nameid); - WFIFOB(s, n * 20 + 8) = static_cast<uint8_t>(id->type); - WFIFOB(s, n * 20 + 9) = 0; //identify; - WFIFOW(s, n * 20 + 10) = static_cast<uint16_t>(id->equip); - WFIFOW(s, n * 20 + 12) = static_cast<uint16_t>(stor->storage_[i].equip); - WFIFOB(s, n * 20 + 14) = 0; //broken or attribute - WFIFOB(s, n * 20 + 15) = 0; //refine; + Packet_Repeat<0x00a6> info; + info.soff1 = i + 1; + info.name_id = stor->storage_[i].nameid; + info.item_type = id->type; + info.identify = 0; + info.epos_id = id->equip; + info.epos_stor = stor->storage_[i].equip; + info.broken_or_attribute = 0; + info.refine = 0; { - WFIFOW(s, n * 20 + 16) = 0; //card[0]; - WFIFOW(s, n * 20 + 18) = 0; //card[1]; - WFIFOW(s, n * 20 + 20) = 0; //card[2]; - WFIFOW(s, n * 20 + 22) = 0; //card[3]; + info.card0 = 0; + info.card1 = 0; + info.card2 = 0; + info.card3 = 0; } - n++; + repeat_a6.push_back(info); } - if (n) + if (!repeat_a6.empty()) { - WFIFOW(s, 2) = 4 + n * 20; - WFIFOSET(s, WFIFOW(s, 2)); + send_packet_repeatonly<0x00a6, 4, 20>(s, repeat_a6); } return 0; } @@ -1618,140 +1598,183 @@ int clif_storageequiplist(dumb_ptr<map_session_data> sd, Storage *stor) */ int clif_updatestatus(dumb_ptr<map_session_data> sd, SP type) { - int len = 8; - nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xb0; - WFIFOW(s, 2) = static_cast<uint16_t>(type); - switch (type) { - // 00b0 + Packet_Fixed<0x00b0> fixed_b0; + fixed_b0.sp_type = type; + switch (type) + { case SP::WEIGHT: pc_checkweighticon(sd); - // is this because pc_checkweighticon can send other packets? - WFIFOW(s, 0) = 0xb0; - WFIFOW(s, 2) = static_cast<uint16_t>(type); - WFIFOL(s, 4) = sd->weight; + fixed_b0.value = sd->weight; break; case SP::MAXWEIGHT: - WFIFOL(s, 4) = sd->max_weight; + fixed_b0.value = sd->max_weight; break; case SP::SPEED: - // ... - WFIFOL(s, 4) = static_cast<uint16_t>(sd->speed.count()); + // 'speed' is actually delay, in milliseconds + fixed_b0.value = sd->speed.count(); break; case SP::BASELEVEL: - WFIFOL(s, 4) = sd->status.base_level; + fixed_b0.value = sd->status.base_level; break; case SP::JOBLEVEL: - WFIFOL(s, 4) = 0; + fixed_b0.value = sd->status.job_level; break; case SP::STATUSPOINT: - WFIFOL(s, 4) = sd->status.status_point; + fixed_b0.value = sd->status.status_point; break; case SP::SKILLPOINT: - WFIFOL(s, 4) = sd->status.skill_point; + fixed_b0.value = sd->status.skill_point; break; case SP::HIT: - WFIFOL(s, 4) = sd->hit; + fixed_b0.value = sd->hit; break; case SP::FLEE1: - WFIFOL(s, 4) = sd->flee; + fixed_b0.value = sd->flee; break; case SP::FLEE2: - WFIFOL(s, 4) = sd->flee2 / 10; + fixed_b0.value = sd->flee2 / 10; break; case SP::MAXHP: - WFIFOL(s, 4) = sd->status.max_hp; + fixed_b0.value = sd->status.max_hp; break; case SP::MAXSP: - WFIFOL(s, 4) = sd->status.max_sp; + fixed_b0.value = sd->status.max_sp; break; case SP::HP: - WFIFOL(s, 4) = sd->status.hp; + fixed_b0.value = sd->status.hp; break; case SP::SP: - WFIFOL(s, 4) = sd->status.sp; + fixed_b0.value = sd->status.sp; break; case SP::ASPD: - WFIFOL(s, 4) = static_cast<uint16_t>(sd->aspd.count()); + fixed_b0.value = sd->aspd.count(); break; case SP::ATK1: - WFIFOL(s, 4) = sd->base_atk + sd->watk; + fixed_b0.value = sd->base_atk + sd->watk; break; case SP::DEF1: - WFIFOL(s, 4) = sd->def; + fixed_b0.value = sd->def; break; case SP::MDEF1: - WFIFOL(s, 4) = sd->mdef; + fixed_b0.value = sd->mdef; break; case SP::ATK2: - WFIFOL(s, 4) = sd->watk2; + fixed_b0.value = sd->watk2; break; case SP::DEF2: - WFIFOL(s, 4) = sd->def2; + fixed_b0.value = sd->def2; break; case SP::MDEF2: - WFIFOL(s, 4) = sd->mdef2; + fixed_b0.value = sd->mdef2; break; case SP::CRITICAL: - WFIFOL(s, 4) = sd->critical / 10; + fixed_b0.value = sd->critical / 10; break; case SP::MATK1: - WFIFOL(s, 4) = sd->matk1; + fixed_b0.value = sd->matk1; break; case SP::MATK2: - WFIFOL(s, 4) = sd->matk2; + fixed_b0.value = sd->matk2; + break; + case SP::GM: + fixed_b0.value = pc_isGM(sd).get_all_bits(); break; + default: + goto not_b0; + } + + send_fpacket<0x00b0, 8>(s, fixed_b0); + return 0; + } +not_b0: + + { + Packet_Fixed<0x00b1> fixed_b1; + fixed_b1.sp_type = type; + switch (type) + { case SP::ZENY: trade_verifyzeny(sd); - WFIFOW(s, 0) = 0xb1; if (sd->status.zeny < 0) sd->status.zeny = 0; - WFIFOL(s, 4) = sd->status.zeny; + fixed_b1.value = sd->status.zeny; break; + case SP::BASEEXP: - WFIFOW(s, 0) = 0xb1; - WFIFOL(s, 4) = sd->status.base_exp; + fixed_b1.value = sd->status.base_exp; break; case SP::JOBEXP: - WFIFOW(s, 0) = 0xb1; - WFIFOL(s, 4) = sd->status.job_exp; + fixed_b1.value = sd->status.job_exp; break; case SP::NEXTBASEEXP: - WFIFOW(s, 0) = 0xb1; - WFIFOL(s, 4) = pc_nextbaseexp(sd); + fixed_b1.value = pc_nextbaseexp(sd); break; case SP::NEXTJOBEXP: - WFIFOW(s, 0) = 0xb1; - WFIFOL(s, 4) = pc_nextjobexp(sd); + fixed_b1.value = pc_nextjobexp(sd); break; - // 00be 終了 + default: + goto not_b1; + } + + send_fpacket<0x00b1, 8>(s, fixed_b1); + return 0; + } +not_b1: + + { + Packet_Fixed<0x00be> fixed_be; + fixed_be.sp_type = type; + switch (type) + { case SP::USTR: case SP::UAGI: case SP::UVIT: case SP::UINT: case SP::UDEX: case SP::ULUK: - WFIFOW(s, 0) = 0xbe; - WFIFOB(s, 4) = pc_need_status_point(sd, usp_to_sp(type)); - len = 5; + fixed_be.value = pc_need_status_point(sd, usp_to_sp(type)); break; - // 013a 終了 + default: + goto not_be; + } + + send_fpacket<0x00be, 5>(s, fixed_be); + return 0; + } +not_be: + + { + Packet_Fixed<0x013a> fixed_13a; + switch (type) + { case SP::ATTACKRANGE: - WFIFOW(s, 0) = 0x13a; - WFIFOW(s, 2) = (sd->attack_spell_override) - ? sd->attack_spell_range : sd->attackrange; - len = 4; + fixed_13a.attack_range = (sd->attack_spell_override + ? sd->attack_spell_range + : sd->attackrange); break; - // 0141 終了 + default: + goto not_13a; + } + + send_fpacket<0x013a, 4>(s, fixed_13a); + return 0; + } +not_13a: + + { + Packet_Fixed<0x00141> fixed_141; + fixed_141.sp_type = type; + switch (type) + { case SP::STR: case SP::AGI: case SP::VIT: @@ -1760,27 +1783,28 @@ int clif_updatestatus(dumb_ptr<map_session_data> sd, SP type) case SP::LUK: { ATTR attr = sp_to_attr(type); - WFIFOW(s, 0) = 0x141; - WFIFOL(s, 2) = static_cast<uint16_t>(type); - WFIFOL(s, 6) = sd->status.attrs[attr]; - WFIFOL(s, 10) = sd->paramb[attr] + sd->parame[attr]; - len = 14; + fixed_141.value_status = sd->status.attrs[attr]; + fixed_141.value_b_e = sd->paramb[attr] + sd->parame[attr]; } break; - case SP::GM: - WFIFOL(s, 4) = pc_isGM(sd).get_all_bits(); - break; - default: + goto not_141; + } + + send_fpacket<0x0141, 14>(s, fixed_141); + return 0; + } + +not_141: + { + { if (battle_config.error_log) PRINTF("clif_updatestatus : make %d routine\n"_fmt, type); return 1; + } } - WFIFOSET(s, len); - - return 0; } /*========================================== @@ -1795,7 +1819,6 @@ int clif_changelook(dumb_ptr<block_list> bl, LOOK type, int val) int clif_changelook_towards(dumb_ptr<block_list> bl, LOOK type, int val, dumb_ptr<map_session_data> dstsd) { - unsigned char buf[32]; dumb_ptr<map_session_data> sd = NULL; nullpo_ret(bl); @@ -1809,61 +1832,65 @@ int clif_changelook_towards(dumb_ptr<block_list> bl, LOOK type, int val, if (sd && (type == LOOK::WEAPON || type == LOOK::SHIELD || type >= LOOK::SHOES)) { - WBUFW(buf, 0) = 0x1d7; - WBUFL(buf, 2) = unwrap<BlockId>(bl->bl_id); + Packet_Fixed<0x01d7> fixed_1d7; + fixed_1d7.block_id = bl->bl_id; if (type >= LOOK::SHOES) { EQUIP equip_point = equip_points[type]; - WBUFB(buf, 6) = static_cast<uint16_t>(type); + fixed_1d7.look_type = type; int idx = sd->equip_index_maybe[equip_point]; if (idx >= 0 && sd->inventory_data[idx]) { - WBUFW(buf, 7) = unwrap<ItemNameId>(sd->status.inventory[idx].nameid); + fixed_1d7.weapon_or_name_id_or_value = unwrap<ItemNameId>(sd->status.inventory[idx].nameid); } else - WBUFW(buf, 7) = 0; - WBUFW(buf, 9) = 0; + fixed_1d7.weapon_or_name_id_or_value = unwrap<ItemNameId>(ItemNameId()); + fixed_1d7.shield = ItemNameId(); } else { - WBUFB(buf, 6) = 2; + fixed_1d7.look_type = LOOK::WEAPON; int widx = sd->equip_index_maybe[EQUIP::WEAPON]; int sidx = sd->equip_index_maybe[EQUIP::SHIELD]; if (sd->attack_spell_override) - WBUFW(buf, 7) = sd->attack_spell_look_override; + fixed_1d7.weapon_or_name_id_or_value = unwrap<ItemNameId>(sd->attack_spell_look_override); else { if (widx >= 0 && sd->inventory_data[widx]) { - WBUFW(buf, 7) = unwrap<ItemNameId>(sd->status.inventory[widx].nameid); + fixed_1d7.weapon_or_name_id_or_value = unwrap<ItemNameId>(sd->status.inventory[widx].nameid); } else - WBUFW(buf, 7) = 0; + fixed_1d7.weapon_or_name_id_or_value = unwrap<ItemNameId>(ItemNameId()); } if (sidx >= 0 && sidx != widx && sd->inventory_data[sidx]) { - WBUFW(buf, 9) = unwrap<ItemNameId>(sd->status.inventory[sidx].nameid); + fixed_1d7.shield = sd->status.inventory[sidx].nameid; } else - WBUFW(buf, 9) = 0; + fixed_1d7.shield = ItemNameId(); } + + Buffer buf = create_fpacket<0x01d7, 11>(fixed_1d7); if (dstsd) - clif_send(buf, clif_parse_func_table[0x1d7].len, dstsd, SendWho::SELF); + clif_send(buf, dstsd, SendWho::SELF); else - clif_send(buf, clif_parse_func_table[0x1d7].len, bl, SendWho::AREA); + clif_send(buf, bl, SendWho::AREA); } else { - WBUFW(buf, 0) = 0x1d7; - WBUFL(buf, 2) = unwrap<BlockId>(bl->bl_id); - WBUFB(buf, 6) = static_cast<uint8_t>(type); - WBUFW(buf, 7) = val; - WBUFW(buf, 9) = 0; + Packet_Fixed<0x01d7> fixed_1d7; + fixed_1d7.block_id = bl->bl_id; + fixed_1d7.look_type = type; + fixed_1d7.weapon_or_name_id_or_value = val; + fixed_1d7.shield = ItemNameId(); + + Buffer buf = create_fpacket<0x01d7, 11>(fixed_1d7); if (dstsd) - clif_send(buf, clif_parse_func_table[0x1d7].len, dstsd, SendWho::SELF); + clif_send(buf, dstsd, SendWho::SELF); else - clif_send(buf, clif_parse_func_table[0x1d7].len, bl, SendWho::AREA); + clif_send(buf, bl, SendWho::AREA); } return 0; } @@ -1879,38 +1906,38 @@ int clif_initialstatus(dumb_ptr<map_session_data> sd) Session *s = sd->sess; - WFIFOW(s, 0) = 0xbd; - WFIFOW(s, 2) = sd->status.status_point; - - WFIFOB(s, 4) = saturate<uint8_t>(sd->status.attrs[ATTR::STR]); - WFIFOB(s, 5) = pc_need_status_point(sd, SP::STR); - WFIFOB(s, 6) = saturate<uint8_t>(sd->status.attrs[ATTR::AGI]); - WFIFOB(s, 7) = pc_need_status_point(sd, SP::AGI); - WFIFOB(s, 8) = saturate<uint8_t>(sd->status.attrs[ATTR::VIT]); - WFIFOB(s, 9) = pc_need_status_point(sd, SP::VIT); - WFIFOB(s, 10) = saturate<uint8_t>(sd->status.attrs[ATTR::INT]); - WFIFOB(s, 11) = pc_need_status_point(sd, SP::INT); - WFIFOB(s, 12) = saturate<uint8_t>(sd->status.attrs[ATTR::DEX]); - WFIFOB(s, 13) = pc_need_status_point(sd, SP::DEX); - WFIFOB(s, 14) = saturate<uint8_t>(sd->status.attrs[ATTR::LUK]); - WFIFOB(s, 15) = pc_need_status_point(sd, SP::LUK); - - WFIFOW(s, 16) = sd->base_atk + sd->watk; - WFIFOW(s, 18) = sd->watk2; //atk bonus - WFIFOW(s, 20) = sd->matk1; - WFIFOW(s, 22) = sd->matk2; - WFIFOW(s, 24) = sd->def; // def - WFIFOW(s, 26) = sd->def2; - WFIFOW(s, 28) = sd->mdef; // mdef - WFIFOW(s, 30) = sd->mdef2; - WFIFOW(s, 32) = sd->hit; - WFIFOW(s, 34) = sd->flee; - WFIFOW(s, 36) = sd->flee2 / 10; - WFIFOW(s, 38) = sd->critical / 10; - WFIFOW(s, 40) = sd->status.karma; - WFIFOW(s, 42) = sd->status.manner; - - WFIFOSET(s, clif_parse_func_table[0xbd].len); + Packet_Fixed<0x00bd> fixed_bd; + fixed_bd.status_point = sd->status.status_point; + + fixed_bd.str_attr = saturate<uint8_t>(sd->status.attrs[ATTR::STR]); + fixed_bd.str_upd = pc_need_status_point(sd, SP::STR); + fixed_bd.agi_attr = saturate<uint8_t>(sd->status.attrs[ATTR::AGI]); + fixed_bd.agi_upd = pc_need_status_point(sd, SP::AGI); + fixed_bd.vit_attr = saturate<uint8_t>(sd->status.attrs[ATTR::VIT]); + fixed_bd.vit_upd = pc_need_status_point(sd, SP::VIT); + fixed_bd.int_attr = saturate<uint8_t>(sd->status.attrs[ATTR::INT]); + fixed_bd.int_upd = pc_need_status_point(sd, SP::INT); + fixed_bd.dex_attr = saturate<uint8_t>(sd->status.attrs[ATTR::DEX]); + fixed_bd.dex_upd = pc_need_status_point(sd, SP::DEX); + fixed_bd.luk_attr = saturate<uint8_t>(sd->status.attrs[ATTR::LUK]); + fixed_bd.luk_upd = pc_need_status_point(sd, SP::LUK); + + fixed_bd.atk_sum = sd->base_atk + sd->watk; + fixed_bd.watk2 = sd->watk2; //atk bonus + fixed_bd.matk1 = sd->matk1; + fixed_bd.matk2 = sd->matk2; + fixed_bd.def = sd->def; + fixed_bd.def2 = sd->def2; + fixed_bd.mdef = sd->mdef; + fixed_bd.mdef2 = sd->mdef2; + fixed_bd.hit = sd->hit; + fixed_bd.flee = sd->flee; + fixed_bd.flee2 = sd->flee2 / 10; + fixed_bd.critical = sd->critical / 10; + fixed_bd.karma = sd->status.karma; + fixed_bd.manner = sd->status.manner; + + send_fpacket<0x00bd, 44>(s, fixed_bd); clif_updatestatus(sd, SP::STR); clif_updatestatus(sd, SP::AGI); @@ -1936,10 +1963,9 @@ int clif_arrowequip(dumb_ptr<map_session_data> sd, int val) sd->attacktarget = BlockId(); Session *s = sd->sess; - WFIFOW(s, 0) = 0x013c; - WFIFOW(s, 2) = val + 2; //矢のアイテムID - - WFIFOSET(s, clif_parse_func_table[0x013c].len); + Packet_Fixed<0x013c> fixed_13c; + fixed_13c.ioff2 = val + 2; + send_fpacket<0x013c, 4>(s, fixed_13c); return 0; } @@ -1954,10 +1980,9 @@ int clif_arrow_fail(dumb_ptr<map_session_data> sd, int type) Session *s = sd->sess; - WFIFOW(s, 0) = 0x013b; - WFIFOW(s, 2) = type; - - WFIFOSET(s, clif_parse_func_table[0x013b].len); + Packet_Fixed<0x013b> fixed_13b; + fixed_13b.type = type; + send_fpacket<0x013b, 4>(s, fixed_13b); return 0; } @@ -1971,11 +1996,11 @@ int clif_statusupack(dumb_ptr<map_session_data> sd, SP type, int ok, int val) nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xbc; - WFIFOW(s, 2) = static_cast<uint16_t>(type); - WFIFOB(s, 4) = ok; - WFIFOB(s, 5) = val; - WFIFOSET(s, clif_parse_func_table[0xbc].len); + Packet_Fixed<0x00bc> fixed_bc; + fixed_bc.sp_type = type; + fixed_bc.ok = ok; + fixed_bc.val = val; + send_fpacket<0x00bc, 6>(s, fixed_bc); return 0; } @@ -1989,11 +2014,11 @@ int clif_equipitemack(dumb_ptr<map_session_data> sd, int n, EPOS pos, int ok) nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xaa; - WFIFOW(s, 2) = n + 2; - WFIFOW(s, 4) = static_cast<uint16_t>(pos); - WFIFOB(s, 6) = ok; - WFIFOSET(s, clif_parse_func_table[0xaa].len); + Packet_Fixed<0x00aa> fixed_aa; + fixed_aa.ioff2 = n + 2; + fixed_aa.epos = pos; + fixed_aa.ok = ok; + send_fpacket<0x00aa, 7>(s, fixed_aa); return 0; } @@ -2007,11 +2032,11 @@ int clif_unequipitemack(dumb_ptr<map_session_data> sd, int n, EPOS pos, int ok) nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xac; - WFIFOW(s, 2) = n + 2; - WFIFOW(s, 4) = static_cast<uint16_t>(pos); - WFIFOB(s, 6) = ok; - WFIFOSET(s, clif_parse_func_table[0xac].len); + Packet_Fixed<0x00ac> fixed_ac; + fixed_ac.ioff2 = n + 2; + fixed_ac.epos = pos; + fixed_ac.ok = ok; + send_fpacket<0x00ac, 7>(s, fixed_ac); return 0; } @@ -2022,15 +2047,14 @@ int clif_unequipitemack(dumb_ptr<map_session_data> sd, int n, EPOS pos, int ok) */ int clif_misceffect(dumb_ptr<block_list> bl, int type) { - uint8_t buf[32]; - nullpo_ret(bl); - WBUFW(buf, 0) = 0x19b; - WBUFL(buf, 2) = unwrap<BlockId>(bl->bl_id); - WBUFL(buf, 6) = type; + Packet_Fixed<0x019b> fixed_19b; + fixed_19b.block_id = bl->bl_id; + fixed_19b.type = type; + Buffer buf = create_fpacket<0x019b, 10>(fixed_19b); - clif_send(buf, clif_parse_func_table[0x19b].len, bl, SendWho::AREA); + clif_send(buf, bl, SendWho::AREA); return 0; } @@ -2041,7 +2065,6 @@ int clif_misceffect(dumb_ptr<block_list> bl, int type) */ int clif_changeoption(dumb_ptr<block_list> bl) { - uint8_t buf[32]; eptr<struct status_change, StatusChange, StatusChange::MAX_STATUSCHANGE> sc_data; nullpo_ret(bl); @@ -2049,14 +2072,15 @@ int clif_changeoption(dumb_ptr<block_list> bl) Option option = *battle_get_option(bl); sc_data = battle_get_sc_data(bl); - WBUFW(buf, 0) = 0x119; - WBUFL(buf, 2) = unwrap<BlockId>(bl->bl_id); - WBUFW(buf, 6) = static_cast<uint16_t>(*battle_get_opt1(bl)); - WBUFW(buf, 8) = static_cast<uint16_t>(*battle_get_opt2(bl)); - WBUFW(buf, 10) = static_cast<uint16_t>(option); - WBUFB(buf, 12) = 0; // ?? + Packet_Fixed<0x0119> fixed_119; + fixed_119.block_id = bl->bl_id; + fixed_119.opt1 = *battle_get_opt1(bl); + fixed_119.opt2 = *battle_get_opt2(bl); + fixed_119.option = option; + fixed_119.zero = 0; + Buffer buf = create_fpacket<0x0119, 13>(fixed_119); - clif_send(buf, clif_parse_func_table[0x119].len, bl, SendWho::AREA); + clif_send(buf, bl, SendWho::AREA); return 0; } @@ -2073,23 +2097,22 @@ int clif_useitemack(dumb_ptr<map_session_data> sd, int index, int amount, if (!ok) { Session *s = sd->sess; - WFIFOW(s, 0) = 0xa8; - WFIFOW(s, 2) = index + 2; - WFIFOW(s, 4) = amount; - WFIFOB(s, 6) = ok; - WFIFOSET(s, clif_parse_func_table[0xa8].len); + Packet_Fixed<0x00a8> fixed_a8; + fixed_a8.ioff2 = index + 2; + fixed_a8.amount = amount; + fixed_a8.ok = ok; + send_fpacket<0x00a8, 7>(s, fixed_a8); } else { - uint8_t buf[32]; - - WBUFW(buf, 0) = 0x1c8; - WBUFW(buf, 2) = index + 2; - WBUFW(buf, 4) = unwrap<ItemNameId>(sd->status.inventory[index].nameid); - WBUFL(buf, 6) = unwrap<BlockId>(sd->bl_id); - WBUFW(buf, 10) = amount; - WBUFB(buf, 12) = ok; - clif_send(buf, clif_parse_func_table[0x1c8].len, sd, SendWho::SELF); + Packet_Fixed<0x01c8> fixed_1c8; + fixed_1c8.ioff2 = index + 2; + fixed_1c8.name_id = sd->status.inventory[index].nameid; + fixed_1c8.block_id = sd->bl_id; + fixed_1c8.amount = amount; + fixed_1c8.ok = ok; + Buffer buf = create_fpacket<0x01c8, 13>(fixed_1c8); + clif_send(buf, sd, SendWho::SELF); } return 0; @@ -2104,9 +2127,9 @@ void clif_traderequest(dumb_ptr<map_session_data> sd, CharName name) nullpo_retv(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xe5; - WFIFO_STRING(s, 2, name.to__actual(), 24); - WFIFOSET(s, clif_parse_func_table[0xe5].len); + Packet_Fixed<0x00e5> fixed_e5; + fixed_e5.char_name = name; + send_fpacket<0x00e5, 26>(s, fixed_e5); } /*========================================== @@ -2118,9 +2141,9 @@ void clif_tradestart(dumb_ptr<map_session_data> sd, int type) nullpo_retv(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xe7; - WFIFOB(s, 2) = type; - WFIFOSET(s, clif_parse_func_table[0xe7].len); + Packet_Fixed<0x00e7> fixed_e7; + fixed_e7.type = type; + send_fpacket<0x00e7, 3>(s, fixed_e7); } /*========================================== @@ -2128,57 +2151,57 @@ void clif_tradestart(dumb_ptr<map_session_data> sd, int type) *------------------------------------------ */ void clif_tradeadditem(dumb_ptr<map_session_data> sd, - dumb_ptr<map_session_data> tsd, int index, int amount) + dumb_ptr<map_session_data> tsd, int index2, int amount) { nullpo_retv(sd); nullpo_retv(tsd); Session *s = tsd->sess; - WFIFOW(s, 0) = 0xe9; - WFIFOL(s, 2) = amount; - if (index == 0) + Packet_Fixed<0x00e9> fixed_e9; + fixed_e9.amount = amount; + if (index2 == 0) { - WFIFOW(s, 6) = 0; // type id - WFIFOB(s, 8) = 0; //identify flag - WFIFOB(s, 9) = 0; // attribute - WFIFOB(s, 10) = 0; //refine - WFIFOW(s, 11) = 0; //card (4w) - WFIFOW(s, 13) = 0; //card (4w) - WFIFOW(s, 15) = 0; //card (4w) - WFIFOW(s, 17) = 0; //card (4w) + fixed_e9.name_id = ItemNameId(); + fixed_e9.identify = 0; + fixed_e9.broken_or_attribute = 0; + fixed_e9.refine = 0; + fixed_e9.card0 = 0; + fixed_e9.card1 = 0; + fixed_e9.card2 = 0; + fixed_e9.card3 = 0; } else { - index -= 2; - WFIFOW(s, 6) = unwrap<ItemNameId>(sd->status.inventory[index].nameid); // type id - WFIFOB(s, 8) = 0; //identify; - WFIFOB(s, 9) = 0; //broken or attribute; - WFIFOB(s, 10) = 0; //refine; + int index0 = index2 - 2; + fixed_e9.name_id = sd->status.inventory[index0].nameid; + fixed_e9.identify = 0; + fixed_e9.broken_or_attribute = 0; + fixed_e9.refine = 0; { - WFIFOW(s, 11) = 0; //card[0]; - WFIFOW(s, 13) = 0; //card[1]; - WFIFOW(s, 15) = 0; //card[2]; - WFIFOW(s, 17) = 0; //card[3]; + fixed_e9.card0 = 0; + fixed_e9.card1 = 0; + fixed_e9.card2 = 0; + fixed_e9.card3 = 0; } } - WFIFOSET(s, clif_parse_func_table[0xe9].len); + send_fpacket<0x00e9, 19>(s, fixed_e9); } /*========================================== * アイテム追加成功/失敗 *------------------------------------------ */ -int clif_tradeitemok(dumb_ptr<map_session_data> sd, int index, int amount, +int clif_tradeitemok(dumb_ptr<map_session_data> sd, int index2, int amount, int fail) { nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0x1b1; - WFIFOW(s, 2) = index; - WFIFOW(s, 4) = amount; - WFIFOB(s, 6) = fail; - WFIFOSET(s, clif_parse_func_table[0x1b1].len); + Packet_Fixed<0x01b1> fixed_1b1; + fixed_1b1.ioff2 = index2; + fixed_1b1.amount = amount; + fixed_1b1.fail = fail; + send_fpacket<0x01b1, 7>(s, fixed_1b1); return 0; } @@ -2192,9 +2215,9 @@ int clif_tradedeal_lock(dumb_ptr<map_session_data> sd, int fail) nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xec; - WFIFOB(s, 2) = fail; // 0=you 1=the other person - WFIFOSET(s, clif_parse_func_table[0xec].len); + Packet_Fixed<0x00ec> fixed_ec; + fixed_ec.fail = fail; // 0=you 1=the other person + send_fpacket<0x00ec, 3>(s, fixed_ec); return 0; } @@ -2208,8 +2231,8 @@ int clif_tradecancelled(dumb_ptr<map_session_data> sd) nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xee; - WFIFOSET(s, clif_parse_func_table[0xee].len); + Packet_Fixed<0x00ee> fixed_ee; + send_fpacket<0x00ee, 2>(s, fixed_ee); return 0; } @@ -2223,9 +2246,9 @@ int clif_tradecompleted(dumb_ptr<map_session_data> sd, int fail) nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xf0; - WFIFOB(s, 2) = fail; - WFIFOSET(s, clif_parse_func_table[0xf0].len); + Packet_Fixed<0x00f0> fixed_f0; + fixed_f0.fail = fail; + send_fpacket<0x00f0, 3>(s, fixed_f0); return 0; } @@ -2241,10 +2264,10 @@ int clif_updatestorageamount(dumb_ptr<map_session_data> sd, nullpo_ret(stor); Session *s = sd->sess; - WFIFOW(s, 0) = 0xf2; // update storage amount - WFIFOW(s, 2) = stor->storage_amount; //items - WFIFOW(s, 4) = MAX_STORAGE; //items max - WFIFOSET(s, clif_parse_func_table[0xf2].len); + Packet_Fixed<0x00f2> fixed_f2; + fixed_f2.current_slots = stor->storage_amount; //items + fixed_f2.max_slots = MAX_STORAGE; //items max + send_fpacket<0x00f2, 6>(s, fixed_f2); return 0; } @@ -2260,23 +2283,20 @@ int clif_storageitemadded(dumb_ptr<map_session_data> sd, Storage *stor, nullpo_ret(stor); Session *s = sd->sess; - WFIFOW(s, 0) = 0xf4; // Storage item added - WFIFOW(s, 2) = index + 1; // index - WFIFOL(s, 4) = amount; // amount -/* if ((view = itemdb_viewid(stor->storage_[index].nameid)) > 0) - WFIFOW(fd,8) =view; - else*/ - WFIFOW(s, 8) = unwrap<ItemNameId>(stor->storage_[index].nameid); - WFIFOB(s, 10) = 0; //identify; - WFIFOB(s, 11) = 0; //broken or attribute; - WFIFOB(s, 12) = 0; //refine; + Packet_Fixed<0x00f4> fixed_f4; + fixed_f4.soff1 = index + 1; + fixed_f4.amount = amount; + fixed_f4.name_id = stor->storage_[index].nameid; + fixed_f4.identify = 0; + fixed_f4.broken_or_attribute = 0; + fixed_f4.refine = 0; { - WFIFOW(s, 13) = 0; //card[0]; - WFIFOW(s, 15) = 0; //card[1]; - WFIFOW(s, 17) = 0; //card[2]; - WFIFOW(s, 19) = 0; //card[3]; + fixed_f4.card0 = 0; + fixed_f4.card1 = 0; + fixed_f4.card2 = 0; + fixed_f4.card3 = 0; } - WFIFOSET(s, clif_parse_func_table[0xf4].len); + send_fpacket<0x00f4, 21>(s, fixed_f4); return 0; } @@ -2291,10 +2311,10 @@ int clif_storageitemremoved(dumb_ptr<map_session_data> sd, int index, nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xf6; // Storage item removed - WFIFOW(s, 2) = index + 1; - WFIFOL(s, 4) = amount; - WFIFOSET(s, clif_parse_func_table[0xf6].len); + Packet_Fixed<0x00f6> fixed_f6; + fixed_f6.soff1 = index + 1; + fixed_f6.amount = amount; + send_fpacket<0x00f6, 8>(s, fixed_f6); return 0; } @@ -2308,8 +2328,8 @@ int clif_storageclose(dumb_ptr<map_session_data> sd) nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xf8; // Storage Closed - WFIFOSET(s, clif_parse_func_table[0xf8].len); + Packet_Fixed<0x00f8> fixed_f8; + send_fpacket<0x00f8, 2>(s, fixed_f8); return 0; } @@ -2332,25 +2352,22 @@ static void clif_getareachar_pc(dumb_ptr<map_session_data> sd, dumb_ptr<map_session_data> dstsd) { - int len; - if (bool(dstsd->status.option & Option::INVISIBILITY)) return; nullpo_retv(sd); nullpo_retv(dstsd); - uint8_t buf[256]; + Buffer buf; if (dstsd->walktimer) { - len = clif_set007b(dstsd, buf); + clif_set007b(dstsd, buf); } else { - len = clif_set0078(dstsd, buf); + clif_set0078_main_1d8(dstsd, buf); } - WFIFO_BUF_CLONE(sd->sess, buf, len); - WFIFOSET(sd->sess, len); + send_buffer(sd->sess, buf); if (battle_config.save_clothcolor == 1 && dstsd->status.clothes_color > 0) clif_changelook(dstsd, LOOK::CLOTHES_COLOR, @@ -2367,16 +2384,15 @@ void clif_getareachar_pc(dumb_ptr<map_session_data> sd, static void clif_getareachar_npc(dumb_ptr<map_session_data> sd, dumb_ptr<npc_data> nd) { - int len; - nullpo_retv(sd); nullpo_retv(nd); - if (nd->npc_class < 0 || nd->flag & 1 || nd->npc_class == INVISIBLE_CLASS) + if (nd->npc_class == NEGATIVE_SPECIES || nd->flag & 1 || nd->npc_class == INVISIBLE_CLASS) return; - len = clif_npc0078(nd, static_cast<uint8_t *>(WFIFOP(sd->sess, 0))); - WFIFOSET(sd->sess, len); + Buffer buf; + clif_npc0078(nd, buf); + send_buffer(sd->sess, buf); } /*========================================== @@ -2385,13 +2401,11 @@ void clif_getareachar_npc(dumb_ptr<map_session_data> sd, dumb_ptr<npc_data> nd) */ int clif_movemob(dumb_ptr<mob_data> md) { - unsigned char buf[256]; - int len; - nullpo_ret(md); - len = clif_mob007b(md, buf); - clif_send(buf, len, md, SendWho::AREA); + Buffer buf; + clif_mob007b(md, buf); + clif_send(buf, md, SendWho::AREA); return 0; } @@ -2402,20 +2416,19 @@ int clif_movemob(dumb_ptr<mob_data> md) */ int clif_fixmobpos(dumb_ptr<mob_data> md) { - unsigned char buf[256]; - int len; - nullpo_ret(md); if (md->state.state == MS::WALK) { - len = clif_mob007b(md, buf); - clif_send(buf, len, md, SendWho::AREA); + Buffer buf; + clif_mob007b(md, buf); + clif_send(buf, md, SendWho::AREA); } else { - len = clif_mob0078(md, buf); - clif_send(buf, len, md, SendWho::AREA); + Buffer buf; + clif_mob0078(md, buf); + clif_send(buf, md, SendWho::AREA); } return 0; @@ -2427,20 +2440,19 @@ int clif_fixmobpos(dumb_ptr<mob_data> md) */ int clif_fixpcpos(dumb_ptr<map_session_data> sd) { - unsigned char buf[256]; - int len; - nullpo_ret(sd); if (sd->walktimer) { - len = clif_set007b(sd, buf); - clif_send(buf, len, sd, SendWho::AREA); + Buffer buf; + clif_set007b(sd, buf); + clif_send(buf, sd, SendWho::AREA); } else { - len = clif_set0078(sd, buf); - clif_send(buf, len, sd, SendWho::AREA); + Buffer buf; + clif_set0078_main_1d8(sd, buf); + clif_send(buf, sd, SendWho::AREA); } clif_changelook_accessories(sd, NULL); @@ -2455,7 +2467,6 @@ int clif_damage(dumb_ptr<block_list> src, dumb_ptr<block_list> dst, tick_t tick, interval_t sdelay, interval_t ddelay, int damage, int div, DamageType type, int damage2) { - unsigned char buf[256]; eptr<struct status_change, StatusChange, StatusChange::MAX_STATUSCHANGE> sc_data; nullpo_ret(src); @@ -2463,17 +2474,18 @@ int clif_damage(dumb_ptr<block_list> src, dumb_ptr<block_list> dst, sc_data = battle_get_sc_data(dst); - WBUFW(buf, 0) = 0x8a; - WBUFL(buf, 2) = unwrap<BlockId>(src->bl_id); - WBUFL(buf, 6) = unwrap<BlockId>(dst->bl_id); - WBUFL(buf, 10) = tick.time_since_epoch().count(); - WBUFL(buf, 14) = sdelay.count(); - WBUFL(buf, 18) = ddelay.count(); - WBUFW(buf, 22) = (damage > 0x7fff) ? 0x7fff : damage; - WBUFW(buf, 24) = div; - WBUFB(buf, 26) = static_cast<uint8_t>(type); - WBUFW(buf, 27) = damage2; - clif_send(buf, clif_parse_func_table[0x8a].len, src, SendWho::AREA); + Packet_Fixed<0x008a> fixed_8a; + fixed_8a.src_id = src->bl_id; + fixed_8a.dst_id = dst->bl_id; + fixed_8a.tick = tick; + fixed_8a.sdelay = sdelay; + fixed_8a.ddelay = ddelay; + fixed_8a.damage = (damage > 0x7fff) ? 0x7fff : damage; + fixed_8a.div = div; + fixed_8a.damage_type = type; + fixed_8a.damage2 = damage2; + Buffer buf = create_fpacket<0x008a, 29>(fixed_8a); + clif_send(buf, src, SendWho::AREA); return 0; } @@ -2485,19 +2497,20 @@ int clif_damage(dumb_ptr<block_list> src, dumb_ptr<block_list> dst, static void clif_getareachar_mob(dumb_ptr<map_session_data> sd, dumb_ptr<mob_data> md) { - int len; nullpo_retv(sd); nullpo_retv(md); if (md->state.state == MS::WALK) { - len = clif_mob007b(md, static_cast<uint8_t *>(WFIFOP(sd->sess, 0))); - WFIFOSET(sd->sess, len); + Buffer buf; + clif_mob007b(md, buf); + send_buffer(sd->sess, buf); } else { - len = clif_mob0078(md, static_cast<uint8_t *>(WFIFOP(sd->sess, 0))); - WFIFOSET(sd->sess, len); + Buffer buf; + clif_mob0078(md, buf); + send_buffer(sd->sess, buf); } } @@ -2513,18 +2526,16 @@ void clif_getareachar_item(dumb_ptr<map_session_data> sd, nullpo_retv(fitem); Session *s = sd->sess; - //009d <ID>.l <item ID>.w <identify flag>.B <X>.w <Y>.w <amount>.w <subX>.B <subY>.B - WFIFOW(s, 0) = 0x9d; - WFIFOL(s, 2) = unwrap<BlockId>(fitem->bl_id); - WFIFOW(s, 6) = unwrap<ItemNameId>(fitem->item_data.nameid); - WFIFOB(s, 8) = 0; //identify; - WFIFOW(s, 9) = fitem->bl_x; - WFIFOW(s, 11) = fitem->bl_y; - WFIFOW(s, 13) = fitem->item_data.amount; - WFIFOB(s, 15) = fitem->subx; - WFIFOB(s, 16) = fitem->suby; - - WFIFOSET(s, clif_parse_func_table[0x9d].len); + Packet_Fixed<0x009d> fixed_9d; + fixed_9d.block_id = fitem->bl_id; + fixed_9d.name_id = fitem->item_data.nameid; + fixed_9d.identify = 0; + fixed_9d.x = fitem->bl_x; + fixed_9d.y = fitem->bl_y; + fixed_9d.amount = fitem->item_data.amount; + fixed_9d.subx = fitem->subx; + fixed_9d.suby = fitem->suby; + send_fpacket<0x009d, 17>(s, fixed_9d); } /*========================================== @@ -2681,27 +2692,27 @@ int clif_skillinfo(dumb_ptr<map_session_data> sd, SkillID skillid, int type, Session *s = sd->sess; if (!sd->status.skill[skillid].lv) return 0; - WFIFOW(s, 0) = 0x147; - WFIFOW(s, 2) = static_cast<uint16_t>(skillid); + Packet_Fixed<0x0147> fixed_147; + fixed_147.info.skill_id = skillid; if (type < 0) - WFIFOW(s, 4) = skill_get_inf(skillid); + fixed_147.info.type_or_inf = skill_get_inf(skillid); else - WFIFOW(s, 4) = type; - WFIFOW(s, 6) = 0; - WFIFOW(s, 8) = sd->status.skill[skillid].lv; - WFIFOW(s, 10) = skill_get_sp(skillid, sd->status.skill[skillid].lv); + fixed_147.info.type_or_inf = type; + fixed_147.info.flags = SkillFlags::ZERO; + fixed_147.info.level = sd->status.skill[skillid].lv; + fixed_147.info.sp = skill_get_sp(skillid, sd->status.skill[skillid].lv); if (range < 0) { range = skill_get_range(skillid, sd->status.skill[skillid].lv); if (range < 0) range = battle_get_range(sd) - (range + 1); - WFIFOW(s, 12) = range; + fixed_147.info.range = range; } else - WFIFOW(s, 12) = range; - WFIFO_ZERO(s, 14, 24); - WFIFOB(s, 38) = sd->status.skill[skillid].lv < skill_get_max_raise(skillid); - WFIFOSET(s, clif_parse_func_table[0x147].len); + fixed_147.info.range = range; + fixed_147.info.unused = ""_s; + fixed_147.info.can_raise = sd->status.skill[skillid].lv < skill_get_max_raise(skillid); + send_fpacket<0x0147, 39>(s, fixed_147); return 0; } @@ -2712,35 +2723,34 @@ int clif_skillinfo(dumb_ptr<map_session_data> sd, SkillID skillid, int type, */ void clif_skillinfoblock(dumb_ptr<map_session_data> sd) { - int len = 4, range; - nullpo_retv(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0x10f; + std::vector<Packet_Repeat<0x010f>> repeat_10f; for (SkillID i : erange(SkillID(), MAX_SKILL)) { if (sd->status.skill[i].lv && sd->tmw_version >= 1) { + Packet_Repeat<0x010f> info; // [Fate] Version 1 and later don't crash because of bad skill IDs anymore - WFIFOW(s, len) = static_cast<uint16_t>(i); - WFIFOW(s, len + 2) = skill_get_inf(i); - WFIFOW(s, len + 4) = static_cast<uint16_t>( + info.info.skill_id = i; + info.info.type_or_inf = skill_get_inf(i); + info.info.flags = ( skill_db[i].poolflags | (sd->status.skill[i].flags & SkillFlags::POOL_ACTIVATED)); - WFIFOW(s, len + 6) = sd->status.skill[i].lv; - WFIFOW(s, len + 8) = skill_get_sp(i, sd->status.skill[i].lv); - range = skill_get_range(i, sd->status.skill[i].lv); + info.info.level = sd->status.skill[i].lv; + info.info.sp = skill_get_sp(i, sd->status.skill[i].lv); + int range = skill_get_range(i, sd->status.skill[i].lv); if (range < 0) range = battle_get_range(sd) - (range + 1); - WFIFOW(s, len + 10) = range; - WFIFO_ZERO(s, len + 12, 24); - WFIFOB(s, len + 36) = sd->status.skill[i].lv < skill_get_max_raise(i); - len += 37; + info.info.range = range; + info.info.unused = ""_s; + info.info.can_raise = sd->status.skill[i].lv < skill_get_max_raise(i); + + repeat_10f.push_back(info); } } - WFIFOW(s, 2) = len; - WFIFOSET(s, len); + send_packet_repeatonly<0x010f, 4, 37>(s, repeat_10f); } /*========================================== @@ -2749,21 +2759,19 @@ void clif_skillinfoblock(dumb_ptr<map_session_data> sd) */ int clif_skillup(dumb_ptr<map_session_data> sd, SkillID skill_num) { - int range; - nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0x10e; - WFIFOW(s, 2) = static_cast<uint16_t>(skill_num); - WFIFOW(s, 4) = sd->status.skill[skill_num].lv; - WFIFOW(s, 6) = skill_get_sp(skill_num, sd->status.skill[skill_num].lv); - range = skill_get_range(skill_num, sd->status.skill[skill_num].lv); + Packet_Fixed<0x010e> fixed_10e; + fixed_10e.skill_id = skill_num; + fixed_10e.level = sd->status.skill[skill_num].lv; + fixed_10e.sp = skill_get_sp(skill_num, sd->status.skill[skill_num].lv); + int range = skill_get_range(skill_num, sd->status.skill[skill_num].lv); if (range < 0) range = battle_get_range(sd) - (range + 1); - WFIFOW(s, 8) = range; - WFIFOB(s, 10) = sd->status.skill[skill_num].lv < skill_get_max_raise(skill_num); - WFIFOSET(s, clif_parse_func_table[0x10e].len); + fixed_10e.range = range; + fixed_10e.can_raise = sd->status.skill[skill_num].lv < skill_get_max_raise(skill_num); + send_fpacket<0x010e, 11>(s, fixed_10e); return 0; } @@ -2774,14 +2782,11 @@ int clif_skillup(dumb_ptr<map_session_data> sd, SkillID skill_num) */ int clif_skillcastcancel(dumb_ptr<block_list> bl) { - unsigned char buf[16]; - - nullpo_ret(bl); - - WBUFW(buf, 0) = 0x1b9; - WBUFL(buf, 2) = unwrap<BlockId>(bl->bl_id); - clif_send(buf, clif_parse_func_table[0x1b9].len, bl, SendWho::AREA); + // packet 0x01b9 was being sent with length 0, + // even though there were 6 bytes involved + // and the client ignores it anyway + (void)bl; return 0; } @@ -2801,13 +2806,13 @@ int clif_skill_fail(dumb_ptr<map_session_data> sd, SkillID skill_id, int type, return 0; } - WFIFOW(s, 0) = 0x110; - WFIFOW(s, 2) = static_cast<uint16_t>(skill_id); - WFIFOW(s, 4) = btype; - WFIFOW(s, 6) = 0; - WFIFOB(s, 8) = 0; - WFIFOB(s, 9) = type; - WFIFOSET(s, clif_parse_func_table[0x110].len); + Packet_Fixed<0x0110> fixed_110; + fixed_110.skill_id = skill_id; + fixed_110.btype = btype; + fixed_110.zero1 = 0; + fixed_110.zero2 = 0; + fixed_110.type = type; + send_fpacket<0x0110, 10>(s, fixed_110); return 0; } @@ -2820,7 +2825,6 @@ int clif_skill_damage(dumb_ptr<block_list> src, dumb_ptr<block_list> dst, tick_t tick, interval_t sdelay, interval_t ddelay, int damage, int div, SkillID skill_id, int skill_lv, int type) { - unsigned char buf[64]; eptr<struct status_change, StatusChange, StatusChange::MAX_STATUSCHANGE> sc_data; nullpo_ret(src); @@ -2828,18 +2832,19 @@ int clif_skill_damage(dumb_ptr<block_list> src, dumb_ptr<block_list> dst, sc_data = battle_get_sc_data(dst); - WBUFW(buf, 0) = 0x1de; - WBUFW(buf, 2) = static_cast<uint16_t>(skill_id); - WBUFL(buf, 4) = unwrap<BlockId>(src->bl_id); - WBUFL(buf, 8) = unwrap<BlockId>(dst->bl_id); - WBUFL(buf, 12) = static_cast<uint32_t>(tick.time_since_epoch().count()); - WBUFL(buf, 16) = static_cast<uint32_t>(sdelay.count()); - WBUFL(buf, 20) = static_cast<uint32_t>(ddelay.count()); - WBUFL(buf, 24) = damage; - WBUFW(buf, 28) = skill_lv; - WBUFW(buf, 30) = div; - WBUFB(buf, 32) = (type > 0) ? type : skill_get_hit(skill_id); - clif_send(buf, clif_parse_func_table[0x1de].len, src, SendWho::AREA); + Packet_Fixed<0x01de> fixed_1de; + fixed_1de.skill_id = skill_id; + fixed_1de.src_id = src->bl_id; + fixed_1de.dst_id = dst->bl_id; + fixed_1de.tick = tick; + fixed_1de.sdelay = sdelay; + fixed_1de.ddelay = ddelay; + fixed_1de.damage = damage; + fixed_1de.skill_level = skill_lv; + fixed_1de.div = div; + fixed_1de.type_or_hit = (type > 0) ? type : skill_get_hit(skill_id); + Buffer buf = create_fpacket<0x01de, 33>(fixed_1de); + clif_send(buf, src, SendWho::AREA); return 0; } @@ -2850,15 +2855,14 @@ int clif_skill_damage(dumb_ptr<block_list> src, dumb_ptr<block_list> dst, */ int clif_status_change(dumb_ptr<block_list> bl, StatusChange type, int flag) { - unsigned char buf[16]; - nullpo_ret(bl); - WBUFW(buf, 0) = 0x0196; - WBUFW(buf, 2) = static_cast<uint16_t>(type); - WBUFL(buf, 4) = unwrap<BlockId>(bl->bl_id); - WBUFB(buf, 8) = flag; - clif_send(buf, clif_parse_func_table[0x196].len, bl, SendWho::AREA); + Packet_Fixed<0x0196> fixed_196; + fixed_196.sc_type = type; + fixed_196.block_id = bl->bl_id; + fixed_196.flag = flag; + Buffer buf = create_fpacket<0x0196, 9>(fixed_196); + clif_send(buf, bl, SendWho::AREA); return 0; } @@ -2871,11 +2875,8 @@ void clif_displaymessage(Session *s, XString mes) if (mes) { // don't send a void message (it's not displaying on the client chat). @help can send void line. - WFIFOW(s, 0) = 0x8e; - size_t str_len = mes.size() + 1; // NUL (might not be NUL yet) - WFIFOW(s, 2) = 4 + str_len; - WFIFO_STRING(s, 4, mes, str_len); - WFIFOSET(s, 4 + str_len); + // This is untrue now ^ + send_packet_repeatonly<0x008e, 4, 1>(s, mes); } } @@ -2885,14 +2886,9 @@ void clif_displaymessage(Session *s, XString mes) */ void clif_GMmessage(dumb_ptr<block_list> bl, XString mes, int flag) { - size_t str_len = mes.size() + 1; - unsigned char buf[str_len + 4]; - - WBUFW(buf, 0) = 0x9a; - WBUFW(buf, 2) = str_len + 4; - WBUF_STRING(buf, 4, mes, str_len); + Buffer buf = create_packet_repeatonly<0x009a, 4, 1>(mes); flag &= 0x07; - clif_send(buf, WBUFW(buf, 2), bl, + clif_send(buf, bl, (flag == 1) ? SendWho::ALL_SAMEMAP : (flag == 2) ? SendWho::AREA : (flag == 3) ? SendWho::SELF : @@ -2905,15 +2901,14 @@ void clif_GMmessage(dumb_ptr<block_list> bl, XString mes, int flag) */ void clif_resurrection(dumb_ptr<block_list> bl, int type) { - uint8_t buf[16]; - nullpo_retv(bl); - WBUFW(buf, 0) = 0x148; - WBUFL(buf, 2) = unwrap<BlockId>(bl->bl_id); - WBUFW(buf, 6) = type; + Packet_Fixed<0x0148> fixed_148; + fixed_148.block_id = bl->bl_id; + fixed_148.type = type; + Buffer buf = create_fpacket<0x0148, 8>(fixed_148); - clif_send(buf, clif_parse_func_table[0x148].len, bl, + clif_send(buf, bl, type == 1 ? SendWho::AREA : SendWho::AREA_WOS); } @@ -2923,12 +2918,9 @@ void clif_resurrection(dumb_ptr<block_list> bl, int type) */ void clif_wis_message(Session *s, CharName nick, XString mes) // R 0097 <len>.w <nick>.24B <message>.?B { - size_t mes_len = mes.size() + 1; - WFIFOW(s, 0) = 0x97; - WFIFOW(s, 2) = mes_len + 24 + 4; - WFIFO_STRING(s, 4, nick.to__actual(), 24); - WFIFO_STRING(s, 28, mes, mes_len); - WFIFOSET(s, WFIFOW(s, 2)); + Packet_Head<0x0097> head_97; + head_97.char_name = nick; + send_vpacket<0x0097, 28, 1>(s, head_97, mes); } /*========================================== @@ -2937,9 +2929,9 @@ void clif_wis_message(Session *s, CharName nick, XString mes) // R 0097 <len>. */ void clif_wis_end(Session *s, int flag) // R 0098 <type>.B: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target { - WFIFOW(s, 0) = 0x98; - WFIFOW(s, 2) = flag; - WFIFOSET(s, clif_parse_func_table[0x98].len); + Packet_Fixed<0x0098> fixed_98; + fixed_98.flag = flag; + send_fpacket<0x0098, 3>(s, fixed_98); } /*========================================== @@ -2959,9 +2951,9 @@ int clif_party_created(dumb_ptr<map_session_data> sd, int flag) nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xfa; - WFIFOB(s, 2) = flag; - WFIFOSET(s, clif_parse_func_table[0xfa].len); + Packet_Fixed<0x00fa> fixed_fa; + fixed_fa.flag = flag; + send_fpacket<0x00fa, 3>(s, fixed_fa); return 0; } @@ -2971,41 +2963,43 @@ int clif_party_created(dumb_ptr<map_session_data> sd, int flag) */ int clif_party_info(PartyPair p, Session *s) { - unsigned char buf[1024]; - int i, c; + int i; dumb_ptr<map_session_data> sd = NULL; nullpo_ret(p); - WBUFW(buf, 0) = 0xfb; - WBUF_STRING(buf, 4, p->name, 24); - for (i = c = 0; i < MAX_PARTY; i++) + Packet_Head<0x00fb> head_fb; + std::vector<Packet_Repeat<0x00fb>> repeat_fb; + head_fb.party_name = p->name; + for (i = 0; i < MAX_PARTY; i++) { struct party_member *m = &p->member[i]; if (m->account_id) { + Packet_Repeat<0x00fb> info; if (sd == NULL) sd = dumb_ptr<map_session_data>(m->sd); - WBUFL(buf, 28 + c * 46) = unwrap<AccountId>(m->account_id); - WBUF_STRING(buf, 28 + c * 46 + 4, m->name.to__actual(), 24); - WBUF_STRING(buf, 28 + c * 46 + 28, m->map, 16); - WBUFB(buf, 28 + c * 46 + 44) = (m->leader) ? 0 : 1; - WBUFB(buf, 28 + c * 46 + 45) = (m->online) ? 0 : 1; - c++; + + info.account_id = m->account_id; + info.char_name = m->name; + info.map_name = m->map; + info.leader = (m->leader) ? 0 : 1; + info.online = (m->online) ? 0 : 1; + repeat_fb.push_back(info); } } - size_t len = 28 + c * 46; - WBUFW(buf, 2) = len; if (s) { // If set, send only to fd. - WFIFO_BUF_CLONE(s, buf, len); - WFIFOSET(s, len); + send_vpacket<0x00fb, 28, 46>(s, head_fb, repeat_fb); return 9; } // else, send it to all the party, if they exist. if (sd != NULL) - clif_send(buf, len, sd, SendWho::PARTY); + { + Buffer buf = create_vpacket<0x00fb, 28, 46>(head_fb, repeat_fb); + clif_send(buf, sd, SendWho::PARTY); + } return 0; } @@ -3029,10 +3023,10 @@ void clif_party_invite(dumb_ptr<map_session_data> sd, if (!(p = party_search(sd->status.party_id))) return; - WFIFOW(s, 0) = 0xfe; - WFIFOL(s, 2) = unwrap<AccountId>(sd->status_key.account_id); - WFIFO_STRING(s, 6, p->name, 24); - WFIFOSET(s, clif_parse_func_table[0xfe].len); + Packet_Fixed<0x00fe> fixed_fe; + fixed_fe.account_id = sd->status_key.account_id; + fixed_fe.party_name = p->name; + send_fpacket<0x00fe, 30>(s, fixed_fe); } /*========================================== @@ -3054,10 +3048,10 @@ void clif_party_inviteack(dumb_ptr<map_session_data> sd, CharName nick, int flag nullpo_retv(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xfd; - WFIFO_STRING(s, 2, nick.to__actual(), 24); - WFIFOB(s, 26) = flag; - WFIFOSET(s, clif_parse_func_table[0xfd].len); + Packet_Fixed<0x00fd> fixed_fd; + fixed_fd.char_name = nick; + fixed_fd.flag = flag; + send_fpacket<0x00fd, 27>(s, fixed_fd); } /*========================================== @@ -3069,8 +3063,6 @@ void clif_party_inviteack(dumb_ptr<map_session_data> sd, CharName nick, int flag */ void clif_party_option(PartyPair p, dumb_ptr<map_session_data> sd, int flag) { - unsigned char buf[16]; - nullpo_retv(p); if (sd == NULL && flag == 0) @@ -3082,15 +3074,17 @@ void clif_party_option(PartyPair p, dumb_ptr<map_session_data> sd, int flag) } if (sd == NULL) return; - WBUFW(buf, 0) = 0x101; - WBUFW(buf, 2) = ((flag & 0x01) ? 2 : p->exp); - WBUFW(buf, 4) = ((flag & 0x10) ? 2 : p->item); + Packet_Fixed<0x0101> fixed_101; + fixed_101.exp = ((flag & 0x01) ? 2 : p->exp); + fixed_101.item = ((flag & 0x10) ? 2 : p->item); if (flag == 0) - clif_send(buf, clif_parse_func_table[0x101].len, sd, SendWho::PARTY); + { + Buffer buf = create_fpacket<0x0101, 6>(fixed_101); + clif_send(buf, sd, SendWho::PARTY); + } else { - WFIFO_BUF_CLONE(sd->sess, buf, clif_parse_func_table[0x101].len); - WFIFOSET(sd->sess, clif_parse_func_table[0x101].len); + send_fpacket<0x0101, 6>(sd->sess, fixed_101); } } @@ -3101,15 +3095,14 @@ void clif_party_option(PartyPair p, dumb_ptr<map_session_data> sd, int flag) void clif_party_leaved(PartyPair p, dumb_ptr<map_session_data> sd, AccountId account_id, CharName name, int flag) { - unsigned char buf[64]; int i; nullpo_retv(p); - WBUFW(buf, 0) = 0x105; - WBUFL(buf, 2) = unwrap<AccountId>(account_id); - WBUF_STRING(buf, 6, name.to__actual(), 24); - WBUFB(buf, 30) = flag & 0x0f; + Packet_Fixed<0x0105> fixed_105; + fixed_105.account_id = account_id; + fixed_105.char_name = name; + fixed_105.flag = flag & 0x0f; if ((flag & 0xf0) == 0) { @@ -3121,12 +3114,14 @@ void clif_party_leaved(PartyPair p, dumb_ptr<map_session_data> sd, break; } if (sd != NULL) - clif_send(buf, clif_parse_func_table[0x105].len, sd, SendWho::PARTY); + { + Buffer buf = create_fpacket<0x0105, 31>(fixed_105); + clif_send(buf, sd, SendWho::PARTY); + } } else if (sd != NULL) { - WFIFO_BUF_CLONE(sd->sess, buf, clif_parse_func_table[0x105].len); - WFIFOSET(sd->sess, clif_parse_func_table[0x105].len); + send_fpacket<0x0105, 31>(sd->sess, fixed_105); } } @@ -3150,13 +3145,10 @@ void clif_party_message(PartyPair p, AccountId account_id, XString mes) } if (sd != NULL) { - size_t len = mes.size() + 1; - unsigned char buf[len + 8]; - WBUFW(buf, 0) = 0x109; - WBUFW(buf, 2) = len + 8; - WBUFL(buf, 4) = unwrap<AccountId>(account_id); - WBUF_STRING(buf, 8, mes, len); - clif_send(buf, len + 8, sd, SendWho::PARTY); + Packet_Head<0x0109> head_109; + head_109.account_id = account_id; + Buffer buf = create_vpacket<0x0109, 8, 1>(head_109, mes); + clif_send(buf, sd, SendWho::PARTY); } } @@ -3166,15 +3158,14 @@ void clif_party_message(PartyPair p, AccountId account_id, XString mes) */ int clif_party_xy(PartyPair , dumb_ptr<map_session_data> sd) { - unsigned char buf[16]; - nullpo_ret(sd); - WBUFW(buf, 0) = 0x107; - WBUFL(buf, 2) = unwrap<AccountId>(sd->status_key.account_id); - WBUFW(buf, 6) = sd->bl_x; - WBUFW(buf, 8) = sd->bl_y; - clif_send(buf, clif_parse_func_table[0x107].len, sd, SendWho::PARTY_SAMEMAP_WOS); + Packet_Fixed<0x0107> fixed_107; + fixed_107.account_id = sd->status_key.account_id; + fixed_107.x = sd->bl_x; + fixed_107.y = sd->bl_y; + Buffer buf = create_fpacket<0x0107, 10>(fixed_107); + clif_send(buf, sd, SendWho::PARTY_SAMEMAP_WOS); return 0; } @@ -3184,16 +3175,15 @@ int clif_party_xy(PartyPair , dumb_ptr<map_session_data> sd) */ int clif_party_hp(PartyPair , dumb_ptr<map_session_data> sd) { - unsigned char buf[16]; - nullpo_ret(sd); - WBUFW(buf, 0) = 0x106; - WBUFL(buf, 2) = unwrap<AccountId>(sd->status_key.account_id); - WBUFW(buf, 6) = (sd->status.hp > 0x7fff) ? 0x7fff : sd->status.hp; - WBUFW(buf, 8) = + Packet_Fixed<0x0106> fixed_106; + fixed_106.account_id = sd->status_key.account_id; + fixed_106.hp = (sd->status.hp > 0x7fff) ? 0x7fff : sd->status.hp; + fixed_106.max_hp = (sd->status.max_hp > 0x7fff) ? 0x7fff : sd->status.max_hp; - clif_send(buf, clif_parse_func_table[0x106].len, sd, SendWho::PARTY_AREA_WOS); + Buffer buf = create_fpacket<0x0106, 10>(fixed_106); + clif_send(buf, sd, SendWho::PARTY_AREA_WOS); return 0; } @@ -3207,14 +3197,14 @@ int clif_movetoattack(dumb_ptr<map_session_data> sd, dumb_ptr<block_list> bl) nullpo_ret(bl); Session *s = sd->sess; - WFIFOW(s, 0) = 0x139; - WFIFOL(s, 2) = unwrap<BlockId>(bl->bl_id); - WFIFOW(s, 6) = bl->bl_x; - WFIFOW(s, 8) = bl->bl_y; - WFIFOW(s, 10) = sd->bl_x; - WFIFOW(s, 12) = sd->bl_y; - WFIFOW(s, 14) = sd->attackrange; - WFIFOSET(s, clif_parse_func_table[0x139].len); + Packet_Fixed<0x0139> fixed_139; + fixed_139.block_id = bl->bl_id; + fixed_139.bl_x = bl->bl_x; + fixed_139.bl_y = bl->bl_y; + fixed_139.sd_x = sd->bl_x; + fixed_139.sd_y = sd->bl_y; + fixed_139.range = sd->attackrange; + send_fpacket<0x0139, 16>(s, fixed_139); return 0; } @@ -3224,13 +3214,12 @@ int clif_movetoattack(dumb_ptr<map_session_data> sd, dumb_ptr<block_list> bl) */ int clif_mvp_effect(dumb_ptr<map_session_data> sd) { - unsigned char buf[16]; - nullpo_ret(sd); - WBUFW(buf, 0) = 0x10c; - WBUFL(buf, 2) = unwrap<BlockId>(sd->bl_id); - clif_send(buf, clif_parse_func_table[0x10c].len, sd, SendWho::AREA); + Packet_Fixed<0x010c> fixed_10c; + fixed_10c.block_id = sd->bl_id; + Buffer buf = create_fpacket<0x010c, 6>(fixed_10c); + clif_send(buf, sd, SendWho::AREA); return 0; } @@ -3240,22 +3229,19 @@ int clif_mvp_effect(dumb_ptr<map_session_data> sd) */ void clif_emotion(dumb_ptr<block_list> bl, int type) { - unsigned char buf[8]; - nullpo_retv(bl); - WBUFW(buf, 0) = 0xc0; - WBUFL(buf, 2) = unwrap<BlockId>(bl->bl_id); - WBUFB(buf, 6) = type; - clif_send(buf, clif_parse_func_table[0xc0].len, bl, SendWho::AREA); + Packet_Fixed<0x00c0> fixed_c0; + fixed_c0.block_id = bl->bl_id; + fixed_c0.type = type; + Buffer buf = create_fpacket<0x00c0, 7>(fixed_c0); + clif_send(buf, bl, SendWho::AREA); } static void clif_emotion_towards(dumb_ptr<block_list> bl, dumb_ptr<block_list> target, int type) { - unsigned char buf[8]; - int len = clif_parse_func_table[0xc0].len; dumb_ptr<map_session_data> sd = target->is_player(); nullpo_retv(bl); @@ -3264,12 +3250,11 @@ void clif_emotion_towards(dumb_ptr<block_list> bl, if (target->bl_type != BL::PC) return; - WBUFW(buf, 0) = 0xc0; - WBUFL(buf, 2) = unwrap<BlockId>(bl->bl_id); - WBUFB(buf, 6) = type; + Packet_Fixed<0x00c0> fixed_c0; + fixed_c0.block_id = bl->bl_id; + fixed_c0.type = type; - WFIFO_BUF_CLONE(sd->sess, buf, len); - WFIFOSET(sd->sess, len); + send_fpacket<0x00c0, 7>(sd->sess, fixed_c0); } /*========================================== @@ -3278,14 +3263,13 @@ void clif_emotion_towards(dumb_ptr<block_list> bl, */ void clif_sitting(Session *, dumb_ptr<map_session_data> sd) { - unsigned char buf[64]; - nullpo_retv(sd); - WBUFW(buf, 0) = 0x8a; - WBUFL(buf, 2) = unwrap<BlockId>(sd->bl_id); - WBUFB(buf, 26) = 2; - clif_send(buf, clif_parse_func_table[0x8a].len, sd, SendWho::AREA); + Packet_Fixed<0x008a> fixed_8a; + fixed_8a.src_id = sd->bl_id; + fixed_8a.damage_type = DamageType::SIT; + Buffer buf = create_fpacket<0x008a, 29>(fixed_8a); + clif_send(buf, sd, SendWho::AREA); } /*========================================== @@ -3298,14 +3282,14 @@ int clif_GM_kickack(dumb_ptr<map_session_data> sd, AccountId id) nullpo_ret(sd); Session *s = sd->sess; - WFIFOW(s, 0) = 0xcd; - WFIFOL(s, 2) = unwrap<AccountId>(id); - WFIFOSET(s, clif_parse_func_table[0xcd].len); + Packet_Fixed<0x00cd> fixed_cd; + fixed_cd.account_id = id; + send_fpacket<0x00cd, 6>(s, fixed_cd); return 0; } static -void clif_parse_QuitGame(Session *s, dumb_ptr<map_session_data> sd); +void clif_do_quit_game(Session *s, dumb_ptr<map_session_data> sd); int clif_GM_kick(dumb_ptr<map_session_data> sd, dumb_ptr<map_session_data> tsd, int type) @@ -3316,7 +3300,7 @@ int clif_GM_kick(dumb_ptr<map_session_data> sd, dumb_ptr<map_session_data> tsd, clif_GM_kickack(sd, tsd->status_key.account_id); tsd->opt1 = Opt1::ZERO; tsd->opt2 = Opt2::ZERO; - clif_parse_QuitGame(tsd->sess, tsd); + clif_do_quit_game(tsd->sess, tsd); return 0; } @@ -3324,15 +3308,12 @@ int clif_GM_kick(dumb_ptr<map_session_data> sd, dumb_ptr<map_session_data> tsd, // displaying special effects (npcs, weather, etc) [Valaris] int clif_specialeffect(dumb_ptr<block_list> bl, int type, int flag) { - unsigned char buf[24]; - nullpo_ret(bl); - WBUF_ZERO(buf, 0, clif_parse_func_table[0x19b].len); - - WBUFW(buf, 0) = 0x19b; - WBUFL(buf, 2) = unwrap<BlockId>(bl->bl_id); - WBUFL(buf, 6) = type; + Packet_Fixed<0x019b> fixed_19b; + fixed_19b.block_id = bl->bl_id; + fixed_19b.type = type; + Buffer buf = create_fpacket<0x019b, 10>(fixed_19b); if (flag == 2) { @@ -3347,9 +3328,9 @@ int clif_specialeffect(dumb_ptr<block_list> bl, int type, int flag) } } else if (flag == 1) - clif_send(buf, clif_parse_func_table[0x19b].len, bl, SendWho::SELF); + clif_send(buf, bl, SendWho::SELF); else if (!flag) - clif_send(buf, clif_parse_func_table[0x19b].len, bl, SendWho::AREA); + clif_send(buf, bl, SendWho::AREA); return 0; @@ -3364,7 +3345,7 @@ int clif_specialeffect(dumb_ptr<block_list> bl, int type, int flag) *------------------------------------------ */ static -void clif_parse_WantToConnection(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_WantToConnection(Session *s, dumb_ptr<map_session_data> sd) { AccountId account_id; // account_id in the packet @@ -3372,18 +3353,22 @@ void clif_parse_WantToConnection(Session *s, dumb_ptr<map_session_data> sd) { if (battle_config.error_log) PRINTF("clif_parse_WantToConnection : invalid request?\n"_fmt); - return; + return RecvResult::Error; } - if (RFIFOW(s, 0) == 0x72) + Packet_Fixed<0x0072> fixed; + RecvResult rv = recv_fpacket<0x0072, 19>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + { - account_id = wrap<AccountId>(RFIFOL(s, 2)); + account_id = fixed.account_id; } - else - return; // Not the auth packet - WFIFOL(s, 0) = unwrap<AccountId>(account_id); - WFIFOSET(s, 4); + // formerly: account id + Packet_Payload<0x8000> special; + special.magic_packet_length = 4; + send_ppacket<0x8000>(s, special); // if same account already connected, we disconnect the 2 sessions dumb_ptr<map_session_data> old_sd = map_id2sd(account_to_block(account_id)); @@ -3400,16 +3385,16 @@ void clif_parse_WantToConnection(Session *s, dumb_ptr<map_session_data> sd) s->session_data.reset(sd.operator->()); sd->sess = s; - pc_setnewpc(sd, account_id, wrap<CharId>(RFIFOL(s, 6)), RFIFOL(s, 10), - tick_t(static_cast<interval_t>(RFIFOL(s, 14))), - static_cast<SEX>(RFIFOB(s, 18))); + pc_setnewpc(sd, account_id, fixed.char_id, fixed.login_id1, + fixed.client_tick, + fixed.sex); map_addiddb(sd); chrif_authreq(sd); } - return; + return RecvResult::Complete; } /*========================================== @@ -3418,12 +3403,15 @@ void clif_parse_WantToConnection(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_LoadEndAck(Session *, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_LoadEndAck(Session *s, dumb_ptr<map_session_data> sd) { - nullpo_retv(sd); - if (sd->bl_prev != NULL) - return; + return RecvResult::Error; + + Packet_Fixed<0x007d> fixed; + RecvResult rv = recv_fpacket<0x007d, 2>(s, fixed); + if (rv != RecvResult::Complete) + return rv; // 接続ok時 //clif_authok(); @@ -3505,6 +3493,8 @@ void clif_parse_LoadEndAck(Session *, dumb_ptr<map_session_data> sd) if (!sd->state.seen_motd) pc_show_motd(sd); + + return rv; } /*========================================== @@ -3512,13 +3502,18 @@ void clif_parse_LoadEndAck(Session *, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_TickSend(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_TickSend(Session *s, dumb_ptr<map_session_data> sd) { - nullpo_retv(sd); + Packet_Fixed<0x007e> fixed; + RecvResult rv = recv_fpacket<0x007e, 6>(s, fixed); + if (rv != RecvResult::Complete) + return rv; - sd->client_tick = tick_t(static_cast<interval_t>(RFIFOL(s, 2))); - sd->server_tick = gettick(); + uint32_t client_tick = fixed.client_tick; + (void)client_tick; clif_servertick(sd); + + return rv; } /*========================================== @@ -3526,55 +3521,68 @@ void clif_parse_TickSend(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_WalkToXY(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_WalkToXY(Session *s, dumb_ptr<map_session_data> sd) { - int x, y; - - nullpo_retv(sd); + Packet_Fixed<0x0085> fixed; + RecvResult rv = recv_fpacket<0x0085, 5>(s, fixed); + if (rv != RecvResult::Complete) + return rv; if (pc_isdead(sd)) { clif_clearchar(sd, BeingRemoveWhy::DEAD); - return; + return rv; } if (sd->npc_id || sd->state.storage_open) - return; + return rv; if (sd->canmove_tick > gettick()) - return; + return rv; // ステータス異常やハイディング中(トンネルドライブ無)で動けない if (bool(sd->opt1) && sd->opt1 != (Opt1::_stone6)) - return; + return rv; if (sd->invincible_timer) pc_delinvincibletimer(sd); pc_stopattack(sd); - x = RFIFOB(s, 2) * 4 + (RFIFOB(s, 3) >> 6); - y = ((RFIFOB(s, 3) & 0x3f) << 4) + (RFIFOB(s, 4) >> 4); + int x = fixed.pos.x; + int y = fixed.pos.y; pc_walktoxy(sd, x, y); + return rv; } /*========================================== * *------------------------------------------ */ -void clif_parse_QuitGame(Session *s, dumb_ptr<map_session_data> sd) +static +RecvResult clif_parse_QuitGame(Session *s, dumb_ptr<map_session_data> sd) { - tick_t tick = gettick(); + Packet_Fixed<0x018a> fixed; + RecvResult rv = recv_fpacket<0x018a, 4>(s, fixed); + if (rv != RecvResult::Complete) + return rv; - nullpo_retv(sd); + clif_do_quit_game(s, sd); + return rv; +} + +void clif_do_quit_game(Session *s, dumb_ptr<map_session_data> sd) +{ - WFIFOW(s, 0) = 0x18b; + tick_t tick = gettick(); + + Packet_Fixed<0x018b> fixed_18b; if ((!pc_isdead(sd) && (sd->opt1 != Opt1::ZERO || sd->opt2 != Opt2::ZERO)) || (tick < sd->canact_tick)) { - WFIFOW(s, 2) = 1; - WFIFOSET(s, clif_parse_func_table[0x18b].len); + fixed_18b.okay = 1; + send_fpacket<0x018b, 4>(s, fixed_18b); return; } @@ -3583,14 +3591,13 @@ void clif_parse_QuitGame(Session *s, dumb_ptr<map_session_data> sd) || tick >= sd->canlog_tick + std::chrono::seconds(10)) { clif_setwaitclose(s); - WFIFOW(s, 2) = 0; + fixed_18b.okay = 0; } else { - WFIFOW(s, 2) = 1; + fixed_18b.okay = 1; } - WFIFOSET(s, clif_parse_func_table[0x18b].len); - + send_fpacket<0x018b, 4>(s, fixed_18b); } /*========================================== @@ -3598,18 +3605,23 @@ void clif_parse_QuitGame(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_GetCharNameRequest(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_GetCharNameRequest(Session *s, dumb_ptr<map_session_data> sd) { + Packet_Fixed<0x0094> fixed; + RecvResult rv = recv_fpacket<0x0094, 6>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + dumb_ptr<block_list> bl; BlockId account_id; - account_id = wrap<BlockId>(RFIFOL(s, 2)); + account_id = fixed.block_id; bl = map_id2bl(account_id); if (bl == NULL) - return; + return rv; - WFIFOW(s, 0) = 0x95; - WFIFOL(s, 2) = unwrap<BlockId>(account_id); + Packet_Fixed<0x0095> fixed_95; + fixed_95.block_id = account_id; switch (bl->bl_type) { @@ -3617,13 +3629,13 @@ void clif_parse_GetCharNameRequest(Session *s, dumb_ptr<map_session_data> sd) { dumb_ptr<map_session_data> ssd = bl->is_player(); - nullpo_retv(ssd); + nullpo_retr(rv, ssd); if (ssd->state.shroud_active) - WFIFO_STRING(s, 6, ""_s, 24); + fixed_95.char_name = CharName(); else - WFIFO_STRING(s, 6, ssd->status_key.name.to__actual(), 24); - WFIFOSET(s, clif_parse_func_table[0x95].len); + fixed_95.char_name = ssd->status_key.name; + send_fpacket<0x0095, 30>(s, fixed_95); PartyPair p; @@ -3639,30 +3651,28 @@ void clif_parse_GetCharNameRequest(Session *s, dumb_ptr<map_session_data> sd) if (send) { - WFIFOW(s, 0) = 0x195; - WFIFOL(s, 2) = unwrap<BlockId>(account_id); - WFIFO_STRING(s, 6, party_name, 24); - WFIFO_STRING(s, 30, ""_s, 24); - WFIFO_STRING(s, 54, ""_s, 24); - WFIFO_STRING(s, 78, ""_s, 24); // We send this value twice because the client expects it - WFIFOSET(s, clif_parse_func_table[0x195].len); - + Packet_Fixed<0x0195> fixed_195; + fixed_195.block_id = account_id; + fixed_195.party_name = party_name; + fixed_195.guild_name = ""_s; + fixed_195.guild_pos = ""_s; + fixed_195.guild_pos = ""_s; // We send this value twice because the client expects it + send_fpacket<0x0195, 102>(s, fixed_195); } if (pc_isGM(sd).satisfies(GmLevel::from(static_cast<uint32_t>(battle_config.hack_info_GM_level)))) { IP4Address ip = ssd->get_ip(); - WFIFOW(s, 0) = 0x20C; + Packet_Fixed<0x020c> fixed_20c; // Mask the IP using the char-server password if (battle_config.mask_ip_gms) ip = MD5_ip(ip); - WFIFOL(s, 2) = unwrap<BlockId>(account_id); - WFIFOIP(s, 6) = ip; - WFIFOSET(s, clif_parse_func_table[0x20C].len); + fixed_20c.block_id = account_id; + fixed_20c.ip = ip; + send_fpacket<0x020c, 10>(s, fixed_20c); } - } break; case BL::NPC: @@ -3670,18 +3680,18 @@ void clif_parse_GetCharNameRequest(Session *s, dumb_ptr<map_session_data> sd) NpcName name = bl->is_npc()->name; // [fate] elim hashed out/invisible names for the client auto it = std::find(name.begin(), name.end(), '#'); - WFIFO_STRING(s, 6, name.xislice_h(it), 24); - WFIFOSET(s, clif_parse_func_table[0x95].len); + fixed_95.char_name = stringish<CharName>(name.xislice_h(it)); + send_fpacket<0x0095, 30>(s, fixed_95); } break; case BL::MOB: { dumb_ptr<mob_data> md = bl->is_mob(); - nullpo_retv(md); + nullpo_retr(rv, md); - WFIFO_STRING(s, 6, md->name, 24); - WFIFOSET(s, clif_parse_func_table[0x95].len); + fixed_95.char_name = stringish<CharName>(md->name); + send_fpacket<0x0095, 30>(s, fixed_95); } break; default: @@ -3690,6 +3700,8 @@ void clif_parse_GetCharNameRequest(Session *s, dumb_ptr<map_session_data> sd) bl->bl_type, account_id); break; } + + return rv; } /*========================================== @@ -3700,19 +3712,22 @@ void clif_parse_GetCharNameRequest(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_GlobalMessage(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_GlobalMessage(Session *s, dumb_ptr<map_session_data> sd) { - nullpo_retv(sd); + AString repeat; + RecvResult rv = recv_packet_repeatonly<0x008c, 4, 1>(s, repeat); + if (rv != RecvResult::Complete) + return rv; - AString mbuf = clif_validate_chat(sd, ChatType::Global); + AString mbuf = clif_validate_chat(sd, ChatType::Global, repeat); if (!mbuf) { clif_displaymessage(s, "Your message could not be sent."_s); - return; + return rv; } if (is_atcommand(s, sd, mbuf, GmLevel())) - return; + return rv; if (!magic_message(sd, mbuf)) { @@ -3720,43 +3735,37 @@ void clif_parse_GlobalMessage(Session *s, dumb_ptr<map_session_data> sd) if (tmw_CheckChatSpam(sd, mbuf)) { clif_displaymessage(s, "Your message could not be sent."_s); - return; + return rv; } /* It's not a spell/magic message, so send the message to others. */ - size_t mbuf_size = mbuf.size() + 1; - uint8_t sendbuf[mbuf_size + 8]; - WBUFW(sendbuf, 0) = 0x8d; - WBUFW(sendbuf, 2) = mbuf_size + 8; /* Header(2) + length(2) + ID(4). */ - WBUFL(sendbuf, 4) = unwrap<BlockId>(sd->bl_id); - WBUF_STRING(sendbuf, 8, mbuf, mbuf_size); - - clif_send(sendbuf, mbuf_size + 8, sd, SendWho::AREA_CHAT_WOC); + Packet_Head<0x008d> head_8d; + head_8d.block_id = sd->bl_id; + XString repeat_8d = mbuf; + Buffer sendbuf = create_vpacket<0x008d, 8, 1>(head_8d, repeat_8d); + + clif_send(sendbuf, sd, SendWho::AREA_CHAT_WOC); } /* Send the message back to the speaker. */ - size_t len = RFIFOW(s, 2); - RFIFO_WFIFO_CLONE(s, s, len); - WFIFOW(s, 0) = 0x8e; - WFIFOSET(s, len); + send_packet_repeatonly<0x008e, 4, 1>(s, repeat); + + return rv; } void clif_message(dumb_ptr<block_list> bl, XString msg) { size_t msg_len = msg.size() + 1; - uint8_t buf[512]; - if (msg_len + 16 > 512) return; nullpo_retv(bl); - WBUFW(buf, 0) = 0x8d; - WBUFW(buf, 2) = msg_len + 8; - WBUFL(buf, 4) = unwrap<BlockId>(bl->bl_id); - WBUF_STRING(buf, 8, msg, msg_len); + Packet_Head<0x008d> head_8d; + head_8d.block_id = bl->bl_id; + Buffer buf = create_vpacket<0x008d, 8, 1>(head_8d, msg); - clif_send(buf, WBUFW(buf, 2), bl, SendWho::AREA); + clif_send(buf, bl, SendWho::AREA); } /*========================================== @@ -3764,16 +3773,17 @@ void clif_message(dumb_ptr<block_list> bl, XString msg) *------------------------------------------ */ static -void clif_parse_ChangeDir(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_ChangeDir(Session *s, dumb_ptr<map_session_data> sd) { - unsigned char buf[64]; + Packet_Fixed<0x009b> fixed; + RecvResult rv = recv_fpacket<0x009b, 5>(s, fixed); + if (rv != RecvResult::Complete) + return rv; - nullpo_retv(sd); - - // RFIFOW(fd, 2) and WBUFW(buf, 6) are always 0 + // RFIFOW(fd,2) and WBUFW(buf,6) are always 0 // TODO perhaps we could use that to remove this hack? DIR dir; - uint8_t client_dir = RFIFOB(s, 4); + uint8_t client_dir = fixed.client_dir; // the client uses a diffenent direction enum ... ugh switch (client_dir) { @@ -3786,21 +3796,22 @@ void clif_parse_ChangeDir(Session *s, dumb_ptr<map_session_data> sd) case 0 | 8: dir = DIR::E; break; // right case 1 | 8: dir = DIR::SE; break; default: - return; + return rv; } if (dir == sd->dir) - return; + return rv; pc_setdir(sd, dir); - WBUFW(buf, 0) = 0x9c; - WBUFL(buf, 2) = unwrap<BlockId>(sd->bl_id); - WBUFW(buf, 6) = 0; - WBUFB(buf, 8) = client_dir; + Packet_Fixed<0x009c> fixed_9c; + fixed_9c.block_id = sd->bl_id; + fixed_9c.client_dir = client_dir; + Buffer buf = create_fpacket<0x009c, 9>(fixed_9c); - clif_send(buf, clif_parse_func_table[0x9c].len, sd, SendWho::AREA_WOS); + clif_send(buf, sd, SendWho::AREA_WOS); + return rv; } /*========================================== @@ -3808,23 +3819,27 @@ void clif_parse_ChangeDir(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_Emotion(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_Emotion(Session *s, dumb_ptr<map_session_data> sd) { - unsigned char buf[64]; - - nullpo_retv(sd); + Packet_Fixed<0x00bf> fixed; + RecvResult rv = recv_fpacket<0x00bf, 3>(s, fixed); + if (rv != RecvResult::Complete) + return rv; if (battle_config.basic_skill_check == 0 || pc_checkskill(sd, SkillID::NV_EMOTE) >= 1) { - uint8_t emote = RFIFOB(s, 2); - WBUFW(buf, 0) = 0xc0; - WBUFL(buf, 2) = unwrap<BlockId>(sd->bl_id); - WBUFB(buf, 6) = emote; - clif_send(buf, clif_parse_func_table[0xc0].len, sd, SendWho::AREA); + uint8_t emote = fixed.emote; + Packet_Fixed<0x00c0> fixed_c0; + fixed_c0.block_id = sd->bl_id; + fixed_c0.type = emote; + Buffer buf = create_fpacket<0x00c0, 7>(fixed_c0); + clif_send(buf, sd, SendWho::AREA); } else clif_skill_fail(sd, SkillID::ONE, 0, 1); + + return rv; } /*========================================== @@ -3832,11 +3847,18 @@ void clif_parse_Emotion(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_HowManyConnections(Session *s, dumb_ptr<map_session_data>) +RecvResult clif_parse_HowManyConnections(Session *s, dumb_ptr<map_session_data>) { - WFIFOW(s, 0) = 0xc2; - WFIFOL(s, 2) = map_getusers(); - WFIFOSET(s, clif_parse_func_table[0xc2].len); + Packet_Fixed<0x00c1> fixed; + RecvResult rv = recv_fpacket<0x00c1, 2>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + + Packet_Fixed<0x00c2> fixed_c2; + fixed_c2.users = map_getusers(); + send_fpacket<0x00c2, 6>(s, fixed_c2); + + return rv; } /*========================================== @@ -3844,64 +3866,69 @@ void clif_parse_HowManyConnections(Session *s, dumb_ptr<map_session_data>) *------------------------------------------ */ static -void clif_parse_ActionRequest(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_ActionRequest(Session *s, dumb_ptr<map_session_data> sd) { - unsigned char buf[64]; - int action_type; - BlockId target_id; + Packet_Fixed<0x0089> fixed; + RecvResult rv = recv_fpacket<0x0089, 7>(s, fixed); + if (rv != RecvResult::Complete) + return rv; - nullpo_retv(sd); + DamageType action_type; + BlockId target_id; if (pc_isdead(sd)) { clif_clearchar(sd, BeingRemoveWhy::DEAD); - return; + return rv; } if (sd->npc_id || bool(sd->opt1) || sd->state.storage_open) - return; + return rv; tick_t tick = gettick(); pc_stop_walking(sd, 0); pc_stopattack(sd); - target_id = wrap<BlockId>(RFIFOL(s, 2)); - action_type = RFIFOB(s, 6); + target_id = fixed.target_id; + action_type = fixed.action; switch (action_type) { - case 0x00: // once attack - case 0x07: // continuous attack + case DamageType::NORMAL: + case DamageType::CONTINUOUS: if (bool(sd->status.option & Option::HIDE)) - return; + return rv; if (!battle_config.skill_delay_attack_enable) { if (tick < sd->canact_tick) { clif_skill_fail(sd, SkillID::ONE, 4, 0); - return; + return rv; } } if (sd->invincible_timer) pc_delinvincibletimer(sd); sd->attacktarget = BlockId(); - pc_attack(sd, target_id, action_type != 0); + pc_attack(sd, target_id, action_type != DamageType::NORMAL); break; - case 0x02: // sitdown + case DamageType::SIT: pc_stop_walking(sd, 1); pc_setsit(sd); clif_sitting(s, sd); break; - case 0x03: // standup + case DamageType::STAND: pc_setstand(sd); - WBUFW(buf, 0) = 0x8a; - WBUFL(buf, 2) = unwrap<BlockId>(sd->bl_id); - WBUFB(buf, 26) = 3; - clif_send(buf, clif_parse_func_table[0x8a].len, sd, SendWho::AREA); + Packet_Fixed<0x008a> fixed_8a; + fixed_8a.src_id = sd->bl_id; + fixed_8a.damage_type = DamageType::STAND; + Buffer buf = create_fpacket<0x008a, 29>(fixed_8a); + clif_send(buf, sd, SendWho::AREA); break; } + + return rv; } /*========================================== @@ -3909,11 +3936,14 @@ void clif_parse_ActionRequest(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_Restart(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_Restart(Session *s, dumb_ptr<map_session_data> sd) { - nullpo_retv(sd); + Packet_Fixed<0x00b2> fixed; + RecvResult rv = recv_fpacket<0x00b2, 3>(s, fixed); + if (rv != RecvResult::Complete) + return rv; - switch (RFIFOB(s, 2)) + switch (fixed.flag) { case 0x00: if (pc_isdead(sd)) @@ -3943,13 +3973,15 @@ void clif_parse_Restart(Session *s, dumb_ptr<map_session_data> sd) } else { - WFIFOW(s, 0) = 0x18b; - WFIFOW(s, 2) = 1; + Packet_Fixed<0x018b> fixed_18b; + fixed_18b.okay = 1; - WFIFOSET(s, clif_parse_func_table[0x018b].len); + send_fpacket<0x018b, 4>(s, fixed_18b); } break; } + + return rv; } /*========================================== @@ -3963,29 +3995,33 @@ void clif_parse_Restart(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_Wis(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_Wis(Session *s, dumb_ptr<map_session_data> sd) { - dumb_ptr<map_session_data> dstsd = NULL; + Packet_Head<0x0096> head; + AString repeat; + RecvResult rv = recv_vpacket<0x0096, 28, 1>(s, head, repeat); + if (rv != RecvResult::Complete) + return rv; - nullpo_retv(sd); + dumb_ptr<map_session_data> dstsd = NULL; - AString mbuf = clif_validate_chat(sd, ChatType::Whisper); + AString mbuf = clif_validate_chat(sd, ChatType::Whisper, repeat); if (!mbuf) { clif_displaymessage(s, "Your message could not be sent."_s); - return; + return rv; } if (is_atcommand(s, sd, mbuf, GmLevel())) { - return; + return rv; } /* Don't send chat that results in an automatic ban. */ if (tmw_CheckChatSpam(sd, mbuf)) { clif_displaymessage(s, "Your message could not be sent."_s); - return; + return rv; } /* @@ -3994,7 +4030,7 @@ void clif_parse_Wis(Session *s, dumb_ptr<map_session_data> sd) * conflict (for instance, "Test" versus "test"), the char-server must * settle the discrepancy. */ - CharName tname = stringish<CharName>(RFIFO_STRING<24>(s, 4)); + CharName tname = head.target_name; if (!(dstsd = map_nick2sd(tname)) || dstsd->status_key.name != tname) intif_wis_message(sd, tname, mbuf); @@ -4018,6 +4054,8 @@ void clif_parse_Wis(Session *s, dumb_ptr<map_session_data> sd) } } } + + return rv; } /*========================================== @@ -4025,36 +4063,41 @@ void clif_parse_Wis(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_TakeItem(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_TakeItem(Session *s, dumb_ptr<map_session_data> sd) { - dumb_ptr<flooritem_data> fitem; + Packet_Fixed<0x009f> fixed; + RecvResult rv = recv_fpacket<0x009f, 6>(s, fixed); + if (rv != RecvResult::Complete) + return rv; - nullpo_retv(sd); + dumb_ptr<flooritem_data> fitem; - BlockId map_object_id = wrap<BlockId>(RFIFOL(s, 2)); + BlockId map_object_id = fixed.object_id; fitem = map_id_is_item(map_object_id); if (pc_isdead(sd)) { clif_clearchar(sd, BeingRemoveWhy::DEAD); - return; + return rv; } if (sd->npc_id || sd->opt1 != Opt1::ZERO) //会話禁止 - return; + return rv; if (fitem == NULL || fitem->bl_m != sd->bl_m) - return; + return rv; if (abs(sd->bl_x - fitem->bl_x) >= 2 || abs(sd->bl_y - fitem->bl_y) >= 2) - return; // too far away to pick up + return rv; // too far away to pick up if (sd->state.shroud_active && sd->state.shroud_disappears_on_pickup) magic_unshroud(sd); pc_takeitem(sd, fitem); + + return rv; } /*========================================== @@ -4062,33 +4105,38 @@ void clif_parse_TakeItem(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_DropItem(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_DropItem(Session *s, dumb_ptr<map_session_data> sd) { - int item_index, item_amount; + Packet_Fixed<0x00a2> fixed; + RecvResult rv = recv_fpacket<0x00a2, 6>(s, fixed); + if (rv != RecvResult::Complete) + return rv; - nullpo_retv(sd); + int item_index, item_amount; if (pc_isdead(sd)) { clif_clearchar(sd, BeingRemoveWhy::DEAD); - return; + return rv; } if (sd->bl_m->flag.get(MapFlag::NO_PLAYER_DROPS)) { clif_displaymessage(sd->sess, "Can't drop items here."_s); - return; + return rv; } if (sd->npc_id || sd->opt1 != Opt1::ZERO) { clif_displaymessage(sd->sess, "Can't drop items right now."_s); - return; + return rv; } - item_index = RFIFOW(s, 2) - 2; - item_amount = RFIFOW(s, 4); + item_index = fixed.ioff2 - 2; + item_amount = fixed.amount; pc_dropitem(sd, item_index, item_amount); + + return rv; } /*========================================== @@ -4096,23 +4144,28 @@ void clif_parse_DropItem(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_UseItem(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_UseItem(Session *s, dumb_ptr<map_session_data> sd) { - nullpo_retv(sd); + Packet_Fixed<0x00a7> fixed; + RecvResult rv = recv_fpacket<0x00a7, 8>(s, fixed); + if (rv != RecvResult::Complete) + return rv; if (pc_isdead(sd)) { clif_clearchar(sd, BeingRemoveWhy::DEAD); - return; + return rv; } if (sd->npc_id || sd->opt1 != Opt1::ZERO) //会話禁止 - return; + return rv; if (sd->invincible_timer) pc_delinvincibletimer(sd); - pc_useitem(sd, RFIFOW(s, 2) - 2); + pc_useitem(sd, fixed.ioff2 - 2); + + return rv; } /*========================================== @@ -4120,30 +4173,35 @@ void clif_parse_UseItem(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_EquipItem(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_EquipItem(Session *s, dumb_ptr<map_session_data> sd) { - int index; + Packet_Fixed<0x00a9> fixed; + RecvResult rv = recv_fpacket<0x00a9, 6>(s, fixed); + if (rv != RecvResult::Complete) + return rv; - nullpo_retv(sd); + int index; if (pc_isdead(sd)) { clif_clearchar(sd, BeingRemoveWhy::DEAD); - return; + return rv; } - index = RFIFOW(s, 2) - 2; + index = fixed.ioff2 - 2; if (sd->npc_id) - return; + return rv; if (sd->inventory_data[index]) { - EPOS epos = EPOS(RFIFOW(s, 4)); + EPOS epos = fixed.epos_ignored; if (sd->inventory_data[index]->type == ItemType::ARROW) epos = EPOS::ARROW; // Note: the EPOS argument to pc_equipitem is actually ignored pc_equipitem(sd, index, epos); } + + return rv; } /*========================================== @@ -4151,23 +4209,28 @@ void clif_parse_EquipItem(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_UnequipItem(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_UnequipItem(Session *s, dumb_ptr<map_session_data> sd) { - int index; + Packet_Fixed<0x00ab> fixed; + RecvResult rv = recv_fpacket<0x00ab, 4>(s, fixed); + if (rv != RecvResult::Complete) + return rv; - nullpo_retv(sd); + int index; if (pc_isdead(sd)) { clif_clearchar(sd, BeingRemoveWhy::DEAD); - return; + return rv; } - index = RFIFOW(s, 2) - 2; + index = fixed.ioff2 - 2; if (sd->npc_id || sd->opt1 != Opt1::ZERO) - return; + return rv; pc_unequipitem(sd, index, CalcStatus::NOW); + + return rv; } /*========================================== @@ -4175,18 +4238,23 @@ void clif_parse_UnequipItem(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_NpcClicked(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_NpcClicked(Session *s, dumb_ptr<map_session_data> sd) { - nullpo_retv(sd); + Packet_Fixed<0x0090> fixed; + RecvResult rv = recv_fpacket<0x0090, 7>(s, fixed); + if (rv != RecvResult::Complete) + return rv; if (pc_isdead(sd)) { clif_clearchar(sd, BeingRemoveWhy::DEAD); - return; + return rv; } if (sd->npc_id) - return; - npc_click(sd, wrap<BlockId>(RFIFOL(s, 2))); + return rv; + npc_click(sd, fixed.block_id); + + return rv; } /*========================================== @@ -4194,9 +4262,16 @@ void clif_parse_NpcClicked(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_NpcBuySellSelected(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_NpcBuySellSelected(Session *s, dumb_ptr<map_session_data> sd) { - npc_buysellsel(sd, wrap<BlockId>(RFIFOL(s, 2)), RFIFOB(s, 6)); + Packet_Fixed<0x00c5> fixed; + RecvResult rv = recv_fpacket<0x00c5, 7>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + + npc_buysellsel(sd, fixed.block_id, fixed.type); + + return rv; } /*========================================== @@ -4204,17 +4279,20 @@ void clif_parse_NpcBuySellSelected(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_NpcBuyListSend(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_NpcBuyListSend(Session *s, dumb_ptr<map_session_data> sd) { - int n = (RFIFOW(s, 2) - 4) / 4; - // really an array of pairs of uint16_t - const uint16_t *item_list = static_cast<const uint16_t *>(RFIFOP(s, 4)); + std::vector<Packet_Repeat<0x00c8>> repeat; + RecvResult rv = recv_packet_repeatonly<0x00c8, 4, 4>(s, repeat); + if (rv != RecvResult::Complete) + return rv; + + int fail = npc_buylist(sd, repeat); - int fail = npc_buylist(sd, n, item_list); + Packet_Fixed<0x00ca> fixed_ca; + fixed_ca.fail = fail; + send_fpacket<0x00ca, 3>(s, fixed_ca); - WFIFOW(s, 0) = 0xca; - WFIFOB(s, 2) = fail; - WFIFOSET(s, clif_parse_func_table[0xca].len); + return rv; } /*========================================== @@ -4222,17 +4300,20 @@ void clif_parse_NpcBuyListSend(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_NpcSellListSend(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_NpcSellListSend(Session *s, dumb_ptr<map_session_data> sd) { - int n = (RFIFOW(s, 2) - 4) / 4; - // really an array of pairs of uint16_t - const uint16_t *item_list = static_cast<const uint16_t *>(RFIFOP(s, 4)); + std::vector<Packet_Repeat<0x00c9>> repeat; + RecvResult rv = recv_packet_repeatonly<0x00c9, 4, 4>(s, repeat); + if (rv != RecvResult::Complete) + return rv; + + int fail = npc_selllist(sd, repeat); - int fail = npc_selllist(sd, n, item_list); + Packet_Fixed<0x00cb> fixed_cb; + fixed_cb.fail = fail; + send_fpacket<0x00cb, 3>(s, fixed_cb); - WFIFOW(s, 0) = 0xcb; - WFIFOB(s, 2) = fail; - WFIFOSET(s, clif_parse_func_table[0xcb].len); + return rv; } /*========================================== @@ -4240,17 +4321,22 @@ void clif_parse_NpcSellListSend(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_TradeRequest(Session *, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_TradeRequest(Session *s, dumb_ptr<map_session_data> sd) { - nullpo_retv(sd); + Packet_Fixed<0x00e4> fixed; + RecvResult rv = recv_fpacket<0x00e4, 6>(s, fixed); + if (rv != RecvResult::Complete) + return rv; if (battle_config.basic_skill_check == 0 || pc_checkskill(sd, SkillID::NV_TRADE) >= 1) { - trade_traderequest(sd, wrap<BlockId>(RFIFOL(sd->sess, 2))); + trade_traderequest(sd, fixed.block_id); } else clif_skill_fail(sd, SkillID::ONE, 0, 0); + + return rv; } /*========================================== @@ -4258,11 +4344,16 @@ void clif_parse_TradeRequest(Session *, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_TradeAck(Session *, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_TradeAck(Session *s, dumb_ptr<map_session_data> sd) { - nullpo_retv(sd); + Packet_Fixed<0x00e6> fixed; + RecvResult rv = recv_fpacket<0x00e6, 3>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + + trade_tradeack(sd, fixed.type); - trade_tradeack(sd, RFIFOB(sd->sess, 2)); + return rv; } /*========================================== @@ -4270,11 +4361,16 @@ void clif_parse_TradeAck(Session *, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_TradeAddItem(Session *, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_TradeAddItem(Session *s, dumb_ptr<map_session_data> sd) { - nullpo_retv(sd); + Packet_Fixed<0x00e8> fixed; + RecvResult rv = recv_fpacket<0x00e8, 8>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + + trade_tradeadditem(sd, fixed.zeny_or_ioff2, fixed.amount); - trade_tradeadditem(sd, RFIFOW(sd->sess, 2), RFIFOL(sd->sess, 4)); + return rv; } /*========================================== @@ -4282,9 +4378,16 @@ void clif_parse_TradeAddItem(Session *, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_TradeOk(Session *, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_TradeOk(Session *s, dumb_ptr<map_session_data> sd) { + Packet_Fixed<0x00eb> fixed; + RecvResult rv = recv_fpacket<0x00eb, 2>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + trade_tradeok(sd); + + return rv; } /*========================================== @@ -4292,9 +4395,16 @@ void clif_parse_TradeOk(Session *, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_TradeCansel(Session *, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_TradeCansel(Session *s, dumb_ptr<map_session_data> sd) { + Packet_Fixed<0x00ed> fixed; + RecvResult rv = recv_fpacket<0x00ed, 2>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + trade_tradecancel(sd); + + return rv; } /*========================================== @@ -4302,9 +4412,16 @@ void clif_parse_TradeCansel(Session *, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_TradeCommit(Session *, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_TradeCommit(Session *s, dumb_ptr<map_session_data> sd) { + Packet_Fixed<0x00ef> fixed; + RecvResult rv = recv_fpacket<0x00ef, 2>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + trade_tradecommit(sd); + + return rv; } /*========================================== @@ -4312,9 +4429,16 @@ void clif_parse_TradeCommit(Session *, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_StopAttack(Session *, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_StopAttack(Session *s, dumb_ptr<map_session_data> sd) { + Packet_Fixed<0x0118> fixed; + RecvResult rv = recv_fpacket<0x0118, 2>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + pc_stopattack(sd); + + return rv; } /*========================================== @@ -4322,9 +4446,16 @@ void clif_parse_StopAttack(Session *, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_StatusUp(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_StatusUp(Session *s, dumb_ptr<map_session_data> sd) { - pc_statusup(sd, static_cast<SP>(RFIFOW(s, 2))); + Packet_Fixed<0x00bb> fixed; + RecvResult rv = recv_fpacket<0x00bb, 5>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + + pc_statusup(sd, fixed.asp); + + return rv; } /*========================================== @@ -4332,9 +4463,16 @@ void clif_parse_StatusUp(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_SkillUp(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_SkillUp(Session *s, dumb_ptr<map_session_data> sd) { - pc_skillup(sd, SkillID(RFIFOW(s, 2))); + Packet_Fixed<0x0112> fixed; + RecvResult rv = recv_fpacket<0x0112, 4>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + + pc_skillup(sd, fixed.skill_id); + + return rv; } /*========================================== @@ -4342,12 +4480,17 @@ void clif_parse_SkillUp(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_NpcSelectMenu(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_NpcSelectMenu(Session *s, dumb_ptr<map_session_data> sd) { - nullpo_retv(sd); + Packet_Fixed<0x00b8> fixed; + RecvResult rv = recv_fpacket<0x00b8, 7>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + + sd->npc_menu = fixed.menu_entry; + map_scriptcont(sd, fixed.npc_id); - sd->npc_menu = RFIFOB(s, 6); - map_scriptcont(sd, wrap<BlockId>(RFIFOL(s, 2))); + return rv; } /*========================================== @@ -4355,9 +4498,16 @@ void clif_parse_NpcSelectMenu(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_NpcNextClicked(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_NpcNextClicked(Session *s, dumb_ptr<map_session_data> sd) { - map_scriptcont(sd, wrap<BlockId>(RFIFOL(s, 2))); + Packet_Fixed<0x00b9> fixed; + RecvResult rv = recv_fpacket<0x00b9, 6>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + + map_scriptcont(sd, fixed.npc_id); + + return rv; } /*========================================== @@ -4365,12 +4515,17 @@ void clif_parse_NpcNextClicked(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_NpcAmountInput(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_NpcAmountInput(Session *s, dumb_ptr<map_session_data> sd) { - nullpo_retv(sd); + Packet_Fixed<0x0143> fixed; + RecvResult rv = recv_fpacket<0x0143, 10>(s, fixed); + if (rv != RecvResult::Complete) + return rv; - sd->npc_amount = RFIFOL(s, 6); - map_scriptcont(sd, wrap<BlockId>(RFIFOL(s, 2))); + sd->npc_amount = fixed.input_int_value; + map_scriptcont(sd, fixed.block_id); + + return rv; } /*========================================== @@ -4380,22 +4535,19 @@ void clif_parse_NpcAmountInput(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_NpcStringInput(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_NpcStringInput(Session *s, dumb_ptr<map_session_data> sd) { - int len; - nullpo_retv(sd); + Packet_Head<0x01d5> head; + AString repeat; + RecvResult rv = recv_vpacket<0x01d5, 8, 1>(s, head, repeat); + if (rv != RecvResult::Complete) + return rv; - len = RFIFOW(s, 2) - 8; + sd->npc_str = repeat; - /* - * If we check for equal to 0, too, we'll freeze clients that send (or - * claim to have sent) an "empty" message. - */ - if (len < 0) - return; - sd->npc_str = RFIFO_STRING(s, 8, len); + map_scriptcont(sd, head.block_id); - map_scriptcont(sd, wrap<BlockId>(RFIFOL(s, 4))); + return rv; } /*========================================== @@ -4403,9 +4555,16 @@ void clif_parse_NpcStringInput(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_NpcCloseClicked(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_NpcCloseClicked(Session *s, dumb_ptr<map_session_data> sd) { - map_scriptcont(sd, wrap<BlockId>(RFIFOL(s, 2))); + Packet_Fixed<0x0146> fixed; + RecvResult rv = recv_fpacket<0x0146, 6>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + + map_scriptcont(sd, fixed.block_id); + + return rv; } /*========================================== @@ -4413,21 +4572,26 @@ void clif_parse_NpcCloseClicked(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_MoveToKafra(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_MoveToKafra(Session *s, dumb_ptr<map_session_data> sd) { - int item_index, item_amount; + Packet_Fixed<0x00f3> fixed; + RecvResult rv = recv_fpacket<0x00f3, 8>(s, fixed); + if (rv != RecvResult::Complete) + return rv; - nullpo_retv(sd); + int item_index, item_amount; - item_index = RFIFOW(s, 2) - 2; - item_amount = RFIFOL(s, 4); + item_index = fixed.ioff2 - 2; + item_amount = fixed.amount; if ((sd->npc_id && !sd->npc_flags.storage) || sd->trade_partner || !sd->state.storage_open) - return; + return rv; if (sd->state.storage_open) storage_storageadd(sd, item_index, item_amount); + + return rv; } /*========================================== @@ -4435,21 +4599,26 @@ void clif_parse_MoveToKafra(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_MoveFromKafra(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_MoveFromKafra(Session *s, dumb_ptr<map_session_data> sd) { - int item_index, item_amount; + Packet_Fixed<0x00f5> fixed; + RecvResult rv = recv_fpacket<0x00f5, 8>(s, fixed); + if (rv != RecvResult::Complete) + return rv; - nullpo_retv(sd); + int item_index, item_amount; - item_index = RFIFOW(s, 2) - 1; - item_amount = RFIFOL(s, 4); + item_index = fixed.soff1 - 1; + item_amount = fixed.amount; if ((sd->npc_id && !sd->npc_flags.storage) || sd->trade_partner || !sd->state.storage_open) - return; + return rv; if (sd->state.storage_open) storage_storageget(sd, item_index, item_amount); + + return rv; } /*========================================== @@ -4457,12 +4626,17 @@ void clif_parse_MoveFromKafra(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_CloseKafra(Session *, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_CloseKafra(Session *s, dumb_ptr<map_session_data> sd) { - nullpo_retv(sd); + Packet_Fixed<0x00f7> fixed; + RecvResult rv = recv_fpacket<0x00f7, 2>(s, fixed); + if (rv != RecvResult::Complete) + return rv; if (sd->state.storage_open) storage_storageclose(sd); + + return rv; } /*========================================== @@ -4473,16 +4647,23 @@ void clif_parse_CloseKafra(Session *, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_CreateParty(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_CreateParty(Session *s, dumb_ptr<map_session_data> sd) { + Packet_Fixed<0x00f9> fixed; + RecvResult rv = recv_fpacket<0x00f9, 26>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + if (battle_config.basic_skill_check == 0 || pc_checkskill(sd, SkillID::NV_PARTY) >= 2) { - PartyName name = stringish<PartyName>(RFIFO_STRING<24>(s, 2)); + PartyName name = fixed.party_name; party_create(sd, name); } else clif_skill_fail(sd, SkillID::ONE, 0, 4); + + return rv; } /*========================================== @@ -4493,9 +4674,16 @@ void clif_parse_CreateParty(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_PartyInvite(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_PartyInvite(Session *s, dumb_ptr<map_session_data> sd) { - party_invite(sd, wrap<AccountId>(RFIFOL(s, 2))); + Packet_Fixed<0x00fc> fixed; + RecvResult rv = recv_fpacket<0x00fc, 6>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + + party_invite(sd, fixed.account_id); + + return rv; } /*========================================== @@ -4506,18 +4694,25 @@ void clif_parse_PartyInvite(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_ReplyPartyInvite(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_ReplyPartyInvite(Session *s, dumb_ptr<map_session_data> sd) { + Packet_Fixed<0x00ff> fixed; + RecvResult rv = recv_fpacket<0x00ff, 10>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + if (battle_config.basic_skill_check == 0 || pc_checkskill(sd, SkillID::NV_PARTY) >= 1) { - party_reply_invite(sd, wrap<AccountId>(RFIFOL(s, 2)), RFIFOL(s, 6)); + party_reply_invite(sd, fixed.account_id, fixed.flag); } else { - party_reply_invite(sd, wrap<AccountId>(RFIFOL(s, 2)), 0); + party_reply_invite(sd, fixed.account_id, 0); clif_skill_fail(sd, SkillID::ONE, 0, 4); } + + return rv; } /*========================================== @@ -4525,9 +4720,16 @@ void clif_parse_ReplyPartyInvite(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_LeaveParty(Session *, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_LeaveParty(Session *s, dumb_ptr<map_session_data> sd) { + Packet_Fixed<0x0100> fixed; + RecvResult rv = recv_fpacket<0x0100, 2>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + party_leave(sd); + + return rv; } /*========================================== @@ -4535,11 +4737,18 @@ void clif_parse_LeaveParty(Session *, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_RemovePartyMember(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_RemovePartyMember(Session *s, dumb_ptr<map_session_data> sd) { - AccountId account_id = wrap<AccountId>(RFIFOL(s, 2)); - // unused RFIFO_STRING<24>(fd, 6); + Packet_Fixed<0x0103> fixed; + RecvResult rv = recv_fpacket<0x0103, 30>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + + AccountId account_id = fixed.account_id; + // unused fixed.unusedchar_name; party_removemember(sd, account_id); + + return rv; } /*========================================== @@ -4547,9 +4756,16 @@ void clif_parse_RemovePartyMember(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_PartyChangeOption(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_PartyChangeOption(Session *s, dumb_ptr<map_session_data> sd) { - party_changeoption(sd, RFIFOW(s, 2), RFIFOW(s, 4)); + Packet_Fixed<0x0102> fixed; + RecvResult rv = recv_fpacket<0x0102, 6>(s, fixed); + if (rv != RecvResult::Complete) + return rv; + + party_changeoption(sd, fixed.exp, fixed.item); + + return rv; } /*========================================== @@ -4561,28 +4777,33 @@ void clif_parse_PartyChangeOption(Session *s, dumb_ptr<map_session_data> sd) *------------------------------------------ */ static -void clif_parse_PartyMessage(Session *s, dumb_ptr<map_session_data> sd) +RecvResult clif_parse_PartyMessage(Session *s, dumb_ptr<map_session_data> sd) { - nullpo_retv(sd); + AString repeat; + RecvResult rv = recv_packet_repeatonly<0x0108, 4, 1>(s, repeat); + if (rv != RecvResult::Complete) + return rv; - AString mbuf = clif_validate_chat(sd, ChatType::Party); + AString mbuf = clif_validate_chat(sd, ChatType::Party, repeat); if (!mbuf) { clif_displaymessage(s, "Your message could not be sent."_s); - return; + return rv; } if (is_atcommand(s, sd, mbuf, GmLevel())) - return; + return rv; /* Don't send chat that results in an automatic ban. */ if (tmw_CheckChatSpam(sd, mbuf)) { clif_displaymessage(s, "Your message could not be sent."_s); - return; + return rv; } party_send_message(sd, mbuf); + + return rv; } func_table clif_parse_func_table[0x0220] = @@ -5135,8 +5356,25 @@ func_table clif_parse_func_table[0x0220] = // Checks for packet flooding static -int clif_check_packet_flood(Session *s, int cmd) +uint16_t clif_check_packet_flood(Session *s, int cmd) { + uint16_t len = clif_parse_func_table[cmd].len_unused; + if (len == VAR) + { + Little16 netlen; + if (!packet_fetch(s, 2, reinterpret_cast<Byte *>(&netlen), 2)) + { + return 0; + } + if (!network_to_native(&len, netlen)) + { + s->set_eof(); + return 0; + } + } + if (packet_avail(s) < len) + return 0; + dumb_ptr<map_session_data> sd = dumb_ptr<map_session_data>(static_cast<map_session_data *>(s->session_data.get())); tick_t tick = gettick(); @@ -5162,25 +5400,23 @@ int clif_check_packet_flood(Session *s, int cmd) // ActionRequest - attacks are allowed a faster rate than sit/stand if (cmd == 0x89) { - int action_type = RFIFOB(s, 6); - if (action_type == 0x00 || action_type == 0x07) + DamageType damage_type; + Byte action_type; + if (!packet_fetch(s, 6, &action_type, 1)) + return 0; + if (!network_to_native(&damage_type, action_type)) + { + s->set_eof(); + return 0; + } + if (damage_type == DamageType::NORMAL || damage_type == DamageType::CONTINUOUS) rate = std::chrono::milliseconds(20); else rate = std::chrono::seconds(1); } -// Restore this code when mana1.0 is released -#if 0 - // ChangeDir - only apply limit if not walking - if (cmd == 0x9b) - { - // .29 clients spam this packet when walking into a blocked tile - if (RFIFOB(fd, 4) == sd->dir || sd->walktimer != -1) - return 0; - - rate = 500; - } -#endif + // Restore this code when mana1.0 is released + // nope, nuh-uh // They are flooding if (tick < sd->flood_rates[cmd] + rate) @@ -5202,12 +5438,12 @@ int clif_check_packet_flood(Session *s, int cmd) if (battle_config.packet_spam_kick) { s->set_eof(); - return 1; + return len; } sd->packet_flood_in = 0; } - return 1; + return len; } sd->flood_rates[cmd] = tick; @@ -5231,7 +5467,7 @@ void WARN_MALFORMED_MSG(dumb_ptr<map_session_data> sd, ZString msg) * @return a dynamically allocated copy of the message, or empty string upon failure */ static -AString clif_validate_chat(dumb_ptr<map_session_data> sd, ChatType type) +AString clif_validate_chat(dumb_ptr<map_session_data> sd, ChatType type, XString buf) { nullpo_retr(AString(), sd); /* @@ -5242,54 +5478,8 @@ AString clif_validate_chat(dumb_ptr<map_session_data> sd, ChatType type) return AString(); Session *s = sd->sess; - size_t msg_len = RFIFOW(s, 2) - 4; size_t name_len = sd->status_key.name.to__actual().size(); - /* - * At least one character is required in all instances. - * Notes for length checks: - * - * For all types, header (2) + length (2) is considered empty. - * For type 1, the message must be longer than the maximum name length (24) - * to be valid. - * For type 2, the message must be longer than the sender's name length - * plus the length of the separator (" : "). - */ - size_t min_len = - (type == ChatType::Whisper) ? 24 - : (type == ChatType::Global) ? name_len + 3 - : 0; - - /* The player just sent the header (2) and length (2) words. */ - if (!msg_len) - { - WARN_MALFORMED_MSG(sd, "no message sent"_s); - return AString(); - } - - /* The client sent (or claims to have sent) an empty message. */ - if (msg_len == min_len) - { - WARN_MALFORMED_MSG(sd, "empty message"_s); - return AString(); - } - - /* The protocol specifies that the target must be 24 bytes long. */ - if (type == ChatType::Whisper && msg_len < min_len) - { - /* Disallow malformed messages. */ - clif_setwaitclose(s); - WARN_MALFORMED_MSG(sd, "illegal target name"_s); - return AString(); - } - - size_t pstart = 4; - size_t buf_len = msg_len; - if (type == ChatType::Whisper) - { - pstart += 24; - buf_len -= 24; - } - AString pbuf = RFIFO_STRING(s, pstart, buf_len); + XString pbuf = buf; /* * The client attempted to exceed the maximum message length. @@ -5298,7 +5488,8 @@ AString clif_validate_chat(dumb_ptr<map_session_data> sd, ChatType type) * is truncated. But the previous behavior was to drop the message, so * we'll do that, too. */ - if (buf_len >= battle_config.chat_maxline) + // TODO this cuts global chat short by (name_length + 3) + if (buf.size() >= battle_config.chat_maxline) { WARN_MALFORMED_MSG(sd, "exceeded maximum message length"_s); return AString(); @@ -5329,19 +5520,39 @@ AString clif_validate_chat(dumb_ptr<map_session_data> sd, ChatType type) static void clif_parse(Session *s) { - int packet_len = 0, cmd = 0; + // old code: + // no while loop (can hang if more than one packet) + // handles 0x7530 and 0x7532 specially, also 0x0072 + // checks packet length table + // checks rate limiter + // dispatches to actual function, unchecked + // interstitial code: + // introduces while loop + // checks rate limiter + // dispatches to actual function + // if incomplete, unchecks rate limiter + // if error, close socket + // future code: + // hoists while loop + // treats all packets as variable-length, except a hard-coded list + // reads packet of that length unconditionally into a buffer + // does rate-limit check (hoisted?) + // dispatches to actual function + // if error, close socket + dumb_ptr<map_session_data> sd = dumb_ptr<map_session_data>(static_cast<map_session_data *>(s->session_data.get())); if (!sd || (sd && !sd->state.auth)) { - if (RFIFOREST(s) < 2) - { // too small a packet disconnect - s->set_eof(); - } - if (RFIFOW(s, 0) != 0x72 && RFIFOW(s, 0) != 0x7530) + uint16_t packet_id; + if (!packet_peek_id(s, &packet_id)) + return; + + if (packet_id != 0x0072 && packet_id != 0x7530) { // first packet must be auth or finger s->set_eof(); + return; } } @@ -5350,95 +5561,84 @@ void clif_parse(Session *s) s->set_eof(); return; } - - if (RFIFOREST(s) < 2) - return; // Too small (no packet number) - - cmd = RFIFOW(s, 0); - - // 管理用パケット処理 - if (cmd >= 30000) + if (sd && sd->state.auth == 1 && sd->state.waitingdisconnect == 1) { - switch (cmd) - { - case 0x7530: // Athena情報所得 - WFIFOW(s, 0) = 0x7531; - WFIFO_STRUCT(s, 2, CURRENT_MAP_SERVER_VERSION); - WFIFOSET(s, 10); - RFIFOSKIP(s, 2); - break; - case 0x7532: // 接続の切断 - s->set_eof(); - break; - } + packet_discard(s, packet_avail(s)); return; } - else if (cmd >= 0x200) - return; - // パケット長を計算 - packet_len = clif_parse_func_table[cmd].len; - if (packet_len == VAR) + uint16_t packet_id; + RecvResult rv = RecvResult::Complete; + while (rv == RecvResult::Complete && packet_peek_id(s, &packet_id)) { - if (RFIFOREST(s) < 4) + switch (packet_id) { - return; // Runt packet (variable length without a length sent) + case 0x7530: + { + Packet_Fixed<0x7530> fixed; + rv = recv_fpacket<0x7530, 2>(s, fixed); + if (rv != RecvResult::Complete) + break; + + Packet_Fixed<0x7531> fixed_31; + fixed_31.version = CURRENT_MAP_SERVER_VERSION; + send_fpacket<0x7531, 10>(s, fixed_31); + break; + } + case 0x7532: + { + Packet_Fixed<0x7532> fixed; + rv = recv_fpacket<0x7532, 2>(s, fixed); + if (rv != RecvResult::Complete) + break; + + s->set_eof(); + break; + } } - packet_len = RFIFOW(s, 2); - if (packet_len < 4 || packet_len > 32768) + if (packet_id < 0x0220) { - s->set_eof(); - return; // Runt packet (variable out of bounds) + if (uint16_t len = clif_check_packet_flood(s, packet_id)) + { + // Packet flood: skip packet + packet_discard(s, len); + rv = RecvResult::Complete; + } + else + { + clif_func func = clif_parse_func_table[packet_id].func; + if (!func) + goto unknown_packet; + rv = func(s, sd); + } } + else + goto unknown_packet; } - if (RFIFOREST(s) < packet_len) - { - return; // Runt packet (sent legnth is too small) - } - - if (sd && sd->state.auth == 1 && sd->state.waitingdisconnect == 1) - { // 切断待ちの場合パケットを処理しない - - } - else if (clif_parse_func_table[cmd].func) - { - if (clif_check_packet_flood(s, cmd)) - { - // Flood triggered. Skip packet. - RFIFOSKIP(sd->sess, packet_len); - return; - } + if (rv == RecvResult::Error) + s->set_eof(); + return; - clif_parse_func_table[cmd].func(s, sd); - } - else +unknown_packet: { - // 不明なパケット if (battle_config.error_log) { if (s) - PRINTF("\nclif_parse: session #%d, packet 0x%x, lenght %d\n"_fmt, - s, cmd, packet_len); -#ifdef DUMP_UNKNOWN_PACKET + PRINTF("\nclif_parse: session #%d, packet 0x%x, lenght %zu\n"_fmt, + s, packet_id, packet_avail(s)); { - int i; ZString packet_txt = "save/packet.txt"_s; - PRINTF("---- 00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F"_fmt); - for (i = 0; i < packet_len; i++) - { - if ((i & 15) == 0) - PRINTF("\n%04X "_fmt, i); - PRINTF("%02X "_fmt, RFIFOB(s, i)); - } if (sd && sd->state.auth) { - PRINTF("\nAccount ID %d, character ID %d, player name %s.\n"_fmt, + PRINTF("Unknown packet: Account ID %d, character ID %d, player name %s.\n"_fmt, sd->status_key.account_id, sd->status_key.char_id, sd->status_key.name); } else if (sd) // not authentified! (refused by char-server or disconnect before to be authentified) - PRINTF("\nAccount ID %d.\n"_fmt, sd->bl_id); + PRINTF("Unkonwn packet (unauthenticated): Account ID %d.\n"_fmt, sd->bl_id); + else + PRINTF("Unknown packet (unknown)\n"_fmt); io::AppendFile fp(packet_txt); if (!fp.is_open()) @@ -5461,24 +5661,18 @@ void clif_parse(Session *s) } else if (sd) // not authentified! (refused by char-server or disconnect before to be authentified) FPRINTF(fp, - "%s\nPlayer with account ID %d sent wrong packet:\n"_fmt, + "%s\nUnauthenticated player with account ID %d sent wrong packet:\n"_fmt, now, sd->bl_id); + else + FPRINTF(fp, + "%s\nUnknown connection sent wrong packet:\n"_fmt, + now); - FPRINTF(fp, - "\t---- 00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F"_fmt); - for (i = 0; i < packet_len; i++) - { - if ((i & 15) == 0) - FPRINTF(fp, "\n\t%04X "_fmt, i); - FPRINTF(fp, "%02X "_fmt, RFIFOB(s, i)); - } - FPRINTF(fp, "\n\n"_fmt); + packet_dump(fp, s); } } -#endif } } - RFIFOSKIP(s, packet_len); } void do_init_clif(void) diff --git a/src/map/clif.t.hpp b/src/map/clif.t.hpp index 2da6cde..5b3d32f 100644 --- a/src/map/clif.t.hpp +++ b/src/map/clif.t.hpp @@ -25,6 +25,91 @@ # include <cstdint> +# include "../ints/little.hpp" + +# include "../generic/enum.hpp" + +# include "../mmo/enums.hpp" + + +namespace e +{ +// [Fate] status.option properties. These are persistent status changes. +// IDs that are not listed are not used in the code (to the best of my knowledge) +enum class Option : uint16_t +{ + ZERO = 0x0000, + + // [Fate] This is the GM `@hide' flag + HIDE = 0x0040, + // [Fate] Complete invisibility to other clients + INVISIBILITY = 0x1000, + + // ? + REAL_ANY_HIDE = HIDE, +}; +enum class Opt1 : uint16_t +{ + ZERO = 0, + _stone1 = 1, + _freeze = 2, + _stan = 3, + _sleep = 4, + _stone6 = 6, +}; +enum class Opt2 : uint16_t +{ + ZERO = 0x0000, + _poison = 0x0001, + _curse = 0x0002, + _silence = 0x0004, + BLIND = 0x0010, + _speedpotion0 = 0x0020, + _signumcrucis = 0x0040, + _atkpot = 0x0080, + _heal = 0x0100, + _slowpoison = 0x0200, +}; +enum class Opt3 : uint16_t +{ + ZERO = 0x0000, + _concentration = 0x0001, + _overthrust = 0x0002, + _energycoat = 0x0004, + _explosionspirits = 0x0008, + _steelbody = 0x0010, + _berserk = 0x0080, + + _marionette = 0x0400, + _assumptio = 0x0800, +}; + +ENUM_BITWISE_OPERATORS(Option) +ENUM_BITWISE_OPERATORS(Opt2) +ENUM_BITWISE_OPERATORS(Opt3) +} +using e::Option; +using e::Opt1; +using e::Opt2; +using e::Opt3; + + +enum class ItemType : uint8_t +{ + USE = 0, // in eA, healing only + _1 = 1, // unused + _2 = 2, // in eA, other usable items + JUNK = 3, // "useless" items (e.g. quests) + WEAPON = 4, // all weapons + ARMOR = 5, // all other equipment + _6 = 6, // in eA, card + _7 = 7, // in eA, pet egg + _8 = 8, // in eA, pet equipment + _9 = 9, // unused + ARROW = 10, // ammo + _11 = 11, // in eA, delayed use (special script) +}; + enum class BeingRemoveWhy : uint8_t { // general disappearance @@ -40,4 +125,464 @@ enum class BeingRemoveWhy : uint8_t NEGATIVE1 = 0xff, }; +enum class PickupFail : uint8_t +{ + OKAY = 0, + BAD_ITEM = 1, + TOO_HEAVY = 2, + TOO_FAR = 3, + INV_FULL = 4, + STACK_FULL = 5, + DROP_STEAL = 6, +}; + +// this is used for both input and output +// different values are valid in 0x0089 vs 0x008a +enum class DamageType : uint8_t +{ + NORMAL = 0x00, + TAKEITEM = 0x01, + SIT = 0x02, + STAND = 0x03, + RETURNED = 0x04, + CONTINUOUS = 0x07, + DOUBLED = 0x08, + CRITICAL = 0x0a, + FLEE2 = 0x0b, +}; + +enum class LOOK : uint8_t +{ + BASE = 0, + HAIR = 1, + WEAPON = 2, + HEAD_BOTTOM = 3, + HEAD_TOP = 4, + HEAD_MID = 5, + HAIR_COLOR = 6, + CLOTHES_COLOR = 7, + SHIELD = 8, + SHOES = 9, + GLOVES = 10, + CAPE = 11, + MISC1 = 12, + MISC2 = 13, + + COUNT, +}; + +// Note: there is also a typedef by this name in <dirent.h> +// but we should be fine since we never include it. +// (in the long term we should still rename this though) +enum class DIR : uint8_t +{ + S = 0, + SW = 1, + W = 2, + NW = 3, + N = 4, + NE = 5, + E = 6, + SE = 7, + + COUNT, +}; + +constexpr +earray<int, DIR, DIR::COUNT> dirx //= +{{ + 0, -1, -1, -1, 0, 1, 1, 1, +}}, diry //= +{{ + 1, 1, 0, -1, -1, -1, 0, 1, +}}; + +constexpr +bool dir_is_diagonal(DIR d) +{ + return static_cast<uint8_t>(d) & 1; +} + + +enum class SP : uint16_t +{ + // sent to client + SPEED = 0, + + // when used as "no stat" + ZERO = 0, + + // sent to client + BASEEXP = 1, + // sent to client + JOBEXP = 2, +# if 0 + KARMA = 3, +# endif + + // sent to client + HP = 5, + // sent to client + MAXHP = 6, + // sent to client + SP = 7, + // sent to client + MAXSP = 8, + // sent to client + STATUSPOINT = 9, + + // sent to client + BASELEVEL = 11, + // sent to client + SKILLPOINT = 12, + // sent to client + STR = 13, + // sent to client + AGI = 14, + // sent to client + VIT = 15, + // sent to client + INT = 16, + // sent to client + DEX = 17, + // sent to client + LUK = 18, + CLASS = 19, + // sent to client + ZENY = 20, + SEX = 21, + // sent to client + NEXTBASEEXP = 22, + // sent to client + NEXTJOBEXP = 23, + // sent to client + WEIGHT = 24, + // sent to client + MAXWEIGHT = 25, + + // sent to client + USTR = 32, + // sent to client + UAGI = 33, + // sent to client + UVIT = 34, + // sent to client + UINT = 35, + // sent to client + UDEX = 36, + // sent to client + ULUK = 37, + + // sent to client + ATK1 = 41, + // sent to client + ATK2 = 42, + // sent to client + MATK1 = 43, + // sent to client + MATK2 = 44, + // sent to client + DEF1 = 45, + // sent to client + DEF2 = 46, + // sent to client + MDEF1 = 47, + // sent to client + MDEF2 = 48, + // sent to client + HIT = 49, + // sent to client + FLEE1 = 50, + // sent to client + FLEE2 = 51, + // sent to client + CRITICAL = 52, + // sent to client + ASPD = 53, + + // sent to client + JOBLEVEL = 55, + +# if 0 + PARTNER = 57, + CART = 58, + FAME = 59, + UNBREAKABLE = 60, +# endif + + DEAF = 70, + + // sent to client + GM = 500, + + // sent to client + ATTACKRANGE = 1000, +# if 0 + ATKELE = 1001, +# endif +# if 0 + DEFELE = 1002, +# endif +# if 0 + CASTRATE = 1003, +# endif + MAXHPRATE = 1004, +# if 0 + MAXSPRATE = 1005, +# endif +# if 0 + SPRATE = 1006, +# endif + +# if 0 + ADDEFF = 1012, +# endif +# if 0 + RESEFF = 1013, +# endif + BASE_ATK = 1014, + ASPD_RATE = 1015, + HP_RECOV_RATE = 1016, +# if 0 + SP_RECOV_RATE = 1017, +# endif +# if 0 + SPEED_RATE = 1018, +# endif + CRITICAL_DEF = 1019, +# if 0 + NEAR_ATK_DEF = 1020, +# endif +# if 0 + LONG_ATK_DEF = 1021, +# endif +# if 0 + DOUBLE_RATE = 1022, +# endif + DOUBLE_ADD_RATE = 1023, +# if 0 + MATK = 1024, +# endif +# if 0 + MATK_RATE = 1025, +# endif +# if 0 + IGNORE_DEF_ELE = 1026, +# endif +# if 0 + IGNORE_DEF_RACE = 1027, +# endif +# if 0 + ATK_RATE = 1028, +# endif + SPEED_ADDRATE = 1029, +# if 0 + ASPD_ADDRATE = 1030, +# endif +# if 0 + MAGIC_ATK_DEF = 1031, +# endif +# if 0 + MISC_ATK_DEF = 1032, +# endif +# if 0 + IGNORE_MDEF_ELE = 1033, +# endif +# if 0 + IGNORE_MDEF_RACE = 1034, +# endif + +# if 0 + PERFECT_HIT_RATE = 1038, +# endif +# if 0 + PERFECT_HIT_ADD_RATE = 1039, +# endif +# if 0 + CRITICAL_RATE = 1040, +# endif +# if 0 + GET_ZENY_NUM = 1041, +# endif +# if 0 + ADD_GET_ZENY_NUM = 1042, +# endif + +# if 0 + ADD_MONSTER_DROP_ITEM = 1047, +# endif +# if 0 + DEF_RATIO_ATK_ELE = 1048, +# endif +# if 0 + DEF_RATIO_ATK_RACE = 1049, +# endif +# if 0 + ADD_SPEED = 1050, +# endif +# if 0 + HIT_RATE = 1051, +# endif +# if 0 + FLEE_RATE = 1052, +# endif +# if 0 + FLEE2_RATE = 1053, +# endif + DEF_RATE = 1054, + DEF2_RATE = 1055, +# if 0 + MDEF_RATE = 1056, +# endif +# if 0 + MDEF2_RATE = 1057, +# endif +# if 0 + SPLASH_RANGE = 1058, +# endif +# if 0 + SPLASH_ADD_RANGE = 1059, +# endif + + HP_DRAIN_RATE = 1061, +# if 0 + SP_DRAIN_RATE = 1062, +# endif +# if 0 + SHORT_WEAPON_DAMAGE_RETURN = 1063, +# endif +# if 0 + LONG_WEAPON_DAMAGE_RETURN = 1064, +# endif + +# if 0 + ADDEFF2 = 1067, +# endif + BREAK_WEAPON_RATE = 1068, + BREAK_ARMOR_RATE = 1069, + ADD_STEAL_RATE = 1070, + MAGIC_DAMAGE_RETURN = 1071, +# if 0 + RANDOM_ATTACK_INCREASE = 1072, +# endif +}; + +constexpr +SP attr_to_sp(ATTR attr) +{ + return static_cast<SP>(static_cast<uint16_t>(attr) + static_cast<uint16_t>(SP::STR)); +} + +constexpr +ATTR sp_to_attr(SP sp) +{ + return static_cast<ATTR>(static_cast<uint16_t>(sp) - static_cast<uint16_t>(SP::STR)); +} + +constexpr +SP attr_to_usp(ATTR attr) +{ + return static_cast<SP>(static_cast<uint16_t>(attr) + static_cast<uint16_t>(SP::USTR)); +} + +constexpr +ATTR usp_to_attr(SP sp) +{ + return static_cast<ATTR>(static_cast<uint16_t>(sp) - static_cast<uint16_t>(SP::USTR)); +} + +constexpr +SP sp_to_usp(SP sp) +{ + return attr_to_usp(sp_to_attr(sp)); +} + +constexpr +SP usp_to_sp(SP sp) +{ + return attr_to_sp(usp_to_attr(sp)); +} + + +// xxxx xxxx xxyy yyyy yyyy dddd +struct NetPosition1 +{ + Byte data[3]; +}; + +struct Position1 +{ + uint16_t x, y; + DIR dir; +}; + +inline +bool native_to_network(NetPosition1 *network, Position1 native) +{ + uint16_t x = native.x; + uint16_t y = native.y; + uint8_t d = static_cast<uint8_t>(native.dir); + + uint8_t *p = reinterpret_cast<uint8_t *>(network); + p[0] = x >> 2; + p[1] = (x << 6) | ((y >> 4) & 0x3f); + p[2] = y << 4 | d; + + return x < 1024 && y < 1024 && d < 16; +} + +inline +bool network_to_native(Position1 *native, NetPosition1 network) +{ + const uint8_t *p = reinterpret_cast<const uint8_t *>(&network); + native->x = (p[0] & (0x3ff >> 2)) << 2 | p[1] >> (8 - 2); + native->y = (p[1] & (0x3ff >> 4)) << 4 | p[2] >> (8 - 4); + uint8_t d = p[2] & 0x0f; + native->dir = static_cast<DIR>(d); + return d < 8; +} + +// x0xx xxxx xxy0 yyyy yyyy x1xx xxxx xxy1 yyyy yyyy +struct NetPosition2 +{ + Byte data[5]; +}; + +struct Position2 +{ + uint16_t x0, y0; + uint16_t x1, y1; +}; + +inline +bool native_to_network(NetPosition2 *network, Position2 native) +{ + uint16_t x0 = native.x0; + uint16_t y0 = native.y0; + uint16_t x1 = native.x1; + uint16_t y1 = native.y1; + + uint8_t *p = reinterpret_cast<uint8_t *>(network); + p[0] = x0 >> 2; + p[1] = (x0 << 6) | ((y0 >> 4) & 0x3f); + p[2] = (y0 << 4) | ((x1 >> 6) & 0x0f); + p[3] = (x1 << 2) | ((y1 >> 8) & 0x03); + p[4] = y1; + + return x0 < 1024 && y0 < 1024 && x1 < 1024 && y1 < 1024; +} + +inline +bool network_to_native(Position2 *native, NetPosition2 network) +{ + const uint8_t *p = reinterpret_cast<const uint8_t *>(&network); + native->x0 = (p[0] & (0x3ff >> 2)) << 2 | p[1] >> (8 - 2); + native->y0 = (p[1] & (0x3ff >> 4)) << 4 | p[2] >> (8 - 4); + native->x1 = (p[2] & (0x3ff >> 6)) << 6 | p[3] >> (8 - 6); + native->y1 = (p[3] & (0x3ff >> 8)) << 8 | p[4] >> (8 - 8); + return true; +} + + + #endif // TMWA_MAP_CLIF_T_HPP diff --git a/src/map/magic-interpreter.t.hpp b/src/map/magic-interpreter.t.hpp index 1fe5fa3..780d011 100644 --- a/src/map/magic-interpreter.t.hpp +++ b/src/map/magic-interpreter.t.hpp @@ -47,38 +47,6 @@ enum class TYPE : uint8_t NEGATIVE_1 = 255, }; -// Note: there is also a typedef by this name in <dirent.h> -// but we should be fine since we never include it. -// (in the long term we should still rename this though) -enum class DIR : uint8_t -{ - S = 0, - SW = 1, - W = 2, - NW = 3, - N = 4, - NE = 5, - E = 6, - SE = 7, - - COUNT, -}; - -constexpr -earray<int, DIR, DIR::COUNT> dirx //= -{{ - 0, -1, -1, -1, 0, 1, 1, 1, -}}, diry //= -{{ - 1, 1, 0, -1, -1, -1, 0, 1, -}}; - -constexpr -bool dir_is_diagonal(DIR d) -{ - return static_cast<uint8_t>(d) & 1; -} - enum class AREA : uint8_t { LOCATION, diff --git a/src/map/magic-stmt.cpp b/src/map/magic-stmt.cpp index ab7f60e..ae59ae7 100644 --- a/src/map/magic-stmt.cpp +++ b/src/map/magic-stmt.cpp @@ -47,7 +47,7 @@ #include "../poison.hpp" /* used for local spell effects */ -constexpr int INVISIBLE_NPC = 127; +constexpr Species INVISIBLE_NPC = wrap<Species>(127); //#define DEBUG @@ -153,7 +153,7 @@ void spell_free_invocation(dumb_ptr<invocation> invocation_) static void char_set_weapon_icon(dumb_ptr<map_session_data> subject, int count, - StatusChange icon, int look) + StatusChange icon, ItemNameId look) { const StatusChange old_icon = subject->attack_spell_icon_override; @@ -166,7 +166,7 @@ void char_set_weapon_icon(dumb_ptr<map_session_data> subject, int count, clif_fixpcpos(subject); if (count) { - clif_changelook(subject, LOOK::WEAPON, look); + clif_changelook(subject, LOOK::WEAPON, unwrap<ItemNameId>(look)); if (icon != StatusChange::ZERO) clif_status_change(subject, icon, 1); } @@ -213,7 +213,7 @@ void magic_stop_completely(dumb_ptr<map_session_data> c) if (attack_spell) spell_free_invocation(attack_spell); c->attack_spell_override = BlockId(); - char_set_weapon_icon(c, 0, StatusChange::ZERO, 0); + char_set_weapon_icon(c, 0, StatusChange::ZERO, ItemNameId()); char_set_attack_info(c, interval_t::zero(), 0); } } @@ -445,7 +445,7 @@ int op_messenger_npc(dumb_ptr<env_t>, Slice<val_t> args) NpcName npcname = stringish<NpcName>(ARGSTR(2)); npc = npc_spawn_text(loc->m, loc->x, loc->y, - ARGINT(1), npcname, ARGSTR(3)); + wrap<Species>(static_cast<uint16_t>(ARGINT(1))), npcname, ARGSTR(3)); Timer(gettick() + static_cast<interval_t>(ARGINT(4)), std::bind(timer_callback_kill_npc, ph::_1, ph::_2, @@ -587,7 +587,7 @@ int op_override_attack(dumb_ptr<env_t> env, Slice<val_t> args) interval_t attack_delay = static_cast<interval_t>(ARGINT(2)); int attack_range = ARGINT(3); StatusChange icon = StatusChange(ARGINT(4)); - int look = ARGINT(5); + ItemNameId look = wrap<ItemNameId>(static_cast<uint16_t>(ARGINT(5))); int stopattack = ARGINT(6); dumb_ptr<map_session_data> subject; @@ -1623,7 +1623,7 @@ int spell_attack(BlockId caster_id, BlockId target_id) else if (!invocation_ || caster->attack_spell_charges <= 0) { caster->attack_spell_override = BlockId(); - char_set_weapon_icon(caster, 0, StatusChange::ZERO, 0); + char_set_weapon_icon(caster, 0, StatusChange::ZERO, ItemNameId()); char_set_attack_info(caster, interval_t::zero(), 0); if (stop_attack) diff --git a/src/map/map.hpp b/src/map/map.hpp index 78d12f8..cbe8b27 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -46,7 +46,7 @@ # include "../mmo/utils.hpp" # include "battle.t.hpp" -# include "magic-interpreter.t.hpp" +# include "clif.t.hpp" # include "mapflag.hpp" # include "mob.t.hpp" # include "script.hpp" // change to script.t.hpp @@ -194,7 +194,6 @@ struct map_session_data : block_list, SessionData Opt2 opt2; Opt3 opt3; DIR dir, head_dir; - tick_t client_tick, server_tick; struct walkpath_data walkpath; Timer walktimer; BlockId npc_id, areanpc_id, npc_shopid; @@ -227,7 +226,7 @@ struct map_session_data : block_list, SessionData // like a weapon. Check pc_attack_timer() for details. // Weapon equipment slot (slot 4) item override StatusChange attack_spell_icon_override; - short attack_spell_look_override; // Weapon `look' (attack animation) override + ItemNameId attack_spell_look_override; // Weapon `look' (attack animation) override short attack_spell_charges; // [Fate] Remaining number of charges for the attack spell interval_t attack_spell_delay; // [Fate] ms delay after spell attack short attack_spell_range; // [Fate] spell range @@ -347,9 +346,7 @@ struct npc_data : block_list { NpcSubtype npc_subtype; short n; - // TODO This *should* be a Species, but the script files give -1 for - // event-only which is not valid unsigned - short npc_class; + Species npc_class; DIR dir; interval_t speed; NpcName name; diff --git a/src/map/map.t.hpp b/src/map/map.t.hpp index e40befa..4eba867 100644 --- a/src/map/map.t.hpp +++ b/src/map/map.t.hpp @@ -32,67 +32,6 @@ # include "../mmo/ids.hpp" # include "../mmo/mmo.hpp" -namespace e -{ -// [Fate] status.option properties. These are persistent status changes. -// IDs that are not listed are not used in the code (to the best of my knowledge) -enum class Option : uint16_t -{ - ZERO = 0x0000, - - // [Fate] This is the GM `@hide' flag - HIDE = 0x0040, - // [Fate] Complete invisibility to other clients - INVISIBILITY = 0x1000, - - // ? - REAL_ANY_HIDE = HIDE, -}; -enum class Opt1 : uint16_t -{ - ZERO = 0, - _stone1 = 1, - _freeze = 2, - _stan = 3, - _sleep = 4, - _stone6 = 6, -}; -enum class Opt2 : uint16_t -{ - ZERO = 0x0000, - _poison = 0x0001, - _curse = 0x0002, - _silence = 0x0004, - BLIND = 0x0010, - _speedpotion0 = 0x0020, - _signumcrucis = 0x0040, - _atkpot = 0x0080, - _heal = 0x0100, - _slowpoison = 0x0200, -}; -enum class Opt3 : uint16_t -{ - ZERO = 0x0000, - _concentration = 0x0001, - _overthrust = 0x0002, - _energycoat = 0x0004, - _explosionspirits = 0x0008, - _steelbody = 0x0010, - _berserk = 0x0080, - - _marionette = 0x0400, - _assumptio = 0x0800, -}; - -ENUM_BITWISE_OPERATORS(Option) -ENUM_BITWISE_OPERATORS(Opt2) -ENUM_BITWISE_OPERATORS(Opt3) -} -using e::Option; -using e::Opt1; -using e::Opt2; -using e::Opt3; - enum class BL : uint8_t { NUL, @@ -153,325 +92,6 @@ enum class ATK DEF, }; -enum class SP : uint16_t -{ - // sent to client - SPEED = 0, - - // when used as "no stat" - ZERO = 0, - - // sent to client - BASEEXP = 1, - // sent to client - JOBEXP = 2, -# if 0 - KARMA = 3, -# endif - - // sent to client - HP = 5, - // sent to client - MAXHP = 6, - // sent to client - SP = 7, - // sent to client - MAXSP = 8, - // sent to client - STATUSPOINT = 9, - - // sent to client - BASELEVEL = 11, - // sent to client - SKILLPOINT = 12, - // sent to client - STR = 13, - // sent to client - AGI = 14, - // sent to client - VIT = 15, - // sent to client - INT = 16, - // sent to client - DEX = 17, - // sent to client - LUK = 18, - CLASS = 19, - // sent to client - ZENY = 20, - SEX = 21, - // sent to client - NEXTBASEEXP = 22, - // sent to client - NEXTJOBEXP = 23, - // sent to client - WEIGHT = 24, - // sent to client - MAXWEIGHT = 25, - - // sent to client - USTR = 32, - // sent to client - UAGI = 33, - // sent to client - UVIT = 34, - // sent to client - UINT = 35, - // sent to client - UDEX = 36, - // sent to client - ULUK = 37, - - // sent to client - ATK1 = 41, - // sent to client - ATK2 = 42, - // sent to client - MATK1 = 43, - // sent to client - MATK2 = 44, - // sent to client - DEF1 = 45, - // sent to client - DEF2 = 46, - // sent to client - MDEF1 = 47, - // sent to client - MDEF2 = 48, - // sent to client - HIT = 49, - // sent to client - FLEE1 = 50, - // sent to client - FLEE2 = 51, - // sent to client - CRITICAL = 52, - // sent to client - ASPD = 53, - - // sent to client - JOBLEVEL = 55, - -# if 0 - PARTNER = 57, - CART = 58, - FAME = 59, - UNBREAKABLE = 60, -# endif - - DEAF = 70, - - // sent to client - GM = 500, - - // sent to client - ATTACKRANGE = 1000, -# if 0 - ATKELE = 1001, -# endif -# if 0 - DEFELE = 1002, -# endif -# if 0 - CASTRATE = 1003, -# endif - MAXHPRATE = 1004, -# if 0 - MAXSPRATE = 1005, -# endif -# if 0 - SPRATE = 1006, -# endif - -# if 0 - ADDEFF = 1012, -# endif -# if 0 - RESEFF = 1013, -# endif - BASE_ATK = 1014, - ASPD_RATE = 1015, - HP_RECOV_RATE = 1016, -# if 0 - SP_RECOV_RATE = 1017, -# endif -# if 0 - SPEED_RATE = 1018, -# endif - CRITICAL_DEF = 1019, -# if 0 - NEAR_ATK_DEF = 1020, -# endif -# if 0 - LONG_ATK_DEF = 1021, -# endif -# if 0 - DOUBLE_RATE = 1022, -# endif - DOUBLE_ADD_RATE = 1023, -# if 0 - MATK = 1024, -# endif -# if 0 - MATK_RATE = 1025, -# endif -# if 0 - IGNORE_DEF_ELE = 1026, -# endif -# if 0 - IGNORE_DEF_RACE = 1027, -# endif -# if 0 - ATK_RATE = 1028, -# endif - SPEED_ADDRATE = 1029, -# if 0 - ASPD_ADDRATE = 1030, -# endif -# if 0 - MAGIC_ATK_DEF = 1031, -# endif -# if 0 - MISC_ATK_DEF = 1032, -# endif -# if 0 - IGNORE_MDEF_ELE = 1033, -# endif -# if 0 - IGNORE_MDEF_RACE = 1034, -# endif - -# if 0 - PERFECT_HIT_RATE = 1038, -# endif -# if 0 - PERFECT_HIT_ADD_RATE = 1039, -# endif -# if 0 - CRITICAL_RATE = 1040, -# endif -# if 0 - GET_ZENY_NUM = 1041, -# endif -# if 0 - ADD_GET_ZENY_NUM = 1042, -# endif - -# if 0 - ADD_MONSTER_DROP_ITEM = 1047, -# endif -# if 0 - DEF_RATIO_ATK_ELE = 1048, -# endif -# if 0 - DEF_RATIO_ATK_RACE = 1049, -# endif -# if 0 - ADD_SPEED = 1050, -# endif -# if 0 - HIT_RATE = 1051, -# endif -# if 0 - FLEE_RATE = 1052, -# endif -# if 0 - FLEE2_RATE = 1053, -# endif - DEF_RATE = 1054, - DEF2_RATE = 1055, -# if 0 - MDEF_RATE = 1056, -# endif -# if 0 - MDEF2_RATE = 1057, -# endif -# if 0 - SPLASH_RANGE = 1058, -# endif -# if 0 - SPLASH_ADD_RANGE = 1059, -# endif - - HP_DRAIN_RATE = 1061, -# if 0 - SP_DRAIN_RATE = 1062, -# endif -# if 0 - SHORT_WEAPON_DAMAGE_RETURN = 1063, -# endif -# if 0 - LONG_WEAPON_DAMAGE_RETURN = 1064, -# endif - -# if 0 - ADDEFF2 = 1067, -# endif - BREAK_WEAPON_RATE = 1068, - BREAK_ARMOR_RATE = 1069, - ADD_STEAL_RATE = 1070, - MAGIC_DAMAGE_RETURN = 1071, -# if 0 - RANDOM_ATTACK_INCREASE = 1072, -# endif -}; - -constexpr -SP attr_to_sp(ATTR attr) -{ - return static_cast<SP>(static_cast<uint16_t>(attr) + static_cast<uint16_t>(SP::STR)); -} - -constexpr -ATTR sp_to_attr(SP sp) -{ - return static_cast<ATTR>(static_cast<uint16_t>(sp) - static_cast<uint16_t>(SP::STR)); -} - -constexpr -SP attr_to_usp(ATTR attr) -{ - return static_cast<SP>(static_cast<uint16_t>(attr) + static_cast<uint16_t>(SP::USTR)); -} - -constexpr -ATTR usp_to_attr(SP sp) -{ - return static_cast<ATTR>(static_cast<uint16_t>(sp) - static_cast<uint16_t>(SP::USTR)); -} - -constexpr -SP sp_to_usp(SP sp) -{ - return attr_to_usp(sp_to_attr(sp)); -} - -constexpr -SP usp_to_sp(SP sp) -{ - return attr_to_sp(usp_to_attr(sp)); -} - - -enum class LOOK : uint8_t -{ - BASE = 0, - HAIR = 1, - WEAPON = 2, - HEAD_BOTTOM = 3, - HEAD_TOP = 4, - HEAD_MID = 5, - HAIR_COLOR = 6, - CLOTHES_COLOR = 7, - SHIELD = 8, - SHOES = 9, - GLOVES = 10, - CAPE = 11, - MISC1 = 12, - MISC2 = 13, - - COUNT, -}; enum class EQUIP { @@ -521,22 +141,6 @@ EQUIP EQUIPs_noarrow[] = EQUIP::WEAPON, }; -enum class ItemType : uint8_t -{ - USE = 0, // in eA, healing only - _1 = 1, // unused - _2 = 2, // in eA, other usable items - JUNK = 3, // "useless" items (e.g. quests) - WEAPON = 4, // all weapons - ARMOR = 5, // all other equipment - _6 = 6, // in eA, card - _7 = 7, // in eA, pet egg - _8 = 8, // in eA, pet equipment - _9 = 9, // unused - ARROW = 10, // ammo - _11 = 11, // in eA, delayed use (special script) -}; - namespace e { enum class MobMode : uint16_t diff --git a/src/map/npc.cpp b/src/map/npc.cpp index aee3d03..ef10d82 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -46,6 +46,8 @@ #include "../mmo/extract.hpp" #include "../mmo/utils.hpp" +#include "../proto2/map-user.hpp" + #include "battle.hpp" #include "clif.hpp" #include "itemdb.hpp" @@ -642,7 +644,7 @@ int npc_checknear(dumb_ptr<map_session_data> sd, BlockId id) if (nd->bl_type != BL::NPC) return 1; - if (nd->npc_class < 0) // イベント系は常にOK + if (nd->npc_class == NEGATIVE_SPECIES) return 0; // エリア判定 @@ -778,15 +780,14 @@ int npc_buysellsel(dumb_ptr<map_session_data> sd, BlockId id, int type) *------------------------------------------ */ // TODO enumify return type -int npc_buylist(dumb_ptr<map_session_data> sd, int n, - const uint16_t *item_list) +int npc_buylist(dumb_ptr<map_session_data> sd, + const std::vector<Packet_Repeat<0x00c8>>& item_list) { dumb_ptr<npc_data> nd; double z; int i, j, w, itemamount = 0, new_stacks = 0; nullpo_retr(3, sd); - nullpo_retr(3, item_list); if (npc_checknear(sd, sd->npc_shopid)) return 3; @@ -795,11 +796,10 @@ int npc_buylist(dumb_ptr<map_session_data> sd, int n, if (nd->npc_subtype != NpcSubtype::SHOP) return 3; - for (i = 0, w = 0, z = 0; i < n; i++) + for (i = 0, w = 0, z = 0; i < item_list.size(); i++) { - // TODO this *really needs to be made into a struct - const uint16_t& item_l_count = item_list[i * 2]; - const ItemNameId& item_l_id = wrap<ItemNameId>(item_list[i * 2 + 1]); + const uint16_t& item_l_count = item_list[i].count; + const ItemNameId& item_l_id = item_list[i].name_id; for (j = 0; j < nd->is_shop()->shop_items.size(); j++) { @@ -840,10 +840,10 @@ int npc_buylist(dumb_ptr<map_session_data> sd, int n, pc_payzeny(sd, static_cast<int>(z)); - for (i = 0; i < n; i++) + for (i = 0; i < item_list.size(); i++) { - const uint16_t& item_l_count = item_list[i * 2]; - const ItemNameId& item_l_id = wrap<ItemNameId>(item_list[i * 2 + 1]); + const uint16_t& item_l_count = item_list[i].count; + const ItemNameId& item_l_id = item_list[i].name_id; struct item_data *item_data; if ((item_data = itemdb_exists(item_l_id)) != NULL) @@ -878,38 +878,37 @@ int npc_buylist(dumb_ptr<map_session_data> sd, int n, * *------------------------------------------ */ -int npc_selllist(dumb_ptr<map_session_data> sd, int n, - const uint16_t *item_list) +int npc_selllist(dumb_ptr<map_session_data> sd, + const std::vector<Packet_Repeat<0x00c9>>& item_list) { double z; int i, itemamount = 0; nullpo_retr(1, sd); - nullpo_retr(1, item_list); if (npc_checknear(sd, sd->npc_shopid)) return 1; - for (i = 0, z = 0; i < n; i++) + for (i = 0, z = 0; i < item_list.size(); i++) { - if (item_list[i * 2] - 2 < 0 || item_list[i * 2] - 2 >= MAX_INVENTORY) + if (item_list[i].ioff2 - 2 < 0 || item_list[i].ioff2 - 2 >= MAX_INVENTORY) return 1; - ItemNameId nameid = sd->status.inventory[item_list[i * 2] - 2].nameid; + ItemNameId nameid = sd->status.inventory[item_list[i].ioff2 - 2].nameid; if (!nameid || - sd->status.inventory[item_list[i * 2] - 2].amount < item_list[i * 2 + 1]) + sd->status.inventory[item_list[i].ioff2 - 2].amount < item_list[i].count) return 1; if (sd->trade_partner) return 2; // cant sell while trading - z += static_cast<double>(itemdb_value_sell(nameid)) * item_list[i * 2 + 1]; - itemamount += item_list[i * 2 + 1]; + z += static_cast<double>(itemdb_value_sell(nameid)) * item_list[i].count; + itemamount += item_list[i].count; } if (z > MAX_ZENY) z = MAX_ZENY; pc_getzeny(sd, static_cast<int>(z)); - for (i = 0; i < n; i++) + for (i = 0; i < item_list.size(); i++) { - int item_id = item_list[i * 2] - 2; - pc_delitem(sd, item_id, item_list[i * 2 + 1], 0); + int item_id = item_list[i].ioff2 - 2; + pc_delitem(sd, item_id, item_list[i].count, 0); } return 0; @@ -1116,7 +1115,7 @@ int npc_parse_shop(XString w1, XString, NpcName w3, ZString w4a) MapName mapname; dumb_ptr<npc_data_shop> nd; ZString::iterator w4comma; - int npc_class; + Species npc_class; int dir_; // TODO use enum directly in extract if (!extract(w1, record<','>(&mapname, &x, &y, &dir_)) @@ -1198,7 +1197,8 @@ int npc_parse_script(XString w1, XString w2, NpcName w3, ZString w4, int x, y; DIR dir = DIR::S; map_local *m; - int xs = 0, ys = 0, npc_class = 0; // [Valaris] thanks to fov + int xs = 0, ys = 0; // [Valaris] thanks to fov + Species npc_class; MapName mapname; std::unique_ptr<const ScriptBuffer> script = NULL; dumb_ptr<npc_data_script> nd; @@ -1279,7 +1279,7 @@ int npc_parse_script(XString w1, XString w2, NpcName w3, ZString w4, if (ys >= 0) ys = ys * 2 + 1; - if (npc_class >= 0) + if (npc_class != NEGATIVE_SPECIES) { for (int i = 0; i < ys; i++) @@ -1303,12 +1303,13 @@ int npc_parse_script(XString w1, XString w2, NpcName w3, ZString w4, } else { - npc_class = atoi(w4.c_str()); + if (!extract(w4, &npc_class)) + abort(); nd->scr.xs = 0; nd->scr.ys = 0; } - if (npc_class < 0 && m != nullptr) + if (npc_class == NEGATIVE_SPECIES && m != nullptr) { evflag = 1; } @@ -1318,6 +1319,7 @@ int npc_parse_script(XString w1, XString w2, NpcName w3, ZString w4, assert(false && "feature removed"_s); abort(); } + { nd->name = w3; } @@ -1596,7 +1598,7 @@ int npc_parse_mapflag(XString w1, XString, XString w3, ZString w4) } dumb_ptr<npc_data> npc_spawn_text(map_local *m, int x, int y, - int npc_class, NpcName name, AString message) + Species npc_class, NpcName name, AString message) { dumb_ptr<npc_data_message> retval; retval.new_(); diff --git a/src/map/npc.hpp b/src/map/npc.hpp index 011ea50..2c91dbd 100644 --- a/src/map/npc.hpp +++ b/src/map/npc.hpp @@ -31,14 +31,17 @@ # include "../net/timer.t.hpp" +# include "../proto2/fwd.hpp" + # include "map.hpp" constexpr BlockId START_NPC_NUM = wrap<BlockId>(110000000); // TODO make these species, see npc_class in npc_data -constexpr int WARP_CLASS = 45; -constexpr int WARP_DEBUG_CLASS = 722; -constexpr int INVISIBLE_CLASS = 32767; +constexpr Species WARP_CLASS = wrap<Species>(45); +constexpr Species FAKE_NPC_CLASS = wrap<Species>(127); +constexpr Species WARP_DEBUG_CLASS = wrap<Species>(722); +constexpr Species INVISIBLE_CLASS = wrap<Species>(32767); int npc_event_dequeue(dumb_ptr<map_session_data> sd); int npc_event(dumb_ptr<map_session_data> sd, NpcEvent npcname, int); @@ -48,8 +51,8 @@ int npc_touch_areanpc(dumb_ptr<map_session_data>, map_local *, int, int); int npc_click(dumb_ptr<map_session_data>, BlockId); int npc_scriptcont(dumb_ptr<map_session_data>, BlockId); int npc_buysellsel(dumb_ptr<map_session_data>, BlockId, int); -int npc_buylist(dumb_ptr<map_session_data>, int, const uint16_t *); -int npc_selllist(dumb_ptr<map_session_data>, int, const uint16_t *); +int npc_buylist(dumb_ptr<map_session_data>, const std::vector<Packet_Repeat<0x00c8>>&); +int npc_selllist(dumb_ptr<map_session_data>, const std::vector<Packet_Repeat<0x00c9>>&); int npc_parse_warp(XString w1, XString, NpcName w3, XString w4); int npc_enable(NpcName name, bool flag); @@ -63,7 +66,7 @@ BlockId npc_get_new_npc_id(void); * \param message The message to speak. If message is NULL, the NPC will not do anything at all. */ dumb_ptr<npc_data> npc_spawn_text(map_local *m, int x, int y, - int class_, NpcName name, AString message); + Species class_, NpcName name, AString message); /** * Uninstalls and frees an NPC diff --git a/src/map/path.cpp b/src/map/path.cpp index e0e18b6..fb423e7 100644 --- a/src/map/path.cpp +++ b/src/map/path.cpp @@ -31,7 +31,7 @@ #include "../io/cxxstdio.hpp" -#include "magic-interpreter.t.hpp" +#include "clif.t.hpp" #include "map.hpp" #include "../poison.hpp" diff --git a/src/map/pc.cpp b/src/map/pc.cpp index ac8af28..33cb57f 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -472,7 +472,7 @@ void pc_makesavestatus(dumb_ptr<map_session_data> sd) *------------------------------------------ */ int pc_setnewpc(dumb_ptr<map_session_data> sd, AccountId account_id, CharId char_id, - int login_id1, tick_t client_tick, SEX sex) + int login_id1, uint32_t client_tick, SEX sex) { nullpo_ret(sd); @@ -485,7 +485,7 @@ int pc_setnewpc(dumb_ptr<map_session_data> sd, AccountId account_id, CharId char // Possible fix: char send auth before client is allowed to know my IP? sd->login_id1 = login_id1; sd->login_id2 = 0; // at this point, we can not know the value :( - sd->client_tick = client_tick; + (void)client_tick; sd->sex = sex; sd->state.auth = 0; sd->bl_type = BL::PC; @@ -912,7 +912,7 @@ void pc_set_weapon_look(dumb_ptr<map_session_data> sd) { if (sd->attack_spell_override) clif_changelook(sd, LOOK::WEAPON, - sd->attack_spell_look_override); + unwrap<ItemNameId>(sd->attack_spell_look_override)); else clif_changelook(sd, LOOK::WEAPON, static_cast<uint16_t>(sd->status.weapon)); diff --git a/src/map/pc.hpp b/src/map/pc.hpp index 900ce97..10c11cf 100644 --- a/src/map/pc.hpp +++ b/src/map/pc.hpp @@ -78,7 +78,7 @@ int pc_counttargeted(dumb_ptr<map_session_data> sd, dumb_ptr<block_list> src, ATK target_lv); int pc_setrestartvalue(dumb_ptr<map_session_data> sd, int type); void pc_makesavestatus(dumb_ptr<map_session_data>); -int pc_setnewpc(dumb_ptr<map_session_data>, AccountId, CharId, int, tick_t, SEX); +int pc_setnewpc(dumb_ptr<map_session_data>, AccountId, CharId, int, uint32_t /*tick_t*/, SEX); int pc_authok(AccountId, int, TimeT, short tmw_version, const CharKey *, const CharData *); int pc_authfail(AccountId accid); diff --git a/src/map/pc.t.hpp b/src/map/pc.t.hpp index e022f3b..86817a7 100644 --- a/src/map/pc.t.hpp +++ b/src/map/pc.t.hpp @@ -50,18 +50,7 @@ enum class ADDITEM enum class CalcStatus { NOW, - LATER , -}; - -enum class PickupFail : uint8_t -{ - OKAY = 0, - BAD_ITEM = 1, - TOO_HEAVY = 2, - TOO_FAR = 3, - INV_FULL = 4, - STACK_FULL = 5, - DROP_STEAL = 6, + LATER, }; #endif // TMWA_MAP_PC_T_HPP diff --git a/src/map/script.cpp b/src/map/script.cpp index 6cac082..b1af725 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -4038,7 +4038,7 @@ void builtin_fakenpcname(ScriptState *st) { NpcName name = stringish<NpcName>(ZString(conv_str(st, &AARGO2(2)))); NpcName newname = stringish<NpcName>(ZString(conv_str(st, &AARGO2(3)))); - int newsprite = conv_num(st, &AARGO2(4)); + Species newsprite = wrap<Species>(static_cast<uint16_t>(conv_num(st, &AARGO2(4)))); dumb_ptr<npc_data> nd = npc_name2id(name); if (!nd) { diff --git a/src/map/script.hpp b/src/map/script.hpp index d42da2c..6708bbc 100644 --- a/src/map/script.hpp +++ b/src/map/script.hpp @@ -34,6 +34,9 @@ # include "../generic/db.hpp" # include "../generic/dumb_ptr.hpp" +# include "../mmo/ids.hpp" + +# include "clif.t.hpp" # include "map.t.hpp" enum class ByteCode : uint8_t; diff --git a/src/mmo/ids.hpp b/src/mmo/ids.hpp index bfd7de9..c79b93c 100644 --- a/src/mmo/ids.hpp +++ b/src/mmo/ids.hpp @@ -26,15 +26,30 @@ # include "extract.hpp" -class Species : public Wrapped<uint16_t> { public: explicit operator bool() const = delete; bool operator !() const = delete; Species() : Wrapped<uint16_t>() {} protected: constexpr explicit Species(uint16_t a) : Wrapped<uint16_t>(a) {} }; +class Species : public Wrapped<uint16_t> { public: explicit operator bool() const = delete; bool operator !() const = delete; constexpr Species() : Wrapped<uint16_t>() {} protected: constexpr explicit Species(uint16_t a) : Wrapped<uint16_t>(a) {} }; -class AccountId : public Wrapped<uint32_t> { public: AccountId() : Wrapped<uint32_t>() {} protected: constexpr explicit AccountId(uint32_t a) : Wrapped<uint32_t>(a) {} }; -class CharId : public Wrapped<uint32_t> { public: CharId() : Wrapped<uint32_t>() {} protected: constexpr explicit CharId(uint32_t a) : Wrapped<uint32_t>(a) {} }; +constexpr Species NEGATIVE_SPECIES = Species(); + +inline +bool extract(XString str, Species *w) +{ + // lots of data files use this + if (str == "-1"_s) + { + *w = NEGATIVE_SPECIES; + return true; + } + return extract(str, &w->_value); +} + + +class AccountId : public Wrapped<uint32_t> { public: constexpr AccountId() : Wrapped<uint32_t>() {} protected: constexpr explicit AccountId(uint32_t a) : Wrapped<uint32_t>(a) {} }; +class CharId : public Wrapped<uint32_t> { public: constexpr CharId() : Wrapped<uint32_t>() {} protected: constexpr explicit CharId(uint32_t a) : Wrapped<uint32_t>(a) {} }; // important note: slave mobs synthesize PartyId as -BlockId of master -class PartyId : public Wrapped<uint32_t> { public: PartyId() : Wrapped<uint32_t>() {} protected: constexpr explicit PartyId(uint32_t a) : Wrapped<uint32_t>(a) {} }; -class ItemNameId : public Wrapped<uint16_t> { public: ItemNameId() : Wrapped<uint16_t>() {} protected: constexpr explicit ItemNameId(uint16_t a) : Wrapped<uint16_t>(a) {} }; +class PartyId : public Wrapped<uint32_t> { public: constexpr PartyId() : Wrapped<uint32_t>() {} protected: constexpr explicit PartyId(uint32_t a) : Wrapped<uint32_t>(a) {} }; +class ItemNameId : public Wrapped<uint16_t> { public: constexpr ItemNameId() : Wrapped<uint16_t>() {} protected: constexpr explicit ItemNameId(uint16_t a) : Wrapped<uint16_t>(a) {} }; -class BlockId : public Wrapped<uint32_t> { public: BlockId() : Wrapped<uint32_t>() {} protected: constexpr explicit BlockId(uint32_t a) : Wrapped<uint32_t>(a) {} }; +class BlockId : public Wrapped<uint32_t> { public: constexpr BlockId() : Wrapped<uint32_t>() {} protected: constexpr explicit BlockId(uint32_t a) : Wrapped<uint32_t>(a) {} }; class GmLevel { diff --git a/src/net/packets.hpp b/src/net/packets.hpp index 293aed8..54167e8 100644 --- a/src/net/packets.hpp +++ b/src/net/packets.hpp @@ -27,11 +27,16 @@ # include "../io/fwd.hpp" -// ordering violation, should invert +// TODO ordering violation, should invert # include "../proto2/fwd.hpp" # include "socket.hpp" +struct Buffer +{ + std::vector<Byte> bytes; +}; + enum class RecvResult { Incomplete, @@ -69,6 +74,14 @@ bool packet_peek_id(Session *s, uint16_t *packet_id) return okay; } +inline +void send_buffer(Session *s, const Buffer& buffer) +{ + bool ok = !buffer.bytes.empty() && packet_send(s, buffer.bytes.data(), buffer.bytes.size()); + if (!ok) + s->set_eof(); +} + template<uint16_t id> __attribute__((warn_unused_result)) SendResult net_send_fpacket(Session *s, const NetPacket_Fixed<id>& fixed) @@ -193,112 +206,146 @@ RecvResult net_recv_opacket(Session *s, NetPacket_Head<id>& head, bool *has_opt, template<uint16_t id, uint16_t size> -void send_fpacket(Session *s, const Packet_Fixed<id>& fixed) +Buffer create_fpacket(const Packet_Fixed<id>& fixed) { static_assert(id == Packet_Fixed<id>::PACKET_ID, "Packet_Fixed<id>::PACKET_ID"); static_assert(size == sizeof(NetPacket_Fixed<id>), "sizeof(NetPacket_Fixed<id>)"); - NetPacket_Fixed<id> net_fixed; + Buffer buf; + buf.bytes.resize(sizeof(NetPacket_Fixed<id>)); + auto& net_fixed = reinterpret_cast<NetPacket_Fixed<id>&>( + *(buf.bytes.begin() + 0)); if (!native_to_network(&net_fixed, fixed)) { - s->set_eof(); - return; + return Buffer(); } - SendResult rv = net_send_fpacket(s, net_fixed); - if (rv != SendResult::Success) - s->set_eof(); + return buf; } template<uint16_t id> -void send_ppacket(Session *s, Packet_Payload<id>& payload) +Buffer create_ppacket(Packet_Payload<id>& payload) { static_assert(id == Packet_Payload<id>::PACKET_ID, "Packet_Payload<id>::PACKET_ID"); - NetPacket_Payload<id> net_payload; - payload.magic_packet_length = sizeof(NetPacket_Payload<id>); + if (id != 0x8000) + payload.magic_packet_length = sizeof(NetPacket_Payload<id>); + + Buffer buf; + buf.bytes.resize(sizeof(NetPacket_Payload<id>)); + auto& net_payload = reinterpret_cast<NetPacket_Payload<id>&>( + *(buf.bytes.begin() + 0)); if (!native_to_network(&net_payload, payload)) { - s->set_eof(); - return; + return Buffer(); } - SendResult rv = net_send_ppacket(s, net_payload); - if (rv != SendResult::Success) - s->set_eof(); + return buf; } template<uint16_t id, uint16_t headsize, uint16_t repeatsize> -void send_vpacket(Session *s, Packet_Head<id>& head, const std::vector<Packet_Repeat<id>>& repeat) +Buffer create_vpacket(Packet_Head<id>& head, const std::vector<Packet_Repeat<id>>& repeat) { static_assert(id == Packet_Head<id>::PACKET_ID, "Packet_Head<id>::PACKET_ID"); static_assert(headsize == sizeof(NetPacket_Head<id>), "sizeof(NetPacket_Head<id>)"); static_assert(id == Packet_Repeat<id>::PACKET_ID, "Packet_Repeat<id>::PACKET_ID"); static_assert(repeatsize == sizeof(NetPacket_Repeat<id>), "sizeof(NetPacket_Repeat<id>)"); - NetPacket_Head<id> net_head; // since these are already allocated, can't overflow address space size_t total_size = sizeof(NetPacket_Head<id>) + repeat.size() * sizeof(NetPacket_Repeat<id>); // truncates head.magic_packet_length = total_size; if (head.magic_packet_length != total_size) { - s->set_eof(); - return; + return Buffer(); } - // TODO potentially avoid the allocation - std::vector<NetPacket_Repeat<id>> net_repeat(repeat.size()); + + Buffer buf; + buf.bytes.resize(total_size); + auto& net_head = reinterpret_cast<NetPacket_Head<id>&>( + *(buf.bytes.begin() + 0)); if (!native_to_network(&net_head, head)) { - s->set_eof(); - return; + return Buffer(); } for (size_t i = 0; i < repeat.size(); ++i) { - if (!native_to_network(&net_repeat[i], repeat[i])) + auto& net_repeat_i = reinterpret_cast<NetPacket_Repeat<id>&>( + *(buf.bytes.begin() + + sizeof(NetPacket_Head<id>) + + i * sizeof(NetPacket_Repeat<id>))); + if (!native_to_network(&net_repeat_i, repeat[i])) { - s->set_eof(); - return; + return Buffer(); } } - SendResult rv = net_send_vpacket(s, net_head, net_repeat); - if (rv != SendResult::Success) - s->set_eof(); + return buf; } template<uint16_t id, uint16_t headsize, uint16_t optsize> -void send_opacket(Session *s, Packet_Head<id>& head, bool has_opt, const Packet_Option<id>& opt) +Buffer create_opacket(Packet_Head<id>& head, bool has_opt, const Packet_Option<id>& opt) { static_assert(id == Packet_Head<id>::PACKET_ID, "Packet_Head<id>::PACKET_ID"); static_assert(headsize == sizeof(NetPacket_Head<id>), "sizeof(NetPacket_Head<id>)"); static_assert(id == Packet_Option<id>::PACKET_ID, "Packet_Option<id>::PACKET_ID"); static_assert(optsize == sizeof(NetPacket_Option<id>), "sizeof(NetPacket_Option<id>)"); - NetPacket_Head<id> net_head; // since these are already allocated, can't overflow address space size_t total_size = sizeof(NetPacket_Head<id>) + has_opt * sizeof(NetPacket_Option<id>); // truncates head.magic_packet_length = total_size; if (head.magic_packet_length != total_size) { - s->set_eof(); - return; + return Buffer(); } - NetPacket_Option<id> net_opt; + + Buffer buf; + buf.bytes.resize(total_size); + + auto& net_head = reinterpret_cast<NetPacket_Head<id>&>( + *(buf.bytes.begin() + 0)); if (!native_to_network(&net_head, head)) { - s->set_eof(); - return; + return Buffer(); } if (has_opt) { + auto& net_opt = reinterpret_cast<NetPacket_Option<id>&>( + *(buf.bytes.begin() + + sizeof(NetPacket_Head<id>))); if (!native_to_network(&net_opt, opt)) { - s->set_eof(); - return; + return Buffer(); } } - SendResult rv = net_send_opacket(s, net_head, has_opt, net_opt); - if (rv != SendResult::Success) - s->set_eof(); + + return buf; +} + +template<uint16_t id, uint16_t size> +void send_fpacket(Session *s, const Packet_Fixed<id>& fixed) +{ + Buffer pkt = create_fpacket<id, size>(fixed); + send_buffer(s, pkt); +} + +template<uint16_t id> +void send_ppacket(Session *s, Packet_Payload<id>& payload) +{ + Buffer pkt = create_ppacket<id>(payload); + send_buffer(s, pkt); +} + +template<uint16_t id, uint16_t headsize, uint16_t repeatsize> +void send_vpacket(Session *s, Packet_Head<id>& head, const std::vector<Packet_Repeat<id>>& repeat) +{ + Buffer pkt = create_vpacket<id, headsize, repeatsize>(head, repeat); + send_buffer(s, pkt); +} + +template<uint16_t id, uint16_t headsize, uint16_t optsize> +void send_opacket(Session *s, Packet_Head<id>& head, bool has_opt, const Packet_Option<id>& opt) +{ + Buffer pkt = create_opacket<id, headsize, optsize>(head, has_opt, opt); + send_buffer(s, pkt); } template<uint16_t id, uint16_t size> @@ -332,6 +379,14 @@ RecvResult recv_ppacket(Session *s, Packet_Payload<id>& payload) if (!network_to_native(&payload, net_payload)) return RecvResult::Error; assert (payload.magic_packet_id == Packet_Payload<id>::PACKET_ID); + if (id == 0x8000) + { + // 0x8000 is special + if (packet_avail(s) < payload.magic_packet_length) + return RecvResult::Incomplete; + payload.magic_packet_length = 4; + return RecvResult::Complete; + } if (payload.magic_packet_length != sizeof(net_payload)) return RecvResult::Error; } @@ -397,7 +452,7 @@ RecvResult recv_opacket(Session *s, Packet_Head<id>& head, bool *has_opt, Packet // convenience for trailing strings template<uint16_t id, uint16_t headsize, uint16_t repeatsize> -void send_vpacket(Session *s, Packet_Head<id>& head, const XString& repeat) +Buffer create_vpacket(Packet_Head<id>& head, const XString& repeat) { static_assert(id == Packet_Head<id>::PACKET_ID, "Packet_Head<id>::PACKET_ID"); static_assert(headsize == sizeof(NetPacket_Head<id>), "NetPacket_Head<id>"); @@ -405,30 +460,44 @@ void send_vpacket(Session *s, Packet_Head<id>& head, const XString& repeat) static_assert(repeatsize == sizeof(NetPacket_Repeat<id>), "NetPacket_Repeat<id>"); static_assert(repeatsize == 1, "repeatsize"); - NetPacket_Head<id> net_head; // since it's already allocated, it can't overflow address space size_t total_length = sizeof(NetPacket_Head<id>) + (repeat.size() + 1) * sizeof(NetPacket_Repeat<id>); head.magic_packet_length = total_length; if (head.magic_packet_length != total_length) { - s->set_eof(); - return; + return Buffer(); } - // TODO potentially avoid the allocation + + Buffer buf; + buf.bytes.resize(total_length); + auto& net_head = reinterpret_cast<NetPacket_Head<id>&>( + *(buf.bytes.begin() + 0)); std::vector<NetPacket_Repeat<id>> net_repeat(repeat.size() + 1); if (!native_to_network(&net_head, head)) { - s->set_eof(); - return; + return Buffer(); } for (size_t i = 0; i < repeat.size(); ++i) { - net_repeat[i].c = Byte{static_cast<uint8_t>(repeat[i])}; + auto& net_repeat_i = reinterpret_cast<NetPacket_Repeat<id>&>( + *(buf.bytes.begin() + + sizeof(NetPacket_Head<id>) + + i)); + net_repeat_i.c = Byte{static_cast<uint8_t>(repeat[i])}; } - net_repeat[repeat.size()].c = Byte{static_cast<uint8_t>('\0')}; - SendResult rv = net_send_vpacket(s, net_head, net_repeat); - if (rv != SendResult::Success) - s->set_eof(); + auto& net_repeat_repeat_size = reinterpret_cast<NetPacket_Repeat<id>&>( + *(buf.bytes.begin() + + sizeof(NetPacket_Head<id>) + + repeat.size())); + net_repeat_repeat_size.c = Byte{static_cast<uint8_t>('\0')}; + return buf; +} + +template<uint16_t id, uint16_t headsize, uint16_t repeatsize> +void send_vpacket(Session *s, Packet_Head<id>& head, const XString& repeat) +{ + Buffer pkt = create_vpacket<id, headsize, repeatsize>(head, repeat); + send_buffer(s, pkt); } template<uint16_t id, uint16_t headsize, uint16_t repeatsize> @@ -462,6 +531,19 @@ RecvResult recv_vpacket(Session *s, Packet_Head<id>& head, AString& repeat) // if there is nothing in the head but the id and length, use the below template<uint16_t id, uint16_t headsize, uint16_t repeatsize> +Buffer create_packet_repeatonly(const std::vector<Packet_Repeat<id>>& v) +{ + static_assert(id == Packet_Head<id>::PACKET_ID, "Packet_Head<id>::PACKET_ID"); + static_assert(headsize == sizeof(NetPacket_Head<id>), "repeat headsize"); + static_assert(headsize == 4, "repeat headsize"); + static_assert(id == Packet_Repeat<id>::PACKET_ID, "Packet_Repeat<id>::PACKET_ID"); + static_assert(repeatsize == sizeof(NetPacket_Repeat<id>), "sizeof(NetPacket_Repeat<id>)"); + + Packet_Head<id> head; + return create_vpacket<id, 4, repeatsize>(head, v); +} + +template<uint16_t id, uint16_t headsize, uint16_t repeatsize> void send_packet_repeatonly(Session *s, const std::vector<Packet_Repeat<id>>& v) { static_assert(id == Packet_Head<id>::PACKET_ID, "Packet_Head<id>::PACKET_ID"); @@ -492,6 +574,20 @@ RecvResult recv_packet_repeatonly(Session *s, std::vector<Packet_Repeat<id>>& v) // and the combination of both of the above template<uint16_t id, uint16_t headsize, uint16_t repeatsize> +Buffer create_packet_repeatonly(const XString& repeat) +{ + static_assert(id == Packet_Head<id>::PACKET_ID, "Packet_Head<id>::PACKET_ID"); + static_assert(headsize == sizeof(NetPacket_Head<id>), "repeat headsize"); + static_assert(headsize == 4, "repeat headsize"); + static_assert(id == Packet_Repeat<id>::PACKET_ID, "Packet_Repeat<id>::PACKET_ID"); + static_assert(repeatsize == sizeof(NetPacket_Repeat<id>), "sizeof(NetPacket_Repeat<id>)"); + static_assert(repeatsize == 1, "repeatsize"); + + Packet_Head<id> head; + return create_vpacket<id, 4, repeatsize>(head, repeat); +} + +template<uint16_t id, uint16_t headsize, uint16_t repeatsize> void send_packet_repeatonly(Session *s, const XString& repeat) { static_assert(id == Packet_Head<id>::PACKET_ID, "Packet_Head<id>::PACKET_ID"); diff --git a/src/net/timer.t.hpp b/src/net/timer.t.hpp index 91d4b74..be32872 100644 --- a/src/net/timer.t.hpp +++ b/src/net/timer.t.hpp @@ -26,6 +26,8 @@ # include <chrono> # include <functional> +# include "../ints/little.hpp" + # include "../generic/dumb_ptr.hpp" /// An implementation of the C++ "clock" concept, exposing @@ -49,6 +51,55 @@ typedef milli_clock::duration interval_t; /// (to get additional arguments, use std::bind or a lambda). typedef std::function<void (TimerData *, tick_t)> timer_func; +// 49.7 day problem +inline __attribute__((warn_unused_result)) +bool native_to_network(Little32 *net, tick_t nat) +{ + auto tmp = nat.time_since_epoch().count(); + return native_to_network(net, static_cast<uint32_t>(tmp)); +} + +inline __attribute__((warn_unused_result)) +bool network_to_native(tick_t *nat, Little32 net) +{ + (void)nat; + (void)net; + abort(); +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(Little32 *net, interval_t nat) +{ + auto tmp = nat.count(); + return native_to_network(net, static_cast<uint32_t>(tmp)); +} + +inline __attribute__((warn_unused_result)) +bool network_to_native(interval_t *nat, Little32 net) +{ + uint32_t tmp; + bool rv = network_to_native(&tmp, net); + *nat = interval_t(tmp); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(Little16 *net, interval_t nat) +{ + auto tmp = nat.count(); + return native_to_network(net, static_cast<uint16_t>(tmp)); +} + +inline __attribute__((warn_unused_result)) +bool network_to_native(interval_t *nat, Little16 net) +{ + uint16_t tmp; + bool rv = network_to_native(&tmp, net); + *nat = interval_t(tmp); + return rv; +} + + class Timer { friend struct TimerData; diff --git a/src/proto2/any-user.hpp b/src/proto2/any-user.hpp index da9b1bc..4e14712 100644 --- a/src/proto2/any-user.hpp +++ b/src/proto2/any-user.hpp @@ -28,7 +28,7 @@ // This is a public protocol, and changes require client cooperation // this is only needed for the payload packet right now, and that needs to die -#pragma pack(push, 1) +# pragma pack(push, 1) template<> struct Packet_Fixed<0x0081> @@ -68,6 +68,17 @@ struct Packet_Fixed<0x7532> uint16_t magic_packet_id = PACKET_ID; }; +template<> +struct Packet_Payload<0x8000> +{ + static const uint16_t PACKET_ID = 0x8000; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; +}; + template<> struct NetPacket_Fixed<0x0081> @@ -78,6 +89,7 @@ struct NetPacket_Fixed<0x0081> static_assert(offsetof(NetPacket_Fixed<0x0081>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0081>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x0081>, error_code) == 2, "offsetof(NetPacket_Fixed<0x0081>, error_code) == 2"); static_assert(sizeof(NetPacket_Fixed<0x0081>) == 3, "sizeof(NetPacket_Fixed<0x0081>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x0081>) == 1, "alignof(NetPacket_Fixed<0x0081>) == 1"); template<> struct NetPacket_Fixed<0x7530> @@ -86,6 +98,7 @@ struct NetPacket_Fixed<0x7530> }; static_assert(offsetof(NetPacket_Fixed<0x7530>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7530>, magic_packet_id) == 0"); static_assert(sizeof(NetPacket_Fixed<0x7530>) == 2, "sizeof(NetPacket_Fixed<0x7530>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x7530>) == 1, "alignof(NetPacket_Fixed<0x7530>) == 1"); template<> struct NetPacket_Fixed<0x7531> @@ -96,6 +109,7 @@ struct NetPacket_Fixed<0x7531> static_assert(offsetof(NetPacket_Fixed<0x7531>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7531>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x7531>, version) == 2, "offsetof(NetPacket_Fixed<0x7531>, version) == 2"); static_assert(sizeof(NetPacket_Fixed<0x7531>) == 10, "sizeof(NetPacket_Fixed<0x7531>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x7531>) == 1, "alignof(NetPacket_Fixed<0x7531>) == 1"); template<> struct NetPacket_Fixed<0x7532> @@ -104,6 +118,18 @@ struct NetPacket_Fixed<0x7532> }; static_assert(offsetof(NetPacket_Fixed<0x7532>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7532>, magic_packet_id) == 0"); static_assert(sizeof(NetPacket_Fixed<0x7532>) == 2, "sizeof(NetPacket_Fixed<0x7532>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x7532>) == 1, "alignof(NetPacket_Fixed<0x7532>) == 1"); + +template<> +struct NetPacket_Payload<0x8000> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; +}; +static_assert(offsetof(NetPacket_Payload<0x8000>, magic_packet_id) == 0, "offsetof(NetPacket_Payload<0x8000>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Payload<0x8000>, magic_packet_length) == 2, "offsetof(NetPacket_Payload<0x8000>, magic_packet_length) == 2"); +static_assert(sizeof(NetPacket_Payload<0x8000>) == 4, "sizeof(NetPacket_Payload<0x8000>) == 4"); +static_assert(alignof(NetPacket_Payload<0x8000>) == 1, "alignof(NetPacket_Payload<0x8000>) == 1"); inline __attribute__((warn_unused_result)) @@ -170,7 +196,24 @@ bool network_to_native(Packet_Fixed<0x7532> *native, NetPacket_Fixed<0x7532> net return rv; } +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Payload<0x8000> *network, Packet_Payload<0x8000> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Payload<0x8000> *native, NetPacket_Payload<0x8000> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + return rv; +} + -#pragma pack(pop) +# pragma pack(pop) #endif // TMWA_PROTO2_ANY_USER_HPP diff --git a/src/proto2/char-map.hpp b/src/proto2/char-map.hpp index 333c948..f543b90 100644 --- a/src/proto2/char-map.hpp +++ b/src/proto2/char-map.hpp @@ -28,7 +28,7 @@ // This is an internal protocol, and can be changed without notice // this is only needed for the payload packet right now, and that needs to die -#pragma pack(push, 1) +# pragma pack(push, 1) template<> struct Packet_Fixed<0x2af7> @@ -928,6 +928,7 @@ struct NetPacket_Fixed<0x2af7> }; static_assert(offsetof(NetPacket_Fixed<0x2af7>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2af7>, magic_packet_id) == 0"); static_assert(sizeof(NetPacket_Fixed<0x2af7>) == 2, "sizeof(NetPacket_Fixed<0x2af7>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x2af7>) == 1, "alignof(NetPacket_Fixed<0x2af7>) == 1"); template<> struct NetPacket_Fixed<0x2af8> @@ -946,6 +947,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2af8>, unused) == 50, "offsetof(NetPack static_assert(offsetof(NetPacket_Fixed<0x2af8>, ip) == 54, "offsetof(NetPacket_Fixed<0x2af8>, ip) == 54"); static_assert(offsetof(NetPacket_Fixed<0x2af8>, port) == 58, "offsetof(NetPacket_Fixed<0x2af8>, port) == 58"); static_assert(sizeof(NetPacket_Fixed<0x2af8>) == 60, "sizeof(NetPacket_Fixed<0x2af8>) == 60"); +static_assert(alignof(NetPacket_Fixed<0x2af8>) == 1, "alignof(NetPacket_Fixed<0x2af8>) == 1"); template<> struct NetPacket_Fixed<0x2af9> @@ -956,6 +958,7 @@ struct NetPacket_Fixed<0x2af9> static_assert(offsetof(NetPacket_Fixed<0x2af9>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2af9>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x2af9>, code) == 2, "offsetof(NetPacket_Fixed<0x2af9>, code) == 2"); static_assert(sizeof(NetPacket_Fixed<0x2af9>) == 3, "sizeof(NetPacket_Fixed<0x2af9>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x2af9>) == 1, "alignof(NetPacket_Fixed<0x2af9>) == 1"); template<> struct NetPacket_Head<0x2afa> @@ -966,6 +969,7 @@ struct NetPacket_Head<0x2afa> static_assert(offsetof(NetPacket_Head<0x2afa>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x2afa>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Head<0x2afa>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x2afa>, magic_packet_length) == 2"); static_assert(sizeof(NetPacket_Head<0x2afa>) == 4, "sizeof(NetPacket_Head<0x2afa>) == 4"); +static_assert(alignof(NetPacket_Head<0x2afa>) == 1, "alignof(NetPacket_Head<0x2afa>) == 1"); template<> struct NetPacket_Repeat<0x2afa> { @@ -973,6 +977,7 @@ struct NetPacket_Repeat<0x2afa> }; static_assert(offsetof(NetPacket_Repeat<0x2afa>, map_name) == 0, "offsetof(NetPacket_Repeat<0x2afa>, map_name) == 0"); static_assert(sizeof(NetPacket_Repeat<0x2afa>) == 16, "sizeof(NetPacket_Repeat<0x2afa>) == 16"); +static_assert(alignof(NetPacket_Repeat<0x2afa>) == 1, "alignof(NetPacket_Repeat<0x2afa>) == 1"); template<> struct NetPacket_Fixed<0x2afa> @@ -985,6 +990,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2afa>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x2afa>, source_item_id) == 2, "offsetof(NetPacket_Fixed<0x2afa>, source_item_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x2afa>, dest_item_id) == 6, "offsetof(NetPacket_Fixed<0x2afa>, dest_item_id) == 6"); static_assert(sizeof(NetPacket_Fixed<0x2afa>) == 10, "sizeof(NetPacket_Fixed<0x2afa>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x2afa>) == 1, "alignof(NetPacket_Fixed<0x2afa>) == 1"); template<> struct NetPacket_Fixed<0x2afb> @@ -997,6 +1003,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2afb>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x2afb>, unknown) == 2, "offsetof(NetPacket_Fixed<0x2afb>, unknown) == 2"); static_assert(offsetof(NetPacket_Fixed<0x2afb>, whisper_name) == 3, "offsetof(NetPacket_Fixed<0x2afb>, whisper_name) == 3"); static_assert(sizeof(NetPacket_Fixed<0x2afb>) == 27, "sizeof(NetPacket_Fixed<0x2afb>) == 27"); +static_assert(alignof(NetPacket_Fixed<0x2afb>) == 1, "alignof(NetPacket_Fixed<0x2afb>) == 1"); template<> struct NetPacket_Fixed<0x2afc> @@ -1015,6 +1022,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2afc>, login_id1) == 10, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x2afc>, login_id2) == 14, "offsetof(NetPacket_Fixed<0x2afc>, login_id2) == 14"); static_assert(offsetof(NetPacket_Fixed<0x2afc>, ip) == 18, "offsetof(NetPacket_Fixed<0x2afc>, ip) == 18"); static_assert(sizeof(NetPacket_Fixed<0x2afc>) == 22, "sizeof(NetPacket_Fixed<0x2afc>) == 22"); +static_assert(alignof(NetPacket_Fixed<0x2afc>) == 1, "alignof(NetPacket_Fixed<0x2afc>) == 1"); template<> struct NetPacket_Payload<0x2afd> @@ -1035,6 +1043,7 @@ static_assert(offsetof(NetPacket_Payload<0x2afd>, login_id2) == 8, "offsetof(Net static_assert(offsetof(NetPacket_Payload<0x2afd>, connect_until) == 12, "offsetof(NetPacket_Payload<0x2afd>, connect_until) == 12"); static_assert(offsetof(NetPacket_Payload<0x2afd>, packet_tmw_version) == 16, "offsetof(NetPacket_Payload<0x2afd>, packet_tmw_version) == 16"); static_assert(offsetof(NetPacket_Payload<0x2afd>, char_key) == 18, "offsetof(NetPacket_Payload<0x2afd>, char_key) == 18"); +static_assert(alignof(NetPacket_Payload<0x2afd>) == 1, "alignof(NetPacket_Payload<0x2afd>) == 1"); template<> struct NetPacket_Fixed<0x2afe> @@ -1045,6 +1054,7 @@ struct NetPacket_Fixed<0x2afe> static_assert(offsetof(NetPacket_Fixed<0x2afe>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2afe>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x2afe>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2afe>, account_id) == 2"); static_assert(sizeof(NetPacket_Fixed<0x2afe>) == 6, "sizeof(NetPacket_Fixed<0x2afe>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x2afe>) == 1, "alignof(NetPacket_Fixed<0x2afe>) == 1"); template<> struct NetPacket_Head<0x2aff> @@ -1057,6 +1067,7 @@ static_assert(offsetof(NetPacket_Head<0x2aff>, magic_packet_id) == 0, "offsetof( static_assert(offsetof(NetPacket_Head<0x2aff>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x2aff>, magic_packet_length) == 2"); static_assert(offsetof(NetPacket_Head<0x2aff>, users) == 4, "offsetof(NetPacket_Head<0x2aff>, users) == 4"); static_assert(sizeof(NetPacket_Head<0x2aff>) == 6, "sizeof(NetPacket_Head<0x2aff>) == 6"); +static_assert(alignof(NetPacket_Head<0x2aff>) == 1, "alignof(NetPacket_Head<0x2aff>) == 1"); template<> struct NetPacket_Repeat<0x2aff> { @@ -1064,6 +1075,7 @@ struct NetPacket_Repeat<0x2aff> }; static_assert(offsetof(NetPacket_Repeat<0x2aff>, char_id) == 0, "offsetof(NetPacket_Repeat<0x2aff>, char_id) == 0"); static_assert(sizeof(NetPacket_Repeat<0x2aff>) == 4, "sizeof(NetPacket_Repeat<0x2aff>) == 4"); +static_assert(alignof(NetPacket_Repeat<0x2aff>) == 1, "alignof(NetPacket_Repeat<0x2aff>) == 1"); template<> struct NetPacket_Fixed<0x2b00> @@ -1074,6 +1086,7 @@ struct NetPacket_Fixed<0x2b00> static_assert(offsetof(NetPacket_Fixed<0x2b00>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2b00>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x2b00>, users) == 2, "offsetof(NetPacket_Fixed<0x2b00>, users) == 2"); static_assert(sizeof(NetPacket_Fixed<0x2b00>) == 6, "sizeof(NetPacket_Fixed<0x2b00>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x2b00>) == 1, "alignof(NetPacket_Fixed<0x2b00>) == 1"); template<> struct NetPacket_Payload<0x2b01> @@ -1090,6 +1103,7 @@ static_assert(offsetof(NetPacket_Payload<0x2b01>, magic_packet_length) == 2, "of static_assert(offsetof(NetPacket_Payload<0x2b01>, account_id) == 4, "offsetof(NetPacket_Payload<0x2b01>, account_id) == 4"); static_assert(offsetof(NetPacket_Payload<0x2b01>, char_id) == 8, "offsetof(NetPacket_Payload<0x2b01>, char_id) == 8"); static_assert(offsetof(NetPacket_Payload<0x2b01>, char_key) == 12, "offsetof(NetPacket_Payload<0x2b01>, char_key) == 12"); +static_assert(alignof(NetPacket_Payload<0x2b01>) == 1, "alignof(NetPacket_Payload<0x2b01>) == 1"); template<> struct NetPacket_Fixed<0x2b02> @@ -1106,6 +1120,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2b02>, login_id1) == 6, "offsetof(NetPa static_assert(offsetof(NetPacket_Fixed<0x2b02>, login_id2) == 10, "offsetof(NetPacket_Fixed<0x2b02>, login_id2) == 10"); static_assert(offsetof(NetPacket_Fixed<0x2b02>, ip) == 14, "offsetof(NetPacket_Fixed<0x2b02>, ip) == 14"); static_assert(sizeof(NetPacket_Fixed<0x2b02>) == 18, "sizeof(NetPacket_Fixed<0x2b02>) == 18"); +static_assert(alignof(NetPacket_Fixed<0x2b02>) == 1, "alignof(NetPacket_Fixed<0x2b02>) == 1"); template<> struct NetPacket_Fixed<0x2b03> @@ -1118,6 +1133,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2b03>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x2b03>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2b03>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x2b03>, unknown) == 6, "offsetof(NetPacket_Fixed<0x2b03>, unknown) == 6"); static_assert(sizeof(NetPacket_Fixed<0x2b03>) == 7, "sizeof(NetPacket_Fixed<0x2b03>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x2b03>) == 1, "alignof(NetPacket_Fixed<0x2b03>) == 1"); template<> struct NetPacket_Head<0x2b04> @@ -1132,6 +1148,7 @@ static_assert(offsetof(NetPacket_Head<0x2b04>, magic_packet_length) == 2, "offse static_assert(offsetof(NetPacket_Head<0x2b04>, ip) == 4, "offsetof(NetPacket_Head<0x2b04>, ip) == 4"); static_assert(offsetof(NetPacket_Head<0x2b04>, port) == 8, "offsetof(NetPacket_Head<0x2b04>, port) == 8"); static_assert(sizeof(NetPacket_Head<0x2b04>) == 10, "sizeof(NetPacket_Head<0x2b04>) == 10"); +static_assert(alignof(NetPacket_Head<0x2b04>) == 1, "alignof(NetPacket_Head<0x2b04>) == 1"); template<> struct NetPacket_Repeat<0x2b04> { @@ -1139,6 +1156,7 @@ struct NetPacket_Repeat<0x2b04> }; static_assert(offsetof(NetPacket_Repeat<0x2b04>, map_name) == 0, "offsetof(NetPacket_Repeat<0x2b04>, map_name) == 0"); static_assert(sizeof(NetPacket_Repeat<0x2b04>) == 16, "sizeof(NetPacket_Repeat<0x2b04>) == 16"); +static_assert(alignof(NetPacket_Repeat<0x2b04>) == 1, "alignof(NetPacket_Repeat<0x2b04>) == 1"); template<> struct NetPacket_Fixed<0x2b05> @@ -1169,6 +1187,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2b05>, map_port) == 42, "offsetof(NetPa static_assert(offsetof(NetPacket_Fixed<0x2b05>, sex) == 44, "offsetof(NetPacket_Fixed<0x2b05>, sex) == 44"); static_assert(offsetof(NetPacket_Fixed<0x2b05>, client_ip) == 45, "offsetof(NetPacket_Fixed<0x2b05>, client_ip) == 45"); static_assert(sizeof(NetPacket_Fixed<0x2b05>) == 49, "sizeof(NetPacket_Fixed<0x2b05>) == 49"); +static_assert(alignof(NetPacket_Fixed<0x2b05>) == 1, "alignof(NetPacket_Fixed<0x2b05>) == 1"); template<> struct NetPacket_Fixed<0x2b06> @@ -1195,6 +1214,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2b06>, y) == 36, "offsetof(NetPacket_Fi static_assert(offsetof(NetPacket_Fixed<0x2b06>, map_ip) == 38, "offsetof(NetPacket_Fixed<0x2b06>, map_ip) == 38"); static_assert(offsetof(NetPacket_Fixed<0x2b06>, map_port) == 42, "offsetof(NetPacket_Fixed<0x2b06>, map_port) == 42"); static_assert(sizeof(NetPacket_Fixed<0x2b06>) == 44, "sizeof(NetPacket_Fixed<0x2b06>) == 44"); +static_assert(alignof(NetPacket_Fixed<0x2b06>) == 1, "alignof(NetPacket_Fixed<0x2b06>) == 1"); template<> struct NetPacket_Head<0x2b0a> @@ -1207,6 +1227,7 @@ static_assert(offsetof(NetPacket_Head<0x2b0a>, magic_packet_id) == 0, "offsetof( static_assert(offsetof(NetPacket_Head<0x2b0a>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x2b0a>, magic_packet_length) == 2"); static_assert(offsetof(NetPacket_Head<0x2b0a>, account_id) == 4, "offsetof(NetPacket_Head<0x2b0a>, account_id) == 4"); static_assert(sizeof(NetPacket_Head<0x2b0a>) == 8, "sizeof(NetPacket_Head<0x2b0a>) == 8"); +static_assert(alignof(NetPacket_Head<0x2b0a>) == 1, "alignof(NetPacket_Head<0x2b0a>) == 1"); template<> struct NetPacket_Repeat<0x2b0a> { @@ -1214,6 +1235,7 @@ struct NetPacket_Repeat<0x2b0a> }; static_assert(offsetof(NetPacket_Repeat<0x2b0a>, c) == 0, "offsetof(NetPacket_Repeat<0x2b0a>, c) == 0"); static_assert(sizeof(NetPacket_Repeat<0x2b0a>) == 1, "sizeof(NetPacket_Repeat<0x2b0a>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x2b0a>) == 1, "alignof(NetPacket_Repeat<0x2b0a>) == 1"); template<> struct NetPacket_Fixed<0x2b0b> @@ -1226,6 +1248,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2b0b>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x2b0b>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2b0b>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x2b0b>, gm_level) == 6, "offsetof(NetPacket_Fixed<0x2b0b>, gm_level) == 6"); static_assert(sizeof(NetPacket_Fixed<0x2b0b>) == 10, "sizeof(NetPacket_Fixed<0x2b0b>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x2b0b>) == 1, "alignof(NetPacket_Fixed<0x2b0b>) == 1"); template<> struct NetPacket_Fixed<0x2b0c> @@ -1240,6 +1263,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2b0c>, account_id) == 2, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x2b0c>, old_email) == 6, "offsetof(NetPacket_Fixed<0x2b0c>, old_email) == 6"); static_assert(offsetof(NetPacket_Fixed<0x2b0c>, new_email) == 46, "offsetof(NetPacket_Fixed<0x2b0c>, new_email) == 46"); static_assert(sizeof(NetPacket_Fixed<0x2b0c>) == 86, "sizeof(NetPacket_Fixed<0x2b0c>) == 86"); +static_assert(alignof(NetPacket_Fixed<0x2b0c>) == 1, "alignof(NetPacket_Fixed<0x2b0c>) == 1"); template<> struct NetPacket_Fixed<0x2b0d> @@ -1252,6 +1276,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2b0d>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x2b0d>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2b0d>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x2b0d>, sex) == 6, "offsetof(NetPacket_Fixed<0x2b0d>, sex) == 6"); static_assert(sizeof(NetPacket_Fixed<0x2b0d>) == 7, "sizeof(NetPacket_Fixed<0x2b0d>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x2b0d>) == 1, "alignof(NetPacket_Fixed<0x2b0d>) == 1"); template<> struct NetPacket_Fixed<0x2b0e> @@ -1268,6 +1293,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2b0e>, char_name) == 6, "offsetof(NetPa static_assert(offsetof(NetPacket_Fixed<0x2b0e>, operation) == 30, "offsetof(NetPacket_Fixed<0x2b0e>, operation) == 30"); static_assert(offsetof(NetPacket_Fixed<0x2b0e>, ban_add) == 32, "offsetof(NetPacket_Fixed<0x2b0e>, ban_add) == 32"); static_assert(sizeof(NetPacket_Fixed<0x2b0e>) == 44, "sizeof(NetPacket_Fixed<0x2b0e>) == 44"); +static_assert(alignof(NetPacket_Fixed<0x2b0e>) == 1, "alignof(NetPacket_Fixed<0x2b0e>) == 1"); template<> struct NetPacket_Fixed<0x2b0f> @@ -1284,6 +1310,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2b0f>, char_name) == 6, "offsetof(NetPa static_assert(offsetof(NetPacket_Fixed<0x2b0f>, operation) == 30, "offsetof(NetPacket_Fixed<0x2b0f>, operation) == 30"); static_assert(offsetof(NetPacket_Fixed<0x2b0f>, error) == 32, "offsetof(NetPacket_Fixed<0x2b0f>, error) == 32"); static_assert(sizeof(NetPacket_Fixed<0x2b0f>) == 34, "sizeof(NetPacket_Fixed<0x2b0f>) == 34"); +static_assert(alignof(NetPacket_Fixed<0x2b0f>) == 1, "alignof(NetPacket_Fixed<0x2b0f>) == 1"); template<> struct NetPacket_Head<0x2b10> @@ -1296,6 +1323,7 @@ static_assert(offsetof(NetPacket_Head<0x2b10>, magic_packet_id) == 0, "offsetof( static_assert(offsetof(NetPacket_Head<0x2b10>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x2b10>, magic_packet_length) == 2"); static_assert(offsetof(NetPacket_Head<0x2b10>, account_id) == 4, "offsetof(NetPacket_Head<0x2b10>, account_id) == 4"); static_assert(sizeof(NetPacket_Head<0x2b10>) == 8, "sizeof(NetPacket_Head<0x2b10>) == 8"); +static_assert(alignof(NetPacket_Head<0x2b10>) == 1, "alignof(NetPacket_Head<0x2b10>) == 1"); template<> struct NetPacket_Repeat<0x2b10> { @@ -1305,6 +1333,7 @@ struct NetPacket_Repeat<0x2b10> static_assert(offsetof(NetPacket_Repeat<0x2b10>, name) == 0, "offsetof(NetPacket_Repeat<0x2b10>, name) == 0"); static_assert(offsetof(NetPacket_Repeat<0x2b10>, value) == 32, "offsetof(NetPacket_Repeat<0x2b10>, value) == 32"); static_assert(sizeof(NetPacket_Repeat<0x2b10>) == 36, "sizeof(NetPacket_Repeat<0x2b10>) == 36"); +static_assert(alignof(NetPacket_Repeat<0x2b10>) == 1, "alignof(NetPacket_Repeat<0x2b10>) == 1"); template<> struct NetPacket_Head<0x2b11> @@ -1317,6 +1346,7 @@ static_assert(offsetof(NetPacket_Head<0x2b11>, magic_packet_id) == 0, "offsetof( static_assert(offsetof(NetPacket_Head<0x2b11>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x2b11>, magic_packet_length) == 2"); static_assert(offsetof(NetPacket_Head<0x2b11>, account_id) == 4, "offsetof(NetPacket_Head<0x2b11>, account_id) == 4"); static_assert(sizeof(NetPacket_Head<0x2b11>) == 8, "sizeof(NetPacket_Head<0x2b11>) == 8"); +static_assert(alignof(NetPacket_Head<0x2b11>) == 1, "alignof(NetPacket_Head<0x2b11>) == 1"); template<> struct NetPacket_Repeat<0x2b11> { @@ -1326,6 +1356,7 @@ struct NetPacket_Repeat<0x2b11> static_assert(offsetof(NetPacket_Repeat<0x2b11>, name) == 0, "offsetof(NetPacket_Repeat<0x2b11>, name) == 0"); static_assert(offsetof(NetPacket_Repeat<0x2b11>, value) == 32, "offsetof(NetPacket_Repeat<0x2b11>, value) == 32"); static_assert(sizeof(NetPacket_Repeat<0x2b11>) == 36, "sizeof(NetPacket_Repeat<0x2b11>) == 36"); +static_assert(alignof(NetPacket_Repeat<0x2b11>) == 1, "alignof(NetPacket_Repeat<0x2b11>) == 1"); template<> struct NetPacket_Fixed<0x2b12> @@ -1338,6 +1369,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2b12>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x2b12>, char_id) == 2, "offsetof(NetPacket_Fixed<0x2b12>, char_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x2b12>, partner_id) == 6, "offsetof(NetPacket_Fixed<0x2b12>, partner_id) == 6"); static_assert(sizeof(NetPacket_Fixed<0x2b12>) == 10, "sizeof(NetPacket_Fixed<0x2b12>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x2b12>) == 1, "alignof(NetPacket_Fixed<0x2b12>) == 1"); template<> struct NetPacket_Fixed<0x2b13> @@ -1348,6 +1380,7 @@ struct NetPacket_Fixed<0x2b13> static_assert(offsetof(NetPacket_Fixed<0x2b13>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2b13>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x2b13>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2b13>, account_id) == 2"); static_assert(sizeof(NetPacket_Fixed<0x2b13>) == 6, "sizeof(NetPacket_Fixed<0x2b13>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x2b13>) == 1, "alignof(NetPacket_Fixed<0x2b13>) == 1"); template<> struct NetPacket_Fixed<0x2b14> @@ -1362,6 +1395,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2b14>, account_id) == 2, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x2b14>, ban_not_status) == 6, "offsetof(NetPacket_Fixed<0x2b14>, ban_not_status) == 6"); static_assert(offsetof(NetPacket_Fixed<0x2b14>, status_or_ban_until) == 7, "offsetof(NetPacket_Fixed<0x2b14>, status_or_ban_until) == 7"); static_assert(sizeof(NetPacket_Fixed<0x2b14>) == 11, "sizeof(NetPacket_Fixed<0x2b14>) == 11"); +static_assert(alignof(NetPacket_Fixed<0x2b14>) == 1, "alignof(NetPacket_Fixed<0x2b14>) == 1"); template<> struct NetPacket_Head<0x2b15> @@ -1372,6 +1406,7 @@ struct NetPacket_Head<0x2b15> static_assert(offsetof(NetPacket_Head<0x2b15>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x2b15>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Head<0x2b15>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x2b15>, magic_packet_length) == 2"); static_assert(sizeof(NetPacket_Head<0x2b15>) == 4, "sizeof(NetPacket_Head<0x2b15>) == 4"); +static_assert(alignof(NetPacket_Head<0x2b15>) == 1, "alignof(NetPacket_Head<0x2b15>) == 1"); template<> struct NetPacket_Repeat<0x2b15> { @@ -1381,6 +1416,7 @@ struct NetPacket_Repeat<0x2b15> static_assert(offsetof(NetPacket_Repeat<0x2b15>, account_id) == 0, "offsetof(NetPacket_Repeat<0x2b15>, account_id) == 0"); static_assert(offsetof(NetPacket_Repeat<0x2b15>, gm_level) == 4, "offsetof(NetPacket_Repeat<0x2b15>, gm_level) == 4"); static_assert(sizeof(NetPacket_Repeat<0x2b15>) == 5, "sizeof(NetPacket_Repeat<0x2b15>) == 5"); +static_assert(alignof(NetPacket_Repeat<0x2b15>) == 1, "alignof(NetPacket_Repeat<0x2b15>) == 1"); template<> struct NetPacket_Fixed<0x2b16> @@ -1391,6 +1427,7 @@ struct NetPacket_Fixed<0x2b16> static_assert(offsetof(NetPacket_Fixed<0x2b16>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2b16>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x2b16>, char_id) == 2, "offsetof(NetPacket_Fixed<0x2b16>, char_id) == 2"); static_assert(sizeof(NetPacket_Fixed<0x2b16>) == 6, "sizeof(NetPacket_Fixed<0x2b16>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x2b16>) == 1, "alignof(NetPacket_Fixed<0x2b16>) == 1"); template<> struct NetPacket_Head<0x3000> @@ -1401,6 +1438,7 @@ struct NetPacket_Head<0x3000> static_assert(offsetof(NetPacket_Head<0x3000>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x3000>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Head<0x3000>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x3000>, magic_packet_length) == 2"); static_assert(sizeof(NetPacket_Head<0x3000>) == 4, "sizeof(NetPacket_Head<0x3000>) == 4"); +static_assert(alignof(NetPacket_Head<0x3000>) == 1, "alignof(NetPacket_Head<0x3000>) == 1"); template<> struct NetPacket_Repeat<0x3000> { @@ -1408,6 +1446,7 @@ struct NetPacket_Repeat<0x3000> }; static_assert(offsetof(NetPacket_Repeat<0x3000>, c) == 0, "offsetof(NetPacket_Repeat<0x3000>, c) == 0"); static_assert(sizeof(NetPacket_Repeat<0x3000>) == 1, "sizeof(NetPacket_Repeat<0x3000>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x3000>) == 1, "alignof(NetPacket_Repeat<0x3000>) == 1"); template<> struct NetPacket_Head<0x3001> @@ -1422,6 +1461,7 @@ static_assert(offsetof(NetPacket_Head<0x3001>, magic_packet_length) == 2, "offse static_assert(offsetof(NetPacket_Head<0x3001>, from_char_name) == 4, "offsetof(NetPacket_Head<0x3001>, from_char_name) == 4"); static_assert(offsetof(NetPacket_Head<0x3001>, to_char_name) == 28, "offsetof(NetPacket_Head<0x3001>, to_char_name) == 28"); static_assert(sizeof(NetPacket_Head<0x3001>) == 52, "sizeof(NetPacket_Head<0x3001>) == 52"); +static_assert(alignof(NetPacket_Head<0x3001>) == 1, "alignof(NetPacket_Head<0x3001>) == 1"); template<> struct NetPacket_Repeat<0x3001> { @@ -1429,6 +1469,7 @@ struct NetPacket_Repeat<0x3001> }; static_assert(offsetof(NetPacket_Repeat<0x3001>, c) == 0, "offsetof(NetPacket_Repeat<0x3001>, c) == 0"); static_assert(sizeof(NetPacket_Repeat<0x3001>) == 1, "sizeof(NetPacket_Repeat<0x3001>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x3001>) == 1, "alignof(NetPacket_Repeat<0x3001>) == 1"); template<> struct NetPacket_Fixed<0x3002> @@ -1441,6 +1482,7 @@ static_assert(offsetof(NetPacket_Fixed<0x3002>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x3002>, char_id) == 2, "offsetof(NetPacket_Fixed<0x3002>, char_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x3002>, flag) == 6, "offsetof(NetPacket_Fixed<0x3002>, flag) == 6"); static_assert(sizeof(NetPacket_Fixed<0x3002>) == 7, "sizeof(NetPacket_Fixed<0x3002>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x3002>) == 1, "alignof(NetPacket_Fixed<0x3002>) == 1"); template<> struct NetPacket_Head<0x3003> @@ -1455,6 +1497,7 @@ static_assert(offsetof(NetPacket_Head<0x3003>, magic_packet_length) == 2, "offse static_assert(offsetof(NetPacket_Head<0x3003>, char_name) == 4, "offsetof(NetPacket_Head<0x3003>, char_name) == 4"); static_assert(offsetof(NetPacket_Head<0x3003>, min_gm_level) == 28, "offsetof(NetPacket_Head<0x3003>, min_gm_level) == 28"); static_assert(sizeof(NetPacket_Head<0x3003>) == 30, "sizeof(NetPacket_Head<0x3003>) == 30"); +static_assert(alignof(NetPacket_Head<0x3003>) == 1, "alignof(NetPacket_Head<0x3003>) == 1"); template<> struct NetPacket_Repeat<0x3003> { @@ -1462,6 +1505,7 @@ struct NetPacket_Repeat<0x3003> }; static_assert(offsetof(NetPacket_Repeat<0x3003>, c) == 0, "offsetof(NetPacket_Repeat<0x3003>, c) == 0"); static_assert(sizeof(NetPacket_Repeat<0x3003>) == 1, "sizeof(NetPacket_Repeat<0x3003>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x3003>) == 1, "alignof(NetPacket_Repeat<0x3003>) == 1"); template<> struct NetPacket_Head<0x3004> @@ -1474,6 +1518,7 @@ static_assert(offsetof(NetPacket_Head<0x3004>, magic_packet_id) == 0, "offsetof( static_assert(offsetof(NetPacket_Head<0x3004>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x3004>, magic_packet_length) == 2"); static_assert(offsetof(NetPacket_Head<0x3004>, account_id) == 4, "offsetof(NetPacket_Head<0x3004>, account_id) == 4"); static_assert(sizeof(NetPacket_Head<0x3004>) == 8, "sizeof(NetPacket_Head<0x3004>) == 8"); +static_assert(alignof(NetPacket_Head<0x3004>) == 1, "alignof(NetPacket_Head<0x3004>) == 1"); template<> struct NetPacket_Repeat<0x3004> { @@ -1483,6 +1528,7 @@ struct NetPacket_Repeat<0x3004> static_assert(offsetof(NetPacket_Repeat<0x3004>, name) == 0, "offsetof(NetPacket_Repeat<0x3004>, name) == 0"); static_assert(offsetof(NetPacket_Repeat<0x3004>, value) == 32, "offsetof(NetPacket_Repeat<0x3004>, value) == 32"); static_assert(sizeof(NetPacket_Repeat<0x3004>) == 36, "sizeof(NetPacket_Repeat<0x3004>) == 36"); +static_assert(alignof(NetPacket_Repeat<0x3004>) == 1, "alignof(NetPacket_Repeat<0x3004>) == 1"); template<> struct NetPacket_Fixed<0x3005> @@ -1493,6 +1539,7 @@ struct NetPacket_Fixed<0x3005> static_assert(offsetof(NetPacket_Fixed<0x3005>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x3005>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x3005>, account_id) == 2, "offsetof(NetPacket_Fixed<0x3005>, account_id) == 2"); static_assert(sizeof(NetPacket_Fixed<0x3005>) == 6, "sizeof(NetPacket_Fixed<0x3005>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x3005>) == 1, "alignof(NetPacket_Fixed<0x3005>) == 1"); template<> struct NetPacket_Fixed<0x3010> @@ -1503,6 +1550,7 @@ struct NetPacket_Fixed<0x3010> static_assert(offsetof(NetPacket_Fixed<0x3010>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x3010>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x3010>, account_id) == 2, "offsetof(NetPacket_Fixed<0x3010>, account_id) == 2"); static_assert(sizeof(NetPacket_Fixed<0x3010>) == 6, "sizeof(NetPacket_Fixed<0x3010>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x3010>) == 1, "alignof(NetPacket_Fixed<0x3010>) == 1"); template<> struct NetPacket_Payload<0x3011> @@ -1516,6 +1564,7 @@ static_assert(offsetof(NetPacket_Payload<0x3011>, magic_packet_id) == 0, "offset static_assert(offsetof(NetPacket_Payload<0x3011>, magic_packet_length) == 2, "offsetof(NetPacket_Payload<0x3011>, magic_packet_length) == 2"); static_assert(offsetof(NetPacket_Payload<0x3011>, account_id) == 4, "offsetof(NetPacket_Payload<0x3011>, account_id) == 4"); static_assert(offsetof(NetPacket_Payload<0x3011>, storage) == 8, "offsetof(NetPacket_Payload<0x3011>, storage) == 8"); +static_assert(alignof(NetPacket_Payload<0x3011>) == 1, "alignof(NetPacket_Payload<0x3011>) == 1"); template<> struct NetPacket_Fixed<0x3020> @@ -1534,6 +1583,7 @@ static_assert(offsetof(NetPacket_Fixed<0x3020>, char_name) == 30, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x3020>, map_name) == 54, "offsetof(NetPacket_Fixed<0x3020>, map_name) == 54"); static_assert(offsetof(NetPacket_Fixed<0x3020>, level) == 70, "offsetof(NetPacket_Fixed<0x3020>, level) == 70"); static_assert(sizeof(NetPacket_Fixed<0x3020>) == 72, "sizeof(NetPacket_Fixed<0x3020>) == 72"); +static_assert(alignof(NetPacket_Fixed<0x3020>) == 1, "alignof(NetPacket_Fixed<0x3020>) == 1"); template<> struct NetPacket_Fixed<0x3021> @@ -1544,6 +1594,7 @@ struct NetPacket_Fixed<0x3021> static_assert(offsetof(NetPacket_Fixed<0x3021>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x3021>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x3021>, party_id) == 2, "offsetof(NetPacket_Fixed<0x3021>, party_id) == 2"); static_assert(sizeof(NetPacket_Fixed<0x3021>) == 6, "sizeof(NetPacket_Fixed<0x3021>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x3021>) == 1, "alignof(NetPacket_Fixed<0x3021>) == 1"); template<> struct NetPacket_Fixed<0x3022> @@ -1562,6 +1613,7 @@ static_assert(offsetof(NetPacket_Fixed<0x3022>, char_name) == 10, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x3022>, map_name) == 34, "offsetof(NetPacket_Fixed<0x3022>, map_name) == 34"); static_assert(offsetof(NetPacket_Fixed<0x3022>, level) == 50, "offsetof(NetPacket_Fixed<0x3022>, level) == 50"); static_assert(sizeof(NetPacket_Fixed<0x3022>) == 52, "sizeof(NetPacket_Fixed<0x3022>) == 52"); +static_assert(alignof(NetPacket_Fixed<0x3022>) == 1, "alignof(NetPacket_Fixed<0x3022>) == 1"); template<> struct NetPacket_Fixed<0x3023> @@ -1578,6 +1630,7 @@ static_assert(offsetof(NetPacket_Fixed<0x3023>, account_id) == 6, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x3023>, exp) == 10, "offsetof(NetPacket_Fixed<0x3023>, exp) == 10"); static_assert(offsetof(NetPacket_Fixed<0x3023>, item) == 12, "offsetof(NetPacket_Fixed<0x3023>, item) == 12"); static_assert(sizeof(NetPacket_Fixed<0x3023>) == 14, "sizeof(NetPacket_Fixed<0x3023>) == 14"); +static_assert(alignof(NetPacket_Fixed<0x3023>) == 1, "alignof(NetPacket_Fixed<0x3023>) == 1"); template<> struct NetPacket_Fixed<0x3024> @@ -1590,6 +1643,7 @@ static_assert(offsetof(NetPacket_Fixed<0x3024>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x3024>, party_id) == 2, "offsetof(NetPacket_Fixed<0x3024>, party_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x3024>, account_id) == 6, "offsetof(NetPacket_Fixed<0x3024>, account_id) == 6"); static_assert(sizeof(NetPacket_Fixed<0x3024>) == 10, "sizeof(NetPacket_Fixed<0x3024>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x3024>) == 1, "alignof(NetPacket_Fixed<0x3024>) == 1"); template<> struct NetPacket_Fixed<0x3025> @@ -1608,6 +1662,7 @@ static_assert(offsetof(NetPacket_Fixed<0x3025>, map_name) == 10, "offsetof(NetPa static_assert(offsetof(NetPacket_Fixed<0x3025>, online) == 26, "offsetof(NetPacket_Fixed<0x3025>, online) == 26"); static_assert(offsetof(NetPacket_Fixed<0x3025>, level) == 27, "offsetof(NetPacket_Fixed<0x3025>, level) == 27"); static_assert(sizeof(NetPacket_Fixed<0x3025>) == 29, "sizeof(NetPacket_Fixed<0x3025>) == 29"); +static_assert(alignof(NetPacket_Fixed<0x3025>) == 1, "alignof(NetPacket_Fixed<0x3025>) == 1"); template<> struct NetPacket_Fixed<0x3026> @@ -1618,6 +1673,7 @@ struct NetPacket_Fixed<0x3026> static_assert(offsetof(NetPacket_Fixed<0x3026>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x3026>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x3026>, party_id) == 2, "offsetof(NetPacket_Fixed<0x3026>, party_id) == 2"); static_assert(sizeof(NetPacket_Fixed<0x3026>) == 6, "sizeof(NetPacket_Fixed<0x3026>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x3026>) == 1, "alignof(NetPacket_Fixed<0x3026>) == 1"); template<> struct NetPacket_Head<0x3027> @@ -1632,6 +1688,7 @@ static_assert(offsetof(NetPacket_Head<0x3027>, magic_packet_length) == 2, "offse static_assert(offsetof(NetPacket_Head<0x3027>, party_id) == 4, "offsetof(NetPacket_Head<0x3027>, party_id) == 4"); static_assert(offsetof(NetPacket_Head<0x3027>, account_id) == 8, "offsetof(NetPacket_Head<0x3027>, account_id) == 8"); static_assert(sizeof(NetPacket_Head<0x3027>) == 12, "sizeof(NetPacket_Head<0x3027>) == 12"); +static_assert(alignof(NetPacket_Head<0x3027>) == 1, "alignof(NetPacket_Head<0x3027>) == 1"); template<> struct NetPacket_Repeat<0x3027> { @@ -1639,6 +1696,7 @@ struct NetPacket_Repeat<0x3027> }; static_assert(offsetof(NetPacket_Repeat<0x3027>, c) == 0, "offsetof(NetPacket_Repeat<0x3027>, c) == 0"); static_assert(sizeof(NetPacket_Repeat<0x3027>) == 1, "sizeof(NetPacket_Repeat<0x3027>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x3027>) == 1, "alignof(NetPacket_Repeat<0x3027>) == 1"); template<> struct NetPacket_Fixed<0x3028> @@ -1653,6 +1711,7 @@ static_assert(offsetof(NetPacket_Fixed<0x3028>, party_id) == 2, "offsetof(NetPac static_assert(offsetof(NetPacket_Fixed<0x3028>, account_id) == 6, "offsetof(NetPacket_Fixed<0x3028>, account_id) == 6"); static_assert(offsetof(NetPacket_Fixed<0x3028>, char_name) == 10, "offsetof(NetPacket_Fixed<0x3028>, char_name) == 10"); static_assert(sizeof(NetPacket_Fixed<0x3028>) == 34, "sizeof(NetPacket_Fixed<0x3028>) == 34"); +static_assert(alignof(NetPacket_Fixed<0x3028>) == 1, "alignof(NetPacket_Fixed<0x3028>) == 1"); template<> struct NetPacket_Head<0x3800> @@ -1663,6 +1722,7 @@ struct NetPacket_Head<0x3800> static_assert(offsetof(NetPacket_Head<0x3800>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x3800>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Head<0x3800>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x3800>, magic_packet_length) == 2"); static_assert(sizeof(NetPacket_Head<0x3800>) == 4, "sizeof(NetPacket_Head<0x3800>) == 4"); +static_assert(alignof(NetPacket_Head<0x3800>) == 1, "alignof(NetPacket_Head<0x3800>) == 1"); template<> struct NetPacket_Repeat<0x3800> { @@ -1670,6 +1730,7 @@ struct NetPacket_Repeat<0x3800> }; static_assert(offsetof(NetPacket_Repeat<0x3800>, c) == 0, "offsetof(NetPacket_Repeat<0x3800>, c) == 0"); static_assert(sizeof(NetPacket_Repeat<0x3800>) == 1, "sizeof(NetPacket_Repeat<0x3800>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x3800>) == 1, "alignof(NetPacket_Repeat<0x3800>) == 1"); template<> struct NetPacket_Head<0x3801> @@ -1686,6 +1747,7 @@ static_assert(offsetof(NetPacket_Head<0x3801>, whisper_id) == 4, "offsetof(NetPa static_assert(offsetof(NetPacket_Head<0x3801>, src_char_name) == 8, "offsetof(NetPacket_Head<0x3801>, src_char_name) == 8"); static_assert(offsetof(NetPacket_Head<0x3801>, dst_char_name) == 32, "offsetof(NetPacket_Head<0x3801>, dst_char_name) == 32"); static_assert(sizeof(NetPacket_Head<0x3801>) == 56, "sizeof(NetPacket_Head<0x3801>) == 56"); +static_assert(alignof(NetPacket_Head<0x3801>) == 1, "alignof(NetPacket_Head<0x3801>) == 1"); template<> struct NetPacket_Repeat<0x3801> { @@ -1693,6 +1755,7 @@ struct NetPacket_Repeat<0x3801> }; static_assert(offsetof(NetPacket_Repeat<0x3801>, c) == 0, "offsetof(NetPacket_Repeat<0x3801>, c) == 0"); static_assert(sizeof(NetPacket_Repeat<0x3801>) == 1, "sizeof(NetPacket_Repeat<0x3801>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x3801>) == 1, "alignof(NetPacket_Repeat<0x3801>) == 1"); template<> struct NetPacket_Fixed<0x3802> @@ -1705,6 +1768,7 @@ static_assert(offsetof(NetPacket_Fixed<0x3802>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x3802>, sender_char_name) == 2, "offsetof(NetPacket_Fixed<0x3802>, sender_char_name) == 2"); static_assert(offsetof(NetPacket_Fixed<0x3802>, flag) == 26, "offsetof(NetPacket_Fixed<0x3802>, flag) == 26"); static_assert(sizeof(NetPacket_Fixed<0x3802>) == 27, "sizeof(NetPacket_Fixed<0x3802>) == 27"); +static_assert(alignof(NetPacket_Fixed<0x3802>) == 1, "alignof(NetPacket_Fixed<0x3802>) == 1"); template<> struct NetPacket_Head<0x3803> @@ -1719,6 +1783,7 @@ static_assert(offsetof(NetPacket_Head<0x3803>, magic_packet_length) == 2, "offse static_assert(offsetof(NetPacket_Head<0x3803>, char_name) == 4, "offsetof(NetPacket_Head<0x3803>, char_name) == 4"); static_assert(offsetof(NetPacket_Head<0x3803>, min_gm_level) == 28, "offsetof(NetPacket_Head<0x3803>, min_gm_level) == 28"); static_assert(sizeof(NetPacket_Head<0x3803>) == 30, "sizeof(NetPacket_Head<0x3803>) == 30"); +static_assert(alignof(NetPacket_Head<0x3803>) == 1, "alignof(NetPacket_Head<0x3803>) == 1"); template<> struct NetPacket_Repeat<0x3803> { @@ -1726,6 +1791,7 @@ struct NetPacket_Repeat<0x3803> }; static_assert(offsetof(NetPacket_Repeat<0x3803>, c) == 0, "offsetof(NetPacket_Repeat<0x3803>, c) == 0"); static_assert(sizeof(NetPacket_Repeat<0x3803>) == 1, "sizeof(NetPacket_Repeat<0x3803>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x3803>) == 1, "alignof(NetPacket_Repeat<0x3803>) == 1"); template<> struct NetPacket_Head<0x3804> @@ -1738,6 +1804,7 @@ static_assert(offsetof(NetPacket_Head<0x3804>, magic_packet_id) == 0, "offsetof( static_assert(offsetof(NetPacket_Head<0x3804>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x3804>, magic_packet_length) == 2"); static_assert(offsetof(NetPacket_Head<0x3804>, account_id) == 4, "offsetof(NetPacket_Head<0x3804>, account_id) == 4"); static_assert(sizeof(NetPacket_Head<0x3804>) == 8, "sizeof(NetPacket_Head<0x3804>) == 8"); +static_assert(alignof(NetPacket_Head<0x3804>) == 1, "alignof(NetPacket_Head<0x3804>) == 1"); template<> struct NetPacket_Repeat<0x3804> { @@ -1747,6 +1814,7 @@ struct NetPacket_Repeat<0x3804> static_assert(offsetof(NetPacket_Repeat<0x3804>, name) == 0, "offsetof(NetPacket_Repeat<0x3804>, name) == 0"); static_assert(offsetof(NetPacket_Repeat<0x3804>, value) == 32, "offsetof(NetPacket_Repeat<0x3804>, value) == 32"); static_assert(sizeof(NetPacket_Repeat<0x3804>) == 36, "sizeof(NetPacket_Repeat<0x3804>) == 36"); +static_assert(alignof(NetPacket_Repeat<0x3804>) == 1, "alignof(NetPacket_Repeat<0x3804>) == 1"); template<> struct NetPacket_Payload<0x3810> @@ -1760,6 +1828,7 @@ static_assert(offsetof(NetPacket_Payload<0x3810>, magic_packet_id) == 0, "offset static_assert(offsetof(NetPacket_Payload<0x3810>, magic_packet_length) == 2, "offsetof(NetPacket_Payload<0x3810>, magic_packet_length) == 2"); static_assert(offsetof(NetPacket_Payload<0x3810>, account_id) == 4, "offsetof(NetPacket_Payload<0x3810>, account_id) == 4"); static_assert(offsetof(NetPacket_Payload<0x3810>, storage) == 8, "offsetof(NetPacket_Payload<0x3810>, storage) == 8"); +static_assert(alignof(NetPacket_Payload<0x3810>) == 1, "alignof(NetPacket_Payload<0x3810>) == 1"); template<> struct NetPacket_Fixed<0x3811> @@ -1772,6 +1841,7 @@ static_assert(offsetof(NetPacket_Fixed<0x3811>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x3811>, account_id) == 2, "offsetof(NetPacket_Fixed<0x3811>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x3811>, unknown) == 6, "offsetof(NetPacket_Fixed<0x3811>, unknown) == 6"); static_assert(sizeof(NetPacket_Fixed<0x3811>) == 7, "sizeof(NetPacket_Fixed<0x3811>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x3811>) == 1, "alignof(NetPacket_Fixed<0x3811>) == 1"); template<> struct NetPacket_Fixed<0x3820> @@ -1788,6 +1858,7 @@ static_assert(offsetof(NetPacket_Fixed<0x3820>, error) == 6, "offsetof(NetPacket static_assert(offsetof(NetPacket_Fixed<0x3820>, party_id) == 7, "offsetof(NetPacket_Fixed<0x3820>, party_id) == 7"); static_assert(offsetof(NetPacket_Fixed<0x3820>, party_name) == 11, "offsetof(NetPacket_Fixed<0x3820>, party_name) == 11"); static_assert(sizeof(NetPacket_Fixed<0x3820>) == 35, "sizeof(NetPacket_Fixed<0x3820>) == 35"); +static_assert(alignof(NetPacket_Fixed<0x3820>) == 1, "alignof(NetPacket_Fixed<0x3820>) == 1"); template<> struct NetPacket_Head<0x3821> @@ -1800,12 +1871,14 @@ static_assert(offsetof(NetPacket_Head<0x3821>, magic_packet_id) == 0, "offsetof( static_assert(offsetof(NetPacket_Head<0x3821>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x3821>, magic_packet_length) == 2"); static_assert(offsetof(NetPacket_Head<0x3821>, party_id) == 4, "offsetof(NetPacket_Head<0x3821>, party_id) == 4"); static_assert(sizeof(NetPacket_Head<0x3821>) == 8, "sizeof(NetPacket_Head<0x3821>) == 8"); +static_assert(alignof(NetPacket_Head<0x3821>) == 1, "alignof(NetPacket_Head<0x3821>) == 1"); template<> struct NetPacket_Option<0x3821> { PartyMost party_most; }; static_assert(offsetof(NetPacket_Option<0x3821>, party_most) == 0, "offsetof(NetPacket_Option<0x3821>, party_most) == 0"); +static_assert(alignof(NetPacket_Option<0x3821>) == 1, "alignof(NetPacket_Option<0x3821>) == 1"); template<> struct NetPacket_Fixed<0x3822> @@ -1820,6 +1893,7 @@ static_assert(offsetof(NetPacket_Fixed<0x3822>, party_id) == 2, "offsetof(NetPac static_assert(offsetof(NetPacket_Fixed<0x3822>, account_id) == 6, "offsetof(NetPacket_Fixed<0x3822>, account_id) == 6"); static_assert(offsetof(NetPacket_Fixed<0x3822>, flag) == 10, "offsetof(NetPacket_Fixed<0x3822>, flag) == 10"); static_assert(sizeof(NetPacket_Fixed<0x3822>) == 11, "sizeof(NetPacket_Fixed<0x3822>) == 11"); +static_assert(alignof(NetPacket_Fixed<0x3822>) == 1, "alignof(NetPacket_Fixed<0x3822>) == 1"); template<> struct NetPacket_Fixed<0x3823> @@ -1838,6 +1912,7 @@ static_assert(offsetof(NetPacket_Fixed<0x3823>, exp) == 10, "offsetof(NetPacket_ static_assert(offsetof(NetPacket_Fixed<0x3823>, item) == 12, "offsetof(NetPacket_Fixed<0x3823>, item) == 12"); static_assert(offsetof(NetPacket_Fixed<0x3823>, flag) == 14, "offsetof(NetPacket_Fixed<0x3823>, flag) == 14"); static_assert(sizeof(NetPacket_Fixed<0x3823>) == 15, "sizeof(NetPacket_Fixed<0x3823>) == 15"); +static_assert(alignof(NetPacket_Fixed<0x3823>) == 1, "alignof(NetPacket_Fixed<0x3823>) == 1"); template<> struct NetPacket_Fixed<0x3824> @@ -1852,6 +1927,7 @@ static_assert(offsetof(NetPacket_Fixed<0x3824>, party_id) == 2, "offsetof(NetPac static_assert(offsetof(NetPacket_Fixed<0x3824>, account_id) == 6, "offsetof(NetPacket_Fixed<0x3824>, account_id) == 6"); static_assert(offsetof(NetPacket_Fixed<0x3824>, char_name) == 10, "offsetof(NetPacket_Fixed<0x3824>, char_name) == 10"); static_assert(sizeof(NetPacket_Fixed<0x3824>) == 34, "sizeof(NetPacket_Fixed<0x3824>) == 34"); +static_assert(alignof(NetPacket_Fixed<0x3824>) == 1, "alignof(NetPacket_Fixed<0x3824>) == 1"); template<> struct NetPacket_Fixed<0x3825> @@ -1870,6 +1946,7 @@ static_assert(offsetof(NetPacket_Fixed<0x3825>, map_name) == 10, "offsetof(NetPa static_assert(offsetof(NetPacket_Fixed<0x3825>, online) == 26, "offsetof(NetPacket_Fixed<0x3825>, online) == 26"); static_assert(offsetof(NetPacket_Fixed<0x3825>, level) == 27, "offsetof(NetPacket_Fixed<0x3825>, level) == 27"); static_assert(sizeof(NetPacket_Fixed<0x3825>) == 29, "sizeof(NetPacket_Fixed<0x3825>) == 29"); +static_assert(alignof(NetPacket_Fixed<0x3825>) == 1, "alignof(NetPacket_Fixed<0x3825>) == 1"); template<> struct NetPacket_Fixed<0x3826> @@ -1882,6 +1959,7 @@ static_assert(offsetof(NetPacket_Fixed<0x3826>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x3826>, party_id) == 2, "offsetof(NetPacket_Fixed<0x3826>, party_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x3826>, flag) == 6, "offsetof(NetPacket_Fixed<0x3826>, flag) == 6"); static_assert(sizeof(NetPacket_Fixed<0x3826>) == 7, "sizeof(NetPacket_Fixed<0x3826>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x3826>) == 1, "alignof(NetPacket_Fixed<0x3826>) == 1"); template<> struct NetPacket_Head<0x3827> @@ -1896,6 +1974,7 @@ static_assert(offsetof(NetPacket_Head<0x3827>, magic_packet_length) == 2, "offse static_assert(offsetof(NetPacket_Head<0x3827>, party_id) == 4, "offsetof(NetPacket_Head<0x3827>, party_id) == 4"); static_assert(offsetof(NetPacket_Head<0x3827>, account_id) == 8, "offsetof(NetPacket_Head<0x3827>, account_id) == 8"); static_assert(sizeof(NetPacket_Head<0x3827>) == 12, "sizeof(NetPacket_Head<0x3827>) == 12"); +static_assert(alignof(NetPacket_Head<0x3827>) == 1, "alignof(NetPacket_Head<0x3827>) == 1"); template<> struct NetPacket_Repeat<0x3827> { @@ -1903,6 +1982,7 @@ struct NetPacket_Repeat<0x3827> }; static_assert(offsetof(NetPacket_Repeat<0x3827>, c) == 0, "offsetof(NetPacket_Repeat<0x3827>, c) == 0"); static_assert(sizeof(NetPacket_Repeat<0x3827>) == 1, "sizeof(NetPacket_Repeat<0x3827>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x3827>) == 1, "alignof(NetPacket_Repeat<0x3827>) == 1"); inline __attribute__((warn_unused_result)) @@ -3456,6 +3536,6 @@ bool network_to_native(Packet_Repeat<0x3827> *native, NetPacket_Repeat<0x3827> n } -#pragma pack(pop) +# pragma pack(pop) #endif // TMWA_PROTO2_CHAR_MAP_HPP diff --git a/src/proto2/char-user.hpp b/src/proto2/char-user.hpp index 3a51a2a..2c1d1ac 100644 --- a/src/proto2/char-user.hpp +++ b/src/proto2/char-user.hpp @@ -28,7 +28,7 @@ // This is a public protocol, and changes require client cooperation // this is only needed for the payload packet right now, and that needs to die -#pragma pack(push, 1) +# pragma pack(push, 1) template<> struct Packet_Fixed<0x0061> @@ -193,6 +193,7 @@ static_assert(offsetof(NetPacket_Fixed<0x0061>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x0061>, old_pass) == 2, "offsetof(NetPacket_Fixed<0x0061>, old_pass) == 2"); static_assert(offsetof(NetPacket_Fixed<0x0061>, new_pass) == 26, "offsetof(NetPacket_Fixed<0x0061>, new_pass) == 26"); static_assert(sizeof(NetPacket_Fixed<0x0061>) == 50, "sizeof(NetPacket_Fixed<0x0061>) == 50"); +static_assert(alignof(NetPacket_Fixed<0x0061>) == 1, "alignof(NetPacket_Fixed<0x0061>) == 1"); template<> struct NetPacket_Fixed<0x0062> @@ -203,6 +204,7 @@ struct NetPacket_Fixed<0x0062> static_assert(offsetof(NetPacket_Fixed<0x0062>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0062>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x0062>, status) == 2, "offsetof(NetPacket_Fixed<0x0062>, status) == 2"); static_assert(sizeof(NetPacket_Fixed<0x0062>) == 3, "sizeof(NetPacket_Fixed<0x0062>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x0062>) == 1, "alignof(NetPacket_Fixed<0x0062>) == 1"); template<> struct NetPacket_Fixed<0x0065> @@ -221,6 +223,7 @@ static_assert(offsetof(NetPacket_Fixed<0x0065>, login_id2) == 10, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x0065>, packet_tmw_version) == 14, "offsetof(NetPacket_Fixed<0x0065>, packet_tmw_version) == 14"); static_assert(offsetof(NetPacket_Fixed<0x0065>, sex) == 16, "offsetof(NetPacket_Fixed<0x0065>, sex) == 16"); static_assert(sizeof(NetPacket_Fixed<0x0065>) == 17, "sizeof(NetPacket_Fixed<0x0065>) == 17"); +static_assert(alignof(NetPacket_Fixed<0x0065>) == 1, "alignof(NetPacket_Fixed<0x0065>) == 1"); template<> struct NetPacket_Fixed<0x0066> @@ -231,6 +234,7 @@ struct NetPacket_Fixed<0x0066> static_assert(offsetof(NetPacket_Fixed<0x0066>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0066>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x0066>, code) == 2, "offsetof(NetPacket_Fixed<0x0066>, code) == 2"); static_assert(sizeof(NetPacket_Fixed<0x0066>) == 3, "sizeof(NetPacket_Fixed<0x0066>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x0066>) == 1, "alignof(NetPacket_Fixed<0x0066>) == 1"); template<> struct NetPacket_Fixed<0x0067> @@ -249,6 +253,7 @@ static_assert(offsetof(NetPacket_Fixed<0x0067>, slot) == 32, "offsetof(NetPacket static_assert(offsetof(NetPacket_Fixed<0x0067>, hair_color) == 33, "offsetof(NetPacket_Fixed<0x0067>, hair_color) == 33"); static_assert(offsetof(NetPacket_Fixed<0x0067>, hair_style) == 35, "offsetof(NetPacket_Fixed<0x0067>, hair_style) == 35"); static_assert(sizeof(NetPacket_Fixed<0x0067>) == 37, "sizeof(NetPacket_Fixed<0x0067>) == 37"); +static_assert(alignof(NetPacket_Fixed<0x0067>) == 1, "alignof(NetPacket_Fixed<0x0067>) == 1"); template<> struct NetPacket_Fixed<0x0068> @@ -261,6 +266,7 @@ static_assert(offsetof(NetPacket_Fixed<0x0068>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x0068>, char_id) == 2, "offsetof(NetPacket_Fixed<0x0068>, char_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x0068>, email) == 6, "offsetof(NetPacket_Fixed<0x0068>, email) == 6"); static_assert(sizeof(NetPacket_Fixed<0x0068>) == 46, "sizeof(NetPacket_Fixed<0x0068>) == 46"); +static_assert(alignof(NetPacket_Fixed<0x0068>) == 1, "alignof(NetPacket_Fixed<0x0068>) == 1"); template<> struct NetPacket_Head<0x006b> @@ -273,6 +279,7 @@ static_assert(offsetof(NetPacket_Head<0x006b>, magic_packet_id) == 0, "offsetof( static_assert(offsetof(NetPacket_Head<0x006b>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x006b>, magic_packet_length) == 2"); static_assert(offsetof(NetPacket_Head<0x006b>, unused) == 4, "offsetof(NetPacket_Head<0x006b>, unused) == 4"); static_assert(sizeof(NetPacket_Head<0x006b>) == 24, "sizeof(NetPacket_Head<0x006b>) == 24"); +static_assert(alignof(NetPacket_Head<0x006b>) == 1, "alignof(NetPacket_Head<0x006b>) == 1"); template<> struct NetPacket_Repeat<0x006b> { @@ -280,6 +287,7 @@ struct NetPacket_Repeat<0x006b> }; static_assert(offsetof(NetPacket_Repeat<0x006b>, char_select) == 0, "offsetof(NetPacket_Repeat<0x006b>, char_select) == 0"); static_assert(sizeof(NetPacket_Repeat<0x006b>) == 106, "sizeof(NetPacket_Repeat<0x006b>) == 106"); +static_assert(alignof(NetPacket_Repeat<0x006b>) == 1, "alignof(NetPacket_Repeat<0x006b>) == 1"); template<> struct NetPacket_Fixed<0x006c> @@ -290,6 +298,7 @@ struct NetPacket_Fixed<0x006c> static_assert(offsetof(NetPacket_Fixed<0x006c>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x006c>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x006c>, code) == 2, "offsetof(NetPacket_Fixed<0x006c>, code) == 2"); static_assert(sizeof(NetPacket_Fixed<0x006c>) == 3, "sizeof(NetPacket_Fixed<0x006c>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x006c>) == 1, "alignof(NetPacket_Fixed<0x006c>) == 1"); template<> struct NetPacket_Fixed<0x006d> @@ -300,6 +309,7 @@ struct NetPacket_Fixed<0x006d> static_assert(offsetof(NetPacket_Fixed<0x006d>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x006d>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x006d>, char_select) == 2, "offsetof(NetPacket_Fixed<0x006d>, char_select) == 2"); static_assert(sizeof(NetPacket_Fixed<0x006d>) == 108, "sizeof(NetPacket_Fixed<0x006d>) == 108"); +static_assert(alignof(NetPacket_Fixed<0x006d>) == 1, "alignof(NetPacket_Fixed<0x006d>) == 1"); template<> struct NetPacket_Fixed<0x006e> @@ -310,6 +320,7 @@ struct NetPacket_Fixed<0x006e> static_assert(offsetof(NetPacket_Fixed<0x006e>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x006e>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x006e>, code) == 2, "offsetof(NetPacket_Fixed<0x006e>, code) == 2"); static_assert(sizeof(NetPacket_Fixed<0x006e>) == 3, "sizeof(NetPacket_Fixed<0x006e>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x006e>) == 1, "alignof(NetPacket_Fixed<0x006e>) == 1"); template<> struct NetPacket_Fixed<0x006f> @@ -318,6 +329,7 @@ struct NetPacket_Fixed<0x006f> }; static_assert(offsetof(NetPacket_Fixed<0x006f>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x006f>, magic_packet_id) == 0"); static_assert(sizeof(NetPacket_Fixed<0x006f>) == 2, "sizeof(NetPacket_Fixed<0x006f>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x006f>) == 1, "alignof(NetPacket_Fixed<0x006f>) == 1"); template<> struct NetPacket_Fixed<0x0070> @@ -328,6 +340,7 @@ struct NetPacket_Fixed<0x0070> static_assert(offsetof(NetPacket_Fixed<0x0070>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0070>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x0070>, code) == 2, "offsetof(NetPacket_Fixed<0x0070>, code) == 2"); static_assert(sizeof(NetPacket_Fixed<0x0070>) == 3, "sizeof(NetPacket_Fixed<0x0070>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x0070>) == 1, "alignof(NetPacket_Fixed<0x0070>) == 1"); template<> struct NetPacket_Fixed<0x0071> @@ -344,6 +357,7 @@ static_assert(offsetof(NetPacket_Fixed<0x0071>, map_name) == 6, "offsetof(NetPac static_assert(offsetof(NetPacket_Fixed<0x0071>, ip) == 22, "offsetof(NetPacket_Fixed<0x0071>, ip) == 22"); static_assert(offsetof(NetPacket_Fixed<0x0071>, port) == 26, "offsetof(NetPacket_Fixed<0x0071>, port) == 26"); static_assert(sizeof(NetPacket_Fixed<0x0071>) == 28, "sizeof(NetPacket_Fixed<0x0071>) == 28"); +static_assert(alignof(NetPacket_Fixed<0x0071>) == 1, "alignof(NetPacket_Fixed<0x0071>) == 1"); inline __attribute__((warn_unused_result)) @@ -608,6 +622,6 @@ bool network_to_native(Packet_Fixed<0x0071> *native, NetPacket_Fixed<0x0071> net } -#pragma pack(pop) +# pragma pack(pop) #endif // TMWA_PROTO2_CHAR_USER_HPP diff --git a/src/proto2/fwd.hpp b/src/proto2/fwd.hpp index 169f5e2..d41b7fe 100644 --- a/src/proto2/fwd.hpp +++ b/src/proto2/fwd.hpp @@ -904,6 +904,790 @@ struct NetPacket_Fixed<0x0071>; template<> +struct Packet_Fixed<0x0072>; +template<> +struct NetPacket_Fixed<0x0072>; + +template<> +struct Packet_Fixed<0x0073>; +template<> +struct NetPacket_Fixed<0x0073>; + +template<> +struct Packet_Fixed<0x0078>; +template<> +struct NetPacket_Fixed<0x0078>; + +template<> +struct Packet_Fixed<0x007b>; +template<> +struct NetPacket_Fixed<0x007b>; + +template<> +struct Packet_Fixed<0x007c>; +template<> +struct NetPacket_Fixed<0x007c>; + +template<> +struct Packet_Fixed<0x007d>; +template<> +struct NetPacket_Fixed<0x007d>; + +template<> +struct Packet_Fixed<0x007e>; +template<> +struct NetPacket_Fixed<0x007e>; + +template<> +struct Packet_Fixed<0x007f>; +template<> +struct NetPacket_Fixed<0x007f>; + +template<> +struct Packet_Fixed<0x0080>; +template<> +struct NetPacket_Fixed<0x0080>; + +template<> +struct Packet_Fixed<0x0085>; +template<> +struct NetPacket_Fixed<0x0085>; + +template<> +struct Packet_Fixed<0x0087>; +template<> +struct NetPacket_Fixed<0x0087>; + +template<> +struct Packet_Fixed<0x0088>; +template<> +struct NetPacket_Fixed<0x0088>; + +template<> +struct Packet_Fixed<0x0089>; +template<> +struct NetPacket_Fixed<0x0089>; + +template<> +struct Packet_Fixed<0x008a>; +template<> +struct NetPacket_Fixed<0x008a>; + +template<> +struct Packet_Head<0x008c>; +template<> +struct NetPacket_Head<0x008c>; +template<> +struct Packet_Repeat<0x008c>; +template<> +struct NetPacket_Repeat<0x008c>; + +template<> +struct Packet_Head<0x008d>; +template<> +struct NetPacket_Head<0x008d>; +template<> +struct Packet_Repeat<0x008d>; +template<> +struct NetPacket_Repeat<0x008d>; + +template<> +struct Packet_Head<0x008e>; +template<> +struct NetPacket_Head<0x008e>; +template<> +struct Packet_Repeat<0x008e>; +template<> +struct NetPacket_Repeat<0x008e>; + +template<> +struct Packet_Fixed<0x0090>; +template<> +struct NetPacket_Fixed<0x0090>; + +template<> +struct Packet_Fixed<0x0091>; +template<> +struct NetPacket_Fixed<0x0091>; + +template<> +struct Packet_Fixed<0x0092>; +template<> +struct NetPacket_Fixed<0x0092>; + +template<> +struct Packet_Fixed<0x0094>; +template<> +struct NetPacket_Fixed<0x0094>; + +template<> +struct Packet_Fixed<0x0095>; +template<> +struct NetPacket_Fixed<0x0095>; + +template<> +struct Packet_Head<0x0096>; +template<> +struct NetPacket_Head<0x0096>; +template<> +struct Packet_Repeat<0x0096>; +template<> +struct NetPacket_Repeat<0x0096>; + +template<> +struct Packet_Head<0x0097>; +template<> +struct NetPacket_Head<0x0097>; +template<> +struct Packet_Repeat<0x0097>; +template<> +struct NetPacket_Repeat<0x0097>; + +template<> +struct Packet_Fixed<0x0098>; +template<> +struct NetPacket_Fixed<0x0098>; + +template<> +struct Packet_Head<0x009a>; +template<> +struct NetPacket_Head<0x009a>; +template<> +struct Packet_Repeat<0x009a>; +template<> +struct NetPacket_Repeat<0x009a>; + +template<> +struct Packet_Fixed<0x009b>; +template<> +struct NetPacket_Fixed<0x009b>; + +template<> +struct Packet_Fixed<0x009c>; +template<> +struct NetPacket_Fixed<0x009c>; + +template<> +struct Packet_Fixed<0x009d>; +template<> +struct NetPacket_Fixed<0x009d>; + +template<> +struct Packet_Fixed<0x009e>; +template<> +struct NetPacket_Fixed<0x009e>; + +template<> +struct Packet_Fixed<0x009f>; +template<> +struct NetPacket_Fixed<0x009f>; + +template<> +struct Packet_Fixed<0x00a0>; +template<> +struct NetPacket_Fixed<0x00a0>; + +template<> +struct Packet_Fixed<0x00a1>; +template<> +struct NetPacket_Fixed<0x00a1>; + +template<> +struct Packet_Fixed<0x00a2>; +template<> +struct NetPacket_Fixed<0x00a2>; + +template<> +struct Packet_Head<0x00a4>; +template<> +struct NetPacket_Head<0x00a4>; +template<> +struct Packet_Repeat<0x00a4>; +template<> +struct NetPacket_Repeat<0x00a4>; + +template<> +struct Packet_Head<0x00a6>; +template<> +struct NetPacket_Head<0x00a6>; +template<> +struct Packet_Repeat<0x00a6>; +template<> +struct NetPacket_Repeat<0x00a6>; + +template<> +struct Packet_Fixed<0x00a7>; +template<> +struct NetPacket_Fixed<0x00a7>; + +template<> +struct Packet_Fixed<0x00a8>; +template<> +struct NetPacket_Fixed<0x00a8>; + +template<> +struct Packet_Fixed<0x00a9>; +template<> +struct NetPacket_Fixed<0x00a9>; + +template<> +struct Packet_Fixed<0x00aa>; +template<> +struct NetPacket_Fixed<0x00aa>; + +template<> +struct Packet_Fixed<0x00ab>; +template<> +struct NetPacket_Fixed<0x00ab>; + +template<> +struct Packet_Fixed<0x00ac>; +template<> +struct NetPacket_Fixed<0x00ac>; + +template<> +struct Packet_Fixed<0x00af>; +template<> +struct NetPacket_Fixed<0x00af>; + +template<> +struct Packet_Fixed<0x00b0>; +template<> +struct NetPacket_Fixed<0x00b0>; + +template<> +struct Packet_Fixed<0x00b1>; +template<> +struct NetPacket_Fixed<0x00b1>; + +template<> +struct Packet_Fixed<0x00b2>; +template<> +struct NetPacket_Fixed<0x00b2>; + +template<> +struct Packet_Fixed<0x00b3>; +template<> +struct NetPacket_Fixed<0x00b3>; + +template<> +struct Packet_Head<0x00b4>; +template<> +struct NetPacket_Head<0x00b4>; +template<> +struct Packet_Repeat<0x00b4>; +template<> +struct NetPacket_Repeat<0x00b4>; + +template<> +struct Packet_Fixed<0x00b5>; +template<> +struct NetPacket_Fixed<0x00b5>; + +template<> +struct Packet_Fixed<0x00b6>; +template<> +struct NetPacket_Fixed<0x00b6>; + +template<> +struct Packet_Head<0x00b7>; +template<> +struct NetPacket_Head<0x00b7>; +template<> +struct Packet_Repeat<0x00b7>; +template<> +struct NetPacket_Repeat<0x00b7>; + +template<> +struct Packet_Fixed<0x00b8>; +template<> +struct NetPacket_Fixed<0x00b8>; + +template<> +struct Packet_Fixed<0x00b9>; +template<> +struct NetPacket_Fixed<0x00b9>; + +template<> +struct Packet_Fixed<0x00bb>; +template<> +struct NetPacket_Fixed<0x00bb>; + +template<> +struct Packet_Fixed<0x00bc>; +template<> +struct NetPacket_Fixed<0x00bc>; + +template<> +struct Packet_Fixed<0x00bd>; +template<> +struct NetPacket_Fixed<0x00bd>; + +template<> +struct Packet_Fixed<0x00be>; +template<> +struct NetPacket_Fixed<0x00be>; + +template<> +struct Packet_Fixed<0x00bf>; +template<> +struct NetPacket_Fixed<0x00bf>; + +template<> +struct Packet_Fixed<0x00c0>; +template<> +struct NetPacket_Fixed<0x00c0>; + +template<> +struct Packet_Fixed<0x00c1>; +template<> +struct NetPacket_Fixed<0x00c1>; + +template<> +struct Packet_Fixed<0x00c2>; +template<> +struct NetPacket_Fixed<0x00c2>; + +template<> +struct Packet_Fixed<0x00c4>; +template<> +struct NetPacket_Fixed<0x00c4>; + +template<> +struct Packet_Fixed<0x00c5>; +template<> +struct NetPacket_Fixed<0x00c5>; + +template<> +struct Packet_Head<0x00c6>; +template<> +struct NetPacket_Head<0x00c6>; +template<> +struct Packet_Repeat<0x00c6>; +template<> +struct NetPacket_Repeat<0x00c6>; + +template<> +struct Packet_Head<0x00c7>; +template<> +struct NetPacket_Head<0x00c7>; +template<> +struct Packet_Repeat<0x00c7>; +template<> +struct NetPacket_Repeat<0x00c7>; + +template<> +struct Packet_Head<0x00c8>; +template<> +struct NetPacket_Head<0x00c8>; +template<> +struct Packet_Repeat<0x00c8>; +template<> +struct NetPacket_Repeat<0x00c8>; + +template<> +struct Packet_Head<0x00c9>; +template<> +struct NetPacket_Head<0x00c9>; +template<> +struct Packet_Repeat<0x00c9>; +template<> +struct NetPacket_Repeat<0x00c9>; + +template<> +struct Packet_Fixed<0x00ca>; +template<> +struct NetPacket_Fixed<0x00ca>; + +template<> +struct Packet_Fixed<0x00cb>; +template<> +struct NetPacket_Fixed<0x00cb>; + +template<> +struct Packet_Fixed<0x00cd>; +template<> +struct NetPacket_Fixed<0x00cd>; + +template<> +struct Packet_Fixed<0x00e4>; +template<> +struct NetPacket_Fixed<0x00e4>; + +template<> +struct Packet_Fixed<0x00e5>; +template<> +struct NetPacket_Fixed<0x00e5>; + +template<> +struct Packet_Fixed<0x00e6>; +template<> +struct NetPacket_Fixed<0x00e6>; + +template<> +struct Packet_Fixed<0x00e7>; +template<> +struct NetPacket_Fixed<0x00e7>; + +template<> +struct Packet_Fixed<0x00e8>; +template<> +struct NetPacket_Fixed<0x00e8>; + +template<> +struct Packet_Fixed<0x00e9>; +template<> +struct NetPacket_Fixed<0x00e9>; + +template<> +struct Packet_Fixed<0x00eb>; +template<> +struct NetPacket_Fixed<0x00eb>; + +template<> +struct Packet_Fixed<0x00ec>; +template<> +struct NetPacket_Fixed<0x00ec>; + +template<> +struct Packet_Fixed<0x00ed>; +template<> +struct NetPacket_Fixed<0x00ed>; + +template<> +struct Packet_Fixed<0x00ee>; +template<> +struct NetPacket_Fixed<0x00ee>; + +template<> +struct Packet_Fixed<0x00ef>; +template<> +struct NetPacket_Fixed<0x00ef>; + +template<> +struct Packet_Fixed<0x00f0>; +template<> +struct NetPacket_Fixed<0x00f0>; + +template<> +struct Packet_Fixed<0x00f2>; +template<> +struct NetPacket_Fixed<0x00f2>; + +template<> +struct Packet_Fixed<0x00f3>; +template<> +struct NetPacket_Fixed<0x00f3>; + +template<> +struct Packet_Fixed<0x00f4>; +template<> +struct NetPacket_Fixed<0x00f4>; + +template<> +struct Packet_Fixed<0x00f5>; +template<> +struct NetPacket_Fixed<0x00f5>; + +template<> +struct Packet_Fixed<0x00f6>; +template<> +struct NetPacket_Fixed<0x00f6>; + +template<> +struct Packet_Fixed<0x00f7>; +template<> +struct NetPacket_Fixed<0x00f7>; + +template<> +struct Packet_Fixed<0x00f8>; +template<> +struct NetPacket_Fixed<0x00f8>; + +template<> +struct Packet_Fixed<0x00f9>; +template<> +struct NetPacket_Fixed<0x00f9>; + +template<> +struct Packet_Fixed<0x00fa>; +template<> +struct NetPacket_Fixed<0x00fa>; + +template<> +struct Packet_Head<0x00fb>; +template<> +struct NetPacket_Head<0x00fb>; +template<> +struct Packet_Repeat<0x00fb>; +template<> +struct NetPacket_Repeat<0x00fb>; + +template<> +struct Packet_Fixed<0x00fc>; +template<> +struct NetPacket_Fixed<0x00fc>; + +template<> +struct Packet_Fixed<0x00fd>; +template<> +struct NetPacket_Fixed<0x00fd>; + +template<> +struct Packet_Fixed<0x00fe>; +template<> +struct NetPacket_Fixed<0x00fe>; + +template<> +struct Packet_Fixed<0x00ff>; +template<> +struct NetPacket_Fixed<0x00ff>; + +template<> +struct Packet_Fixed<0x0100>; +template<> +struct NetPacket_Fixed<0x0100>; + +template<> +struct Packet_Fixed<0x0101>; +template<> +struct NetPacket_Fixed<0x0101>; + +template<> +struct Packet_Fixed<0x0102>; +template<> +struct NetPacket_Fixed<0x0102>; + +template<> +struct Packet_Fixed<0x0103>; +template<> +struct NetPacket_Fixed<0x0103>; + +template<> +struct Packet_Fixed<0x0105>; +template<> +struct NetPacket_Fixed<0x0105>; + +template<> +struct Packet_Fixed<0x0106>; +template<> +struct NetPacket_Fixed<0x0106>; + +template<> +struct Packet_Fixed<0x0107>; +template<> +struct NetPacket_Fixed<0x0107>; + +template<> +struct Packet_Head<0x0108>; +template<> +struct NetPacket_Head<0x0108>; +template<> +struct Packet_Repeat<0x0108>; +template<> +struct NetPacket_Repeat<0x0108>; + +template<> +struct Packet_Head<0x0109>; +template<> +struct NetPacket_Head<0x0109>; +template<> +struct Packet_Repeat<0x0109>; +template<> +struct NetPacket_Repeat<0x0109>; + +template<> +struct Packet_Fixed<0x010c>; +template<> +struct NetPacket_Fixed<0x010c>; + +template<> +struct Packet_Fixed<0x010e>; +template<> +struct NetPacket_Fixed<0x010e>; + +template<> +struct Packet_Head<0x010f>; +template<> +struct NetPacket_Head<0x010f>; +template<> +struct Packet_Repeat<0x010f>; +template<> +struct NetPacket_Repeat<0x010f>; + +template<> +struct Packet_Fixed<0x0110>; +template<> +struct NetPacket_Fixed<0x0110>; + +template<> +struct Packet_Fixed<0x0112>; +template<> +struct NetPacket_Fixed<0x0112>; + +template<> +struct Packet_Fixed<0x0118>; +template<> +struct NetPacket_Fixed<0x0118>; + +template<> +struct Packet_Fixed<0x0119>; +template<> +struct NetPacket_Fixed<0x0119>; + +template<> +struct Packet_Fixed<0x0139>; +template<> +struct NetPacket_Fixed<0x0139>; + +template<> +struct Packet_Fixed<0x013a>; +template<> +struct NetPacket_Fixed<0x013a>; + +template<> +struct Packet_Fixed<0x013b>; +template<> +struct NetPacket_Fixed<0x013b>; + +template<> +struct Packet_Fixed<0x013c>; +template<> +struct NetPacket_Fixed<0x013c>; + +template<> +struct Packet_Fixed<0x0141>; +template<> +struct NetPacket_Fixed<0x0141>; + +template<> +struct Packet_Fixed<0x0142>; +template<> +struct NetPacket_Fixed<0x0142>; + +template<> +struct Packet_Fixed<0x0143>; +template<> +struct NetPacket_Fixed<0x0143>; + +template<> +struct Packet_Fixed<0x0146>; +template<> +struct NetPacket_Fixed<0x0146>; + +template<> +struct Packet_Fixed<0x0147>; +template<> +struct NetPacket_Fixed<0x0147>; + +template<> +struct Packet_Fixed<0x0148>; +template<> +struct NetPacket_Fixed<0x0148>; + +template<> +struct Packet_Fixed<0x014d>; +template<> +struct NetPacket_Fixed<0x014d>; + +template<> +struct Packet_Fixed<0x018a>; +template<> +struct NetPacket_Fixed<0x018a>; + +template<> +struct Packet_Fixed<0x018b>; +template<> +struct NetPacket_Fixed<0x018b>; + +template<> +struct Packet_Fixed<0x0195>; +template<> +struct NetPacket_Fixed<0x0195>; + +template<> +struct Packet_Fixed<0x0196>; +template<> +struct NetPacket_Fixed<0x0196>; + +template<> +struct Packet_Fixed<0x019b>; +template<> +struct NetPacket_Fixed<0x019b>; + +template<> +struct Packet_Fixed<0x01b1>; +template<> +struct NetPacket_Fixed<0x01b1>; + +template<> +struct Packet_Fixed<0x01c8>; +template<> +struct NetPacket_Fixed<0x01c8>; + +template<> +struct Packet_Fixed<0x01d4>; +template<> +struct NetPacket_Fixed<0x01d4>; + +template<> +struct Packet_Head<0x01d5>; +template<> +struct NetPacket_Head<0x01d5>; +template<> +struct Packet_Repeat<0x01d5>; +template<> +struct NetPacket_Repeat<0x01d5>; + +template<> +struct Packet_Fixed<0x01d7>; +template<> +struct NetPacket_Fixed<0x01d7>; + +template<> +struct Packet_Fixed<0x01d8>; +template<> +struct NetPacket_Fixed<0x01d8>; + +template<> +struct Packet_Fixed<0x01d9>; +template<> +struct NetPacket_Fixed<0x01d9>; + +template<> +struct Packet_Fixed<0x01da>; +template<> +struct NetPacket_Fixed<0x01da>; + +template<> +struct Packet_Fixed<0x01de>; +template<> +struct NetPacket_Fixed<0x01de>; + +template<> +struct Packet_Head<0x01ee>; +template<> +struct NetPacket_Head<0x01ee>; +template<> +struct Packet_Repeat<0x01ee>; +template<> +struct NetPacket_Repeat<0x01ee>; + +template<> +struct Packet_Head<0x01f0>; +template<> +struct NetPacket_Head<0x01f0>; +template<> +struct Packet_Repeat<0x01f0>; +template<> +struct NetPacket_Repeat<0x01f0>; + +template<> +struct Packet_Fixed<0x020c>; +template<> +struct NetPacket_Fixed<0x020c>; + +template<> struct Packet_Fixed<0x0212>; template<> struct NetPacket_Fixed<0x0212>; @@ -929,6 +1713,11 @@ struct Packet_Fixed<0x7532>; template<> struct NetPacket_Fixed<0x7532>; +template<> +struct Packet_Payload<0x8000>; +template<> +struct NetPacket_Payload<0x8000>; + #endif // TMWA_PROTO2_FWD_HPP diff --git a/src/proto2/include_clif_t_test.cpp b/src/proto2/include_clif_t_test.cpp new file mode 100644 index 0000000..93c7f90 --- /dev/null +++ b/src/proto2/include_clif_t_test.cpp @@ -0,0 +1,36 @@ +#include "../map/clif.t.hpp" +// include_clif_t_test.cpp - testsuite for protocol includes +// +// Copyright © 2014 Ben Longbons <b.r.longbons@gmail.com> +// +// This file is part of The Mana World (Athena server) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program 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 Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +#include "../poison.hpp" + +using Test_Position1 = Position1; +using Test_NetPosition1 = NetPosition1; +using Test_Position2 = Position2; +using Test_NetPosition2 = NetPosition2; +using Test_BeingRemoveWhy = BeingRemoveWhy; +using Test_DIR = DIR; +using Test_Opt1 = Opt1; +using Test_Opt2 = Opt2; +using Test_Opt3 = Opt3; +using Test_ItemType = ItemType; +using Test_PickupFail = PickupFail; +using Test_DamageType = DamageType; +using Test_SP = SP; +using Test_LOOK = LOOK; diff --git a/src/proto2/include_enums_test.cpp b/src/proto2/include_enums_test.cpp index 49b4a95..cad9b12 100644 --- a/src/proto2/include_enums_test.cpp +++ b/src/proto2/include_enums_test.cpp @@ -22,3 +22,4 @@ using Test_SEX = SEX; using Test_Option = Option; +using Test_EPOS = EPOS; diff --git a/src/proto2/include_types_test.cpp b/src/proto2/include_login_t_test.cpp index 7927f37..3273ba3 100644 --- a/src/proto2/include_types_test.cpp +++ b/src/proto2/include_login_t_test.cpp @@ -1,5 +1,5 @@ -#include "../login/types.hpp" -// include_types_test.cpp - testsuite for protocol includes +#include "../login/login.t.hpp" +// include_login_t_test.cpp - testsuite for protocol includes // // Copyright © 2014 Ben Longbons <b.r.longbons@gmail.com> // diff --git a/src/proto2/include_skill_t_test.cpp b/src/proto2/include_skill_t_test.cpp new file mode 100644 index 0000000..e4b957f --- /dev/null +++ b/src/proto2/include_skill_t_test.cpp @@ -0,0 +1,25 @@ +#include "../map/skill.t.hpp" +// include_skill_t_test.cpp - testsuite for protocol includes +// +// Copyright © 2014 Ben Longbons <b.r.longbons@gmail.com> +// +// This file is part of The Mana World (Athena server) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program 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 Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. + +#include "../poison.hpp" + +using Test_SkillID = SkillID; +using Test_StatusChange = StatusChange; +using Test_SkillFlags = SkillFlags; diff --git a/src/login/types.cpp b/src/proto2/include_timer_t_test.cpp index 854220b..859757f 100644 --- a/src/login/types.cpp +++ b/src/proto2/include_timer_t_test.cpp @@ -1,21 +1,24 @@ -#include "types.hpp" -// types.cpp - externally useful types from login +#include "../net/timer.t.hpp" +// include_timer_t_test.cpp - testsuite for protocol includes // // Copyright © 2014 Ben Longbons <b.r.longbons@gmail.com> // // This file is part of The Mana World (Athena server) // // This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by +// it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program 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 General Public License for more details. +// GNU Affero General Public License for more details. // -// You should have received a copy of the GNU General Public License +// You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. #include "../poison.hpp" + +using Test_tick_t = tick_t; +using Test_interval_t = interval_t; diff --git a/src/proto2/login-admin.hpp b/src/proto2/login-admin.hpp index 7876d1d..e3962b9 100644 --- a/src/proto2/login-admin.hpp +++ b/src/proto2/login-admin.hpp @@ -28,7 +28,7 @@ // This is an internal protocol, and can be changed without notice // this is only needed for the payload packet right now, and that needs to die -#pragma pack(push, 1) +# pragma pack(push, 1) template<> struct Packet_Head<0x2726> @@ -599,6 +599,7 @@ static_assert(offsetof(NetPacket_Head<0x2726>, magic_packet_id) == 0, "offsetof( static_assert(offsetof(NetPacket_Head<0x2726>, unused) == 2, "offsetof(NetPacket_Head<0x2726>, unused) == 2"); static_assert(offsetof(NetPacket_Head<0x2726>, magic_packet_length) == 4, "offsetof(NetPacket_Head<0x2726>, magic_packet_length) == 4"); static_assert(sizeof(NetPacket_Head<0x2726>) == 8, "sizeof(NetPacket_Head<0x2726>) == 8"); +static_assert(alignof(NetPacket_Head<0x2726>) == 1, "alignof(NetPacket_Head<0x2726>) == 1"); template<> struct NetPacket_Repeat<0x2726> { @@ -606,6 +607,7 @@ struct NetPacket_Repeat<0x2726> }; static_assert(offsetof(NetPacket_Repeat<0x2726>, c) == 0, "offsetof(NetPacket_Repeat<0x2726>, c) == 0"); static_assert(sizeof(NetPacket_Repeat<0x2726>) == 1, "sizeof(NetPacket_Repeat<0x2726>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x2726>) == 1, "alignof(NetPacket_Repeat<0x2726>) == 1"); template<> struct NetPacket_Fixed<0x7918> @@ -618,6 +620,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7918>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x7918>, encryption_zero) == 2, "offsetof(NetPacket_Fixed<0x7918>, encryption_zero) == 2"); static_assert(offsetof(NetPacket_Fixed<0x7918>, account_pass) == 4, "offsetof(NetPacket_Fixed<0x7918>, account_pass) == 4"); static_assert(sizeof(NetPacket_Fixed<0x7918>) == 28, "sizeof(NetPacket_Fixed<0x7918>) == 28"); +static_assert(alignof(NetPacket_Fixed<0x7918>) == 1, "alignof(NetPacket_Fixed<0x7918>) == 1"); template<> struct NetPacket_Fixed<0x7919> @@ -628,6 +631,7 @@ struct NetPacket_Fixed<0x7919> static_assert(offsetof(NetPacket_Fixed<0x7919>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7919>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x7919>, error) == 2, "offsetof(NetPacket_Fixed<0x7919>, error) == 2"); static_assert(sizeof(NetPacket_Fixed<0x7919>) == 3, "sizeof(NetPacket_Fixed<0x7919>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x7919>) == 1, "alignof(NetPacket_Fixed<0x7919>) == 1"); template<> struct NetPacket_Fixed<0x7920> @@ -640,6 +644,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7920>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x7920>, start_account_id) == 2, "offsetof(NetPacket_Fixed<0x7920>, start_account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x7920>, end_account_id) == 6, "offsetof(NetPacket_Fixed<0x7920>, end_account_id) == 6"); static_assert(sizeof(NetPacket_Fixed<0x7920>) == 10, "sizeof(NetPacket_Fixed<0x7920>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x7920>) == 1, "alignof(NetPacket_Fixed<0x7920>) == 1"); template<> struct NetPacket_Head<0x7921> @@ -650,6 +655,7 @@ struct NetPacket_Head<0x7921> static_assert(offsetof(NetPacket_Head<0x7921>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x7921>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Head<0x7921>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x7921>, magic_packet_length) == 2"); static_assert(sizeof(NetPacket_Head<0x7921>) == 4, "sizeof(NetPacket_Head<0x7921>) == 4"); +static_assert(alignof(NetPacket_Head<0x7921>) == 1, "alignof(NetPacket_Head<0x7921>) == 1"); template<> struct NetPacket_Repeat<0x7921> { @@ -667,6 +673,7 @@ static_assert(offsetof(NetPacket_Repeat<0x7921>, sex) == 29, "offsetof(NetPacket static_assert(offsetof(NetPacket_Repeat<0x7921>, login_count) == 30, "offsetof(NetPacket_Repeat<0x7921>, login_count) == 30"); static_assert(offsetof(NetPacket_Repeat<0x7921>, status) == 34, "offsetof(NetPacket_Repeat<0x7921>, status) == 34"); static_assert(sizeof(NetPacket_Repeat<0x7921>) == 38, "sizeof(NetPacket_Repeat<0x7921>) == 38"); +static_assert(alignof(NetPacket_Repeat<0x7921>) == 1, "alignof(NetPacket_Repeat<0x7921>) == 1"); template<> struct NetPacket_Fixed<0x7924> @@ -679,6 +686,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7924>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x7924>, source_item_id) == 2, "offsetof(NetPacket_Fixed<0x7924>, source_item_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x7924>, dest_item_id) == 6, "offsetof(NetPacket_Fixed<0x7924>, dest_item_id) == 6"); static_assert(sizeof(NetPacket_Fixed<0x7924>) == 10, "sizeof(NetPacket_Fixed<0x7924>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x7924>) == 1, "alignof(NetPacket_Fixed<0x7924>) == 1"); template<> struct NetPacket_Fixed<0x7925> @@ -687,6 +695,7 @@ struct NetPacket_Fixed<0x7925> }; static_assert(offsetof(NetPacket_Fixed<0x7925>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7925>, magic_packet_id) == 0"); static_assert(sizeof(NetPacket_Fixed<0x7925>) == 2, "sizeof(NetPacket_Fixed<0x7925>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x7925>) == 1, "alignof(NetPacket_Fixed<0x7925>) == 1"); template<> struct NetPacket_Fixed<0x7930> @@ -703,6 +712,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7930>, password) == 26, "offsetof(NetPa static_assert(offsetof(NetPacket_Fixed<0x7930>, sex) == 50, "offsetof(NetPacket_Fixed<0x7930>, sex) == 50"); static_assert(offsetof(NetPacket_Fixed<0x7930>, email) == 51, "offsetof(NetPacket_Fixed<0x7930>, email) == 51"); static_assert(sizeof(NetPacket_Fixed<0x7930>) == 91, "sizeof(NetPacket_Fixed<0x7930>) == 91"); +static_assert(alignof(NetPacket_Fixed<0x7930>) == 1, "alignof(NetPacket_Fixed<0x7930>) == 1"); template<> struct NetPacket_Fixed<0x7931> @@ -715,6 +725,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7931>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x7931>, account_id) == 2, "offsetof(NetPacket_Fixed<0x7931>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x7931>, account_name) == 6, "offsetof(NetPacket_Fixed<0x7931>, account_name) == 6"); static_assert(sizeof(NetPacket_Fixed<0x7931>) == 30, "sizeof(NetPacket_Fixed<0x7931>) == 30"); +static_assert(alignof(NetPacket_Fixed<0x7931>) == 1, "alignof(NetPacket_Fixed<0x7931>) == 1"); template<> struct NetPacket_Fixed<0x7932> @@ -725,6 +736,7 @@ struct NetPacket_Fixed<0x7932> static_assert(offsetof(NetPacket_Fixed<0x7932>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7932>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x7932>, account_name) == 2, "offsetof(NetPacket_Fixed<0x7932>, account_name) == 2"); static_assert(sizeof(NetPacket_Fixed<0x7932>) == 26, "sizeof(NetPacket_Fixed<0x7932>) == 26"); +static_assert(alignof(NetPacket_Fixed<0x7932>) == 1, "alignof(NetPacket_Fixed<0x7932>) == 1"); template<> struct NetPacket_Fixed<0x7933> @@ -737,6 +749,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7933>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x7933>, account_id) == 2, "offsetof(NetPacket_Fixed<0x7933>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x7933>, account_name) == 6, "offsetof(NetPacket_Fixed<0x7933>, account_name) == 6"); static_assert(sizeof(NetPacket_Fixed<0x7933>) == 30, "sizeof(NetPacket_Fixed<0x7933>) == 30"); +static_assert(alignof(NetPacket_Fixed<0x7933>) == 1, "alignof(NetPacket_Fixed<0x7933>) == 1"); template<> struct NetPacket_Fixed<0x7934> @@ -749,6 +762,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7934>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x7934>, account_name) == 2, "offsetof(NetPacket_Fixed<0x7934>, account_name) == 2"); static_assert(offsetof(NetPacket_Fixed<0x7934>, password) == 26, "offsetof(NetPacket_Fixed<0x7934>, password) == 26"); static_assert(sizeof(NetPacket_Fixed<0x7934>) == 50, "sizeof(NetPacket_Fixed<0x7934>) == 50"); +static_assert(alignof(NetPacket_Fixed<0x7934>) == 1, "alignof(NetPacket_Fixed<0x7934>) == 1"); template<> struct NetPacket_Fixed<0x7935> @@ -761,6 +775,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7935>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x7935>, account_id) == 2, "offsetof(NetPacket_Fixed<0x7935>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x7935>, account_name) == 6, "offsetof(NetPacket_Fixed<0x7935>, account_name) == 6"); static_assert(sizeof(NetPacket_Fixed<0x7935>) == 30, "sizeof(NetPacket_Fixed<0x7935>) == 30"); +static_assert(alignof(NetPacket_Fixed<0x7935>) == 1, "alignof(NetPacket_Fixed<0x7935>) == 1"); template<> struct NetPacket_Fixed<0x7936> @@ -775,6 +790,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7936>, account_name) == 2, "offsetof(Ne static_assert(offsetof(NetPacket_Fixed<0x7936>, status) == 26, "offsetof(NetPacket_Fixed<0x7936>, status) == 26"); static_assert(offsetof(NetPacket_Fixed<0x7936>, error_message) == 30, "offsetof(NetPacket_Fixed<0x7936>, error_message) == 30"); static_assert(sizeof(NetPacket_Fixed<0x7936>) == 50, "sizeof(NetPacket_Fixed<0x7936>) == 50"); +static_assert(alignof(NetPacket_Fixed<0x7936>) == 1, "alignof(NetPacket_Fixed<0x7936>) == 1"); template<> struct NetPacket_Fixed<0x7937> @@ -789,6 +805,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7937>, account_id) == 2, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x7937>, account_name) == 6, "offsetof(NetPacket_Fixed<0x7937>, account_name) == 6"); static_assert(offsetof(NetPacket_Fixed<0x7937>, status) == 30, "offsetof(NetPacket_Fixed<0x7937>, status) == 30"); static_assert(sizeof(NetPacket_Fixed<0x7937>) == 34, "sizeof(NetPacket_Fixed<0x7937>) == 34"); +static_assert(alignof(NetPacket_Fixed<0x7937>) == 1, "alignof(NetPacket_Fixed<0x7937>) == 1"); template<> struct NetPacket_Fixed<0x7938> @@ -797,6 +814,7 @@ struct NetPacket_Fixed<0x7938> }; static_assert(offsetof(NetPacket_Fixed<0x7938>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7938>, magic_packet_id) == 0"); static_assert(sizeof(NetPacket_Fixed<0x7938>) == 2, "sizeof(NetPacket_Fixed<0x7938>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x7938>) == 1, "alignof(NetPacket_Fixed<0x7938>) == 1"); template<> struct NetPacket_Head<0x7939> @@ -807,6 +825,7 @@ struct NetPacket_Head<0x7939> static_assert(offsetof(NetPacket_Head<0x7939>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x7939>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Head<0x7939>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x7939>, magic_packet_length) == 2"); static_assert(sizeof(NetPacket_Head<0x7939>) == 4, "sizeof(NetPacket_Head<0x7939>) == 4"); +static_assert(alignof(NetPacket_Head<0x7939>) == 1, "alignof(NetPacket_Head<0x7939>) == 1"); template<> struct NetPacket_Repeat<0x7939> { @@ -824,6 +843,7 @@ static_assert(offsetof(NetPacket_Repeat<0x7939>, users) == 26, "offsetof(NetPack static_assert(offsetof(NetPacket_Repeat<0x7939>, maintenance) == 28, "offsetof(NetPacket_Repeat<0x7939>, maintenance) == 28"); static_assert(offsetof(NetPacket_Repeat<0x7939>, is_new) == 30, "offsetof(NetPacket_Repeat<0x7939>, is_new) == 30"); static_assert(sizeof(NetPacket_Repeat<0x7939>) == 32, "sizeof(NetPacket_Repeat<0x7939>) == 32"); +static_assert(alignof(NetPacket_Repeat<0x7939>) == 1, "alignof(NetPacket_Repeat<0x7939>) == 1"); template<> struct NetPacket_Fixed<0x793a> @@ -836,6 +856,7 @@ static_assert(offsetof(NetPacket_Fixed<0x793a>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x793a>, account_name) == 2, "offsetof(NetPacket_Fixed<0x793a>, account_name) == 2"); static_assert(offsetof(NetPacket_Fixed<0x793a>, password) == 26, "offsetof(NetPacket_Fixed<0x793a>, password) == 26"); static_assert(sizeof(NetPacket_Fixed<0x793a>) == 50, "sizeof(NetPacket_Fixed<0x793a>) == 50"); +static_assert(alignof(NetPacket_Fixed<0x793a>) == 1, "alignof(NetPacket_Fixed<0x793a>) == 1"); template<> struct NetPacket_Fixed<0x793b> @@ -848,6 +869,7 @@ static_assert(offsetof(NetPacket_Fixed<0x793b>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x793b>, account_id) == 2, "offsetof(NetPacket_Fixed<0x793b>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x793b>, account_name) == 6, "offsetof(NetPacket_Fixed<0x793b>, account_name) == 6"); static_assert(sizeof(NetPacket_Fixed<0x793b>) == 30, "sizeof(NetPacket_Fixed<0x793b>) == 30"); +static_assert(alignof(NetPacket_Fixed<0x793b>) == 1, "alignof(NetPacket_Fixed<0x793b>) == 1"); template<> struct NetPacket_Fixed<0x793c> @@ -860,6 +882,7 @@ static_assert(offsetof(NetPacket_Fixed<0x793c>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x793c>, account_name) == 2, "offsetof(NetPacket_Fixed<0x793c>, account_name) == 2"); static_assert(offsetof(NetPacket_Fixed<0x793c>, sex) == 26, "offsetof(NetPacket_Fixed<0x793c>, sex) == 26"); static_assert(sizeof(NetPacket_Fixed<0x793c>) == 27, "sizeof(NetPacket_Fixed<0x793c>) == 27"); +static_assert(alignof(NetPacket_Fixed<0x793c>) == 1, "alignof(NetPacket_Fixed<0x793c>) == 1"); template<> struct NetPacket_Fixed<0x793d> @@ -872,6 +895,7 @@ static_assert(offsetof(NetPacket_Fixed<0x793d>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x793d>, account_id) == 2, "offsetof(NetPacket_Fixed<0x793d>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x793d>, account_name) == 6, "offsetof(NetPacket_Fixed<0x793d>, account_name) == 6"); static_assert(sizeof(NetPacket_Fixed<0x793d>) == 30, "sizeof(NetPacket_Fixed<0x793d>) == 30"); +static_assert(alignof(NetPacket_Fixed<0x793d>) == 1, "alignof(NetPacket_Fixed<0x793d>) == 1"); template<> struct NetPacket_Fixed<0x793e> @@ -884,6 +908,7 @@ static_assert(offsetof(NetPacket_Fixed<0x793e>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x793e>, account_name) == 2, "offsetof(NetPacket_Fixed<0x793e>, account_name) == 2"); static_assert(offsetof(NetPacket_Fixed<0x793e>, gm_level) == 26, "offsetof(NetPacket_Fixed<0x793e>, gm_level) == 26"); static_assert(sizeof(NetPacket_Fixed<0x793e>) == 27, "sizeof(NetPacket_Fixed<0x793e>) == 27"); +static_assert(alignof(NetPacket_Fixed<0x793e>) == 1, "alignof(NetPacket_Fixed<0x793e>) == 1"); template<> struct NetPacket_Fixed<0x793f> @@ -896,6 +921,7 @@ static_assert(offsetof(NetPacket_Fixed<0x793f>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x793f>, account_id) == 2, "offsetof(NetPacket_Fixed<0x793f>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x793f>, account_name) == 6, "offsetof(NetPacket_Fixed<0x793f>, account_name) == 6"); static_assert(sizeof(NetPacket_Fixed<0x793f>) == 30, "sizeof(NetPacket_Fixed<0x793f>) == 30"); +static_assert(alignof(NetPacket_Fixed<0x793f>) == 1, "alignof(NetPacket_Fixed<0x793f>) == 1"); template<> struct NetPacket_Fixed<0x7940> @@ -908,6 +934,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7940>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x7940>, account_name) == 2, "offsetof(NetPacket_Fixed<0x7940>, account_name) == 2"); static_assert(offsetof(NetPacket_Fixed<0x7940>, email) == 26, "offsetof(NetPacket_Fixed<0x7940>, email) == 26"); static_assert(sizeof(NetPacket_Fixed<0x7940>) == 66, "sizeof(NetPacket_Fixed<0x7940>) == 66"); +static_assert(alignof(NetPacket_Fixed<0x7940>) == 1, "alignof(NetPacket_Fixed<0x7940>) == 1"); template<> struct NetPacket_Fixed<0x7941> @@ -920,6 +947,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7941>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x7941>, account_id) == 2, "offsetof(NetPacket_Fixed<0x7941>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x7941>, account_name) == 6, "offsetof(NetPacket_Fixed<0x7941>, account_name) == 6"); static_assert(sizeof(NetPacket_Fixed<0x7941>) == 30, "sizeof(NetPacket_Fixed<0x7941>) == 30"); +static_assert(alignof(NetPacket_Fixed<0x7941>) == 1, "alignof(NetPacket_Fixed<0x7941>) == 1"); template<> struct NetPacket_Head<0x7942> @@ -932,6 +960,7 @@ static_assert(offsetof(NetPacket_Head<0x7942>, magic_packet_id) == 0, "offsetof( static_assert(offsetof(NetPacket_Head<0x7942>, account_name) == 2, "offsetof(NetPacket_Head<0x7942>, account_name) == 2"); static_assert(offsetof(NetPacket_Head<0x7942>, magic_packet_length) == 26, "offsetof(NetPacket_Head<0x7942>, magic_packet_length) == 26"); static_assert(sizeof(NetPacket_Head<0x7942>) == 28, "sizeof(NetPacket_Head<0x7942>) == 28"); +static_assert(alignof(NetPacket_Head<0x7942>) == 1, "alignof(NetPacket_Head<0x7942>) == 1"); template<> struct NetPacket_Repeat<0x7942> { @@ -939,6 +968,7 @@ struct NetPacket_Repeat<0x7942> }; static_assert(offsetof(NetPacket_Repeat<0x7942>, c) == 0, "offsetof(NetPacket_Repeat<0x7942>, c) == 0"); static_assert(sizeof(NetPacket_Repeat<0x7942>) == 1, "sizeof(NetPacket_Repeat<0x7942>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x7942>) == 1, "alignof(NetPacket_Repeat<0x7942>) == 1"); template<> struct NetPacket_Fixed<0x7943> @@ -951,6 +981,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7943>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x7943>, account_id) == 2, "offsetof(NetPacket_Fixed<0x7943>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x7943>, account_name) == 6, "offsetof(NetPacket_Fixed<0x7943>, account_name) == 6"); static_assert(sizeof(NetPacket_Fixed<0x7943>) == 30, "sizeof(NetPacket_Fixed<0x7943>) == 30"); +static_assert(alignof(NetPacket_Fixed<0x7943>) == 1, "alignof(NetPacket_Fixed<0x7943>) == 1"); template<> struct NetPacket_Fixed<0x7944> @@ -961,6 +992,7 @@ struct NetPacket_Fixed<0x7944> static_assert(offsetof(NetPacket_Fixed<0x7944>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7944>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x7944>, account_name) == 2, "offsetof(NetPacket_Fixed<0x7944>, account_name) == 2"); static_assert(sizeof(NetPacket_Fixed<0x7944>) == 26, "sizeof(NetPacket_Fixed<0x7944>) == 26"); +static_assert(alignof(NetPacket_Fixed<0x7944>) == 1, "alignof(NetPacket_Fixed<0x7944>) == 1"); template<> struct NetPacket_Fixed<0x7945> @@ -973,6 +1005,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7945>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x7945>, account_id) == 2, "offsetof(NetPacket_Fixed<0x7945>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x7945>, account_name) == 6, "offsetof(NetPacket_Fixed<0x7945>, account_name) == 6"); static_assert(sizeof(NetPacket_Fixed<0x7945>) == 30, "sizeof(NetPacket_Fixed<0x7945>) == 30"); +static_assert(alignof(NetPacket_Fixed<0x7945>) == 1, "alignof(NetPacket_Fixed<0x7945>) == 1"); template<> struct NetPacket_Fixed<0x7946> @@ -983,6 +1016,7 @@ struct NetPacket_Fixed<0x7946> static_assert(offsetof(NetPacket_Fixed<0x7946>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7946>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x7946>, account_id) == 2, "offsetof(NetPacket_Fixed<0x7946>, account_id) == 2"); static_assert(sizeof(NetPacket_Fixed<0x7946>) == 6, "sizeof(NetPacket_Fixed<0x7946>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x7946>) == 1, "alignof(NetPacket_Fixed<0x7946>) == 1"); template<> struct NetPacket_Fixed<0x7947> @@ -995,6 +1029,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7947>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x7947>, account_id) == 2, "offsetof(NetPacket_Fixed<0x7947>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x7947>, account_name) == 6, "offsetof(NetPacket_Fixed<0x7947>, account_name) == 6"); static_assert(sizeof(NetPacket_Fixed<0x7947>) == 30, "sizeof(NetPacket_Fixed<0x7947>) == 30"); +static_assert(alignof(NetPacket_Fixed<0x7947>) == 1, "alignof(NetPacket_Fixed<0x7947>) == 1"); template<> struct NetPacket_Fixed<0x7948> @@ -1007,6 +1042,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7948>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x7948>, account_name) == 2, "offsetof(NetPacket_Fixed<0x7948>, account_name) == 2"); static_assert(offsetof(NetPacket_Fixed<0x7948>, valid_until) == 26, "offsetof(NetPacket_Fixed<0x7948>, valid_until) == 26"); static_assert(sizeof(NetPacket_Fixed<0x7948>) == 30, "sizeof(NetPacket_Fixed<0x7948>) == 30"); +static_assert(alignof(NetPacket_Fixed<0x7948>) == 1, "alignof(NetPacket_Fixed<0x7948>) == 1"); template<> struct NetPacket_Fixed<0x7949> @@ -1021,6 +1057,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7949>, account_id) == 2, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x7949>, account_name) == 6, "offsetof(NetPacket_Fixed<0x7949>, account_name) == 6"); static_assert(offsetof(NetPacket_Fixed<0x7949>, valid_until) == 30, "offsetof(NetPacket_Fixed<0x7949>, valid_until) == 30"); static_assert(sizeof(NetPacket_Fixed<0x7949>) == 34, "sizeof(NetPacket_Fixed<0x7949>) == 34"); +static_assert(alignof(NetPacket_Fixed<0x7949>) == 1, "alignof(NetPacket_Fixed<0x7949>) == 1"); template<> struct NetPacket_Fixed<0x794a> @@ -1033,6 +1070,7 @@ static_assert(offsetof(NetPacket_Fixed<0x794a>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x794a>, account_name) == 2, "offsetof(NetPacket_Fixed<0x794a>, account_name) == 2"); static_assert(offsetof(NetPacket_Fixed<0x794a>, ban_until) == 26, "offsetof(NetPacket_Fixed<0x794a>, ban_until) == 26"); static_assert(sizeof(NetPacket_Fixed<0x794a>) == 30, "sizeof(NetPacket_Fixed<0x794a>) == 30"); +static_assert(alignof(NetPacket_Fixed<0x794a>) == 1, "alignof(NetPacket_Fixed<0x794a>) == 1"); template<> struct NetPacket_Fixed<0x794b> @@ -1047,6 +1085,7 @@ static_assert(offsetof(NetPacket_Fixed<0x794b>, account_id) == 2, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x794b>, account_name) == 6, "offsetof(NetPacket_Fixed<0x794b>, account_name) == 6"); static_assert(offsetof(NetPacket_Fixed<0x794b>, ban_until) == 30, "offsetof(NetPacket_Fixed<0x794b>, ban_until) == 30"); static_assert(sizeof(NetPacket_Fixed<0x794b>) == 34, "sizeof(NetPacket_Fixed<0x794b>) == 34"); +static_assert(alignof(NetPacket_Fixed<0x794b>) == 1, "alignof(NetPacket_Fixed<0x794b>) == 1"); template<> struct NetPacket_Fixed<0x794c> @@ -1059,6 +1098,7 @@ static_assert(offsetof(NetPacket_Fixed<0x794c>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x794c>, account_name) == 2, "offsetof(NetPacket_Fixed<0x794c>, account_name) == 2"); static_assert(offsetof(NetPacket_Fixed<0x794c>, ban_add) == 26, "offsetof(NetPacket_Fixed<0x794c>, ban_add) == 26"); static_assert(sizeof(NetPacket_Fixed<0x794c>) == 38, "sizeof(NetPacket_Fixed<0x794c>) == 38"); +static_assert(alignof(NetPacket_Fixed<0x794c>) == 1, "alignof(NetPacket_Fixed<0x794c>) == 1"); template<> struct NetPacket_Fixed<0x794d> @@ -1073,6 +1113,7 @@ static_assert(offsetof(NetPacket_Fixed<0x794d>, account_id) == 2, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x794d>, account_name) == 6, "offsetof(NetPacket_Fixed<0x794d>, account_name) == 6"); static_assert(offsetof(NetPacket_Fixed<0x794d>, ban_until) == 30, "offsetof(NetPacket_Fixed<0x794d>, ban_until) == 30"); static_assert(sizeof(NetPacket_Fixed<0x794d>) == 34, "sizeof(NetPacket_Fixed<0x794d>) == 34"); +static_assert(alignof(NetPacket_Fixed<0x794d>) == 1, "alignof(NetPacket_Fixed<0x794d>) == 1"); template<> struct NetPacket_Head<0x794e> @@ -1085,6 +1126,7 @@ static_assert(offsetof(NetPacket_Head<0x794e>, magic_packet_id) == 0, "offsetof( static_assert(offsetof(NetPacket_Head<0x794e>, unused) == 2, "offsetof(NetPacket_Head<0x794e>, unused) == 2"); static_assert(offsetof(NetPacket_Head<0x794e>, magic_packet_length) == 4, "offsetof(NetPacket_Head<0x794e>, magic_packet_length) == 4"); static_assert(sizeof(NetPacket_Head<0x794e>) == 8, "sizeof(NetPacket_Head<0x794e>) == 8"); +static_assert(alignof(NetPacket_Head<0x794e>) == 1, "alignof(NetPacket_Head<0x794e>) == 1"); template<> struct NetPacket_Repeat<0x794e> { @@ -1092,6 +1134,7 @@ struct NetPacket_Repeat<0x794e> }; static_assert(offsetof(NetPacket_Repeat<0x794e>, c) == 0, "offsetof(NetPacket_Repeat<0x794e>, c) == 0"); static_assert(sizeof(NetPacket_Repeat<0x794e>) == 1, "sizeof(NetPacket_Repeat<0x794e>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x794e>) == 1, "alignof(NetPacket_Repeat<0x794e>) == 1"); template<> struct NetPacket_Fixed<0x794f> @@ -1102,6 +1145,7 @@ struct NetPacket_Fixed<0x794f> static_assert(offsetof(NetPacket_Fixed<0x794f>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x794f>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x794f>, error) == 2, "offsetof(NetPacket_Fixed<0x794f>, error) == 2"); static_assert(sizeof(NetPacket_Fixed<0x794f>) == 4, "sizeof(NetPacket_Fixed<0x794f>) == 4"); +static_assert(alignof(NetPacket_Fixed<0x794f>) == 1, "alignof(NetPacket_Fixed<0x794f>) == 1"); template<> struct NetPacket_Fixed<0x7950> @@ -1114,6 +1158,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7950>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x7950>, account_name) == 2, "offsetof(NetPacket_Fixed<0x7950>, account_name) == 2"); static_assert(offsetof(NetPacket_Fixed<0x7950>, valid_add) == 26, "offsetof(NetPacket_Fixed<0x7950>, valid_add) == 26"); static_assert(sizeof(NetPacket_Fixed<0x7950>) == 38, "sizeof(NetPacket_Fixed<0x7950>) == 38"); +static_assert(alignof(NetPacket_Fixed<0x7950>) == 1, "alignof(NetPacket_Fixed<0x7950>) == 1"); template<> struct NetPacket_Fixed<0x7951> @@ -1128,6 +1173,7 @@ static_assert(offsetof(NetPacket_Fixed<0x7951>, account_id) == 2, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x7951>, account_name) == 6, "offsetof(NetPacket_Fixed<0x7951>, account_name) == 6"); static_assert(offsetof(NetPacket_Fixed<0x7951>, valid_until) == 30, "offsetof(NetPacket_Fixed<0x7951>, valid_until) == 30"); static_assert(sizeof(NetPacket_Fixed<0x7951>) == 34, "sizeof(NetPacket_Fixed<0x7951>) == 34"); +static_assert(alignof(NetPacket_Fixed<0x7951>) == 1, "alignof(NetPacket_Fixed<0x7951>) == 1"); template<> struct NetPacket_Fixed<0x7952> @@ -1138,6 +1184,7 @@ struct NetPacket_Fixed<0x7952> static_assert(offsetof(NetPacket_Fixed<0x7952>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7952>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x7952>, account_name) == 2, "offsetof(NetPacket_Fixed<0x7952>, account_name) == 2"); static_assert(sizeof(NetPacket_Fixed<0x7952>) == 26, "sizeof(NetPacket_Fixed<0x7952>) == 26"); +static_assert(alignof(NetPacket_Fixed<0x7952>) == 1, "alignof(NetPacket_Fixed<0x7952>) == 1"); template<> struct NetPacket_Head<0x7953> @@ -1172,6 +1219,7 @@ static_assert(offsetof(NetPacket_Head<0x7953>, connect_until) == 140, "offsetof( static_assert(offsetof(NetPacket_Head<0x7953>, ban_until) == 144, "offsetof(NetPacket_Head<0x7953>, ban_until) == 144"); static_assert(offsetof(NetPacket_Head<0x7953>, magic_packet_length) == 148, "offsetof(NetPacket_Head<0x7953>, magic_packet_length) == 148"); static_assert(sizeof(NetPacket_Head<0x7953>) == 150, "sizeof(NetPacket_Head<0x7953>) == 150"); +static_assert(alignof(NetPacket_Head<0x7953>) == 1, "alignof(NetPacket_Head<0x7953>) == 1"); template<> struct NetPacket_Repeat<0x7953> { @@ -1179,6 +1227,7 @@ struct NetPacket_Repeat<0x7953> }; static_assert(offsetof(NetPacket_Repeat<0x7953>, c) == 0, "offsetof(NetPacket_Repeat<0x7953>, c) == 0"); static_assert(sizeof(NetPacket_Repeat<0x7953>) == 1, "sizeof(NetPacket_Repeat<0x7953>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x7953>) == 1, "alignof(NetPacket_Repeat<0x7953>) == 1"); template<> struct NetPacket_Fixed<0x7954> @@ -1189,6 +1238,7 @@ struct NetPacket_Fixed<0x7954> static_assert(offsetof(NetPacket_Fixed<0x7954>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7954>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x7954>, account_id) == 2, "offsetof(NetPacket_Fixed<0x7954>, account_id) == 2"); static_assert(sizeof(NetPacket_Fixed<0x7954>) == 6, "sizeof(NetPacket_Fixed<0x7954>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x7954>) == 1, "alignof(NetPacket_Fixed<0x7954>) == 1"); template<> struct NetPacket_Fixed<0x7955> @@ -1197,6 +1247,7 @@ struct NetPacket_Fixed<0x7955> }; static_assert(offsetof(NetPacket_Fixed<0x7955>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7955>, magic_packet_id) == 0"); static_assert(sizeof(NetPacket_Fixed<0x7955>) == 2, "sizeof(NetPacket_Fixed<0x7955>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x7955>) == 1, "alignof(NetPacket_Fixed<0x7955>) == 1"); inline __attribute__((warn_unused_result)) @@ -2167,6 +2218,6 @@ bool network_to_native(Packet_Fixed<0x7955> *native, NetPacket_Fixed<0x7955> net } -#pragma pack(pop) +# pragma pack(pop) #endif // TMWA_PROTO2_LOGIN_ADMIN_HPP diff --git a/src/proto2/login-char.hpp b/src/proto2/login-char.hpp index 14d19a9..53e99f9 100644 --- a/src/proto2/login-char.hpp +++ b/src/proto2/login-char.hpp @@ -28,7 +28,7 @@ // This is an internal protocol, and can be changed without notice // this is only needed for the payload packet right now, and that needs to die -#pragma pack(push, 1) +# pragma pack(push, 1) template<> struct Packet_Fixed<0x2709> @@ -344,6 +344,7 @@ struct NetPacket_Fixed<0x2709> }; static_assert(offsetof(NetPacket_Fixed<0x2709>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2709>, magic_packet_id) == 0"); static_assert(sizeof(NetPacket_Fixed<0x2709>) == 2, "sizeof(NetPacket_Fixed<0x2709>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x2709>) == 1, "alignof(NetPacket_Fixed<0x2709>) == 1"); template<> struct NetPacket_Fixed<0x2710> @@ -370,6 +371,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2710>, unknown2) == 80, "offsetof(NetPa static_assert(offsetof(NetPacket_Fixed<0x2710>, maintenance) == 82, "offsetof(NetPacket_Fixed<0x2710>, maintenance) == 82"); static_assert(offsetof(NetPacket_Fixed<0x2710>, is_new) == 84, "offsetof(NetPacket_Fixed<0x2710>, is_new) == 84"); static_assert(sizeof(NetPacket_Fixed<0x2710>) == 86, "sizeof(NetPacket_Fixed<0x2710>) == 86"); +static_assert(alignof(NetPacket_Fixed<0x2710>) == 1, "alignof(NetPacket_Fixed<0x2710>) == 1"); template<> struct NetPacket_Fixed<0x2711> @@ -380,6 +382,7 @@ struct NetPacket_Fixed<0x2711> static_assert(offsetof(NetPacket_Fixed<0x2711>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2711>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x2711>, code) == 2, "offsetof(NetPacket_Fixed<0x2711>, code) == 2"); static_assert(sizeof(NetPacket_Fixed<0x2711>) == 3, "sizeof(NetPacket_Fixed<0x2711>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x2711>) == 1, "alignof(NetPacket_Fixed<0x2711>) == 1"); template<> struct NetPacket_Fixed<0x2712> @@ -398,6 +401,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2712>, login_id2) == 10, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x2712>, sex) == 14, "offsetof(NetPacket_Fixed<0x2712>, sex) == 14"); static_assert(offsetof(NetPacket_Fixed<0x2712>, ip) == 15, "offsetof(NetPacket_Fixed<0x2712>, ip) == 15"); static_assert(sizeof(NetPacket_Fixed<0x2712>) == 19, "sizeof(NetPacket_Fixed<0x2712>) == 19"); +static_assert(alignof(NetPacket_Fixed<0x2712>) == 1, "alignof(NetPacket_Fixed<0x2712>) == 1"); template<> struct NetPacket_Fixed<0x2713> @@ -414,6 +418,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2713>, invalid) == 6, "offsetof(NetPack static_assert(offsetof(NetPacket_Fixed<0x2713>, email) == 7, "offsetof(NetPacket_Fixed<0x2713>, email) == 7"); static_assert(offsetof(NetPacket_Fixed<0x2713>, connect_until) == 47, "offsetof(NetPacket_Fixed<0x2713>, connect_until) == 47"); static_assert(sizeof(NetPacket_Fixed<0x2713>) == 51, "sizeof(NetPacket_Fixed<0x2713>) == 51"); +static_assert(alignof(NetPacket_Fixed<0x2713>) == 1, "alignof(NetPacket_Fixed<0x2713>) == 1"); template<> struct NetPacket_Fixed<0x2714> @@ -424,6 +429,7 @@ struct NetPacket_Fixed<0x2714> static_assert(offsetof(NetPacket_Fixed<0x2714>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2714>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x2714>, users) == 2, "offsetof(NetPacket_Fixed<0x2714>, users) == 2"); static_assert(sizeof(NetPacket_Fixed<0x2714>) == 6, "sizeof(NetPacket_Fixed<0x2714>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x2714>) == 1, "alignof(NetPacket_Fixed<0x2714>) == 1"); template<> struct NetPacket_Fixed<0x2715> @@ -436,6 +442,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2715>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x2715>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2715>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x2715>, email) == 6, "offsetof(NetPacket_Fixed<0x2715>, email) == 6"); static_assert(sizeof(NetPacket_Fixed<0x2715>) == 46, "sizeof(NetPacket_Fixed<0x2715>) == 46"); +static_assert(alignof(NetPacket_Fixed<0x2715>) == 1, "alignof(NetPacket_Fixed<0x2715>) == 1"); template<> struct NetPacket_Fixed<0x2716> @@ -446,6 +453,7 @@ struct NetPacket_Fixed<0x2716> static_assert(offsetof(NetPacket_Fixed<0x2716>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2716>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x2716>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2716>, account_id) == 2"); static_assert(sizeof(NetPacket_Fixed<0x2716>) == 6, "sizeof(NetPacket_Fixed<0x2716>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x2716>) == 1, "alignof(NetPacket_Fixed<0x2716>) == 1"); template<> struct NetPacket_Fixed<0x2717> @@ -460,6 +468,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2717>, account_id) == 2, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x2717>, email) == 6, "offsetof(NetPacket_Fixed<0x2717>, email) == 6"); static_assert(offsetof(NetPacket_Fixed<0x2717>, connect_until) == 46, "offsetof(NetPacket_Fixed<0x2717>, connect_until) == 46"); static_assert(sizeof(NetPacket_Fixed<0x2717>) == 50, "sizeof(NetPacket_Fixed<0x2717>) == 50"); +static_assert(alignof(NetPacket_Fixed<0x2717>) == 1, "alignof(NetPacket_Fixed<0x2717>) == 1"); template<> struct NetPacket_Head<0x2720> @@ -472,6 +481,7 @@ static_assert(offsetof(NetPacket_Head<0x2720>, magic_packet_id) == 0, "offsetof( static_assert(offsetof(NetPacket_Head<0x2720>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x2720>, magic_packet_length) == 2"); static_assert(offsetof(NetPacket_Head<0x2720>, account_id) == 4, "offsetof(NetPacket_Head<0x2720>, account_id) == 4"); static_assert(sizeof(NetPacket_Head<0x2720>) == 8, "sizeof(NetPacket_Head<0x2720>) == 8"); +static_assert(alignof(NetPacket_Head<0x2720>) == 1, "alignof(NetPacket_Head<0x2720>) == 1"); template<> struct NetPacket_Repeat<0x2720> { @@ -479,6 +489,7 @@ struct NetPacket_Repeat<0x2720> }; static_assert(offsetof(NetPacket_Repeat<0x2720>, c) == 0, "offsetof(NetPacket_Repeat<0x2720>, c) == 0"); static_assert(sizeof(NetPacket_Repeat<0x2720>) == 1, "sizeof(NetPacket_Repeat<0x2720>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x2720>) == 1, "alignof(NetPacket_Repeat<0x2720>) == 1"); template<> struct NetPacket_Fixed<0x2721> @@ -491,6 +502,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2721>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x2721>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2721>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x2721>, gm_level) == 6, "offsetof(NetPacket_Fixed<0x2721>, gm_level) == 6"); static_assert(sizeof(NetPacket_Fixed<0x2721>) == 10, "sizeof(NetPacket_Fixed<0x2721>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x2721>) == 1, "alignof(NetPacket_Fixed<0x2721>) == 1"); template<> struct NetPacket_Fixed<0x2722> @@ -505,6 +517,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2722>, account_id) == 2, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x2722>, old_email) == 6, "offsetof(NetPacket_Fixed<0x2722>, old_email) == 6"); static_assert(offsetof(NetPacket_Fixed<0x2722>, new_email) == 46, "offsetof(NetPacket_Fixed<0x2722>, new_email) == 46"); static_assert(sizeof(NetPacket_Fixed<0x2722>) == 86, "sizeof(NetPacket_Fixed<0x2722>) == 86"); +static_assert(alignof(NetPacket_Fixed<0x2722>) == 1, "alignof(NetPacket_Fixed<0x2722>) == 1"); template<> struct NetPacket_Fixed<0x2723> @@ -517,6 +530,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2723>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x2723>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2723>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x2723>, sex) == 6, "offsetof(NetPacket_Fixed<0x2723>, sex) == 6"); static_assert(sizeof(NetPacket_Fixed<0x2723>) == 7, "sizeof(NetPacket_Fixed<0x2723>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x2723>) == 1, "alignof(NetPacket_Fixed<0x2723>) == 1"); template<> struct NetPacket_Fixed<0x2724> @@ -529,6 +543,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2724>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x2724>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2724>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x2724>, status) == 6, "offsetof(NetPacket_Fixed<0x2724>, status) == 6"); static_assert(sizeof(NetPacket_Fixed<0x2724>) == 10, "sizeof(NetPacket_Fixed<0x2724>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x2724>) == 1, "alignof(NetPacket_Fixed<0x2724>) == 1"); template<> struct NetPacket_Fixed<0x2725> @@ -541,6 +556,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2725>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x2725>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2725>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x2725>, ban_add) == 6, "offsetof(NetPacket_Fixed<0x2725>, ban_add) == 6"); static_assert(sizeof(NetPacket_Fixed<0x2725>) == 18, "sizeof(NetPacket_Fixed<0x2725>) == 18"); +static_assert(alignof(NetPacket_Fixed<0x2725>) == 1, "alignof(NetPacket_Fixed<0x2725>) == 1"); template<> struct NetPacket_Fixed<0x2727> @@ -551,6 +567,7 @@ struct NetPacket_Fixed<0x2727> static_assert(offsetof(NetPacket_Fixed<0x2727>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2727>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x2727>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2727>, account_id) == 2"); static_assert(sizeof(NetPacket_Fixed<0x2727>) == 6, "sizeof(NetPacket_Fixed<0x2727>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x2727>) == 1, "alignof(NetPacket_Fixed<0x2727>) == 1"); template<> struct NetPacket_Head<0x2728> @@ -563,6 +580,7 @@ static_assert(offsetof(NetPacket_Head<0x2728>, magic_packet_id) == 0, "offsetof( static_assert(offsetof(NetPacket_Head<0x2728>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x2728>, magic_packet_length) == 2"); static_assert(offsetof(NetPacket_Head<0x2728>, account_id) == 4, "offsetof(NetPacket_Head<0x2728>, account_id) == 4"); static_assert(sizeof(NetPacket_Head<0x2728>) == 8, "sizeof(NetPacket_Head<0x2728>) == 8"); +static_assert(alignof(NetPacket_Head<0x2728>) == 1, "alignof(NetPacket_Head<0x2728>) == 1"); template<> struct NetPacket_Repeat<0x2728> { @@ -572,6 +590,7 @@ struct NetPacket_Repeat<0x2728> static_assert(offsetof(NetPacket_Repeat<0x2728>, name) == 0, "offsetof(NetPacket_Repeat<0x2728>, name) == 0"); static_assert(offsetof(NetPacket_Repeat<0x2728>, value) == 32, "offsetof(NetPacket_Repeat<0x2728>, value) == 32"); static_assert(sizeof(NetPacket_Repeat<0x2728>) == 36, "sizeof(NetPacket_Repeat<0x2728>) == 36"); +static_assert(alignof(NetPacket_Repeat<0x2728>) == 1, "alignof(NetPacket_Repeat<0x2728>) == 1"); template<> struct NetPacket_Head<0x2729> @@ -584,6 +603,7 @@ static_assert(offsetof(NetPacket_Head<0x2729>, magic_packet_id) == 0, "offsetof( static_assert(offsetof(NetPacket_Head<0x2729>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x2729>, magic_packet_length) == 2"); static_assert(offsetof(NetPacket_Head<0x2729>, account_id) == 4, "offsetof(NetPacket_Head<0x2729>, account_id) == 4"); static_assert(sizeof(NetPacket_Head<0x2729>) == 8, "sizeof(NetPacket_Head<0x2729>) == 8"); +static_assert(alignof(NetPacket_Head<0x2729>) == 1, "alignof(NetPacket_Head<0x2729>) == 1"); template<> struct NetPacket_Repeat<0x2729> { @@ -593,6 +613,7 @@ struct NetPacket_Repeat<0x2729> static_assert(offsetof(NetPacket_Repeat<0x2729>, name) == 0, "offsetof(NetPacket_Repeat<0x2729>, name) == 0"); static_assert(offsetof(NetPacket_Repeat<0x2729>, value) == 32, "offsetof(NetPacket_Repeat<0x2729>, value) == 32"); static_assert(sizeof(NetPacket_Repeat<0x2729>) == 36, "sizeof(NetPacket_Repeat<0x2729>) == 36"); +static_assert(alignof(NetPacket_Repeat<0x2729>) == 1, "alignof(NetPacket_Repeat<0x2729>) == 1"); template<> struct NetPacket_Fixed<0x272a> @@ -603,6 +624,7 @@ struct NetPacket_Fixed<0x272a> static_assert(offsetof(NetPacket_Fixed<0x272a>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x272a>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x272a>, account_id) == 2, "offsetof(NetPacket_Fixed<0x272a>, account_id) == 2"); static_assert(sizeof(NetPacket_Fixed<0x272a>) == 6, "sizeof(NetPacket_Fixed<0x272a>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x272a>) == 1, "alignof(NetPacket_Fixed<0x272a>) == 1"); template<> struct NetPacket_Fixed<0x2730> @@ -613,6 +635,7 @@ struct NetPacket_Fixed<0x2730> static_assert(offsetof(NetPacket_Fixed<0x2730>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2730>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Fixed<0x2730>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2730>, account_id) == 2"); static_assert(sizeof(NetPacket_Fixed<0x2730>) == 6, "sizeof(NetPacket_Fixed<0x2730>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x2730>) == 1, "alignof(NetPacket_Fixed<0x2730>) == 1"); template<> struct NetPacket_Fixed<0x2731> @@ -627,6 +650,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2731>, account_id) == 2, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x2731>, ban_not_status) == 6, "offsetof(NetPacket_Fixed<0x2731>, ban_not_status) == 6"); static_assert(offsetof(NetPacket_Fixed<0x2731>, status_or_ban_until) == 7, "offsetof(NetPacket_Fixed<0x2731>, status_or_ban_until) == 7"); static_assert(sizeof(NetPacket_Fixed<0x2731>) == 11, "sizeof(NetPacket_Fixed<0x2731>) == 11"); +static_assert(alignof(NetPacket_Fixed<0x2731>) == 1, "alignof(NetPacket_Fixed<0x2731>) == 1"); template<> struct NetPacket_Head<0x2732> @@ -637,6 +661,7 @@ struct NetPacket_Head<0x2732> static_assert(offsetof(NetPacket_Head<0x2732>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x2732>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Head<0x2732>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x2732>, magic_packet_length) == 2"); static_assert(sizeof(NetPacket_Head<0x2732>) == 4, "sizeof(NetPacket_Head<0x2732>) == 4"); +static_assert(alignof(NetPacket_Head<0x2732>) == 1, "alignof(NetPacket_Head<0x2732>) == 1"); template<> struct NetPacket_Repeat<0x2732> { @@ -646,6 +671,7 @@ struct NetPacket_Repeat<0x2732> static_assert(offsetof(NetPacket_Repeat<0x2732>, account_id) == 0, "offsetof(NetPacket_Repeat<0x2732>, account_id) == 0"); static_assert(offsetof(NetPacket_Repeat<0x2732>, gm_level) == 4, "offsetof(NetPacket_Repeat<0x2732>, gm_level) == 4"); static_assert(sizeof(NetPacket_Repeat<0x2732>) == 5, "sizeof(NetPacket_Repeat<0x2732>) == 5"); +static_assert(alignof(NetPacket_Repeat<0x2732>) == 1, "alignof(NetPacket_Repeat<0x2732>) == 1"); template<> struct NetPacket_Fixed<0x2740> @@ -660,6 +686,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2740>, account_id) == 2, "offsetof(NetP static_assert(offsetof(NetPacket_Fixed<0x2740>, old_pass) == 6, "offsetof(NetPacket_Fixed<0x2740>, old_pass) == 6"); static_assert(offsetof(NetPacket_Fixed<0x2740>, new_pass) == 30, "offsetof(NetPacket_Fixed<0x2740>, new_pass) == 30"); static_assert(sizeof(NetPacket_Fixed<0x2740>) == 54, "sizeof(NetPacket_Fixed<0x2740>) == 54"); +static_assert(alignof(NetPacket_Fixed<0x2740>) == 1, "alignof(NetPacket_Fixed<0x2740>) == 1"); template<> struct NetPacket_Fixed<0x2741> @@ -672,6 +699,7 @@ static_assert(offsetof(NetPacket_Fixed<0x2741>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x2741>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2741>, account_id) == 2"); static_assert(offsetof(NetPacket_Fixed<0x2741>, status) == 6, "offsetof(NetPacket_Fixed<0x2741>, status) == 6"); static_assert(sizeof(NetPacket_Fixed<0x2741>) == 7, "sizeof(NetPacket_Fixed<0x2741>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x2741>) == 1, "alignof(NetPacket_Fixed<0x2741>) == 1"); inline __attribute__((warn_unused_result)) @@ -1207,6 +1235,6 @@ bool network_to_native(Packet_Fixed<0x2741> *native, NetPacket_Fixed<0x2741> net } -#pragma pack(pop) +# pragma pack(pop) #endif // TMWA_PROTO2_LOGIN_CHAR_HPP diff --git a/src/proto2/login-user.hpp b/src/proto2/login-user.hpp index 7f0e5ea..af4a070 100644 --- a/src/proto2/login-user.hpp +++ b/src/proto2/login-user.hpp @@ -28,7 +28,7 @@ // This is a public protocol, and changes require client cooperation // this is only needed for the payload packet right now, and that needs to die -#pragma pack(push, 1) +# pragma pack(push, 1) template<> struct Packet_Head<0x0063> @@ -112,6 +112,7 @@ struct NetPacket_Head<0x0063> static_assert(offsetof(NetPacket_Head<0x0063>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x0063>, magic_packet_id) == 0"); static_assert(offsetof(NetPacket_Head<0x0063>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x0063>, magic_packet_length) == 2"); static_assert(sizeof(NetPacket_Head<0x0063>) == 4, "sizeof(NetPacket_Head<0x0063>) == 4"); +static_assert(alignof(NetPacket_Head<0x0063>) == 1, "alignof(NetPacket_Head<0x0063>) == 1"); template<> struct NetPacket_Repeat<0x0063> { @@ -119,6 +120,7 @@ struct NetPacket_Repeat<0x0063> }; static_assert(offsetof(NetPacket_Repeat<0x0063>, c) == 0, "offsetof(NetPacket_Repeat<0x0063>, c) == 0"); static_assert(sizeof(NetPacket_Repeat<0x0063>) == 1, "sizeof(NetPacket_Repeat<0x0063>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x0063>) == 1, "alignof(NetPacket_Repeat<0x0063>) == 1"); template<> struct NetPacket_Fixed<0x0064> @@ -135,6 +137,7 @@ static_assert(offsetof(NetPacket_Fixed<0x0064>, account_name) == 6, "offsetof(Ne static_assert(offsetof(NetPacket_Fixed<0x0064>, account_pass) == 30, "offsetof(NetPacket_Fixed<0x0064>, account_pass) == 30"); static_assert(offsetof(NetPacket_Fixed<0x0064>, version_2_flags) == 54, "offsetof(NetPacket_Fixed<0x0064>, version_2_flags) == 54"); static_assert(sizeof(NetPacket_Fixed<0x0064>) == 55, "sizeof(NetPacket_Fixed<0x0064>) == 55"); +static_assert(alignof(NetPacket_Fixed<0x0064>) == 1, "alignof(NetPacket_Fixed<0x0064>) == 1"); template<> struct NetPacket_Head<0x0069> @@ -159,6 +162,7 @@ static_assert(offsetof(NetPacket_Head<0x0069>, last_login_string) == 20, "offset static_assert(offsetof(NetPacket_Head<0x0069>, unused2) == 44, "offsetof(NetPacket_Head<0x0069>, unused2) == 44"); static_assert(offsetof(NetPacket_Head<0x0069>, sex) == 46, "offsetof(NetPacket_Head<0x0069>, sex) == 46"); static_assert(sizeof(NetPacket_Head<0x0069>) == 47, "sizeof(NetPacket_Head<0x0069>) == 47"); +static_assert(alignof(NetPacket_Head<0x0069>) == 1, "alignof(NetPacket_Head<0x0069>) == 1"); template<> struct NetPacket_Repeat<0x0069> { @@ -176,6 +180,7 @@ static_assert(offsetof(NetPacket_Repeat<0x0069>, users) == 26, "offsetof(NetPack static_assert(offsetof(NetPacket_Repeat<0x0069>, maintenance) == 28, "offsetof(NetPacket_Repeat<0x0069>, maintenance) == 28"); static_assert(offsetof(NetPacket_Repeat<0x0069>, is_new) == 30, "offsetof(NetPacket_Repeat<0x0069>, is_new) == 30"); static_assert(sizeof(NetPacket_Repeat<0x0069>) == 32, "sizeof(NetPacket_Repeat<0x0069>) == 32"); +static_assert(alignof(NetPacket_Repeat<0x0069>) == 1, "alignof(NetPacket_Repeat<0x0069>) == 1"); template<> struct NetPacket_Fixed<0x006a> @@ -188,6 +193,7 @@ static_assert(offsetof(NetPacket_Fixed<0x006a>, magic_packet_id) == 0, "offsetof static_assert(offsetof(NetPacket_Fixed<0x006a>, error_code) == 2, "offsetof(NetPacket_Fixed<0x006a>, error_code) == 2"); static_assert(offsetof(NetPacket_Fixed<0x006a>, error_message) == 3, "offsetof(NetPacket_Fixed<0x006a>, error_message) == 3"); static_assert(sizeof(NetPacket_Fixed<0x006a>) == 23, "sizeof(NetPacket_Fixed<0x006a>) == 23"); +static_assert(alignof(NetPacket_Fixed<0x006a>) == 1, "alignof(NetPacket_Fixed<0x006a>) == 1"); inline __attribute__((warn_unused_result)) @@ -319,6 +325,6 @@ bool network_to_native(Packet_Fixed<0x006a> *native, NetPacket_Fixed<0x006a> net } -#pragma pack(pop) +# pragma pack(pop) #endif // TMWA_PROTO2_LOGIN_USER_HPP diff --git a/src/proto2/map-user.hpp b/src/proto2/map-user.hpp index 08d19fa..ef401f4 100644 --- a/src/proto2/map-user.hpp +++ b/src/proto2/map-user.hpp @@ -28,7 +28,1953 @@ // This is a public protocol, and changes require client cooperation // this is only needed for the payload packet right now, and that needs to die -#pragma pack(push, 1) +# pragma pack(push, 1) + +template<> +struct Packet_Fixed<0x0072> +{ + static const uint16_t PACKET_ID = 0x0072; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + AccountId account_id = {}; + CharId char_id = {}; + uint32_t login_id1 = {}; + uint32_t client_tick = {}; + SEX sex = {}; +}; + +template<> +struct Packet_Fixed<0x0073> +{ + static const uint16_t PACKET_ID = 0x0073; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + tick_t tick = {}; + Position1 pos = {}; + uint8_t five1 = {}; + uint8_t five2 = {}; +}; + +template<> +struct Packet_Fixed<0x0078> +{ + static const uint16_t PACKET_ID = 0x0078; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + interval_t speed = {}; + Opt1 opt1 = {}; + Opt2 opt2 = {}; + Option option = {}; + Species species = {}; + uint16_t unused_hair_style = {}; + uint16_t unused_weapon = {}; + uint16_t unused_head_bottom_or_species_again = {}; + uint16_t unused_shield_or_part_of_guild_emblem = {}; + uint16_t unused_head_top_or_unused_part_of_guild_emblem = {}; + uint16_t unused_head_mid_or_part_of_guild_id = {}; + uint16_t unused_hair_color_or_part_of_guild_id = {}; + uint16_t unused_clothes_color = {}; + uint16_t unused_1 = {}; + uint16_t unused_2 = {}; + Position1 unused_pos_again = {}; + uint8_t unused_4b = {}; + uint16_t unused_5 = {}; + uint16_t unused_zero_1 = {}; + uint8_t unused_zero_2 = {}; + uint8_t unused_sex = {}; + Position1 pos = {}; + uint8_t five1 = {}; + uint8_t five2 = {}; + uint8_t zero = {}; + uint16_t level = {}; +}; + +template<> +struct Packet_Fixed<0x007b> +{ + static const uint16_t PACKET_ID = 0x007b; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + interval_t speed = {}; + Opt1 opt1 = {}; + Opt2 opt2 = {}; + Option option = {}; + Species mob_class = {}; + uint16_t unused_hair_style = {}; + uint16_t unused_weapon = {}; + uint16_t unused_head_bottom = {}; + tick_t tick_and_maybe_part_of_guild_emblem = {}; + uint16_t unused_shield_or_maybe_part_of_guild_emblem = {}; + uint16_t unused_head_top_or_maybe_part_of_guild_id = {}; + uint16_t unused_head_mid_or_maybe_part_of_guild_id = {}; + uint16_t unused_hair_color = {}; + uint16_t unused_clothes_color = {}; + uint16_t unused_1 = {}; + uint16_t unused_2 = {}; + uint16_t unused_3 = {}; + uint16_t unused_4 = {}; + uint16_t unused_5 = {}; + uint16_t unused_zero_1 = {}; + uint8_t unused_zero_2 = {}; + uint8_t unused_sex = {}; + Position2 pos2 = {}; + uint8_t zero = {}; + uint8_t five1 = {}; + uint8_t five2 = {}; + uint16_t level = {}; +}; + +template<> +struct Packet_Fixed<0x007c> +{ + static const uint16_t PACKET_ID = 0x007c; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + interval_t speed = {}; + Opt1 opt1 = {}; + Opt2 opt2 = {}; + Option option = {}; + uint16_t unknown_1 = {}; + uint16_t unknown_2 = {}; + uint16_t unknown_3 = {}; + Species species = {}; + uint16_t unknown_4 = {}; + uint16_t unknown_5 = {}; + uint16_t unknown_6 = {}; + uint16_t unknown_7 = {}; + uint16_t unknown_8 = {}; + uint16_t unknown_9 = {}; + uint16_t unknown_10 = {}; + Position1 pos = {}; + uint16_t unknown_11 = {}; +}; + +template<> +struct Packet_Fixed<0x007d> +{ + static const uint16_t PACKET_ID = 0x007d; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; +}; + +template<> +struct Packet_Fixed<0x007e> +{ + static const uint16_t PACKET_ID = 0x007e; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint32_t client_tick = {}; +}; + +template<> +struct Packet_Fixed<0x007f> +{ + static const uint16_t PACKET_ID = 0x007f; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + tick_t tick = {}; +}; + +template<> +struct Packet_Fixed<0x0080> +{ + static const uint16_t PACKET_ID = 0x0080; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + BeingRemoveWhy type = {}; +}; + +template<> +struct Packet_Fixed<0x0085> +{ + static const uint16_t PACKET_ID = 0x0085; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + Position1 pos = {}; +}; + +template<> +struct Packet_Fixed<0x0087> +{ + static const uint16_t PACKET_ID = 0x0087; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + tick_t tick = {}; + Position2 pos2 = {}; + uint8_t zero = {}; +}; + +template<> +struct Packet_Fixed<0x0088> +{ + static const uint16_t PACKET_ID = 0x0088; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + uint16_t x = {}; + uint16_t y = {}; +}; + +template<> +struct Packet_Fixed<0x0089> +{ + static const uint16_t PACKET_ID = 0x0089; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId target_id = {}; + DamageType action = {}; +}; + +template<> +struct Packet_Fixed<0x008a> +{ + static const uint16_t PACKET_ID = 0x008a; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId src_id = {}; + BlockId dst_id = {}; + tick_t tick = {}; + interval_t sdelay = {}; + interval_t ddelay = {}; + uint16_t damage = {}; + uint16_t div = {}; + DamageType damage_type = {}; + uint16_t damage2 = {}; +}; + +template<> +struct Packet_Head<0x008c> +{ + static const uint16_t PACKET_ID = 0x008c; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; +}; +template<> +struct Packet_Repeat<0x008c> +{ + static const uint16_t PACKET_ID = 0x008c; + + uint8_t c = {}; +}; + +template<> +struct Packet_Head<0x008d> +{ + static const uint16_t PACKET_ID = 0x008d; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; + BlockId block_id = {}; +}; +template<> +struct Packet_Repeat<0x008d> +{ + static const uint16_t PACKET_ID = 0x008d; + + uint8_t c = {}; +}; + +template<> +struct Packet_Head<0x008e> +{ + static const uint16_t PACKET_ID = 0x008e; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; +}; +template<> +struct Packet_Repeat<0x008e> +{ + static const uint16_t PACKET_ID = 0x008e; + + uint8_t c = {}; +}; + +template<> +struct Packet_Fixed<0x0090> +{ + static const uint16_t PACKET_ID = 0x0090; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + uint8_t unused = {}; +}; + +template<> +struct Packet_Fixed<0x0091> +{ + static const uint16_t PACKET_ID = 0x0091; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + MapName map_name = {}; + uint16_t x = {}; + uint16_t y = {}; +}; + +template<> +struct Packet_Fixed<0x0092> +{ + static const uint16_t PACKET_ID = 0x0092; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + MapName map_name = {}; + uint16_t x = {}; + uint16_t y = {}; + IP4Address ip = {}; + uint16_t port = {}; +}; + +template<> +struct Packet_Fixed<0x0094> +{ + static const uint16_t PACKET_ID = 0x0094; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; +}; + +template<> +struct Packet_Fixed<0x0095> +{ + static const uint16_t PACKET_ID = 0x0095; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + CharName char_name = {}; +}; + +template<> +struct Packet_Head<0x0096> +{ + static const uint16_t PACKET_ID = 0x0096; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; + CharName target_name = {}; +}; +template<> +struct Packet_Repeat<0x0096> +{ + static const uint16_t PACKET_ID = 0x0096; + + uint8_t c = {}; +}; + +template<> +struct Packet_Head<0x0097> +{ + static const uint16_t PACKET_ID = 0x0097; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; + CharName char_name = {}; +}; +template<> +struct Packet_Repeat<0x0097> +{ + static const uint16_t PACKET_ID = 0x0097; + + uint8_t c = {}; +}; + +template<> +struct Packet_Fixed<0x0098> +{ + static const uint16_t PACKET_ID = 0x0098; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint8_t flag = {}; +}; + +template<> +struct Packet_Head<0x009a> +{ + static const uint16_t PACKET_ID = 0x009a; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; +}; +template<> +struct Packet_Repeat<0x009a> +{ + static const uint16_t PACKET_ID = 0x009a; + + uint8_t c = {}; +}; + +template<> +struct Packet_Fixed<0x009b> +{ + static const uint16_t PACKET_ID = 0x009b; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t unused = {}; + uint8_t client_dir = {}; +}; + +template<> +struct Packet_Fixed<0x009c> +{ + static const uint16_t PACKET_ID = 0x009c; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + uint16_t zero = {}; + uint8_t client_dir = {}; +}; + +template<> +struct Packet_Fixed<0x009d> +{ + static const uint16_t PACKET_ID = 0x009d; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + ItemNameId name_id = {}; + uint8_t identify = {}; + uint16_t x = {}; + uint16_t y = {}; + uint16_t amount = {}; + uint8_t subx = {}; + uint8_t suby = {}; +}; + +template<> +struct Packet_Fixed<0x009e> +{ + static const uint16_t PACKET_ID = 0x009e; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + ItemNameId name_id = {}; + uint8_t identify = {}; + uint16_t x = {}; + uint16_t y = {}; + uint8_t subx = {}; + uint8_t suby = {}; + uint16_t amount = {}; +}; + +template<> +struct Packet_Fixed<0x009f> +{ + static const uint16_t PACKET_ID = 0x009f; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId object_id = {}; +}; + +template<> +struct Packet_Fixed<0x00a0> +{ + static const uint16_t PACKET_ID = 0x00a0; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t ioff2 = {}; + uint16_t amount = {}; + ItemNameId name_id = {}; + uint8_t identify = {}; + uint8_t broken_or_attribute = {}; + uint8_t refine = {}; + uint16_t card0 = {}; + uint16_t card1 = {}; + uint16_t card2 = {}; + uint16_t card3 = {}; + EPOS epos = {}; + ItemType item_type = {}; + PickupFail pickup_fail = {}; +}; + +template<> +struct Packet_Fixed<0x00a1> +{ + static const uint16_t PACKET_ID = 0x00a1; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; +}; + +template<> +struct Packet_Fixed<0x00a2> +{ + static const uint16_t PACKET_ID = 0x00a2; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t ioff2 = {}; + uint16_t amount = {}; +}; + +template<> +struct Packet_Head<0x00a4> +{ + static const uint16_t PACKET_ID = 0x00a4; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; +}; +template<> +struct Packet_Repeat<0x00a4> +{ + static const uint16_t PACKET_ID = 0x00a4; + + uint16_t ioff2 = {}; + ItemNameId name_id = {}; + ItemType item_type = {}; + uint8_t identify = {}; + EPOS epos_pc = {}; + EPOS epos_inv = {}; + uint8_t broken_or_attribute = {}; + uint8_t refine = {}; + uint16_t card0 = {}; + uint16_t card1 = {}; + uint16_t card2 = {}; + uint16_t card3 = {}; +}; + +template<> +struct Packet_Head<0x00a6> +{ + static const uint16_t PACKET_ID = 0x00a6; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; +}; +template<> +struct Packet_Repeat<0x00a6> +{ + static const uint16_t PACKET_ID = 0x00a6; + + uint16_t soff1 = {}; + ItemNameId name_id = {}; + ItemType item_type = {}; + uint8_t identify = {}; + EPOS epos_id = {}; + EPOS epos_stor = {}; + uint8_t broken_or_attribute = {}; + uint8_t refine = {}; + uint16_t card0 = {}; + uint16_t card1 = {}; + uint16_t card2 = {}; + uint16_t card3 = {}; +}; + +template<> +struct Packet_Fixed<0x00a7> +{ + static const uint16_t PACKET_ID = 0x00a7; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t ioff2 = {}; + uint32_t unused_id = {}; +}; + +template<> +struct Packet_Fixed<0x00a8> +{ + static const uint16_t PACKET_ID = 0x00a8; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t ioff2 = {}; + uint16_t amount = {}; + uint8_t ok = {}; +}; + +template<> +struct Packet_Fixed<0x00a9> +{ + static const uint16_t PACKET_ID = 0x00a9; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t ioff2 = {}; + EPOS epos_ignored = {}; +}; + +template<> +struct Packet_Fixed<0x00aa> +{ + static const uint16_t PACKET_ID = 0x00aa; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t ioff2 = {}; + EPOS epos = {}; + uint8_t ok = {}; +}; + +template<> +struct Packet_Fixed<0x00ab> +{ + static const uint16_t PACKET_ID = 0x00ab; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t ioff2 = {}; +}; + +template<> +struct Packet_Fixed<0x00ac> +{ + static const uint16_t PACKET_ID = 0x00ac; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t ioff2 = {}; + EPOS epos = {}; + uint8_t ok = {}; +}; + +template<> +struct Packet_Fixed<0x00af> +{ + static const uint16_t PACKET_ID = 0x00af; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t ioff2 = {}; + uint16_t amount = {}; +}; + +template<> +struct Packet_Fixed<0x00b0> +{ + static const uint16_t PACKET_ID = 0x00b0; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + SP sp_type = {}; + uint32_t value = {}; +}; + +template<> +struct Packet_Fixed<0x00b1> +{ + static const uint16_t PACKET_ID = 0x00b1; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + SP sp_type = {}; + uint32_t value = {}; +}; + +template<> +struct Packet_Fixed<0x00b2> +{ + static const uint16_t PACKET_ID = 0x00b2; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint8_t flag = {}; +}; + +template<> +struct Packet_Fixed<0x00b3> +{ + static const uint16_t PACKET_ID = 0x00b3; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint8_t one = {}; +}; + +template<> +struct Packet_Head<0x00b4> +{ + static const uint16_t PACKET_ID = 0x00b4; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; + BlockId block_id = {}; +}; +template<> +struct Packet_Repeat<0x00b4> +{ + static const uint16_t PACKET_ID = 0x00b4; + + uint8_t c = {}; +}; + +template<> +struct Packet_Fixed<0x00b5> +{ + static const uint16_t PACKET_ID = 0x00b5; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; +}; + +template<> +struct Packet_Fixed<0x00b6> +{ + static const uint16_t PACKET_ID = 0x00b6; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; +}; + +template<> +struct Packet_Head<0x00b7> +{ + static const uint16_t PACKET_ID = 0x00b7; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; + BlockId block_id = {}; +}; +template<> +struct Packet_Repeat<0x00b7> +{ + static const uint16_t PACKET_ID = 0x00b7; + + uint8_t c = {}; +}; + +template<> +struct Packet_Fixed<0x00b8> +{ + static const uint16_t PACKET_ID = 0x00b8; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId npc_id = {}; + uint8_t menu_entry = {}; +}; + +template<> +struct Packet_Fixed<0x00b9> +{ + static const uint16_t PACKET_ID = 0x00b9; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId npc_id = {}; +}; + +template<> +struct Packet_Fixed<0x00bb> +{ + static const uint16_t PACKET_ID = 0x00bb; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + SP asp = {}; + uint8_t unused = {}; +}; + +template<> +struct Packet_Fixed<0x00bc> +{ + static const uint16_t PACKET_ID = 0x00bc; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + SP sp_type = {}; + uint8_t ok = {}; + uint8_t val = {}; +}; + +template<> +struct Packet_Fixed<0x00bd> +{ + static const uint16_t PACKET_ID = 0x00bd; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t status_point = {}; + uint8_t str_attr = {}; + uint8_t str_upd = {}; + uint8_t agi_attr = {}; + uint8_t agi_upd = {}; + uint8_t vit_attr = {}; + uint8_t vit_upd = {}; + uint8_t int_attr = {}; + uint8_t int_upd = {}; + uint8_t dex_attr = {}; + uint8_t dex_upd = {}; + uint8_t luk_attr = {}; + uint8_t luk_upd = {}; + uint16_t atk_sum = {}; + uint16_t watk2 = {}; + uint16_t matk1 = {}; + uint16_t matk2 = {}; + uint16_t def = {}; + uint16_t def2 = {}; + uint16_t mdef = {}; + uint16_t mdef2 = {}; + uint16_t hit = {}; + uint16_t flee = {}; + uint16_t flee2 = {}; + uint16_t critical = {}; + uint16_t karma = {}; + uint16_t manner = {}; +}; + +template<> +struct Packet_Fixed<0x00be> +{ + static const uint16_t PACKET_ID = 0x00be; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + SP sp_type = {}; + uint8_t value = {}; +}; + +template<> +struct Packet_Fixed<0x00bf> +{ + static const uint16_t PACKET_ID = 0x00bf; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint8_t emote = {}; +}; + +template<> +struct Packet_Fixed<0x00c0> +{ + static const uint16_t PACKET_ID = 0x00c0; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + uint8_t type = {}; +}; + +template<> +struct Packet_Fixed<0x00c1> +{ + static const uint16_t PACKET_ID = 0x00c1; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; +}; + +template<> +struct Packet_Fixed<0x00c2> +{ + static const uint16_t PACKET_ID = 0x00c2; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint32_t users = {}; +}; + +template<> +struct Packet_Fixed<0x00c4> +{ + static const uint16_t PACKET_ID = 0x00c4; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; +}; + +template<> +struct Packet_Fixed<0x00c5> +{ + static const uint16_t PACKET_ID = 0x00c5; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + uint8_t type = {}; +}; + +template<> +struct Packet_Head<0x00c6> +{ + static const uint16_t PACKET_ID = 0x00c6; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; +}; +template<> +struct Packet_Repeat<0x00c6> +{ + static const uint16_t PACKET_ID = 0x00c6; + + uint32_t base_price = {}; + uint32_t actual_price = {}; + ItemType type = {}; + ItemNameId name_id = {}; +}; + +template<> +struct Packet_Head<0x00c7> +{ + static const uint16_t PACKET_ID = 0x00c7; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; +}; +template<> +struct Packet_Repeat<0x00c7> +{ + static const uint16_t PACKET_ID = 0x00c7; + + uint16_t ioff2 = {}; + uint32_t base_price = {}; + uint32_t actual_price = {}; +}; + +template<> +struct Packet_Head<0x00c8> +{ + static const uint16_t PACKET_ID = 0x00c8; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; +}; +template<> +struct Packet_Repeat<0x00c8> +{ + static const uint16_t PACKET_ID = 0x00c8; + + uint16_t count = {}; + ItemNameId name_id = {}; +}; + +template<> +struct Packet_Head<0x00c9> +{ + static const uint16_t PACKET_ID = 0x00c9; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; +}; +template<> +struct Packet_Repeat<0x00c9> +{ + static const uint16_t PACKET_ID = 0x00c9; + + uint16_t ioff2 = {}; + uint16_t count = {}; +}; + +template<> +struct Packet_Fixed<0x00ca> +{ + static const uint16_t PACKET_ID = 0x00ca; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint8_t fail = {}; +}; + +template<> +struct Packet_Fixed<0x00cb> +{ + static const uint16_t PACKET_ID = 0x00cb; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint8_t fail = {}; +}; + +template<> +struct Packet_Fixed<0x00cd> +{ + static const uint16_t PACKET_ID = 0x00cd; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + AccountId account_id = {}; +}; + +template<> +struct Packet_Fixed<0x00e4> +{ + static const uint16_t PACKET_ID = 0x00e4; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; +}; + +template<> +struct Packet_Fixed<0x00e5> +{ + static const uint16_t PACKET_ID = 0x00e5; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + CharName char_name = {}; +}; + +template<> +struct Packet_Fixed<0x00e6> +{ + static const uint16_t PACKET_ID = 0x00e6; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint8_t type = {}; +}; + +template<> +struct Packet_Fixed<0x00e7> +{ + static const uint16_t PACKET_ID = 0x00e7; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint8_t type = {}; +}; + +template<> +struct Packet_Fixed<0x00e8> +{ + static const uint16_t PACKET_ID = 0x00e8; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t zeny_or_ioff2 = {}; + uint32_t amount = {}; +}; + +template<> +struct Packet_Fixed<0x00e9> +{ + static const uint16_t PACKET_ID = 0x00e9; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint32_t amount = {}; + ItemNameId name_id = {}; + uint8_t identify = {}; + uint8_t broken_or_attribute = {}; + uint8_t refine = {}; + uint16_t card0 = {}; + uint16_t card1 = {}; + uint16_t card2 = {}; + uint16_t card3 = {}; +}; + +template<> +struct Packet_Fixed<0x00eb> +{ + static const uint16_t PACKET_ID = 0x00eb; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; +}; + +template<> +struct Packet_Fixed<0x00ec> +{ + static const uint16_t PACKET_ID = 0x00ec; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint8_t fail = {}; +}; + +template<> +struct Packet_Fixed<0x00ed> +{ + static const uint16_t PACKET_ID = 0x00ed; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; +}; + +template<> +struct Packet_Fixed<0x00ee> +{ + static const uint16_t PACKET_ID = 0x00ee; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; +}; + +template<> +struct Packet_Fixed<0x00ef> +{ + static const uint16_t PACKET_ID = 0x00ef; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; +}; + +template<> +struct Packet_Fixed<0x00f0> +{ + static const uint16_t PACKET_ID = 0x00f0; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint8_t fail = {}; +}; + +template<> +struct Packet_Fixed<0x00f2> +{ + static const uint16_t PACKET_ID = 0x00f2; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t current_slots = {}; + uint16_t max_slots = {}; +}; + +template<> +struct Packet_Fixed<0x00f3> +{ + static const uint16_t PACKET_ID = 0x00f3; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t ioff2 = {}; + uint32_t amount = {}; +}; + +template<> +struct Packet_Fixed<0x00f4> +{ + static const uint16_t PACKET_ID = 0x00f4; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t soff1 = {}; + uint32_t amount = {}; + ItemNameId name_id = {}; + uint8_t identify = {}; + uint8_t broken_or_attribute = {}; + uint8_t refine = {}; + uint16_t card0 = {}; + uint16_t card1 = {}; + uint16_t card2 = {}; + uint16_t card3 = {}; +}; + +template<> +struct Packet_Fixed<0x00f5> +{ + static const uint16_t PACKET_ID = 0x00f5; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t soff1 = {}; + uint32_t amount = {}; +}; + +template<> +struct Packet_Fixed<0x00f6> +{ + static const uint16_t PACKET_ID = 0x00f6; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t soff1 = {}; + uint32_t amount = {}; +}; + +template<> +struct Packet_Fixed<0x00f7> +{ + static const uint16_t PACKET_ID = 0x00f7; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; +}; + +template<> +struct Packet_Fixed<0x00f8> +{ + static const uint16_t PACKET_ID = 0x00f8; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; +}; + +template<> +struct Packet_Fixed<0x00f9> +{ + static const uint16_t PACKET_ID = 0x00f9; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + PartyName party_name = {}; +}; + +template<> +struct Packet_Fixed<0x00fa> +{ + static const uint16_t PACKET_ID = 0x00fa; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint8_t flag = {}; +}; + +template<> +struct Packet_Head<0x00fb> +{ + static const uint16_t PACKET_ID = 0x00fb; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; + PartyName party_name = {}; +}; +template<> +struct Packet_Repeat<0x00fb> +{ + static const uint16_t PACKET_ID = 0x00fb; + + AccountId account_id = {}; + CharName char_name = {}; + MapName map_name = {}; + uint8_t leader = {}; + uint8_t online = {}; +}; + +template<> +struct Packet_Fixed<0x00fc> +{ + static const uint16_t PACKET_ID = 0x00fc; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + AccountId account_id = {}; +}; + +template<> +struct Packet_Fixed<0x00fd> +{ + static const uint16_t PACKET_ID = 0x00fd; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + CharName char_name = {}; + uint8_t flag = {}; +}; + +template<> +struct Packet_Fixed<0x00fe> +{ + static const uint16_t PACKET_ID = 0x00fe; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + AccountId account_id = {}; + PartyName party_name = {}; +}; + +template<> +struct Packet_Fixed<0x00ff> +{ + static const uint16_t PACKET_ID = 0x00ff; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + AccountId account_id = {}; + uint32_t flag = {}; +}; + +template<> +struct Packet_Fixed<0x0100> +{ + static const uint16_t PACKET_ID = 0x0100; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; +}; + +template<> +struct Packet_Fixed<0x0101> +{ + static const uint16_t PACKET_ID = 0x0101; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t exp = {}; + uint16_t item = {}; +}; + +template<> +struct Packet_Fixed<0x0102> +{ + static const uint16_t PACKET_ID = 0x0102; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t exp = {}; + uint16_t item = {}; +}; + +template<> +struct Packet_Fixed<0x0103> +{ + static const uint16_t PACKET_ID = 0x0103; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + AccountId account_id = {}; + CharName unused_char_name = {}; +}; + +template<> +struct Packet_Fixed<0x0105> +{ + static const uint16_t PACKET_ID = 0x0105; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + AccountId account_id = {}; + CharName char_name = {}; + uint8_t flag = {}; +}; + +template<> +struct Packet_Fixed<0x0106> +{ + static const uint16_t PACKET_ID = 0x0106; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + AccountId account_id = {}; + uint16_t hp = {}; + uint16_t max_hp = {}; +}; + +template<> +struct Packet_Fixed<0x0107> +{ + static const uint16_t PACKET_ID = 0x0107; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + AccountId account_id = {}; + uint16_t x = {}; + uint16_t y = {}; +}; + +template<> +struct Packet_Head<0x0108> +{ + static const uint16_t PACKET_ID = 0x0108; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; +}; +template<> +struct Packet_Repeat<0x0108> +{ + static const uint16_t PACKET_ID = 0x0108; + + uint8_t c = {}; +}; + +template<> +struct Packet_Head<0x0109> +{ + static const uint16_t PACKET_ID = 0x0109; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; + AccountId account_id = {}; +}; +template<> +struct Packet_Repeat<0x0109> +{ + static const uint16_t PACKET_ID = 0x0109; + + uint8_t c = {}; +}; + +template<> +struct Packet_Fixed<0x010c> +{ + static const uint16_t PACKET_ID = 0x010c; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; +}; + +template<> +struct Packet_Fixed<0x010e> +{ + static const uint16_t PACKET_ID = 0x010e; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + SkillID skill_id = {}; + uint16_t level = {}; + uint16_t sp = {}; + uint16_t range = {}; + uint8_t can_raise = {}; +}; + +template<> +struct Packet_Head<0x010f> +{ + static const uint16_t PACKET_ID = 0x010f; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; +}; +template<> +struct Packet_Repeat<0x010f> +{ + static const uint16_t PACKET_ID = 0x010f; + + SkillInfo info = {}; +}; + +template<> +struct Packet_Fixed<0x0110> +{ + static const uint16_t PACKET_ID = 0x0110; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + SkillID skill_id = {}; + uint16_t btype = {}; + uint16_t zero1 = {}; + uint8_t zero2 = {}; + uint8_t type = {}; +}; + +template<> +struct Packet_Fixed<0x0112> +{ + static const uint16_t PACKET_ID = 0x0112; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + SkillID skill_id = {}; +}; + +template<> +struct Packet_Fixed<0x0118> +{ + static const uint16_t PACKET_ID = 0x0118; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; +}; + +template<> +struct Packet_Fixed<0x0119> +{ + static const uint16_t PACKET_ID = 0x0119; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + Opt1 opt1 = {}; + Opt2 opt2 = {}; + Option option = {}; + uint8_t zero = {}; +}; + +template<> +struct Packet_Fixed<0x0139> +{ + static const uint16_t PACKET_ID = 0x0139; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + uint16_t bl_x = {}; + uint16_t bl_y = {}; + uint16_t sd_x = {}; + uint16_t sd_y = {}; + uint16_t range = {}; +}; + +template<> +struct Packet_Fixed<0x013a> +{ + static const uint16_t PACKET_ID = 0x013a; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t attack_range = {}; +}; + +template<> +struct Packet_Fixed<0x013b> +{ + static const uint16_t PACKET_ID = 0x013b; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t type = {}; +}; + +template<> +struct Packet_Fixed<0x013c> +{ + static const uint16_t PACKET_ID = 0x013c; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t ioff2 = {}; +}; + +template<> +struct Packet_Fixed<0x0141> +{ + static const uint16_t PACKET_ID = 0x0141; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + SP sp_type = {}; + uint16_t zero = {}; + uint32_t value_status = {}; + uint32_t value_b_e = {}; +}; + +template<> +struct Packet_Fixed<0x0142> +{ + static const uint16_t PACKET_ID = 0x0142; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; +}; + +template<> +struct Packet_Fixed<0x0143> +{ + static const uint16_t PACKET_ID = 0x0143; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + uint32_t input_int_value = {}; +}; + +template<> +struct Packet_Fixed<0x0146> +{ + static const uint16_t PACKET_ID = 0x0146; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; +}; + +template<> +struct Packet_Fixed<0x0147> +{ + static const uint16_t PACKET_ID = 0x0147; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + SkillInfo info = {}; +}; + +template<> +struct Packet_Fixed<0x0148> +{ + static const uint16_t PACKET_ID = 0x0148; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + uint16_t type = {}; +}; + +template<> +struct Packet_Fixed<0x014d> +{ + static const uint16_t PACKET_ID = 0x014d; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; +}; + +template<> +struct Packet_Fixed<0x018a> +{ + static const uint16_t PACKET_ID = 0x018a; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t unused = {}; +}; + +template<> +struct Packet_Fixed<0x018b> +{ + static const uint16_t PACKET_ID = 0x018b; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t okay = {}; +}; + +template<> +struct Packet_Fixed<0x0195> +{ + static const uint16_t PACKET_ID = 0x0195; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + PartyName party_name = {}; + VString<23> guild_name = {}; + VString<23> guild_pos = {}; + VString<23> guild_pos_again = {}; +}; + +template<> +struct Packet_Fixed<0x0196> +{ + static const uint16_t PACKET_ID = 0x0196; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + StatusChange sc_type = {}; + BlockId block_id = {}; + uint8_t flag = {}; +}; + +template<> +struct Packet_Fixed<0x019b> +{ + static const uint16_t PACKET_ID = 0x019b; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + uint32_t type = {}; +}; + +template<> +struct Packet_Fixed<0x01b1> +{ + static const uint16_t PACKET_ID = 0x01b1; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t ioff2 = {}; + uint16_t amount = {}; + uint8_t fail = {}; +}; + +template<> +struct Packet_Fixed<0x01c8> +{ + static const uint16_t PACKET_ID = 0x01c8; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + uint16_t ioff2 = {}; + ItemNameId name_id = {}; + BlockId block_id = {}; + uint16_t amount = {}; + uint8_t ok = {}; +}; + +template<> +struct Packet_Fixed<0x01d4> +{ + static const uint16_t PACKET_ID = 0x01d4; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; +}; + +template<> +struct Packet_Head<0x01d5> +{ + static const uint16_t PACKET_ID = 0x01d5; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; + BlockId block_id = {}; +}; +template<> +struct Packet_Repeat<0x01d5> +{ + static const uint16_t PACKET_ID = 0x01d5; + + uint8_t c = {}; +}; + +template<> +struct Packet_Fixed<0x01d7> +{ + static const uint16_t PACKET_ID = 0x01d7; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + LOOK look_type = {}; + uint16_t weapon_or_name_id_or_value = {}; + ItemNameId shield = {}; +}; + +template<> +struct Packet_Fixed<0x01d8> +{ + static const uint16_t PACKET_ID = 0x01d8; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + interval_t speed = {}; + Opt1 opt1 = {}; + Opt2 opt2 = {}; + Option option = {}; + Species species = {}; + uint16_t hair_style = {}; + ItemNameId weapon = {}; + ItemNameId shield = {}; + ItemNameId head_bottom = {}; + ItemNameId head_top = {}; + ItemNameId head_mid = {}; + uint16_t hair_color = {}; + uint16_t clothes_color = {}; + DIR head_dir = {}; + uint8_t unused2 = {}; + uint32_t guild_id = {}; + uint16_t guild_emblem_id = {}; + uint16_t manner = {}; + Opt3 opt3 = {}; + uint8_t karma = {}; + SEX sex = {}; + Position1 pos = {}; + uint16_t gm_bits = {}; + uint8_t dead_sit = {}; + uint16_t unused = {}; +}; + +template<> +struct Packet_Fixed<0x01d9> +{ + static const uint16_t PACKET_ID = 0x01d9; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + interval_t speed = {}; + Opt1 opt1 = {}; + Opt2 opt2 = {}; + Option option = {}; + Species species = {}; + uint16_t hair_style = {}; + ItemNameId weapon = {}; + ItemNameId shield = {}; + ItemNameId head_bottom = {}; + ItemNameId head_top = {}; + ItemNameId head_mid = {}; + uint16_t hair_color = {}; + uint16_t clothes_color = {}; + DIR head_dir = {}; + uint8_t unused2 = {}; + uint32_t guild_id = {}; + uint16_t guild_emblem_id = {}; + uint16_t manner = {}; + Opt3 opt3 = {}; + uint8_t karma = {}; + SEX sex = {}; + Position1 pos = {}; + uint16_t gm_bits = {}; + uint16_t unused = {}; +}; + +template<> +struct Packet_Fixed<0x01da> +{ + static const uint16_t PACKET_ID = 0x01da; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + interval_t speed = {}; + Opt1 opt1 = {}; + Opt2 opt2 = {}; + Option option = {}; + Species species = {}; + uint16_t hair_style = {}; + ItemNameId weapon = {}; + ItemNameId shield = {}; + ItemNameId head_bottom = {}; + tick_t tick = {}; + ItemNameId head_top = {}; + ItemNameId head_mid = {}; + uint16_t hair_color = {}; + uint16_t clothes_color = {}; + DIR head_dir = {}; + uint8_t unused2 = {}; + uint32_t guild_id = {}; + uint16_t guild_emblem_id = {}; + uint16_t manner = {}; + Opt3 opt3 = {}; + uint8_t karma = {}; + SEX sex = {}; + Position2 pos2 = {}; + uint16_t gm_bits = {}; + uint8_t five = {}; + uint16_t unused = {}; +}; + +template<> +struct Packet_Fixed<0x01de> +{ + static const uint16_t PACKET_ID = 0x01de; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + SkillID skill_id = {}; + BlockId src_id = {}; + BlockId dst_id = {}; + tick_t tick = {}; + interval_t sdelay = {}; + interval_t ddelay = {}; + uint32_t damage = {}; + uint16_t skill_level = {}; + uint16_t div = {}; + uint8_t type_or_hit = {}; +}; + +template<> +struct Packet_Head<0x01ee> +{ + static const uint16_t PACKET_ID = 0x01ee; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; +}; +template<> +struct Packet_Repeat<0x01ee> +{ + static const uint16_t PACKET_ID = 0x01ee; + + uint16_t ioff2 = {}; + ItemNameId name_id = {}; + ItemType item_type = {}; + uint8_t identify = {}; + uint16_t amount = {}; + EPOS epos = {}; + uint16_t card0 = {}; + uint16_t card1 = {}; + uint16_t card2 = {}; + uint16_t card3 = {}; +}; + +template<> +struct Packet_Head<0x01f0> +{ + static const uint16_t PACKET_ID = 0x01f0; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + // TODO remove this + uint16_t magic_packet_length = {}; +}; +template<> +struct Packet_Repeat<0x01f0> +{ + static const uint16_t PACKET_ID = 0x01f0; + + uint16_t soff1 = {}; + ItemNameId name_id = {}; + ItemType item_type = {}; + uint8_t identify = {}; + uint16_t amount = {}; + EPOS epos_zero = {}; + uint16_t card0 = {}; + uint16_t card1 = {}; + uint16_t card2 = {}; + uint16_t card3 = {}; +}; + +template<> +struct Packet_Fixed<0x020c> +{ + static const uint16_t PACKET_ID = 0x020c; + + // TODO remove this + uint16_t magic_packet_id = PACKET_ID; + BlockId block_id = {}; + IP4Address ip = {}; +}; template<> struct Packet_Fixed<0x0212> @@ -46,6 +1992,2470 @@ struct Packet_Fixed<0x0212> template<> +struct NetPacket_Fixed<0x0072> +{ + Little16 magic_packet_id; + Little32 account_id; + Little32 char_id; + Little32 login_id1; + Little32 client_tick; + Byte sex; +}; +static_assert(offsetof(NetPacket_Fixed<0x0072>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0072>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0072>, account_id) == 2, "offsetof(NetPacket_Fixed<0x0072>, account_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0072>, char_id) == 6, "offsetof(NetPacket_Fixed<0x0072>, char_id) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x0072>, login_id1) == 10, "offsetof(NetPacket_Fixed<0x0072>, login_id1) == 10"); +static_assert(offsetof(NetPacket_Fixed<0x0072>, client_tick) == 14, "offsetof(NetPacket_Fixed<0x0072>, client_tick) == 14"); +static_assert(offsetof(NetPacket_Fixed<0x0072>, sex) == 18, "offsetof(NetPacket_Fixed<0x0072>, sex) == 18"); +static_assert(sizeof(NetPacket_Fixed<0x0072>) == 19, "sizeof(NetPacket_Fixed<0x0072>) == 19"); +static_assert(alignof(NetPacket_Fixed<0x0072>) == 1, "alignof(NetPacket_Fixed<0x0072>) == 1"); + +template<> +struct NetPacket_Fixed<0x0073> +{ + Little16 magic_packet_id; + Little32 tick; + NetPosition1 pos; + Byte five1; + Byte five2; +}; +static_assert(offsetof(NetPacket_Fixed<0x0073>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0073>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0073>, tick) == 2, "offsetof(NetPacket_Fixed<0x0073>, tick) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0073>, pos) == 6, "offsetof(NetPacket_Fixed<0x0073>, pos) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x0073>, five1) == 9, "offsetof(NetPacket_Fixed<0x0073>, five1) == 9"); +static_assert(offsetof(NetPacket_Fixed<0x0073>, five2) == 10, "offsetof(NetPacket_Fixed<0x0073>, five2) == 10"); +static_assert(sizeof(NetPacket_Fixed<0x0073>) == 11, "sizeof(NetPacket_Fixed<0x0073>) == 11"); +static_assert(alignof(NetPacket_Fixed<0x0073>) == 1, "alignof(NetPacket_Fixed<0x0073>) == 1"); + +template<> +struct NetPacket_Fixed<0x0078> +{ + Little16 magic_packet_id; + Little32 block_id; + Little16 speed; + Little16 opt1; + Little16 opt2; + Little16 option; + Little16 species; + Little16 unused_hair_style; + Little16 unused_weapon; + Little16 unused_head_bottom_or_species_again; + Little16 unused_shield_or_part_of_guild_emblem; + Little16 unused_head_top_or_unused_part_of_guild_emblem; + Little16 unused_head_mid_or_part_of_guild_id; + Little16 unused_hair_color_or_part_of_guild_id; + Little16 unused_clothes_color; + Little16 unused_1; + Little16 unused_2; + NetPosition1 unused_pos_again; + Byte unused_4b; + Little16 unused_5; + Little16 unused_zero_1; + Byte unused_zero_2; + Byte unused_sex; + NetPosition1 pos; + Byte five1; + Byte five2; + Byte zero; + Little16 level; +}; +static_assert(offsetof(NetPacket_Fixed<0x0078>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0078>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, block_id) == 2, "offsetof(NetPacket_Fixed<0x0078>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, speed) == 6, "offsetof(NetPacket_Fixed<0x0078>, speed) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, opt1) == 8, "offsetof(NetPacket_Fixed<0x0078>, opt1) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, opt2) == 10, "offsetof(NetPacket_Fixed<0x0078>, opt2) == 10"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, option) == 12, "offsetof(NetPacket_Fixed<0x0078>, option) == 12"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, species) == 14, "offsetof(NetPacket_Fixed<0x0078>, species) == 14"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, unused_hair_style) == 16, "offsetof(NetPacket_Fixed<0x0078>, unused_hair_style) == 16"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, unused_weapon) == 18, "offsetof(NetPacket_Fixed<0x0078>, unused_weapon) == 18"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, unused_head_bottom_or_species_again) == 20, "offsetof(NetPacket_Fixed<0x0078>, unused_head_bottom_or_species_again) == 20"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, unused_shield_or_part_of_guild_emblem) == 22, "offsetof(NetPacket_Fixed<0x0078>, unused_shield_or_part_of_guild_emblem) == 22"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, unused_head_top_or_unused_part_of_guild_emblem) == 24, "offsetof(NetPacket_Fixed<0x0078>, unused_head_top_or_unused_part_of_guild_emblem) == 24"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, unused_head_mid_or_part_of_guild_id) == 26, "offsetof(NetPacket_Fixed<0x0078>, unused_head_mid_or_part_of_guild_id) == 26"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, unused_hair_color_or_part_of_guild_id) == 28, "offsetof(NetPacket_Fixed<0x0078>, unused_hair_color_or_part_of_guild_id) == 28"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, unused_clothes_color) == 30, "offsetof(NetPacket_Fixed<0x0078>, unused_clothes_color) == 30"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, unused_1) == 32, "offsetof(NetPacket_Fixed<0x0078>, unused_1) == 32"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, unused_2) == 34, "offsetof(NetPacket_Fixed<0x0078>, unused_2) == 34"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, unused_pos_again) == 36, "offsetof(NetPacket_Fixed<0x0078>, unused_pos_again) == 36"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, unused_4b) == 39, "offsetof(NetPacket_Fixed<0x0078>, unused_4b) == 39"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, unused_5) == 40, "offsetof(NetPacket_Fixed<0x0078>, unused_5) == 40"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, unused_zero_1) == 42, "offsetof(NetPacket_Fixed<0x0078>, unused_zero_1) == 42"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, unused_zero_2) == 44, "offsetof(NetPacket_Fixed<0x0078>, unused_zero_2) == 44"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, unused_sex) == 45, "offsetof(NetPacket_Fixed<0x0078>, unused_sex) == 45"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, pos) == 46, "offsetof(NetPacket_Fixed<0x0078>, pos) == 46"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, five1) == 49, "offsetof(NetPacket_Fixed<0x0078>, five1) == 49"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, five2) == 50, "offsetof(NetPacket_Fixed<0x0078>, five2) == 50"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, zero) == 51, "offsetof(NetPacket_Fixed<0x0078>, zero) == 51"); +static_assert(offsetof(NetPacket_Fixed<0x0078>, level) == 52, "offsetof(NetPacket_Fixed<0x0078>, level) == 52"); +static_assert(sizeof(NetPacket_Fixed<0x0078>) == 54, "sizeof(NetPacket_Fixed<0x0078>) == 54"); +static_assert(alignof(NetPacket_Fixed<0x0078>) == 1, "alignof(NetPacket_Fixed<0x0078>) == 1"); + +template<> +struct NetPacket_Fixed<0x007b> +{ + Little16 magic_packet_id; + Little32 block_id; + Little16 speed; + Little16 opt1; + Little16 opt2; + Little16 option; + Little16 mob_class; + Little16 unused_hair_style; + Little16 unused_weapon; + Little16 unused_head_bottom; + Little32 tick_and_maybe_part_of_guild_emblem; + Little16 unused_shield_or_maybe_part_of_guild_emblem; + Little16 unused_head_top_or_maybe_part_of_guild_id; + Little16 unused_head_mid_or_maybe_part_of_guild_id; + Little16 unused_hair_color; + Little16 unused_clothes_color; + Little16 unused_1; + Little16 unused_2; + Little16 unused_3; + Little16 unused_4; + Little16 unused_5; + Little16 unused_zero_1; + Byte unused_zero_2; + Byte unused_sex; + NetPosition2 pos2; + Byte zero; + Byte five1; + Byte five2; + Little16 level; +}; +static_assert(offsetof(NetPacket_Fixed<0x007b>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x007b>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, block_id) == 2, "offsetof(NetPacket_Fixed<0x007b>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, speed) == 6, "offsetof(NetPacket_Fixed<0x007b>, speed) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, opt1) == 8, "offsetof(NetPacket_Fixed<0x007b>, opt1) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, opt2) == 10, "offsetof(NetPacket_Fixed<0x007b>, opt2) == 10"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, option) == 12, "offsetof(NetPacket_Fixed<0x007b>, option) == 12"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, mob_class) == 14, "offsetof(NetPacket_Fixed<0x007b>, mob_class) == 14"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, unused_hair_style) == 16, "offsetof(NetPacket_Fixed<0x007b>, unused_hair_style) == 16"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, unused_weapon) == 18, "offsetof(NetPacket_Fixed<0x007b>, unused_weapon) == 18"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, unused_head_bottom) == 20, "offsetof(NetPacket_Fixed<0x007b>, unused_head_bottom) == 20"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, tick_and_maybe_part_of_guild_emblem) == 22, "offsetof(NetPacket_Fixed<0x007b>, tick_and_maybe_part_of_guild_emblem) == 22"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, unused_shield_or_maybe_part_of_guild_emblem) == 26, "offsetof(NetPacket_Fixed<0x007b>, unused_shield_or_maybe_part_of_guild_emblem) == 26"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, unused_head_top_or_maybe_part_of_guild_id) == 28, "offsetof(NetPacket_Fixed<0x007b>, unused_head_top_or_maybe_part_of_guild_id) == 28"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, unused_head_mid_or_maybe_part_of_guild_id) == 30, "offsetof(NetPacket_Fixed<0x007b>, unused_head_mid_or_maybe_part_of_guild_id) == 30"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, unused_hair_color) == 32, "offsetof(NetPacket_Fixed<0x007b>, unused_hair_color) == 32"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, unused_clothes_color) == 34, "offsetof(NetPacket_Fixed<0x007b>, unused_clothes_color) == 34"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, unused_1) == 36, "offsetof(NetPacket_Fixed<0x007b>, unused_1) == 36"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, unused_2) == 38, "offsetof(NetPacket_Fixed<0x007b>, unused_2) == 38"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, unused_3) == 40, "offsetof(NetPacket_Fixed<0x007b>, unused_3) == 40"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, unused_4) == 42, "offsetof(NetPacket_Fixed<0x007b>, unused_4) == 42"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, unused_5) == 44, "offsetof(NetPacket_Fixed<0x007b>, unused_5) == 44"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, unused_zero_1) == 46, "offsetof(NetPacket_Fixed<0x007b>, unused_zero_1) == 46"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, unused_zero_2) == 48, "offsetof(NetPacket_Fixed<0x007b>, unused_zero_2) == 48"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, unused_sex) == 49, "offsetof(NetPacket_Fixed<0x007b>, unused_sex) == 49"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, pos2) == 50, "offsetof(NetPacket_Fixed<0x007b>, pos2) == 50"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, zero) == 55, "offsetof(NetPacket_Fixed<0x007b>, zero) == 55"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, five1) == 56, "offsetof(NetPacket_Fixed<0x007b>, five1) == 56"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, five2) == 57, "offsetof(NetPacket_Fixed<0x007b>, five2) == 57"); +static_assert(offsetof(NetPacket_Fixed<0x007b>, level) == 58, "offsetof(NetPacket_Fixed<0x007b>, level) == 58"); +static_assert(sizeof(NetPacket_Fixed<0x007b>) == 60, "sizeof(NetPacket_Fixed<0x007b>) == 60"); +static_assert(alignof(NetPacket_Fixed<0x007b>) == 1, "alignof(NetPacket_Fixed<0x007b>) == 1"); + +template<> +struct NetPacket_Fixed<0x007c> +{ + Little16 magic_packet_id; + Little32 block_id; + Little16 speed; + Little16 opt1; + Little16 opt2; + Little16 option; + Little16 unknown_1; + Little16 unknown_2; + Little16 unknown_3; + Little16 species; + Little16 unknown_4; + Little16 unknown_5; + Little16 unknown_6; + Little16 unknown_7; + Little16 unknown_8; + Little16 unknown_9; + Little16 unknown_10; + NetPosition1 pos; + Little16 unknown_11; +}; +static_assert(offsetof(NetPacket_Fixed<0x007c>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x007c>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, block_id) == 2, "offsetof(NetPacket_Fixed<0x007c>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, speed) == 6, "offsetof(NetPacket_Fixed<0x007c>, speed) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, opt1) == 8, "offsetof(NetPacket_Fixed<0x007c>, opt1) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, opt2) == 10, "offsetof(NetPacket_Fixed<0x007c>, opt2) == 10"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, option) == 12, "offsetof(NetPacket_Fixed<0x007c>, option) == 12"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, unknown_1) == 14, "offsetof(NetPacket_Fixed<0x007c>, unknown_1) == 14"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, unknown_2) == 16, "offsetof(NetPacket_Fixed<0x007c>, unknown_2) == 16"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, unknown_3) == 18, "offsetof(NetPacket_Fixed<0x007c>, unknown_3) == 18"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, species) == 20, "offsetof(NetPacket_Fixed<0x007c>, species) == 20"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, unknown_4) == 22, "offsetof(NetPacket_Fixed<0x007c>, unknown_4) == 22"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, unknown_5) == 24, "offsetof(NetPacket_Fixed<0x007c>, unknown_5) == 24"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, unknown_6) == 26, "offsetof(NetPacket_Fixed<0x007c>, unknown_6) == 26"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, unknown_7) == 28, "offsetof(NetPacket_Fixed<0x007c>, unknown_7) == 28"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, unknown_8) == 30, "offsetof(NetPacket_Fixed<0x007c>, unknown_8) == 30"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, unknown_9) == 32, "offsetof(NetPacket_Fixed<0x007c>, unknown_9) == 32"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, unknown_10) == 34, "offsetof(NetPacket_Fixed<0x007c>, unknown_10) == 34"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, pos) == 36, "offsetof(NetPacket_Fixed<0x007c>, pos) == 36"); +static_assert(offsetof(NetPacket_Fixed<0x007c>, unknown_11) == 39, "offsetof(NetPacket_Fixed<0x007c>, unknown_11) == 39"); +static_assert(sizeof(NetPacket_Fixed<0x007c>) == 41, "sizeof(NetPacket_Fixed<0x007c>) == 41"); +static_assert(alignof(NetPacket_Fixed<0x007c>) == 1, "alignof(NetPacket_Fixed<0x007c>) == 1"); + +template<> +struct NetPacket_Fixed<0x007d> +{ + Little16 magic_packet_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x007d>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x007d>, magic_packet_id) == 0"); +static_assert(sizeof(NetPacket_Fixed<0x007d>) == 2, "sizeof(NetPacket_Fixed<0x007d>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x007d>) == 1, "alignof(NetPacket_Fixed<0x007d>) == 1"); + +template<> +struct NetPacket_Fixed<0x007e> +{ + Little16 magic_packet_id; + Little32 client_tick; +}; +static_assert(offsetof(NetPacket_Fixed<0x007e>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x007e>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x007e>, client_tick) == 2, "offsetof(NetPacket_Fixed<0x007e>, client_tick) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x007e>) == 6, "sizeof(NetPacket_Fixed<0x007e>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x007e>) == 1, "alignof(NetPacket_Fixed<0x007e>) == 1"); + +template<> +struct NetPacket_Fixed<0x007f> +{ + Little16 magic_packet_id; + Little32 tick; +}; +static_assert(offsetof(NetPacket_Fixed<0x007f>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x007f>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x007f>, tick) == 2, "offsetof(NetPacket_Fixed<0x007f>, tick) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x007f>) == 6, "sizeof(NetPacket_Fixed<0x007f>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x007f>) == 1, "alignof(NetPacket_Fixed<0x007f>) == 1"); + +template<> +struct NetPacket_Fixed<0x0080> +{ + Little16 magic_packet_id; + Little32 block_id; + Byte type; +}; +static_assert(offsetof(NetPacket_Fixed<0x0080>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0080>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0080>, block_id) == 2, "offsetof(NetPacket_Fixed<0x0080>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0080>, type) == 6, "offsetof(NetPacket_Fixed<0x0080>, type) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x0080>) == 7, "sizeof(NetPacket_Fixed<0x0080>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x0080>) == 1, "alignof(NetPacket_Fixed<0x0080>) == 1"); + +template<> +struct NetPacket_Fixed<0x0085> +{ + Little16 magic_packet_id; + NetPosition1 pos; +}; +static_assert(offsetof(NetPacket_Fixed<0x0085>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0085>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0085>, pos) == 2, "offsetof(NetPacket_Fixed<0x0085>, pos) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x0085>) == 5, "sizeof(NetPacket_Fixed<0x0085>) == 5"); +static_assert(alignof(NetPacket_Fixed<0x0085>) == 1, "alignof(NetPacket_Fixed<0x0085>) == 1"); + +template<> +struct NetPacket_Fixed<0x0087> +{ + Little16 magic_packet_id; + Little32 tick; + NetPosition2 pos2; + Byte zero; +}; +static_assert(offsetof(NetPacket_Fixed<0x0087>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0087>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0087>, tick) == 2, "offsetof(NetPacket_Fixed<0x0087>, tick) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0087>, pos2) == 6, "offsetof(NetPacket_Fixed<0x0087>, pos2) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x0087>, zero) == 11, "offsetof(NetPacket_Fixed<0x0087>, zero) == 11"); +static_assert(sizeof(NetPacket_Fixed<0x0087>) == 12, "sizeof(NetPacket_Fixed<0x0087>) == 12"); +static_assert(alignof(NetPacket_Fixed<0x0087>) == 1, "alignof(NetPacket_Fixed<0x0087>) == 1"); + +template<> +struct NetPacket_Fixed<0x0088> +{ + Little16 magic_packet_id; + Little32 block_id; + Little16 x; + Little16 y; +}; +static_assert(offsetof(NetPacket_Fixed<0x0088>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0088>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0088>, block_id) == 2, "offsetof(NetPacket_Fixed<0x0088>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0088>, x) == 6, "offsetof(NetPacket_Fixed<0x0088>, x) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x0088>, y) == 8, "offsetof(NetPacket_Fixed<0x0088>, y) == 8"); +static_assert(sizeof(NetPacket_Fixed<0x0088>) == 10, "sizeof(NetPacket_Fixed<0x0088>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x0088>) == 1, "alignof(NetPacket_Fixed<0x0088>) == 1"); + +template<> +struct NetPacket_Fixed<0x0089> +{ + Little16 magic_packet_id; + Little32 target_id; + Byte action; +}; +static_assert(offsetof(NetPacket_Fixed<0x0089>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0089>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0089>, target_id) == 2, "offsetof(NetPacket_Fixed<0x0089>, target_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0089>, action) == 6, "offsetof(NetPacket_Fixed<0x0089>, action) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x0089>) == 7, "sizeof(NetPacket_Fixed<0x0089>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x0089>) == 1, "alignof(NetPacket_Fixed<0x0089>) == 1"); + +template<> +struct NetPacket_Fixed<0x008a> +{ + Little16 magic_packet_id; + Little32 src_id; + Little32 dst_id; + Little32 tick; + Little32 sdelay; + Little32 ddelay; + Little16 damage; + Little16 div; + Byte damage_type; + Little16 damage2; +}; +static_assert(offsetof(NetPacket_Fixed<0x008a>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x008a>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x008a>, src_id) == 2, "offsetof(NetPacket_Fixed<0x008a>, src_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x008a>, dst_id) == 6, "offsetof(NetPacket_Fixed<0x008a>, dst_id) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x008a>, tick) == 10, "offsetof(NetPacket_Fixed<0x008a>, tick) == 10"); +static_assert(offsetof(NetPacket_Fixed<0x008a>, sdelay) == 14, "offsetof(NetPacket_Fixed<0x008a>, sdelay) == 14"); +static_assert(offsetof(NetPacket_Fixed<0x008a>, ddelay) == 18, "offsetof(NetPacket_Fixed<0x008a>, ddelay) == 18"); +static_assert(offsetof(NetPacket_Fixed<0x008a>, damage) == 22, "offsetof(NetPacket_Fixed<0x008a>, damage) == 22"); +static_assert(offsetof(NetPacket_Fixed<0x008a>, div) == 24, "offsetof(NetPacket_Fixed<0x008a>, div) == 24"); +static_assert(offsetof(NetPacket_Fixed<0x008a>, damage_type) == 26, "offsetof(NetPacket_Fixed<0x008a>, damage_type) == 26"); +static_assert(offsetof(NetPacket_Fixed<0x008a>, damage2) == 27, "offsetof(NetPacket_Fixed<0x008a>, damage2) == 27"); +static_assert(sizeof(NetPacket_Fixed<0x008a>) == 29, "sizeof(NetPacket_Fixed<0x008a>) == 29"); +static_assert(alignof(NetPacket_Fixed<0x008a>) == 1, "alignof(NetPacket_Fixed<0x008a>) == 1"); + +template<> +struct NetPacket_Head<0x008c> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; +}; +static_assert(offsetof(NetPacket_Head<0x008c>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x008c>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x008c>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x008c>, magic_packet_length) == 2"); +static_assert(sizeof(NetPacket_Head<0x008c>) == 4, "sizeof(NetPacket_Head<0x008c>) == 4"); +static_assert(alignof(NetPacket_Head<0x008c>) == 1, "alignof(NetPacket_Head<0x008c>) == 1"); +template<> +struct NetPacket_Repeat<0x008c> +{ + Byte c; +}; +static_assert(offsetof(NetPacket_Repeat<0x008c>, c) == 0, "offsetof(NetPacket_Repeat<0x008c>, c) == 0"); +static_assert(sizeof(NetPacket_Repeat<0x008c>) == 1, "sizeof(NetPacket_Repeat<0x008c>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x008c>) == 1, "alignof(NetPacket_Repeat<0x008c>) == 1"); + +template<> +struct NetPacket_Head<0x008d> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; + Little32 block_id; +}; +static_assert(offsetof(NetPacket_Head<0x008d>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x008d>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x008d>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x008d>, magic_packet_length) == 2"); +static_assert(offsetof(NetPacket_Head<0x008d>, block_id) == 4, "offsetof(NetPacket_Head<0x008d>, block_id) == 4"); +static_assert(sizeof(NetPacket_Head<0x008d>) == 8, "sizeof(NetPacket_Head<0x008d>) == 8"); +static_assert(alignof(NetPacket_Head<0x008d>) == 1, "alignof(NetPacket_Head<0x008d>) == 1"); +template<> +struct NetPacket_Repeat<0x008d> +{ + Byte c; +}; +static_assert(offsetof(NetPacket_Repeat<0x008d>, c) == 0, "offsetof(NetPacket_Repeat<0x008d>, c) == 0"); +static_assert(sizeof(NetPacket_Repeat<0x008d>) == 1, "sizeof(NetPacket_Repeat<0x008d>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x008d>) == 1, "alignof(NetPacket_Repeat<0x008d>) == 1"); + +template<> +struct NetPacket_Head<0x008e> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; +}; +static_assert(offsetof(NetPacket_Head<0x008e>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x008e>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x008e>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x008e>, magic_packet_length) == 2"); +static_assert(sizeof(NetPacket_Head<0x008e>) == 4, "sizeof(NetPacket_Head<0x008e>) == 4"); +static_assert(alignof(NetPacket_Head<0x008e>) == 1, "alignof(NetPacket_Head<0x008e>) == 1"); +template<> +struct NetPacket_Repeat<0x008e> +{ + Byte c; +}; +static_assert(offsetof(NetPacket_Repeat<0x008e>, c) == 0, "offsetof(NetPacket_Repeat<0x008e>, c) == 0"); +static_assert(sizeof(NetPacket_Repeat<0x008e>) == 1, "sizeof(NetPacket_Repeat<0x008e>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x008e>) == 1, "alignof(NetPacket_Repeat<0x008e>) == 1"); + +template<> +struct NetPacket_Fixed<0x0090> +{ + Little16 magic_packet_id; + Little32 block_id; + Byte unused; +}; +static_assert(offsetof(NetPacket_Fixed<0x0090>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0090>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0090>, block_id) == 2, "offsetof(NetPacket_Fixed<0x0090>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0090>, unused) == 6, "offsetof(NetPacket_Fixed<0x0090>, unused) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x0090>) == 7, "sizeof(NetPacket_Fixed<0x0090>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x0090>) == 1, "alignof(NetPacket_Fixed<0x0090>) == 1"); + +template<> +struct NetPacket_Fixed<0x0091> +{ + Little16 magic_packet_id; + NetString<sizeof(MapName)> map_name; + Little16 x; + Little16 y; +}; +static_assert(offsetof(NetPacket_Fixed<0x0091>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0091>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0091>, map_name) == 2, "offsetof(NetPacket_Fixed<0x0091>, map_name) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0091>, x) == 18, "offsetof(NetPacket_Fixed<0x0091>, x) == 18"); +static_assert(offsetof(NetPacket_Fixed<0x0091>, y) == 20, "offsetof(NetPacket_Fixed<0x0091>, y) == 20"); +static_assert(sizeof(NetPacket_Fixed<0x0091>) == 22, "sizeof(NetPacket_Fixed<0x0091>) == 22"); +static_assert(alignof(NetPacket_Fixed<0x0091>) == 1, "alignof(NetPacket_Fixed<0x0091>) == 1"); + +template<> +struct NetPacket_Fixed<0x0092> +{ + Little16 magic_packet_id; + NetString<sizeof(MapName)> map_name; + Little16 x; + Little16 y; + IP4Address ip; + Little16 port; +}; +static_assert(offsetof(NetPacket_Fixed<0x0092>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0092>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0092>, map_name) == 2, "offsetof(NetPacket_Fixed<0x0092>, map_name) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0092>, x) == 18, "offsetof(NetPacket_Fixed<0x0092>, x) == 18"); +static_assert(offsetof(NetPacket_Fixed<0x0092>, y) == 20, "offsetof(NetPacket_Fixed<0x0092>, y) == 20"); +static_assert(offsetof(NetPacket_Fixed<0x0092>, ip) == 22, "offsetof(NetPacket_Fixed<0x0092>, ip) == 22"); +static_assert(offsetof(NetPacket_Fixed<0x0092>, port) == 26, "offsetof(NetPacket_Fixed<0x0092>, port) == 26"); +static_assert(sizeof(NetPacket_Fixed<0x0092>) == 28, "sizeof(NetPacket_Fixed<0x0092>) == 28"); +static_assert(alignof(NetPacket_Fixed<0x0092>) == 1, "alignof(NetPacket_Fixed<0x0092>) == 1"); + +template<> +struct NetPacket_Fixed<0x0094> +{ + Little16 magic_packet_id; + Little32 block_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x0094>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0094>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0094>, block_id) == 2, "offsetof(NetPacket_Fixed<0x0094>, block_id) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x0094>) == 6, "sizeof(NetPacket_Fixed<0x0094>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x0094>) == 1, "alignof(NetPacket_Fixed<0x0094>) == 1"); + +template<> +struct NetPacket_Fixed<0x0095> +{ + Little16 magic_packet_id; + Little32 block_id; + NetString<sizeof(CharName)> char_name; +}; +static_assert(offsetof(NetPacket_Fixed<0x0095>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0095>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0095>, block_id) == 2, "offsetof(NetPacket_Fixed<0x0095>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0095>, char_name) == 6, "offsetof(NetPacket_Fixed<0x0095>, char_name) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x0095>) == 30, "sizeof(NetPacket_Fixed<0x0095>) == 30"); +static_assert(alignof(NetPacket_Fixed<0x0095>) == 1, "alignof(NetPacket_Fixed<0x0095>) == 1"); + +template<> +struct NetPacket_Head<0x0096> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; + NetString<sizeof(CharName)> target_name; +}; +static_assert(offsetof(NetPacket_Head<0x0096>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x0096>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x0096>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x0096>, magic_packet_length) == 2"); +static_assert(offsetof(NetPacket_Head<0x0096>, target_name) == 4, "offsetof(NetPacket_Head<0x0096>, target_name) == 4"); +static_assert(sizeof(NetPacket_Head<0x0096>) == 28, "sizeof(NetPacket_Head<0x0096>) == 28"); +static_assert(alignof(NetPacket_Head<0x0096>) == 1, "alignof(NetPacket_Head<0x0096>) == 1"); +template<> +struct NetPacket_Repeat<0x0096> +{ + Byte c; +}; +static_assert(offsetof(NetPacket_Repeat<0x0096>, c) == 0, "offsetof(NetPacket_Repeat<0x0096>, c) == 0"); +static_assert(sizeof(NetPacket_Repeat<0x0096>) == 1, "sizeof(NetPacket_Repeat<0x0096>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x0096>) == 1, "alignof(NetPacket_Repeat<0x0096>) == 1"); + +template<> +struct NetPacket_Head<0x0097> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; + NetString<sizeof(CharName)> char_name; +}; +static_assert(offsetof(NetPacket_Head<0x0097>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x0097>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x0097>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x0097>, magic_packet_length) == 2"); +static_assert(offsetof(NetPacket_Head<0x0097>, char_name) == 4, "offsetof(NetPacket_Head<0x0097>, char_name) == 4"); +static_assert(sizeof(NetPacket_Head<0x0097>) == 28, "sizeof(NetPacket_Head<0x0097>) == 28"); +static_assert(alignof(NetPacket_Head<0x0097>) == 1, "alignof(NetPacket_Head<0x0097>) == 1"); +template<> +struct NetPacket_Repeat<0x0097> +{ + Byte c; +}; +static_assert(offsetof(NetPacket_Repeat<0x0097>, c) == 0, "offsetof(NetPacket_Repeat<0x0097>, c) == 0"); +static_assert(sizeof(NetPacket_Repeat<0x0097>) == 1, "sizeof(NetPacket_Repeat<0x0097>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x0097>) == 1, "alignof(NetPacket_Repeat<0x0097>) == 1"); + +template<> +struct NetPacket_Fixed<0x0098> +{ + Little16 magic_packet_id; + Byte flag; +}; +static_assert(offsetof(NetPacket_Fixed<0x0098>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0098>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0098>, flag) == 2, "offsetof(NetPacket_Fixed<0x0098>, flag) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x0098>) == 3, "sizeof(NetPacket_Fixed<0x0098>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x0098>) == 1, "alignof(NetPacket_Fixed<0x0098>) == 1"); + +template<> +struct NetPacket_Head<0x009a> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; +}; +static_assert(offsetof(NetPacket_Head<0x009a>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x009a>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x009a>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x009a>, magic_packet_length) == 2"); +static_assert(sizeof(NetPacket_Head<0x009a>) == 4, "sizeof(NetPacket_Head<0x009a>) == 4"); +static_assert(alignof(NetPacket_Head<0x009a>) == 1, "alignof(NetPacket_Head<0x009a>) == 1"); +template<> +struct NetPacket_Repeat<0x009a> +{ + Byte c; +}; +static_assert(offsetof(NetPacket_Repeat<0x009a>, c) == 0, "offsetof(NetPacket_Repeat<0x009a>, c) == 0"); +static_assert(sizeof(NetPacket_Repeat<0x009a>) == 1, "sizeof(NetPacket_Repeat<0x009a>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x009a>) == 1, "alignof(NetPacket_Repeat<0x009a>) == 1"); + +template<> +struct NetPacket_Fixed<0x009b> +{ + Little16 magic_packet_id; + Little16 unused; + Byte client_dir; +}; +static_assert(offsetof(NetPacket_Fixed<0x009b>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x009b>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x009b>, unused) == 2, "offsetof(NetPacket_Fixed<0x009b>, unused) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x009b>, client_dir) == 4, "offsetof(NetPacket_Fixed<0x009b>, client_dir) == 4"); +static_assert(sizeof(NetPacket_Fixed<0x009b>) == 5, "sizeof(NetPacket_Fixed<0x009b>) == 5"); +static_assert(alignof(NetPacket_Fixed<0x009b>) == 1, "alignof(NetPacket_Fixed<0x009b>) == 1"); + +template<> +struct NetPacket_Fixed<0x009c> +{ + Little16 magic_packet_id; + Little32 block_id; + Little16 zero; + Byte client_dir; +}; +static_assert(offsetof(NetPacket_Fixed<0x009c>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x009c>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x009c>, block_id) == 2, "offsetof(NetPacket_Fixed<0x009c>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x009c>, zero) == 6, "offsetof(NetPacket_Fixed<0x009c>, zero) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x009c>, client_dir) == 8, "offsetof(NetPacket_Fixed<0x009c>, client_dir) == 8"); +static_assert(sizeof(NetPacket_Fixed<0x009c>) == 9, "sizeof(NetPacket_Fixed<0x009c>) == 9"); +static_assert(alignof(NetPacket_Fixed<0x009c>) == 1, "alignof(NetPacket_Fixed<0x009c>) == 1"); + +template<> +struct NetPacket_Fixed<0x009d> +{ + Little16 magic_packet_id; + Little32 block_id; + Little16 name_id; + Byte identify; + Little16 x; + Little16 y; + Little16 amount; + Byte subx; + Byte suby; +}; +static_assert(offsetof(NetPacket_Fixed<0x009d>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x009d>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x009d>, block_id) == 2, "offsetof(NetPacket_Fixed<0x009d>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x009d>, name_id) == 6, "offsetof(NetPacket_Fixed<0x009d>, name_id) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x009d>, identify) == 8, "offsetof(NetPacket_Fixed<0x009d>, identify) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x009d>, x) == 9, "offsetof(NetPacket_Fixed<0x009d>, x) == 9"); +static_assert(offsetof(NetPacket_Fixed<0x009d>, y) == 11, "offsetof(NetPacket_Fixed<0x009d>, y) == 11"); +static_assert(offsetof(NetPacket_Fixed<0x009d>, amount) == 13, "offsetof(NetPacket_Fixed<0x009d>, amount) == 13"); +static_assert(offsetof(NetPacket_Fixed<0x009d>, subx) == 15, "offsetof(NetPacket_Fixed<0x009d>, subx) == 15"); +static_assert(offsetof(NetPacket_Fixed<0x009d>, suby) == 16, "offsetof(NetPacket_Fixed<0x009d>, suby) == 16"); +static_assert(sizeof(NetPacket_Fixed<0x009d>) == 17, "sizeof(NetPacket_Fixed<0x009d>) == 17"); +static_assert(alignof(NetPacket_Fixed<0x009d>) == 1, "alignof(NetPacket_Fixed<0x009d>) == 1"); + +template<> +struct NetPacket_Fixed<0x009e> +{ + Little16 magic_packet_id; + Little32 block_id; + Little16 name_id; + Byte identify; + Little16 x; + Little16 y; + Byte subx; + Byte suby; + Little16 amount; +}; +static_assert(offsetof(NetPacket_Fixed<0x009e>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x009e>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x009e>, block_id) == 2, "offsetof(NetPacket_Fixed<0x009e>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x009e>, name_id) == 6, "offsetof(NetPacket_Fixed<0x009e>, name_id) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x009e>, identify) == 8, "offsetof(NetPacket_Fixed<0x009e>, identify) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x009e>, x) == 9, "offsetof(NetPacket_Fixed<0x009e>, x) == 9"); +static_assert(offsetof(NetPacket_Fixed<0x009e>, y) == 11, "offsetof(NetPacket_Fixed<0x009e>, y) == 11"); +static_assert(offsetof(NetPacket_Fixed<0x009e>, subx) == 13, "offsetof(NetPacket_Fixed<0x009e>, subx) == 13"); +static_assert(offsetof(NetPacket_Fixed<0x009e>, suby) == 14, "offsetof(NetPacket_Fixed<0x009e>, suby) == 14"); +static_assert(offsetof(NetPacket_Fixed<0x009e>, amount) == 15, "offsetof(NetPacket_Fixed<0x009e>, amount) == 15"); +static_assert(sizeof(NetPacket_Fixed<0x009e>) == 17, "sizeof(NetPacket_Fixed<0x009e>) == 17"); +static_assert(alignof(NetPacket_Fixed<0x009e>) == 1, "alignof(NetPacket_Fixed<0x009e>) == 1"); + +template<> +struct NetPacket_Fixed<0x009f> +{ + Little16 magic_packet_id; + Little32 object_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x009f>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x009f>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x009f>, object_id) == 2, "offsetof(NetPacket_Fixed<0x009f>, object_id) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x009f>) == 6, "sizeof(NetPacket_Fixed<0x009f>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x009f>) == 1, "alignof(NetPacket_Fixed<0x009f>) == 1"); + +template<> +struct NetPacket_Fixed<0x00a0> +{ + Little16 magic_packet_id; + Little16 ioff2; + Little16 amount; + Little16 name_id; + Byte identify; + Byte broken_or_attribute; + Byte refine; + Little16 card0; + Little16 card1; + Little16 card2; + Little16 card3; + Little16 epos; + Byte item_type; + Byte pickup_fail; +}; +static_assert(offsetof(NetPacket_Fixed<0x00a0>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00a0>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00a0>, ioff2) == 2, "offsetof(NetPacket_Fixed<0x00a0>, ioff2) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00a0>, amount) == 4, "offsetof(NetPacket_Fixed<0x00a0>, amount) == 4"); +static_assert(offsetof(NetPacket_Fixed<0x00a0>, name_id) == 6, "offsetof(NetPacket_Fixed<0x00a0>, name_id) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x00a0>, identify) == 8, "offsetof(NetPacket_Fixed<0x00a0>, identify) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x00a0>, broken_or_attribute) == 9, "offsetof(NetPacket_Fixed<0x00a0>, broken_or_attribute) == 9"); +static_assert(offsetof(NetPacket_Fixed<0x00a0>, refine) == 10, "offsetof(NetPacket_Fixed<0x00a0>, refine) == 10"); +static_assert(offsetof(NetPacket_Fixed<0x00a0>, card0) == 11, "offsetof(NetPacket_Fixed<0x00a0>, card0) == 11"); +static_assert(offsetof(NetPacket_Fixed<0x00a0>, card1) == 13, "offsetof(NetPacket_Fixed<0x00a0>, card1) == 13"); +static_assert(offsetof(NetPacket_Fixed<0x00a0>, card2) == 15, "offsetof(NetPacket_Fixed<0x00a0>, card2) == 15"); +static_assert(offsetof(NetPacket_Fixed<0x00a0>, card3) == 17, "offsetof(NetPacket_Fixed<0x00a0>, card3) == 17"); +static_assert(offsetof(NetPacket_Fixed<0x00a0>, epos) == 19, "offsetof(NetPacket_Fixed<0x00a0>, epos) == 19"); +static_assert(offsetof(NetPacket_Fixed<0x00a0>, item_type) == 21, "offsetof(NetPacket_Fixed<0x00a0>, item_type) == 21"); +static_assert(offsetof(NetPacket_Fixed<0x00a0>, pickup_fail) == 22, "offsetof(NetPacket_Fixed<0x00a0>, pickup_fail) == 22"); +static_assert(sizeof(NetPacket_Fixed<0x00a0>) == 23, "sizeof(NetPacket_Fixed<0x00a0>) == 23"); +static_assert(alignof(NetPacket_Fixed<0x00a0>) == 1, "alignof(NetPacket_Fixed<0x00a0>) == 1"); + +template<> +struct NetPacket_Fixed<0x00a1> +{ + Little16 magic_packet_id; + Little32 block_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x00a1>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00a1>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00a1>, block_id) == 2, "offsetof(NetPacket_Fixed<0x00a1>, block_id) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00a1>) == 6, "sizeof(NetPacket_Fixed<0x00a1>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x00a1>) == 1, "alignof(NetPacket_Fixed<0x00a1>) == 1"); + +template<> +struct NetPacket_Fixed<0x00a2> +{ + Little16 magic_packet_id; + Little16 ioff2; + Little16 amount; +}; +static_assert(offsetof(NetPacket_Fixed<0x00a2>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00a2>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00a2>, ioff2) == 2, "offsetof(NetPacket_Fixed<0x00a2>, ioff2) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00a2>, amount) == 4, "offsetof(NetPacket_Fixed<0x00a2>, amount) == 4"); +static_assert(sizeof(NetPacket_Fixed<0x00a2>) == 6, "sizeof(NetPacket_Fixed<0x00a2>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x00a2>) == 1, "alignof(NetPacket_Fixed<0x00a2>) == 1"); + +template<> +struct NetPacket_Head<0x00a4> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; +}; +static_assert(offsetof(NetPacket_Head<0x00a4>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x00a4>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x00a4>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x00a4>, magic_packet_length) == 2"); +static_assert(sizeof(NetPacket_Head<0x00a4>) == 4, "sizeof(NetPacket_Head<0x00a4>) == 4"); +static_assert(alignof(NetPacket_Head<0x00a4>) == 1, "alignof(NetPacket_Head<0x00a4>) == 1"); +template<> +struct NetPacket_Repeat<0x00a4> +{ + Little16 ioff2; + Little16 name_id; + Byte item_type; + Byte identify; + Little16 epos_pc; + Little16 epos_inv; + Byte broken_or_attribute; + Byte refine; + Little16 card0; + Little16 card1; + Little16 card2; + Little16 card3; +}; +static_assert(offsetof(NetPacket_Repeat<0x00a4>, ioff2) == 0, "offsetof(NetPacket_Repeat<0x00a4>, ioff2) == 0"); +static_assert(offsetof(NetPacket_Repeat<0x00a4>, name_id) == 2, "offsetof(NetPacket_Repeat<0x00a4>, name_id) == 2"); +static_assert(offsetof(NetPacket_Repeat<0x00a4>, item_type) == 4, "offsetof(NetPacket_Repeat<0x00a4>, item_type) == 4"); +static_assert(offsetof(NetPacket_Repeat<0x00a4>, identify) == 5, "offsetof(NetPacket_Repeat<0x00a4>, identify) == 5"); +static_assert(offsetof(NetPacket_Repeat<0x00a4>, epos_pc) == 6, "offsetof(NetPacket_Repeat<0x00a4>, epos_pc) == 6"); +static_assert(offsetof(NetPacket_Repeat<0x00a4>, epos_inv) == 8, "offsetof(NetPacket_Repeat<0x00a4>, epos_inv) == 8"); +static_assert(offsetof(NetPacket_Repeat<0x00a4>, broken_or_attribute) == 10, "offsetof(NetPacket_Repeat<0x00a4>, broken_or_attribute) == 10"); +static_assert(offsetof(NetPacket_Repeat<0x00a4>, refine) == 11, "offsetof(NetPacket_Repeat<0x00a4>, refine) == 11"); +static_assert(offsetof(NetPacket_Repeat<0x00a4>, card0) == 12, "offsetof(NetPacket_Repeat<0x00a4>, card0) == 12"); +static_assert(offsetof(NetPacket_Repeat<0x00a4>, card1) == 14, "offsetof(NetPacket_Repeat<0x00a4>, card1) == 14"); +static_assert(offsetof(NetPacket_Repeat<0x00a4>, card2) == 16, "offsetof(NetPacket_Repeat<0x00a4>, card2) == 16"); +static_assert(offsetof(NetPacket_Repeat<0x00a4>, card3) == 18, "offsetof(NetPacket_Repeat<0x00a4>, card3) == 18"); +static_assert(sizeof(NetPacket_Repeat<0x00a4>) == 20, "sizeof(NetPacket_Repeat<0x00a4>) == 20"); +static_assert(alignof(NetPacket_Repeat<0x00a4>) == 1, "alignof(NetPacket_Repeat<0x00a4>) == 1"); + +template<> +struct NetPacket_Head<0x00a6> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; +}; +static_assert(offsetof(NetPacket_Head<0x00a6>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x00a6>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x00a6>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x00a6>, magic_packet_length) == 2"); +static_assert(sizeof(NetPacket_Head<0x00a6>) == 4, "sizeof(NetPacket_Head<0x00a6>) == 4"); +static_assert(alignof(NetPacket_Head<0x00a6>) == 1, "alignof(NetPacket_Head<0x00a6>) == 1"); +template<> +struct NetPacket_Repeat<0x00a6> +{ + Little16 soff1; + Little16 name_id; + Byte item_type; + Byte identify; + Little16 epos_id; + Little16 epos_stor; + Byte broken_or_attribute; + Byte refine; + Little16 card0; + Little16 card1; + Little16 card2; + Little16 card3; +}; +static_assert(offsetof(NetPacket_Repeat<0x00a6>, soff1) == 0, "offsetof(NetPacket_Repeat<0x00a6>, soff1) == 0"); +static_assert(offsetof(NetPacket_Repeat<0x00a6>, name_id) == 2, "offsetof(NetPacket_Repeat<0x00a6>, name_id) == 2"); +static_assert(offsetof(NetPacket_Repeat<0x00a6>, item_type) == 4, "offsetof(NetPacket_Repeat<0x00a6>, item_type) == 4"); +static_assert(offsetof(NetPacket_Repeat<0x00a6>, identify) == 5, "offsetof(NetPacket_Repeat<0x00a6>, identify) == 5"); +static_assert(offsetof(NetPacket_Repeat<0x00a6>, epos_id) == 6, "offsetof(NetPacket_Repeat<0x00a6>, epos_id) == 6"); +static_assert(offsetof(NetPacket_Repeat<0x00a6>, epos_stor) == 8, "offsetof(NetPacket_Repeat<0x00a6>, epos_stor) == 8"); +static_assert(offsetof(NetPacket_Repeat<0x00a6>, broken_or_attribute) == 10, "offsetof(NetPacket_Repeat<0x00a6>, broken_or_attribute) == 10"); +static_assert(offsetof(NetPacket_Repeat<0x00a6>, refine) == 11, "offsetof(NetPacket_Repeat<0x00a6>, refine) == 11"); +static_assert(offsetof(NetPacket_Repeat<0x00a6>, card0) == 12, "offsetof(NetPacket_Repeat<0x00a6>, card0) == 12"); +static_assert(offsetof(NetPacket_Repeat<0x00a6>, card1) == 14, "offsetof(NetPacket_Repeat<0x00a6>, card1) == 14"); +static_assert(offsetof(NetPacket_Repeat<0x00a6>, card2) == 16, "offsetof(NetPacket_Repeat<0x00a6>, card2) == 16"); +static_assert(offsetof(NetPacket_Repeat<0x00a6>, card3) == 18, "offsetof(NetPacket_Repeat<0x00a6>, card3) == 18"); +static_assert(sizeof(NetPacket_Repeat<0x00a6>) == 20, "sizeof(NetPacket_Repeat<0x00a6>) == 20"); +static_assert(alignof(NetPacket_Repeat<0x00a6>) == 1, "alignof(NetPacket_Repeat<0x00a6>) == 1"); + +template<> +struct NetPacket_Fixed<0x00a7> +{ + Little16 magic_packet_id; + Little16 ioff2; + Little32 unused_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x00a7>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00a7>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00a7>, ioff2) == 2, "offsetof(NetPacket_Fixed<0x00a7>, ioff2) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00a7>, unused_id) == 4, "offsetof(NetPacket_Fixed<0x00a7>, unused_id) == 4"); +static_assert(sizeof(NetPacket_Fixed<0x00a7>) == 8, "sizeof(NetPacket_Fixed<0x00a7>) == 8"); +static_assert(alignof(NetPacket_Fixed<0x00a7>) == 1, "alignof(NetPacket_Fixed<0x00a7>) == 1"); + +template<> +struct NetPacket_Fixed<0x00a8> +{ + Little16 magic_packet_id; + Little16 ioff2; + Little16 amount; + Byte ok; +}; +static_assert(offsetof(NetPacket_Fixed<0x00a8>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00a8>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00a8>, ioff2) == 2, "offsetof(NetPacket_Fixed<0x00a8>, ioff2) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00a8>, amount) == 4, "offsetof(NetPacket_Fixed<0x00a8>, amount) == 4"); +static_assert(offsetof(NetPacket_Fixed<0x00a8>, ok) == 6, "offsetof(NetPacket_Fixed<0x00a8>, ok) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x00a8>) == 7, "sizeof(NetPacket_Fixed<0x00a8>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x00a8>) == 1, "alignof(NetPacket_Fixed<0x00a8>) == 1"); + +template<> +struct NetPacket_Fixed<0x00a9> +{ + Little16 magic_packet_id; + Little16 ioff2; + Little16 epos_ignored; +}; +static_assert(offsetof(NetPacket_Fixed<0x00a9>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00a9>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00a9>, ioff2) == 2, "offsetof(NetPacket_Fixed<0x00a9>, ioff2) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00a9>, epos_ignored) == 4, "offsetof(NetPacket_Fixed<0x00a9>, epos_ignored) == 4"); +static_assert(sizeof(NetPacket_Fixed<0x00a9>) == 6, "sizeof(NetPacket_Fixed<0x00a9>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x00a9>) == 1, "alignof(NetPacket_Fixed<0x00a9>) == 1"); + +template<> +struct NetPacket_Fixed<0x00aa> +{ + Little16 magic_packet_id; + Little16 ioff2; + Little16 epos; + Byte ok; +}; +static_assert(offsetof(NetPacket_Fixed<0x00aa>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00aa>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00aa>, ioff2) == 2, "offsetof(NetPacket_Fixed<0x00aa>, ioff2) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00aa>, epos) == 4, "offsetof(NetPacket_Fixed<0x00aa>, epos) == 4"); +static_assert(offsetof(NetPacket_Fixed<0x00aa>, ok) == 6, "offsetof(NetPacket_Fixed<0x00aa>, ok) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x00aa>) == 7, "sizeof(NetPacket_Fixed<0x00aa>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x00aa>) == 1, "alignof(NetPacket_Fixed<0x00aa>) == 1"); + +template<> +struct NetPacket_Fixed<0x00ab> +{ + Little16 magic_packet_id; + Little16 ioff2; +}; +static_assert(offsetof(NetPacket_Fixed<0x00ab>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00ab>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00ab>, ioff2) == 2, "offsetof(NetPacket_Fixed<0x00ab>, ioff2) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00ab>) == 4, "sizeof(NetPacket_Fixed<0x00ab>) == 4"); +static_assert(alignof(NetPacket_Fixed<0x00ab>) == 1, "alignof(NetPacket_Fixed<0x00ab>) == 1"); + +template<> +struct NetPacket_Fixed<0x00ac> +{ + Little16 magic_packet_id; + Little16 ioff2; + Little16 epos; + Byte ok; +}; +static_assert(offsetof(NetPacket_Fixed<0x00ac>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00ac>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00ac>, ioff2) == 2, "offsetof(NetPacket_Fixed<0x00ac>, ioff2) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00ac>, epos) == 4, "offsetof(NetPacket_Fixed<0x00ac>, epos) == 4"); +static_assert(offsetof(NetPacket_Fixed<0x00ac>, ok) == 6, "offsetof(NetPacket_Fixed<0x00ac>, ok) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x00ac>) == 7, "sizeof(NetPacket_Fixed<0x00ac>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x00ac>) == 1, "alignof(NetPacket_Fixed<0x00ac>) == 1"); + +template<> +struct NetPacket_Fixed<0x00af> +{ + Little16 magic_packet_id; + Little16 ioff2; + Little16 amount; +}; +static_assert(offsetof(NetPacket_Fixed<0x00af>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00af>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00af>, ioff2) == 2, "offsetof(NetPacket_Fixed<0x00af>, ioff2) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00af>, amount) == 4, "offsetof(NetPacket_Fixed<0x00af>, amount) == 4"); +static_assert(sizeof(NetPacket_Fixed<0x00af>) == 6, "sizeof(NetPacket_Fixed<0x00af>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x00af>) == 1, "alignof(NetPacket_Fixed<0x00af>) == 1"); + +template<> +struct NetPacket_Fixed<0x00b0> +{ + Little16 magic_packet_id; + Little16 sp_type; + Little32 value; +}; +static_assert(offsetof(NetPacket_Fixed<0x00b0>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00b0>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00b0>, sp_type) == 2, "offsetof(NetPacket_Fixed<0x00b0>, sp_type) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00b0>, value) == 4, "offsetof(NetPacket_Fixed<0x00b0>, value) == 4"); +static_assert(sizeof(NetPacket_Fixed<0x00b0>) == 8, "sizeof(NetPacket_Fixed<0x00b0>) == 8"); +static_assert(alignof(NetPacket_Fixed<0x00b0>) == 1, "alignof(NetPacket_Fixed<0x00b0>) == 1"); + +template<> +struct NetPacket_Fixed<0x00b1> +{ + Little16 magic_packet_id; + Little16 sp_type; + Little32 value; +}; +static_assert(offsetof(NetPacket_Fixed<0x00b1>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00b1>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00b1>, sp_type) == 2, "offsetof(NetPacket_Fixed<0x00b1>, sp_type) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00b1>, value) == 4, "offsetof(NetPacket_Fixed<0x00b1>, value) == 4"); +static_assert(sizeof(NetPacket_Fixed<0x00b1>) == 8, "sizeof(NetPacket_Fixed<0x00b1>) == 8"); +static_assert(alignof(NetPacket_Fixed<0x00b1>) == 1, "alignof(NetPacket_Fixed<0x00b1>) == 1"); + +template<> +struct NetPacket_Fixed<0x00b2> +{ + Little16 magic_packet_id; + Byte flag; +}; +static_assert(offsetof(NetPacket_Fixed<0x00b2>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00b2>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00b2>, flag) == 2, "offsetof(NetPacket_Fixed<0x00b2>, flag) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00b2>) == 3, "sizeof(NetPacket_Fixed<0x00b2>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x00b2>) == 1, "alignof(NetPacket_Fixed<0x00b2>) == 1"); + +template<> +struct NetPacket_Fixed<0x00b3> +{ + Little16 magic_packet_id; + Byte one; +}; +static_assert(offsetof(NetPacket_Fixed<0x00b3>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00b3>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00b3>, one) == 2, "offsetof(NetPacket_Fixed<0x00b3>, one) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00b3>) == 3, "sizeof(NetPacket_Fixed<0x00b3>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x00b3>) == 1, "alignof(NetPacket_Fixed<0x00b3>) == 1"); + +template<> +struct NetPacket_Head<0x00b4> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; + Little32 block_id; +}; +static_assert(offsetof(NetPacket_Head<0x00b4>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x00b4>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x00b4>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x00b4>, magic_packet_length) == 2"); +static_assert(offsetof(NetPacket_Head<0x00b4>, block_id) == 4, "offsetof(NetPacket_Head<0x00b4>, block_id) == 4"); +static_assert(sizeof(NetPacket_Head<0x00b4>) == 8, "sizeof(NetPacket_Head<0x00b4>) == 8"); +static_assert(alignof(NetPacket_Head<0x00b4>) == 1, "alignof(NetPacket_Head<0x00b4>) == 1"); +template<> +struct NetPacket_Repeat<0x00b4> +{ + Byte c; +}; +static_assert(offsetof(NetPacket_Repeat<0x00b4>, c) == 0, "offsetof(NetPacket_Repeat<0x00b4>, c) == 0"); +static_assert(sizeof(NetPacket_Repeat<0x00b4>) == 1, "sizeof(NetPacket_Repeat<0x00b4>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x00b4>) == 1, "alignof(NetPacket_Repeat<0x00b4>) == 1"); + +template<> +struct NetPacket_Fixed<0x00b5> +{ + Little16 magic_packet_id; + Little32 block_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x00b5>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00b5>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00b5>, block_id) == 2, "offsetof(NetPacket_Fixed<0x00b5>, block_id) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00b5>) == 6, "sizeof(NetPacket_Fixed<0x00b5>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x00b5>) == 1, "alignof(NetPacket_Fixed<0x00b5>) == 1"); + +template<> +struct NetPacket_Fixed<0x00b6> +{ + Little16 magic_packet_id; + Little32 block_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x00b6>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00b6>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00b6>, block_id) == 2, "offsetof(NetPacket_Fixed<0x00b6>, block_id) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00b6>) == 6, "sizeof(NetPacket_Fixed<0x00b6>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x00b6>) == 1, "alignof(NetPacket_Fixed<0x00b6>) == 1"); + +template<> +struct NetPacket_Head<0x00b7> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; + Little32 block_id; +}; +static_assert(offsetof(NetPacket_Head<0x00b7>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x00b7>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x00b7>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x00b7>, magic_packet_length) == 2"); +static_assert(offsetof(NetPacket_Head<0x00b7>, block_id) == 4, "offsetof(NetPacket_Head<0x00b7>, block_id) == 4"); +static_assert(sizeof(NetPacket_Head<0x00b7>) == 8, "sizeof(NetPacket_Head<0x00b7>) == 8"); +static_assert(alignof(NetPacket_Head<0x00b7>) == 1, "alignof(NetPacket_Head<0x00b7>) == 1"); +template<> +struct NetPacket_Repeat<0x00b7> +{ + Byte c; +}; +static_assert(offsetof(NetPacket_Repeat<0x00b7>, c) == 0, "offsetof(NetPacket_Repeat<0x00b7>, c) == 0"); +static_assert(sizeof(NetPacket_Repeat<0x00b7>) == 1, "sizeof(NetPacket_Repeat<0x00b7>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x00b7>) == 1, "alignof(NetPacket_Repeat<0x00b7>) == 1"); + +template<> +struct NetPacket_Fixed<0x00b8> +{ + Little16 magic_packet_id; + Little32 npc_id; + Byte menu_entry; +}; +static_assert(offsetof(NetPacket_Fixed<0x00b8>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00b8>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00b8>, npc_id) == 2, "offsetof(NetPacket_Fixed<0x00b8>, npc_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00b8>, menu_entry) == 6, "offsetof(NetPacket_Fixed<0x00b8>, menu_entry) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x00b8>) == 7, "sizeof(NetPacket_Fixed<0x00b8>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x00b8>) == 1, "alignof(NetPacket_Fixed<0x00b8>) == 1"); + +template<> +struct NetPacket_Fixed<0x00b9> +{ + Little16 magic_packet_id; + Little32 npc_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x00b9>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00b9>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00b9>, npc_id) == 2, "offsetof(NetPacket_Fixed<0x00b9>, npc_id) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00b9>) == 6, "sizeof(NetPacket_Fixed<0x00b9>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x00b9>) == 1, "alignof(NetPacket_Fixed<0x00b9>) == 1"); + +template<> +struct NetPacket_Fixed<0x00bb> +{ + Little16 magic_packet_id; + Little16 asp; + Byte unused; +}; +static_assert(offsetof(NetPacket_Fixed<0x00bb>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00bb>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00bb>, asp) == 2, "offsetof(NetPacket_Fixed<0x00bb>, asp) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00bb>, unused) == 4, "offsetof(NetPacket_Fixed<0x00bb>, unused) == 4"); +static_assert(sizeof(NetPacket_Fixed<0x00bb>) == 5, "sizeof(NetPacket_Fixed<0x00bb>) == 5"); +static_assert(alignof(NetPacket_Fixed<0x00bb>) == 1, "alignof(NetPacket_Fixed<0x00bb>) == 1"); + +template<> +struct NetPacket_Fixed<0x00bc> +{ + Little16 magic_packet_id; + Little16 sp_type; + Byte ok; + Byte val; +}; +static_assert(offsetof(NetPacket_Fixed<0x00bc>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00bc>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00bc>, sp_type) == 2, "offsetof(NetPacket_Fixed<0x00bc>, sp_type) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00bc>, ok) == 4, "offsetof(NetPacket_Fixed<0x00bc>, ok) == 4"); +static_assert(offsetof(NetPacket_Fixed<0x00bc>, val) == 5, "offsetof(NetPacket_Fixed<0x00bc>, val) == 5"); +static_assert(sizeof(NetPacket_Fixed<0x00bc>) == 6, "sizeof(NetPacket_Fixed<0x00bc>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x00bc>) == 1, "alignof(NetPacket_Fixed<0x00bc>) == 1"); + +template<> +struct NetPacket_Fixed<0x00bd> +{ + Little16 magic_packet_id; + Little16 status_point; + Byte str_attr; + Byte str_upd; + Byte agi_attr; + Byte agi_upd; + Byte vit_attr; + Byte vit_upd; + Byte int_attr; + Byte int_upd; + Byte dex_attr; + Byte dex_upd; + Byte luk_attr; + Byte luk_upd; + Little16 atk_sum; + Little16 watk2; + Little16 matk1; + Little16 matk2; + Little16 def; + Little16 def2; + Little16 mdef; + Little16 mdef2; + Little16 hit; + Little16 flee; + Little16 flee2; + Little16 critical; + Little16 karma; + Little16 manner; +}; +static_assert(offsetof(NetPacket_Fixed<0x00bd>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00bd>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, status_point) == 2, "offsetof(NetPacket_Fixed<0x00bd>, status_point) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, str_attr) == 4, "offsetof(NetPacket_Fixed<0x00bd>, str_attr) == 4"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, str_upd) == 5, "offsetof(NetPacket_Fixed<0x00bd>, str_upd) == 5"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, agi_attr) == 6, "offsetof(NetPacket_Fixed<0x00bd>, agi_attr) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, agi_upd) == 7, "offsetof(NetPacket_Fixed<0x00bd>, agi_upd) == 7"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, vit_attr) == 8, "offsetof(NetPacket_Fixed<0x00bd>, vit_attr) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, vit_upd) == 9, "offsetof(NetPacket_Fixed<0x00bd>, vit_upd) == 9"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, int_attr) == 10, "offsetof(NetPacket_Fixed<0x00bd>, int_attr) == 10"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, int_upd) == 11, "offsetof(NetPacket_Fixed<0x00bd>, int_upd) == 11"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, dex_attr) == 12, "offsetof(NetPacket_Fixed<0x00bd>, dex_attr) == 12"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, dex_upd) == 13, "offsetof(NetPacket_Fixed<0x00bd>, dex_upd) == 13"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, luk_attr) == 14, "offsetof(NetPacket_Fixed<0x00bd>, luk_attr) == 14"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, luk_upd) == 15, "offsetof(NetPacket_Fixed<0x00bd>, luk_upd) == 15"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, atk_sum) == 16, "offsetof(NetPacket_Fixed<0x00bd>, atk_sum) == 16"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, watk2) == 18, "offsetof(NetPacket_Fixed<0x00bd>, watk2) == 18"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, matk1) == 20, "offsetof(NetPacket_Fixed<0x00bd>, matk1) == 20"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, matk2) == 22, "offsetof(NetPacket_Fixed<0x00bd>, matk2) == 22"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, def) == 24, "offsetof(NetPacket_Fixed<0x00bd>, def) == 24"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, def2) == 26, "offsetof(NetPacket_Fixed<0x00bd>, def2) == 26"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, mdef) == 28, "offsetof(NetPacket_Fixed<0x00bd>, mdef) == 28"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, mdef2) == 30, "offsetof(NetPacket_Fixed<0x00bd>, mdef2) == 30"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, hit) == 32, "offsetof(NetPacket_Fixed<0x00bd>, hit) == 32"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, flee) == 34, "offsetof(NetPacket_Fixed<0x00bd>, flee) == 34"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, flee2) == 36, "offsetof(NetPacket_Fixed<0x00bd>, flee2) == 36"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, critical) == 38, "offsetof(NetPacket_Fixed<0x00bd>, critical) == 38"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, karma) == 40, "offsetof(NetPacket_Fixed<0x00bd>, karma) == 40"); +static_assert(offsetof(NetPacket_Fixed<0x00bd>, manner) == 42, "offsetof(NetPacket_Fixed<0x00bd>, manner) == 42"); +static_assert(sizeof(NetPacket_Fixed<0x00bd>) == 44, "sizeof(NetPacket_Fixed<0x00bd>) == 44"); +static_assert(alignof(NetPacket_Fixed<0x00bd>) == 1, "alignof(NetPacket_Fixed<0x00bd>) == 1"); + +template<> +struct NetPacket_Fixed<0x00be> +{ + Little16 magic_packet_id; + Little16 sp_type; + Byte value; +}; +static_assert(offsetof(NetPacket_Fixed<0x00be>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00be>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00be>, sp_type) == 2, "offsetof(NetPacket_Fixed<0x00be>, sp_type) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00be>, value) == 4, "offsetof(NetPacket_Fixed<0x00be>, value) == 4"); +static_assert(sizeof(NetPacket_Fixed<0x00be>) == 5, "sizeof(NetPacket_Fixed<0x00be>) == 5"); +static_assert(alignof(NetPacket_Fixed<0x00be>) == 1, "alignof(NetPacket_Fixed<0x00be>) == 1"); + +template<> +struct NetPacket_Fixed<0x00bf> +{ + Little16 magic_packet_id; + Byte emote; +}; +static_assert(offsetof(NetPacket_Fixed<0x00bf>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00bf>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00bf>, emote) == 2, "offsetof(NetPacket_Fixed<0x00bf>, emote) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00bf>) == 3, "sizeof(NetPacket_Fixed<0x00bf>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x00bf>) == 1, "alignof(NetPacket_Fixed<0x00bf>) == 1"); + +template<> +struct NetPacket_Fixed<0x00c0> +{ + Little16 magic_packet_id; + Little32 block_id; + Byte type; +}; +static_assert(offsetof(NetPacket_Fixed<0x00c0>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00c0>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00c0>, block_id) == 2, "offsetof(NetPacket_Fixed<0x00c0>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00c0>, type) == 6, "offsetof(NetPacket_Fixed<0x00c0>, type) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x00c0>) == 7, "sizeof(NetPacket_Fixed<0x00c0>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x00c0>) == 1, "alignof(NetPacket_Fixed<0x00c0>) == 1"); + +template<> +struct NetPacket_Fixed<0x00c1> +{ + Little16 magic_packet_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x00c1>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00c1>, magic_packet_id) == 0"); +static_assert(sizeof(NetPacket_Fixed<0x00c1>) == 2, "sizeof(NetPacket_Fixed<0x00c1>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x00c1>) == 1, "alignof(NetPacket_Fixed<0x00c1>) == 1"); + +template<> +struct NetPacket_Fixed<0x00c2> +{ + Little16 magic_packet_id; + Little32 users; +}; +static_assert(offsetof(NetPacket_Fixed<0x00c2>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00c2>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00c2>, users) == 2, "offsetof(NetPacket_Fixed<0x00c2>, users) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00c2>) == 6, "sizeof(NetPacket_Fixed<0x00c2>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x00c2>) == 1, "alignof(NetPacket_Fixed<0x00c2>) == 1"); + +template<> +struct NetPacket_Fixed<0x00c4> +{ + Little16 magic_packet_id; + Little32 block_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x00c4>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00c4>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00c4>, block_id) == 2, "offsetof(NetPacket_Fixed<0x00c4>, block_id) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00c4>) == 6, "sizeof(NetPacket_Fixed<0x00c4>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x00c4>) == 1, "alignof(NetPacket_Fixed<0x00c4>) == 1"); + +template<> +struct NetPacket_Fixed<0x00c5> +{ + Little16 magic_packet_id; + Little32 block_id; + Byte type; +}; +static_assert(offsetof(NetPacket_Fixed<0x00c5>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00c5>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00c5>, block_id) == 2, "offsetof(NetPacket_Fixed<0x00c5>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00c5>, type) == 6, "offsetof(NetPacket_Fixed<0x00c5>, type) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x00c5>) == 7, "sizeof(NetPacket_Fixed<0x00c5>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x00c5>) == 1, "alignof(NetPacket_Fixed<0x00c5>) == 1"); + +template<> +struct NetPacket_Head<0x00c6> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; +}; +static_assert(offsetof(NetPacket_Head<0x00c6>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x00c6>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x00c6>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x00c6>, magic_packet_length) == 2"); +static_assert(sizeof(NetPacket_Head<0x00c6>) == 4, "sizeof(NetPacket_Head<0x00c6>) == 4"); +static_assert(alignof(NetPacket_Head<0x00c6>) == 1, "alignof(NetPacket_Head<0x00c6>) == 1"); +template<> +struct NetPacket_Repeat<0x00c6> +{ + Little32 base_price; + Little32 actual_price; + Byte type; + Little16 name_id; +}; +static_assert(offsetof(NetPacket_Repeat<0x00c6>, base_price) == 0, "offsetof(NetPacket_Repeat<0x00c6>, base_price) == 0"); +static_assert(offsetof(NetPacket_Repeat<0x00c6>, actual_price) == 4, "offsetof(NetPacket_Repeat<0x00c6>, actual_price) == 4"); +static_assert(offsetof(NetPacket_Repeat<0x00c6>, type) == 8, "offsetof(NetPacket_Repeat<0x00c6>, type) == 8"); +static_assert(offsetof(NetPacket_Repeat<0x00c6>, name_id) == 9, "offsetof(NetPacket_Repeat<0x00c6>, name_id) == 9"); +static_assert(sizeof(NetPacket_Repeat<0x00c6>) == 11, "sizeof(NetPacket_Repeat<0x00c6>) == 11"); +static_assert(alignof(NetPacket_Repeat<0x00c6>) == 1, "alignof(NetPacket_Repeat<0x00c6>) == 1"); + +template<> +struct NetPacket_Head<0x00c7> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; +}; +static_assert(offsetof(NetPacket_Head<0x00c7>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x00c7>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x00c7>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x00c7>, magic_packet_length) == 2"); +static_assert(sizeof(NetPacket_Head<0x00c7>) == 4, "sizeof(NetPacket_Head<0x00c7>) == 4"); +static_assert(alignof(NetPacket_Head<0x00c7>) == 1, "alignof(NetPacket_Head<0x00c7>) == 1"); +template<> +struct NetPacket_Repeat<0x00c7> +{ + Little16 ioff2; + Little32 base_price; + Little32 actual_price; +}; +static_assert(offsetof(NetPacket_Repeat<0x00c7>, ioff2) == 0, "offsetof(NetPacket_Repeat<0x00c7>, ioff2) == 0"); +static_assert(offsetof(NetPacket_Repeat<0x00c7>, base_price) == 2, "offsetof(NetPacket_Repeat<0x00c7>, base_price) == 2"); +static_assert(offsetof(NetPacket_Repeat<0x00c7>, actual_price) == 6, "offsetof(NetPacket_Repeat<0x00c7>, actual_price) == 6"); +static_assert(sizeof(NetPacket_Repeat<0x00c7>) == 10, "sizeof(NetPacket_Repeat<0x00c7>) == 10"); +static_assert(alignof(NetPacket_Repeat<0x00c7>) == 1, "alignof(NetPacket_Repeat<0x00c7>) == 1"); + +template<> +struct NetPacket_Head<0x00c8> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; +}; +static_assert(offsetof(NetPacket_Head<0x00c8>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x00c8>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x00c8>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x00c8>, magic_packet_length) == 2"); +static_assert(sizeof(NetPacket_Head<0x00c8>) == 4, "sizeof(NetPacket_Head<0x00c8>) == 4"); +static_assert(alignof(NetPacket_Head<0x00c8>) == 1, "alignof(NetPacket_Head<0x00c8>) == 1"); +template<> +struct NetPacket_Repeat<0x00c8> +{ + Little16 count; + Little16 name_id; +}; +static_assert(offsetof(NetPacket_Repeat<0x00c8>, count) == 0, "offsetof(NetPacket_Repeat<0x00c8>, count) == 0"); +static_assert(offsetof(NetPacket_Repeat<0x00c8>, name_id) == 2, "offsetof(NetPacket_Repeat<0x00c8>, name_id) == 2"); +static_assert(sizeof(NetPacket_Repeat<0x00c8>) == 4, "sizeof(NetPacket_Repeat<0x00c8>) == 4"); +static_assert(alignof(NetPacket_Repeat<0x00c8>) == 1, "alignof(NetPacket_Repeat<0x00c8>) == 1"); + +template<> +struct NetPacket_Head<0x00c9> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; +}; +static_assert(offsetof(NetPacket_Head<0x00c9>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x00c9>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x00c9>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x00c9>, magic_packet_length) == 2"); +static_assert(sizeof(NetPacket_Head<0x00c9>) == 4, "sizeof(NetPacket_Head<0x00c9>) == 4"); +static_assert(alignof(NetPacket_Head<0x00c9>) == 1, "alignof(NetPacket_Head<0x00c9>) == 1"); +template<> +struct NetPacket_Repeat<0x00c9> +{ + Little16 ioff2; + Little16 count; +}; +static_assert(offsetof(NetPacket_Repeat<0x00c9>, ioff2) == 0, "offsetof(NetPacket_Repeat<0x00c9>, ioff2) == 0"); +static_assert(offsetof(NetPacket_Repeat<0x00c9>, count) == 2, "offsetof(NetPacket_Repeat<0x00c9>, count) == 2"); +static_assert(sizeof(NetPacket_Repeat<0x00c9>) == 4, "sizeof(NetPacket_Repeat<0x00c9>) == 4"); +static_assert(alignof(NetPacket_Repeat<0x00c9>) == 1, "alignof(NetPacket_Repeat<0x00c9>) == 1"); + +template<> +struct NetPacket_Fixed<0x00ca> +{ + Little16 magic_packet_id; + Byte fail; +}; +static_assert(offsetof(NetPacket_Fixed<0x00ca>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00ca>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00ca>, fail) == 2, "offsetof(NetPacket_Fixed<0x00ca>, fail) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00ca>) == 3, "sizeof(NetPacket_Fixed<0x00ca>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x00ca>) == 1, "alignof(NetPacket_Fixed<0x00ca>) == 1"); + +template<> +struct NetPacket_Fixed<0x00cb> +{ + Little16 magic_packet_id; + Byte fail; +}; +static_assert(offsetof(NetPacket_Fixed<0x00cb>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00cb>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00cb>, fail) == 2, "offsetof(NetPacket_Fixed<0x00cb>, fail) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00cb>) == 3, "sizeof(NetPacket_Fixed<0x00cb>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x00cb>) == 1, "alignof(NetPacket_Fixed<0x00cb>) == 1"); + +template<> +struct NetPacket_Fixed<0x00cd> +{ + Little16 magic_packet_id; + Little32 account_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x00cd>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00cd>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00cd>, account_id) == 2, "offsetof(NetPacket_Fixed<0x00cd>, account_id) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00cd>) == 6, "sizeof(NetPacket_Fixed<0x00cd>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x00cd>) == 1, "alignof(NetPacket_Fixed<0x00cd>) == 1"); + +template<> +struct NetPacket_Fixed<0x00e4> +{ + Little16 magic_packet_id; + Little32 block_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x00e4>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00e4>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00e4>, block_id) == 2, "offsetof(NetPacket_Fixed<0x00e4>, block_id) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00e4>) == 6, "sizeof(NetPacket_Fixed<0x00e4>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x00e4>) == 1, "alignof(NetPacket_Fixed<0x00e4>) == 1"); + +template<> +struct NetPacket_Fixed<0x00e5> +{ + Little16 magic_packet_id; + NetString<sizeof(CharName)> char_name; +}; +static_assert(offsetof(NetPacket_Fixed<0x00e5>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00e5>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00e5>, char_name) == 2, "offsetof(NetPacket_Fixed<0x00e5>, char_name) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00e5>) == 26, "sizeof(NetPacket_Fixed<0x00e5>) == 26"); +static_assert(alignof(NetPacket_Fixed<0x00e5>) == 1, "alignof(NetPacket_Fixed<0x00e5>) == 1"); + +template<> +struct NetPacket_Fixed<0x00e6> +{ + Little16 magic_packet_id; + Byte type; +}; +static_assert(offsetof(NetPacket_Fixed<0x00e6>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00e6>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00e6>, type) == 2, "offsetof(NetPacket_Fixed<0x00e6>, type) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00e6>) == 3, "sizeof(NetPacket_Fixed<0x00e6>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x00e6>) == 1, "alignof(NetPacket_Fixed<0x00e6>) == 1"); + +template<> +struct NetPacket_Fixed<0x00e7> +{ + Little16 magic_packet_id; + Byte type; +}; +static_assert(offsetof(NetPacket_Fixed<0x00e7>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00e7>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00e7>, type) == 2, "offsetof(NetPacket_Fixed<0x00e7>, type) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00e7>) == 3, "sizeof(NetPacket_Fixed<0x00e7>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x00e7>) == 1, "alignof(NetPacket_Fixed<0x00e7>) == 1"); + +template<> +struct NetPacket_Fixed<0x00e8> +{ + Little16 magic_packet_id; + Little16 zeny_or_ioff2; + Little32 amount; +}; +static_assert(offsetof(NetPacket_Fixed<0x00e8>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00e8>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00e8>, zeny_or_ioff2) == 2, "offsetof(NetPacket_Fixed<0x00e8>, zeny_or_ioff2) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00e8>, amount) == 4, "offsetof(NetPacket_Fixed<0x00e8>, amount) == 4"); +static_assert(sizeof(NetPacket_Fixed<0x00e8>) == 8, "sizeof(NetPacket_Fixed<0x00e8>) == 8"); +static_assert(alignof(NetPacket_Fixed<0x00e8>) == 1, "alignof(NetPacket_Fixed<0x00e8>) == 1"); + +template<> +struct NetPacket_Fixed<0x00e9> +{ + Little16 magic_packet_id; + Little32 amount; + Little16 name_id; + Byte identify; + Byte broken_or_attribute; + Byte refine; + Little16 card0; + Little16 card1; + Little16 card2; + Little16 card3; +}; +static_assert(offsetof(NetPacket_Fixed<0x00e9>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00e9>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00e9>, amount) == 2, "offsetof(NetPacket_Fixed<0x00e9>, amount) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00e9>, name_id) == 6, "offsetof(NetPacket_Fixed<0x00e9>, name_id) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x00e9>, identify) == 8, "offsetof(NetPacket_Fixed<0x00e9>, identify) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x00e9>, broken_or_attribute) == 9, "offsetof(NetPacket_Fixed<0x00e9>, broken_or_attribute) == 9"); +static_assert(offsetof(NetPacket_Fixed<0x00e9>, refine) == 10, "offsetof(NetPacket_Fixed<0x00e9>, refine) == 10"); +static_assert(offsetof(NetPacket_Fixed<0x00e9>, card0) == 11, "offsetof(NetPacket_Fixed<0x00e9>, card0) == 11"); +static_assert(offsetof(NetPacket_Fixed<0x00e9>, card1) == 13, "offsetof(NetPacket_Fixed<0x00e9>, card1) == 13"); +static_assert(offsetof(NetPacket_Fixed<0x00e9>, card2) == 15, "offsetof(NetPacket_Fixed<0x00e9>, card2) == 15"); +static_assert(offsetof(NetPacket_Fixed<0x00e9>, card3) == 17, "offsetof(NetPacket_Fixed<0x00e9>, card3) == 17"); +static_assert(sizeof(NetPacket_Fixed<0x00e9>) == 19, "sizeof(NetPacket_Fixed<0x00e9>) == 19"); +static_assert(alignof(NetPacket_Fixed<0x00e9>) == 1, "alignof(NetPacket_Fixed<0x00e9>) == 1"); + +template<> +struct NetPacket_Fixed<0x00eb> +{ + Little16 magic_packet_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x00eb>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00eb>, magic_packet_id) == 0"); +static_assert(sizeof(NetPacket_Fixed<0x00eb>) == 2, "sizeof(NetPacket_Fixed<0x00eb>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x00eb>) == 1, "alignof(NetPacket_Fixed<0x00eb>) == 1"); + +template<> +struct NetPacket_Fixed<0x00ec> +{ + Little16 magic_packet_id; + Byte fail; +}; +static_assert(offsetof(NetPacket_Fixed<0x00ec>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00ec>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00ec>, fail) == 2, "offsetof(NetPacket_Fixed<0x00ec>, fail) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00ec>) == 3, "sizeof(NetPacket_Fixed<0x00ec>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x00ec>) == 1, "alignof(NetPacket_Fixed<0x00ec>) == 1"); + +template<> +struct NetPacket_Fixed<0x00ed> +{ + Little16 magic_packet_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x00ed>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00ed>, magic_packet_id) == 0"); +static_assert(sizeof(NetPacket_Fixed<0x00ed>) == 2, "sizeof(NetPacket_Fixed<0x00ed>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x00ed>) == 1, "alignof(NetPacket_Fixed<0x00ed>) == 1"); + +template<> +struct NetPacket_Fixed<0x00ee> +{ + Little16 magic_packet_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x00ee>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00ee>, magic_packet_id) == 0"); +static_assert(sizeof(NetPacket_Fixed<0x00ee>) == 2, "sizeof(NetPacket_Fixed<0x00ee>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x00ee>) == 1, "alignof(NetPacket_Fixed<0x00ee>) == 1"); + +template<> +struct NetPacket_Fixed<0x00ef> +{ + Little16 magic_packet_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x00ef>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00ef>, magic_packet_id) == 0"); +static_assert(sizeof(NetPacket_Fixed<0x00ef>) == 2, "sizeof(NetPacket_Fixed<0x00ef>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x00ef>) == 1, "alignof(NetPacket_Fixed<0x00ef>) == 1"); + +template<> +struct NetPacket_Fixed<0x00f0> +{ + Little16 magic_packet_id; + Byte fail; +}; +static_assert(offsetof(NetPacket_Fixed<0x00f0>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00f0>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00f0>, fail) == 2, "offsetof(NetPacket_Fixed<0x00f0>, fail) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00f0>) == 3, "sizeof(NetPacket_Fixed<0x00f0>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x00f0>) == 1, "alignof(NetPacket_Fixed<0x00f0>) == 1"); + +template<> +struct NetPacket_Fixed<0x00f2> +{ + Little16 magic_packet_id; + Little16 current_slots; + Little16 max_slots; +}; +static_assert(offsetof(NetPacket_Fixed<0x00f2>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00f2>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00f2>, current_slots) == 2, "offsetof(NetPacket_Fixed<0x00f2>, current_slots) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00f2>, max_slots) == 4, "offsetof(NetPacket_Fixed<0x00f2>, max_slots) == 4"); +static_assert(sizeof(NetPacket_Fixed<0x00f2>) == 6, "sizeof(NetPacket_Fixed<0x00f2>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x00f2>) == 1, "alignof(NetPacket_Fixed<0x00f2>) == 1"); + +template<> +struct NetPacket_Fixed<0x00f3> +{ + Little16 magic_packet_id; + Little16 ioff2; + Little32 amount; +}; +static_assert(offsetof(NetPacket_Fixed<0x00f3>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00f3>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00f3>, ioff2) == 2, "offsetof(NetPacket_Fixed<0x00f3>, ioff2) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00f3>, amount) == 4, "offsetof(NetPacket_Fixed<0x00f3>, amount) == 4"); +static_assert(sizeof(NetPacket_Fixed<0x00f3>) == 8, "sizeof(NetPacket_Fixed<0x00f3>) == 8"); +static_assert(alignof(NetPacket_Fixed<0x00f3>) == 1, "alignof(NetPacket_Fixed<0x00f3>) == 1"); + +template<> +struct NetPacket_Fixed<0x00f4> +{ + Little16 magic_packet_id; + Little16 soff1; + Little32 amount; + Little16 name_id; + Byte identify; + Byte broken_or_attribute; + Byte refine; + Little16 card0; + Little16 card1; + Little16 card2; + Little16 card3; +}; +static_assert(offsetof(NetPacket_Fixed<0x00f4>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00f4>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00f4>, soff1) == 2, "offsetof(NetPacket_Fixed<0x00f4>, soff1) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00f4>, amount) == 4, "offsetof(NetPacket_Fixed<0x00f4>, amount) == 4"); +static_assert(offsetof(NetPacket_Fixed<0x00f4>, name_id) == 8, "offsetof(NetPacket_Fixed<0x00f4>, name_id) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x00f4>, identify) == 10, "offsetof(NetPacket_Fixed<0x00f4>, identify) == 10"); +static_assert(offsetof(NetPacket_Fixed<0x00f4>, broken_or_attribute) == 11, "offsetof(NetPacket_Fixed<0x00f4>, broken_or_attribute) == 11"); +static_assert(offsetof(NetPacket_Fixed<0x00f4>, refine) == 12, "offsetof(NetPacket_Fixed<0x00f4>, refine) == 12"); +static_assert(offsetof(NetPacket_Fixed<0x00f4>, card0) == 13, "offsetof(NetPacket_Fixed<0x00f4>, card0) == 13"); +static_assert(offsetof(NetPacket_Fixed<0x00f4>, card1) == 15, "offsetof(NetPacket_Fixed<0x00f4>, card1) == 15"); +static_assert(offsetof(NetPacket_Fixed<0x00f4>, card2) == 17, "offsetof(NetPacket_Fixed<0x00f4>, card2) == 17"); +static_assert(offsetof(NetPacket_Fixed<0x00f4>, card3) == 19, "offsetof(NetPacket_Fixed<0x00f4>, card3) == 19"); +static_assert(sizeof(NetPacket_Fixed<0x00f4>) == 21, "sizeof(NetPacket_Fixed<0x00f4>) == 21"); +static_assert(alignof(NetPacket_Fixed<0x00f4>) == 1, "alignof(NetPacket_Fixed<0x00f4>) == 1"); + +template<> +struct NetPacket_Fixed<0x00f5> +{ + Little16 magic_packet_id; + Little16 soff1; + Little32 amount; +}; +static_assert(offsetof(NetPacket_Fixed<0x00f5>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00f5>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00f5>, soff1) == 2, "offsetof(NetPacket_Fixed<0x00f5>, soff1) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00f5>, amount) == 4, "offsetof(NetPacket_Fixed<0x00f5>, amount) == 4"); +static_assert(sizeof(NetPacket_Fixed<0x00f5>) == 8, "sizeof(NetPacket_Fixed<0x00f5>) == 8"); +static_assert(alignof(NetPacket_Fixed<0x00f5>) == 1, "alignof(NetPacket_Fixed<0x00f5>) == 1"); + +template<> +struct NetPacket_Fixed<0x00f6> +{ + Little16 magic_packet_id; + Little16 soff1; + Little32 amount; +}; +static_assert(offsetof(NetPacket_Fixed<0x00f6>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00f6>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00f6>, soff1) == 2, "offsetof(NetPacket_Fixed<0x00f6>, soff1) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00f6>, amount) == 4, "offsetof(NetPacket_Fixed<0x00f6>, amount) == 4"); +static_assert(sizeof(NetPacket_Fixed<0x00f6>) == 8, "sizeof(NetPacket_Fixed<0x00f6>) == 8"); +static_assert(alignof(NetPacket_Fixed<0x00f6>) == 1, "alignof(NetPacket_Fixed<0x00f6>) == 1"); + +template<> +struct NetPacket_Fixed<0x00f7> +{ + Little16 magic_packet_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x00f7>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00f7>, magic_packet_id) == 0"); +static_assert(sizeof(NetPacket_Fixed<0x00f7>) == 2, "sizeof(NetPacket_Fixed<0x00f7>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x00f7>) == 1, "alignof(NetPacket_Fixed<0x00f7>) == 1"); + +template<> +struct NetPacket_Fixed<0x00f8> +{ + Little16 magic_packet_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x00f8>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00f8>, magic_packet_id) == 0"); +static_assert(sizeof(NetPacket_Fixed<0x00f8>) == 2, "sizeof(NetPacket_Fixed<0x00f8>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x00f8>) == 1, "alignof(NetPacket_Fixed<0x00f8>) == 1"); + +template<> +struct NetPacket_Fixed<0x00f9> +{ + Little16 magic_packet_id; + NetString<sizeof(PartyName)> party_name; +}; +static_assert(offsetof(NetPacket_Fixed<0x00f9>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00f9>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00f9>, party_name) == 2, "offsetof(NetPacket_Fixed<0x00f9>, party_name) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00f9>) == 26, "sizeof(NetPacket_Fixed<0x00f9>) == 26"); +static_assert(alignof(NetPacket_Fixed<0x00f9>) == 1, "alignof(NetPacket_Fixed<0x00f9>) == 1"); + +template<> +struct NetPacket_Fixed<0x00fa> +{ + Little16 magic_packet_id; + Byte flag; +}; +static_assert(offsetof(NetPacket_Fixed<0x00fa>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00fa>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00fa>, flag) == 2, "offsetof(NetPacket_Fixed<0x00fa>, flag) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00fa>) == 3, "sizeof(NetPacket_Fixed<0x00fa>) == 3"); +static_assert(alignof(NetPacket_Fixed<0x00fa>) == 1, "alignof(NetPacket_Fixed<0x00fa>) == 1"); + +template<> +struct NetPacket_Head<0x00fb> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; + NetString<sizeof(PartyName)> party_name; +}; +static_assert(offsetof(NetPacket_Head<0x00fb>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x00fb>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x00fb>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x00fb>, magic_packet_length) == 2"); +static_assert(offsetof(NetPacket_Head<0x00fb>, party_name) == 4, "offsetof(NetPacket_Head<0x00fb>, party_name) == 4"); +static_assert(sizeof(NetPacket_Head<0x00fb>) == 28, "sizeof(NetPacket_Head<0x00fb>) == 28"); +static_assert(alignof(NetPacket_Head<0x00fb>) == 1, "alignof(NetPacket_Head<0x00fb>) == 1"); +template<> +struct NetPacket_Repeat<0x00fb> +{ + Little32 account_id; + NetString<sizeof(CharName)> char_name; + NetString<sizeof(MapName)> map_name; + Byte leader; + Byte online; +}; +static_assert(offsetof(NetPacket_Repeat<0x00fb>, account_id) == 0, "offsetof(NetPacket_Repeat<0x00fb>, account_id) == 0"); +static_assert(offsetof(NetPacket_Repeat<0x00fb>, char_name) == 4, "offsetof(NetPacket_Repeat<0x00fb>, char_name) == 4"); +static_assert(offsetof(NetPacket_Repeat<0x00fb>, map_name) == 28, "offsetof(NetPacket_Repeat<0x00fb>, map_name) == 28"); +static_assert(offsetof(NetPacket_Repeat<0x00fb>, leader) == 44, "offsetof(NetPacket_Repeat<0x00fb>, leader) == 44"); +static_assert(offsetof(NetPacket_Repeat<0x00fb>, online) == 45, "offsetof(NetPacket_Repeat<0x00fb>, online) == 45"); +static_assert(sizeof(NetPacket_Repeat<0x00fb>) == 46, "sizeof(NetPacket_Repeat<0x00fb>) == 46"); +static_assert(alignof(NetPacket_Repeat<0x00fb>) == 1, "alignof(NetPacket_Repeat<0x00fb>) == 1"); + +template<> +struct NetPacket_Fixed<0x00fc> +{ + Little16 magic_packet_id; + Little32 account_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x00fc>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00fc>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00fc>, account_id) == 2, "offsetof(NetPacket_Fixed<0x00fc>, account_id) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x00fc>) == 6, "sizeof(NetPacket_Fixed<0x00fc>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x00fc>) == 1, "alignof(NetPacket_Fixed<0x00fc>) == 1"); + +template<> +struct NetPacket_Fixed<0x00fd> +{ + Little16 magic_packet_id; + NetString<sizeof(CharName)> char_name; + Byte flag; +}; +static_assert(offsetof(NetPacket_Fixed<0x00fd>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00fd>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00fd>, char_name) == 2, "offsetof(NetPacket_Fixed<0x00fd>, char_name) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00fd>, flag) == 26, "offsetof(NetPacket_Fixed<0x00fd>, flag) == 26"); +static_assert(sizeof(NetPacket_Fixed<0x00fd>) == 27, "sizeof(NetPacket_Fixed<0x00fd>) == 27"); +static_assert(alignof(NetPacket_Fixed<0x00fd>) == 1, "alignof(NetPacket_Fixed<0x00fd>) == 1"); + +template<> +struct NetPacket_Fixed<0x00fe> +{ + Little16 magic_packet_id; + Little32 account_id; + NetString<sizeof(PartyName)> party_name; +}; +static_assert(offsetof(NetPacket_Fixed<0x00fe>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00fe>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00fe>, account_id) == 2, "offsetof(NetPacket_Fixed<0x00fe>, account_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00fe>, party_name) == 6, "offsetof(NetPacket_Fixed<0x00fe>, party_name) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x00fe>) == 30, "sizeof(NetPacket_Fixed<0x00fe>) == 30"); +static_assert(alignof(NetPacket_Fixed<0x00fe>) == 1, "alignof(NetPacket_Fixed<0x00fe>) == 1"); + +template<> +struct NetPacket_Fixed<0x00ff> +{ + Little16 magic_packet_id; + Little32 account_id; + Little32 flag; +}; +static_assert(offsetof(NetPacket_Fixed<0x00ff>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x00ff>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x00ff>, account_id) == 2, "offsetof(NetPacket_Fixed<0x00ff>, account_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x00ff>, flag) == 6, "offsetof(NetPacket_Fixed<0x00ff>, flag) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x00ff>) == 10, "sizeof(NetPacket_Fixed<0x00ff>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x00ff>) == 1, "alignof(NetPacket_Fixed<0x00ff>) == 1"); + +template<> +struct NetPacket_Fixed<0x0100> +{ + Little16 magic_packet_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x0100>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0100>, magic_packet_id) == 0"); +static_assert(sizeof(NetPacket_Fixed<0x0100>) == 2, "sizeof(NetPacket_Fixed<0x0100>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x0100>) == 1, "alignof(NetPacket_Fixed<0x0100>) == 1"); + +template<> +struct NetPacket_Fixed<0x0101> +{ + Little16 magic_packet_id; + Little16 exp; + Little16 item; +}; +static_assert(offsetof(NetPacket_Fixed<0x0101>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0101>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0101>, exp) == 2, "offsetof(NetPacket_Fixed<0x0101>, exp) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0101>, item) == 4, "offsetof(NetPacket_Fixed<0x0101>, item) == 4"); +static_assert(sizeof(NetPacket_Fixed<0x0101>) == 6, "sizeof(NetPacket_Fixed<0x0101>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x0101>) == 1, "alignof(NetPacket_Fixed<0x0101>) == 1"); + +template<> +struct NetPacket_Fixed<0x0102> +{ + Little16 magic_packet_id; + Little16 exp; + Little16 item; +}; +static_assert(offsetof(NetPacket_Fixed<0x0102>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0102>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0102>, exp) == 2, "offsetof(NetPacket_Fixed<0x0102>, exp) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0102>, item) == 4, "offsetof(NetPacket_Fixed<0x0102>, item) == 4"); +static_assert(sizeof(NetPacket_Fixed<0x0102>) == 6, "sizeof(NetPacket_Fixed<0x0102>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x0102>) == 1, "alignof(NetPacket_Fixed<0x0102>) == 1"); + +template<> +struct NetPacket_Fixed<0x0103> +{ + Little16 magic_packet_id; + Little32 account_id; + NetString<sizeof(CharName)> unused_char_name; +}; +static_assert(offsetof(NetPacket_Fixed<0x0103>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0103>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0103>, account_id) == 2, "offsetof(NetPacket_Fixed<0x0103>, account_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0103>, unused_char_name) == 6, "offsetof(NetPacket_Fixed<0x0103>, unused_char_name) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x0103>) == 30, "sizeof(NetPacket_Fixed<0x0103>) == 30"); +static_assert(alignof(NetPacket_Fixed<0x0103>) == 1, "alignof(NetPacket_Fixed<0x0103>) == 1"); + +template<> +struct NetPacket_Fixed<0x0105> +{ + Little16 magic_packet_id; + Little32 account_id; + NetString<sizeof(CharName)> char_name; + Byte flag; +}; +static_assert(offsetof(NetPacket_Fixed<0x0105>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0105>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0105>, account_id) == 2, "offsetof(NetPacket_Fixed<0x0105>, account_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0105>, char_name) == 6, "offsetof(NetPacket_Fixed<0x0105>, char_name) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x0105>, flag) == 30, "offsetof(NetPacket_Fixed<0x0105>, flag) == 30"); +static_assert(sizeof(NetPacket_Fixed<0x0105>) == 31, "sizeof(NetPacket_Fixed<0x0105>) == 31"); +static_assert(alignof(NetPacket_Fixed<0x0105>) == 1, "alignof(NetPacket_Fixed<0x0105>) == 1"); + +template<> +struct NetPacket_Fixed<0x0106> +{ + Little16 magic_packet_id; + Little32 account_id; + Little16 hp; + Little16 max_hp; +}; +static_assert(offsetof(NetPacket_Fixed<0x0106>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0106>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0106>, account_id) == 2, "offsetof(NetPacket_Fixed<0x0106>, account_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0106>, hp) == 6, "offsetof(NetPacket_Fixed<0x0106>, hp) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x0106>, max_hp) == 8, "offsetof(NetPacket_Fixed<0x0106>, max_hp) == 8"); +static_assert(sizeof(NetPacket_Fixed<0x0106>) == 10, "sizeof(NetPacket_Fixed<0x0106>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x0106>) == 1, "alignof(NetPacket_Fixed<0x0106>) == 1"); + +template<> +struct NetPacket_Fixed<0x0107> +{ + Little16 magic_packet_id; + Little32 account_id; + Little16 x; + Little16 y; +}; +static_assert(offsetof(NetPacket_Fixed<0x0107>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0107>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0107>, account_id) == 2, "offsetof(NetPacket_Fixed<0x0107>, account_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0107>, x) == 6, "offsetof(NetPacket_Fixed<0x0107>, x) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x0107>, y) == 8, "offsetof(NetPacket_Fixed<0x0107>, y) == 8"); +static_assert(sizeof(NetPacket_Fixed<0x0107>) == 10, "sizeof(NetPacket_Fixed<0x0107>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x0107>) == 1, "alignof(NetPacket_Fixed<0x0107>) == 1"); + +template<> +struct NetPacket_Head<0x0108> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; +}; +static_assert(offsetof(NetPacket_Head<0x0108>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x0108>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x0108>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x0108>, magic_packet_length) == 2"); +static_assert(sizeof(NetPacket_Head<0x0108>) == 4, "sizeof(NetPacket_Head<0x0108>) == 4"); +static_assert(alignof(NetPacket_Head<0x0108>) == 1, "alignof(NetPacket_Head<0x0108>) == 1"); +template<> +struct NetPacket_Repeat<0x0108> +{ + Byte c; +}; +static_assert(offsetof(NetPacket_Repeat<0x0108>, c) == 0, "offsetof(NetPacket_Repeat<0x0108>, c) == 0"); +static_assert(sizeof(NetPacket_Repeat<0x0108>) == 1, "sizeof(NetPacket_Repeat<0x0108>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x0108>) == 1, "alignof(NetPacket_Repeat<0x0108>) == 1"); + +template<> +struct NetPacket_Head<0x0109> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; + Little32 account_id; +}; +static_assert(offsetof(NetPacket_Head<0x0109>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x0109>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x0109>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x0109>, magic_packet_length) == 2"); +static_assert(offsetof(NetPacket_Head<0x0109>, account_id) == 4, "offsetof(NetPacket_Head<0x0109>, account_id) == 4"); +static_assert(sizeof(NetPacket_Head<0x0109>) == 8, "sizeof(NetPacket_Head<0x0109>) == 8"); +static_assert(alignof(NetPacket_Head<0x0109>) == 1, "alignof(NetPacket_Head<0x0109>) == 1"); +template<> +struct NetPacket_Repeat<0x0109> +{ + Byte c; +}; +static_assert(offsetof(NetPacket_Repeat<0x0109>, c) == 0, "offsetof(NetPacket_Repeat<0x0109>, c) == 0"); +static_assert(sizeof(NetPacket_Repeat<0x0109>) == 1, "sizeof(NetPacket_Repeat<0x0109>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x0109>) == 1, "alignof(NetPacket_Repeat<0x0109>) == 1"); + +template<> +struct NetPacket_Fixed<0x010c> +{ + Little16 magic_packet_id; + Little32 block_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x010c>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x010c>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x010c>, block_id) == 2, "offsetof(NetPacket_Fixed<0x010c>, block_id) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x010c>) == 6, "sizeof(NetPacket_Fixed<0x010c>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x010c>) == 1, "alignof(NetPacket_Fixed<0x010c>) == 1"); + +template<> +struct NetPacket_Fixed<0x010e> +{ + Little16 magic_packet_id; + Little16 skill_id; + Little16 level; + Little16 sp; + Little16 range; + Byte can_raise; +}; +static_assert(offsetof(NetPacket_Fixed<0x010e>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x010e>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x010e>, skill_id) == 2, "offsetof(NetPacket_Fixed<0x010e>, skill_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x010e>, level) == 4, "offsetof(NetPacket_Fixed<0x010e>, level) == 4"); +static_assert(offsetof(NetPacket_Fixed<0x010e>, sp) == 6, "offsetof(NetPacket_Fixed<0x010e>, sp) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x010e>, range) == 8, "offsetof(NetPacket_Fixed<0x010e>, range) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x010e>, can_raise) == 10, "offsetof(NetPacket_Fixed<0x010e>, can_raise) == 10"); +static_assert(sizeof(NetPacket_Fixed<0x010e>) == 11, "sizeof(NetPacket_Fixed<0x010e>) == 11"); +static_assert(alignof(NetPacket_Fixed<0x010e>) == 1, "alignof(NetPacket_Fixed<0x010e>) == 1"); + +template<> +struct NetPacket_Head<0x010f> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; +}; +static_assert(offsetof(NetPacket_Head<0x010f>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x010f>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x010f>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x010f>, magic_packet_length) == 2"); +static_assert(sizeof(NetPacket_Head<0x010f>) == 4, "sizeof(NetPacket_Head<0x010f>) == 4"); +static_assert(alignof(NetPacket_Head<0x010f>) == 1, "alignof(NetPacket_Head<0x010f>) == 1"); +template<> +struct NetPacket_Repeat<0x010f> +{ + NetSkillInfo info; +}; +static_assert(offsetof(NetPacket_Repeat<0x010f>, info) == 0, "offsetof(NetPacket_Repeat<0x010f>, info) == 0"); +static_assert(sizeof(NetPacket_Repeat<0x010f>) == 37, "sizeof(NetPacket_Repeat<0x010f>) == 37"); +static_assert(alignof(NetPacket_Repeat<0x010f>) == 1, "alignof(NetPacket_Repeat<0x010f>) == 1"); + +template<> +struct NetPacket_Fixed<0x0110> +{ + Little16 magic_packet_id; + Little16 skill_id; + Little16 btype; + Little16 zero1; + Byte zero2; + Byte type; +}; +static_assert(offsetof(NetPacket_Fixed<0x0110>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0110>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0110>, skill_id) == 2, "offsetof(NetPacket_Fixed<0x0110>, skill_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0110>, btype) == 4, "offsetof(NetPacket_Fixed<0x0110>, btype) == 4"); +static_assert(offsetof(NetPacket_Fixed<0x0110>, zero1) == 6, "offsetof(NetPacket_Fixed<0x0110>, zero1) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x0110>, zero2) == 8, "offsetof(NetPacket_Fixed<0x0110>, zero2) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x0110>, type) == 9, "offsetof(NetPacket_Fixed<0x0110>, type) == 9"); +static_assert(sizeof(NetPacket_Fixed<0x0110>) == 10, "sizeof(NetPacket_Fixed<0x0110>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x0110>) == 1, "alignof(NetPacket_Fixed<0x0110>) == 1"); + +template<> +struct NetPacket_Fixed<0x0112> +{ + Little16 magic_packet_id; + Little16 skill_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x0112>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0112>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0112>, skill_id) == 2, "offsetof(NetPacket_Fixed<0x0112>, skill_id) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x0112>) == 4, "sizeof(NetPacket_Fixed<0x0112>) == 4"); +static_assert(alignof(NetPacket_Fixed<0x0112>) == 1, "alignof(NetPacket_Fixed<0x0112>) == 1"); + +template<> +struct NetPacket_Fixed<0x0118> +{ + Little16 magic_packet_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x0118>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0118>, magic_packet_id) == 0"); +static_assert(sizeof(NetPacket_Fixed<0x0118>) == 2, "sizeof(NetPacket_Fixed<0x0118>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x0118>) == 1, "alignof(NetPacket_Fixed<0x0118>) == 1"); + +template<> +struct NetPacket_Fixed<0x0119> +{ + Little16 magic_packet_id; + Little32 block_id; + Little16 opt1; + Little16 opt2; + Little16 option; + Byte zero; +}; +static_assert(offsetof(NetPacket_Fixed<0x0119>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0119>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0119>, block_id) == 2, "offsetof(NetPacket_Fixed<0x0119>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0119>, opt1) == 6, "offsetof(NetPacket_Fixed<0x0119>, opt1) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x0119>, opt2) == 8, "offsetof(NetPacket_Fixed<0x0119>, opt2) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x0119>, option) == 10, "offsetof(NetPacket_Fixed<0x0119>, option) == 10"); +static_assert(offsetof(NetPacket_Fixed<0x0119>, zero) == 12, "offsetof(NetPacket_Fixed<0x0119>, zero) == 12"); +static_assert(sizeof(NetPacket_Fixed<0x0119>) == 13, "sizeof(NetPacket_Fixed<0x0119>) == 13"); +static_assert(alignof(NetPacket_Fixed<0x0119>) == 1, "alignof(NetPacket_Fixed<0x0119>) == 1"); + +template<> +struct NetPacket_Fixed<0x0139> +{ + Little16 magic_packet_id; + Little32 block_id; + Little16 bl_x; + Little16 bl_y; + Little16 sd_x; + Little16 sd_y; + Little16 range; +}; +static_assert(offsetof(NetPacket_Fixed<0x0139>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0139>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0139>, block_id) == 2, "offsetof(NetPacket_Fixed<0x0139>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0139>, bl_x) == 6, "offsetof(NetPacket_Fixed<0x0139>, bl_x) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x0139>, bl_y) == 8, "offsetof(NetPacket_Fixed<0x0139>, bl_y) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x0139>, sd_x) == 10, "offsetof(NetPacket_Fixed<0x0139>, sd_x) == 10"); +static_assert(offsetof(NetPacket_Fixed<0x0139>, sd_y) == 12, "offsetof(NetPacket_Fixed<0x0139>, sd_y) == 12"); +static_assert(offsetof(NetPacket_Fixed<0x0139>, range) == 14, "offsetof(NetPacket_Fixed<0x0139>, range) == 14"); +static_assert(sizeof(NetPacket_Fixed<0x0139>) == 16, "sizeof(NetPacket_Fixed<0x0139>) == 16"); +static_assert(alignof(NetPacket_Fixed<0x0139>) == 1, "alignof(NetPacket_Fixed<0x0139>) == 1"); + +template<> +struct NetPacket_Fixed<0x013a> +{ + Little16 magic_packet_id; + Little16 attack_range; +}; +static_assert(offsetof(NetPacket_Fixed<0x013a>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x013a>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x013a>, attack_range) == 2, "offsetof(NetPacket_Fixed<0x013a>, attack_range) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x013a>) == 4, "sizeof(NetPacket_Fixed<0x013a>) == 4"); +static_assert(alignof(NetPacket_Fixed<0x013a>) == 1, "alignof(NetPacket_Fixed<0x013a>) == 1"); + +template<> +struct NetPacket_Fixed<0x013b> +{ + Little16 magic_packet_id; + Little16 type; +}; +static_assert(offsetof(NetPacket_Fixed<0x013b>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x013b>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x013b>, type) == 2, "offsetof(NetPacket_Fixed<0x013b>, type) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x013b>) == 4, "sizeof(NetPacket_Fixed<0x013b>) == 4"); +static_assert(alignof(NetPacket_Fixed<0x013b>) == 1, "alignof(NetPacket_Fixed<0x013b>) == 1"); + +template<> +struct NetPacket_Fixed<0x013c> +{ + Little16 magic_packet_id; + Little16 ioff2; +}; +static_assert(offsetof(NetPacket_Fixed<0x013c>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x013c>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x013c>, ioff2) == 2, "offsetof(NetPacket_Fixed<0x013c>, ioff2) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x013c>) == 4, "sizeof(NetPacket_Fixed<0x013c>) == 4"); +static_assert(alignof(NetPacket_Fixed<0x013c>) == 1, "alignof(NetPacket_Fixed<0x013c>) == 1"); + +template<> +struct NetPacket_Fixed<0x0141> +{ + Little16 magic_packet_id; + Little16 sp_type; + Little16 zero; + Little32 value_status; + Little32 value_b_e; +}; +static_assert(offsetof(NetPacket_Fixed<0x0141>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0141>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0141>, sp_type) == 2, "offsetof(NetPacket_Fixed<0x0141>, sp_type) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0141>, zero) == 4, "offsetof(NetPacket_Fixed<0x0141>, zero) == 4"); +static_assert(offsetof(NetPacket_Fixed<0x0141>, value_status) == 6, "offsetof(NetPacket_Fixed<0x0141>, value_status) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x0141>, value_b_e) == 10, "offsetof(NetPacket_Fixed<0x0141>, value_b_e) == 10"); +static_assert(sizeof(NetPacket_Fixed<0x0141>) == 14, "sizeof(NetPacket_Fixed<0x0141>) == 14"); +static_assert(alignof(NetPacket_Fixed<0x0141>) == 1, "alignof(NetPacket_Fixed<0x0141>) == 1"); + +template<> +struct NetPacket_Fixed<0x0142> +{ + Little16 magic_packet_id; + Little32 block_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x0142>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0142>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0142>, block_id) == 2, "offsetof(NetPacket_Fixed<0x0142>, block_id) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x0142>) == 6, "sizeof(NetPacket_Fixed<0x0142>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x0142>) == 1, "alignof(NetPacket_Fixed<0x0142>) == 1"); + +template<> +struct NetPacket_Fixed<0x0143> +{ + Little16 magic_packet_id; + Little32 block_id; + Little32 input_int_value; +}; +static_assert(offsetof(NetPacket_Fixed<0x0143>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0143>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0143>, block_id) == 2, "offsetof(NetPacket_Fixed<0x0143>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0143>, input_int_value) == 6, "offsetof(NetPacket_Fixed<0x0143>, input_int_value) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x0143>) == 10, "sizeof(NetPacket_Fixed<0x0143>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x0143>) == 1, "alignof(NetPacket_Fixed<0x0143>) == 1"); + +template<> +struct NetPacket_Fixed<0x0146> +{ + Little16 magic_packet_id; + Little32 block_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x0146>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0146>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0146>, block_id) == 2, "offsetof(NetPacket_Fixed<0x0146>, block_id) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x0146>) == 6, "sizeof(NetPacket_Fixed<0x0146>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x0146>) == 1, "alignof(NetPacket_Fixed<0x0146>) == 1"); + +template<> +struct NetPacket_Fixed<0x0147> +{ + Little16 magic_packet_id; + NetSkillInfo info; +}; +static_assert(offsetof(NetPacket_Fixed<0x0147>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0147>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0147>, info) == 2, "offsetof(NetPacket_Fixed<0x0147>, info) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x0147>) == 39, "sizeof(NetPacket_Fixed<0x0147>) == 39"); +static_assert(alignof(NetPacket_Fixed<0x0147>) == 1, "alignof(NetPacket_Fixed<0x0147>) == 1"); + +template<> +struct NetPacket_Fixed<0x0148> +{ + Little16 magic_packet_id; + Little32 block_id; + Little16 type; +}; +static_assert(offsetof(NetPacket_Fixed<0x0148>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0148>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0148>, block_id) == 2, "offsetof(NetPacket_Fixed<0x0148>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0148>, type) == 6, "offsetof(NetPacket_Fixed<0x0148>, type) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x0148>) == 8, "sizeof(NetPacket_Fixed<0x0148>) == 8"); +static_assert(alignof(NetPacket_Fixed<0x0148>) == 1, "alignof(NetPacket_Fixed<0x0148>) == 1"); + +template<> +struct NetPacket_Fixed<0x014d> +{ + Little16 magic_packet_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x014d>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x014d>, magic_packet_id) == 0"); +static_assert(sizeof(NetPacket_Fixed<0x014d>) == 2, "sizeof(NetPacket_Fixed<0x014d>) == 2"); +static_assert(alignof(NetPacket_Fixed<0x014d>) == 1, "alignof(NetPacket_Fixed<0x014d>) == 1"); + +template<> +struct NetPacket_Fixed<0x018a> +{ + Little16 magic_packet_id; + Little16 unused; +}; +static_assert(offsetof(NetPacket_Fixed<0x018a>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x018a>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x018a>, unused) == 2, "offsetof(NetPacket_Fixed<0x018a>, unused) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x018a>) == 4, "sizeof(NetPacket_Fixed<0x018a>) == 4"); +static_assert(alignof(NetPacket_Fixed<0x018a>) == 1, "alignof(NetPacket_Fixed<0x018a>) == 1"); + +template<> +struct NetPacket_Fixed<0x018b> +{ + Little16 magic_packet_id; + Little16 okay; +}; +static_assert(offsetof(NetPacket_Fixed<0x018b>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x018b>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x018b>, okay) == 2, "offsetof(NetPacket_Fixed<0x018b>, okay) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x018b>) == 4, "sizeof(NetPacket_Fixed<0x018b>) == 4"); +static_assert(alignof(NetPacket_Fixed<0x018b>) == 1, "alignof(NetPacket_Fixed<0x018b>) == 1"); + +template<> +struct NetPacket_Fixed<0x0195> +{ + Little16 magic_packet_id; + Little32 block_id; + NetString<sizeof(PartyName)> party_name; + NetString<sizeof(VString<23>)> guild_name; + NetString<sizeof(VString<23>)> guild_pos; + NetString<sizeof(VString<23>)> guild_pos_again; +}; +static_assert(offsetof(NetPacket_Fixed<0x0195>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0195>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0195>, block_id) == 2, "offsetof(NetPacket_Fixed<0x0195>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0195>, party_name) == 6, "offsetof(NetPacket_Fixed<0x0195>, party_name) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x0195>, guild_name) == 30, "offsetof(NetPacket_Fixed<0x0195>, guild_name) == 30"); +static_assert(offsetof(NetPacket_Fixed<0x0195>, guild_pos) == 54, "offsetof(NetPacket_Fixed<0x0195>, guild_pos) == 54"); +static_assert(offsetof(NetPacket_Fixed<0x0195>, guild_pos_again) == 78, "offsetof(NetPacket_Fixed<0x0195>, guild_pos_again) == 78"); +static_assert(sizeof(NetPacket_Fixed<0x0195>) == 102, "sizeof(NetPacket_Fixed<0x0195>) == 102"); +static_assert(alignof(NetPacket_Fixed<0x0195>) == 1, "alignof(NetPacket_Fixed<0x0195>) == 1"); + +template<> +struct NetPacket_Fixed<0x0196> +{ + Little16 magic_packet_id; + Little16 sc_type; + Little32 block_id; + Byte flag; +}; +static_assert(offsetof(NetPacket_Fixed<0x0196>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0196>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x0196>, sc_type) == 2, "offsetof(NetPacket_Fixed<0x0196>, sc_type) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x0196>, block_id) == 4, "offsetof(NetPacket_Fixed<0x0196>, block_id) == 4"); +static_assert(offsetof(NetPacket_Fixed<0x0196>, flag) == 8, "offsetof(NetPacket_Fixed<0x0196>, flag) == 8"); +static_assert(sizeof(NetPacket_Fixed<0x0196>) == 9, "sizeof(NetPacket_Fixed<0x0196>) == 9"); +static_assert(alignof(NetPacket_Fixed<0x0196>) == 1, "alignof(NetPacket_Fixed<0x0196>) == 1"); + +template<> +struct NetPacket_Fixed<0x019b> +{ + Little16 magic_packet_id; + Little32 block_id; + Little32 type; +}; +static_assert(offsetof(NetPacket_Fixed<0x019b>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x019b>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x019b>, block_id) == 2, "offsetof(NetPacket_Fixed<0x019b>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x019b>, type) == 6, "offsetof(NetPacket_Fixed<0x019b>, type) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x019b>) == 10, "sizeof(NetPacket_Fixed<0x019b>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x019b>) == 1, "alignof(NetPacket_Fixed<0x019b>) == 1"); + +template<> +struct NetPacket_Fixed<0x01b1> +{ + Little16 magic_packet_id; + Little16 ioff2; + Little16 amount; + Byte fail; +}; +static_assert(offsetof(NetPacket_Fixed<0x01b1>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x01b1>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x01b1>, ioff2) == 2, "offsetof(NetPacket_Fixed<0x01b1>, ioff2) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x01b1>, amount) == 4, "offsetof(NetPacket_Fixed<0x01b1>, amount) == 4"); +static_assert(offsetof(NetPacket_Fixed<0x01b1>, fail) == 6, "offsetof(NetPacket_Fixed<0x01b1>, fail) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x01b1>) == 7, "sizeof(NetPacket_Fixed<0x01b1>) == 7"); +static_assert(alignof(NetPacket_Fixed<0x01b1>) == 1, "alignof(NetPacket_Fixed<0x01b1>) == 1"); + +template<> +struct NetPacket_Fixed<0x01c8> +{ + Little16 magic_packet_id; + Little16 ioff2; + Little16 name_id; + Little32 block_id; + Little16 amount; + Byte ok; +}; +static_assert(offsetof(NetPacket_Fixed<0x01c8>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x01c8>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x01c8>, ioff2) == 2, "offsetof(NetPacket_Fixed<0x01c8>, ioff2) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x01c8>, name_id) == 4, "offsetof(NetPacket_Fixed<0x01c8>, name_id) == 4"); +static_assert(offsetof(NetPacket_Fixed<0x01c8>, block_id) == 6, "offsetof(NetPacket_Fixed<0x01c8>, block_id) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x01c8>, amount) == 10, "offsetof(NetPacket_Fixed<0x01c8>, amount) == 10"); +static_assert(offsetof(NetPacket_Fixed<0x01c8>, ok) == 12, "offsetof(NetPacket_Fixed<0x01c8>, ok) == 12"); +static_assert(sizeof(NetPacket_Fixed<0x01c8>) == 13, "sizeof(NetPacket_Fixed<0x01c8>) == 13"); +static_assert(alignof(NetPacket_Fixed<0x01c8>) == 1, "alignof(NetPacket_Fixed<0x01c8>) == 1"); + +template<> +struct NetPacket_Fixed<0x01d4> +{ + Little16 magic_packet_id; + Little32 block_id; +}; +static_assert(offsetof(NetPacket_Fixed<0x01d4>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x01d4>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x01d4>, block_id) == 2, "offsetof(NetPacket_Fixed<0x01d4>, block_id) == 2"); +static_assert(sizeof(NetPacket_Fixed<0x01d4>) == 6, "sizeof(NetPacket_Fixed<0x01d4>) == 6"); +static_assert(alignof(NetPacket_Fixed<0x01d4>) == 1, "alignof(NetPacket_Fixed<0x01d4>) == 1"); + +template<> +struct NetPacket_Head<0x01d5> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; + Little32 block_id; +}; +static_assert(offsetof(NetPacket_Head<0x01d5>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x01d5>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x01d5>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x01d5>, magic_packet_length) == 2"); +static_assert(offsetof(NetPacket_Head<0x01d5>, block_id) == 4, "offsetof(NetPacket_Head<0x01d5>, block_id) == 4"); +static_assert(sizeof(NetPacket_Head<0x01d5>) == 8, "sizeof(NetPacket_Head<0x01d5>) == 8"); +static_assert(alignof(NetPacket_Head<0x01d5>) == 1, "alignof(NetPacket_Head<0x01d5>) == 1"); +template<> +struct NetPacket_Repeat<0x01d5> +{ + Byte c; +}; +static_assert(offsetof(NetPacket_Repeat<0x01d5>, c) == 0, "offsetof(NetPacket_Repeat<0x01d5>, c) == 0"); +static_assert(sizeof(NetPacket_Repeat<0x01d5>) == 1, "sizeof(NetPacket_Repeat<0x01d5>) == 1"); +static_assert(alignof(NetPacket_Repeat<0x01d5>) == 1, "alignof(NetPacket_Repeat<0x01d5>) == 1"); + +template<> +struct NetPacket_Fixed<0x01d7> +{ + Little16 magic_packet_id; + Little32 block_id; + Byte look_type; + Little16 weapon_or_name_id_or_value; + Little16 shield; +}; +static_assert(offsetof(NetPacket_Fixed<0x01d7>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x01d7>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x01d7>, block_id) == 2, "offsetof(NetPacket_Fixed<0x01d7>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x01d7>, look_type) == 6, "offsetof(NetPacket_Fixed<0x01d7>, look_type) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x01d7>, weapon_or_name_id_or_value) == 7, "offsetof(NetPacket_Fixed<0x01d7>, weapon_or_name_id_or_value) == 7"); +static_assert(offsetof(NetPacket_Fixed<0x01d7>, shield) == 9, "offsetof(NetPacket_Fixed<0x01d7>, shield) == 9"); +static_assert(sizeof(NetPacket_Fixed<0x01d7>) == 11, "sizeof(NetPacket_Fixed<0x01d7>) == 11"); +static_assert(alignof(NetPacket_Fixed<0x01d7>) == 1, "alignof(NetPacket_Fixed<0x01d7>) == 1"); + +template<> +struct NetPacket_Fixed<0x01d8> +{ + Little16 magic_packet_id; + Little32 block_id; + Little16 speed; + Little16 opt1; + Little16 opt2; + Little16 option; + Little16 species; + Little16 hair_style; + Little16 weapon; + Little16 shield; + Little16 head_bottom; + Little16 head_top; + Little16 head_mid; + Little16 hair_color; + Little16 clothes_color; + Byte head_dir; + Byte unused2; + Little32 guild_id; + Little16 guild_emblem_id; + Little16 manner; + Little16 opt3; + Byte karma; + Byte sex; + NetPosition1 pos; + Little16 gm_bits; + Byte dead_sit; + Little16 unused; +}; +static_assert(offsetof(NetPacket_Fixed<0x01d8>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x01d8>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, block_id) == 2, "offsetof(NetPacket_Fixed<0x01d8>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, speed) == 6, "offsetof(NetPacket_Fixed<0x01d8>, speed) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, opt1) == 8, "offsetof(NetPacket_Fixed<0x01d8>, opt1) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, opt2) == 10, "offsetof(NetPacket_Fixed<0x01d8>, opt2) == 10"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, option) == 12, "offsetof(NetPacket_Fixed<0x01d8>, option) == 12"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, species) == 14, "offsetof(NetPacket_Fixed<0x01d8>, species) == 14"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, hair_style) == 16, "offsetof(NetPacket_Fixed<0x01d8>, hair_style) == 16"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, weapon) == 18, "offsetof(NetPacket_Fixed<0x01d8>, weapon) == 18"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, shield) == 20, "offsetof(NetPacket_Fixed<0x01d8>, shield) == 20"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, head_bottom) == 22, "offsetof(NetPacket_Fixed<0x01d8>, head_bottom) == 22"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, head_top) == 24, "offsetof(NetPacket_Fixed<0x01d8>, head_top) == 24"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, head_mid) == 26, "offsetof(NetPacket_Fixed<0x01d8>, head_mid) == 26"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, hair_color) == 28, "offsetof(NetPacket_Fixed<0x01d8>, hair_color) == 28"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, clothes_color) == 30, "offsetof(NetPacket_Fixed<0x01d8>, clothes_color) == 30"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, head_dir) == 32, "offsetof(NetPacket_Fixed<0x01d8>, head_dir) == 32"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, unused2) == 33, "offsetof(NetPacket_Fixed<0x01d8>, unused2) == 33"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, guild_id) == 34, "offsetof(NetPacket_Fixed<0x01d8>, guild_id) == 34"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, guild_emblem_id) == 38, "offsetof(NetPacket_Fixed<0x01d8>, guild_emblem_id) == 38"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, manner) == 40, "offsetof(NetPacket_Fixed<0x01d8>, manner) == 40"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, opt3) == 42, "offsetof(NetPacket_Fixed<0x01d8>, opt3) == 42"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, karma) == 44, "offsetof(NetPacket_Fixed<0x01d8>, karma) == 44"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, sex) == 45, "offsetof(NetPacket_Fixed<0x01d8>, sex) == 45"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, pos) == 46, "offsetof(NetPacket_Fixed<0x01d8>, pos) == 46"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, gm_bits) == 49, "offsetof(NetPacket_Fixed<0x01d8>, gm_bits) == 49"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, dead_sit) == 51, "offsetof(NetPacket_Fixed<0x01d8>, dead_sit) == 51"); +static_assert(offsetof(NetPacket_Fixed<0x01d8>, unused) == 52, "offsetof(NetPacket_Fixed<0x01d8>, unused) == 52"); +static_assert(sizeof(NetPacket_Fixed<0x01d8>) == 54, "sizeof(NetPacket_Fixed<0x01d8>) == 54"); +static_assert(alignof(NetPacket_Fixed<0x01d8>) == 1, "alignof(NetPacket_Fixed<0x01d8>) == 1"); + +template<> +struct NetPacket_Fixed<0x01d9> +{ + Little16 magic_packet_id; + Little32 block_id; + Little16 speed; + Little16 opt1; + Little16 opt2; + Little16 option; + Little16 species; + Little16 hair_style; + Little16 weapon; + Little16 shield; + Little16 head_bottom; + Little16 head_top; + Little16 head_mid; + Little16 hair_color; + Little16 clothes_color; + Byte head_dir; + Byte unused2; + Little32 guild_id; + Little16 guild_emblem_id; + Little16 manner; + Little16 opt3; + Byte karma; + Byte sex; + NetPosition1 pos; + Little16 gm_bits; + Little16 unused; +}; +static_assert(offsetof(NetPacket_Fixed<0x01d9>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x01d9>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, block_id) == 2, "offsetof(NetPacket_Fixed<0x01d9>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, speed) == 6, "offsetof(NetPacket_Fixed<0x01d9>, speed) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, opt1) == 8, "offsetof(NetPacket_Fixed<0x01d9>, opt1) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, opt2) == 10, "offsetof(NetPacket_Fixed<0x01d9>, opt2) == 10"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, option) == 12, "offsetof(NetPacket_Fixed<0x01d9>, option) == 12"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, species) == 14, "offsetof(NetPacket_Fixed<0x01d9>, species) == 14"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, hair_style) == 16, "offsetof(NetPacket_Fixed<0x01d9>, hair_style) == 16"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, weapon) == 18, "offsetof(NetPacket_Fixed<0x01d9>, weapon) == 18"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, shield) == 20, "offsetof(NetPacket_Fixed<0x01d9>, shield) == 20"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, head_bottom) == 22, "offsetof(NetPacket_Fixed<0x01d9>, head_bottom) == 22"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, head_top) == 24, "offsetof(NetPacket_Fixed<0x01d9>, head_top) == 24"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, head_mid) == 26, "offsetof(NetPacket_Fixed<0x01d9>, head_mid) == 26"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, hair_color) == 28, "offsetof(NetPacket_Fixed<0x01d9>, hair_color) == 28"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, clothes_color) == 30, "offsetof(NetPacket_Fixed<0x01d9>, clothes_color) == 30"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, head_dir) == 32, "offsetof(NetPacket_Fixed<0x01d9>, head_dir) == 32"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, unused2) == 33, "offsetof(NetPacket_Fixed<0x01d9>, unused2) == 33"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, guild_id) == 34, "offsetof(NetPacket_Fixed<0x01d9>, guild_id) == 34"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, guild_emblem_id) == 38, "offsetof(NetPacket_Fixed<0x01d9>, guild_emblem_id) == 38"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, manner) == 40, "offsetof(NetPacket_Fixed<0x01d9>, manner) == 40"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, opt3) == 42, "offsetof(NetPacket_Fixed<0x01d9>, opt3) == 42"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, karma) == 44, "offsetof(NetPacket_Fixed<0x01d9>, karma) == 44"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, sex) == 45, "offsetof(NetPacket_Fixed<0x01d9>, sex) == 45"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, pos) == 46, "offsetof(NetPacket_Fixed<0x01d9>, pos) == 46"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, gm_bits) == 49, "offsetof(NetPacket_Fixed<0x01d9>, gm_bits) == 49"); +static_assert(offsetof(NetPacket_Fixed<0x01d9>, unused) == 51, "offsetof(NetPacket_Fixed<0x01d9>, unused) == 51"); +static_assert(sizeof(NetPacket_Fixed<0x01d9>) == 53, "sizeof(NetPacket_Fixed<0x01d9>) == 53"); +static_assert(alignof(NetPacket_Fixed<0x01d9>) == 1, "alignof(NetPacket_Fixed<0x01d9>) == 1"); + +template<> +struct NetPacket_Fixed<0x01da> +{ + Little16 magic_packet_id; + Little32 block_id; + Little16 speed; + Little16 opt1; + Little16 opt2; + Little16 option; + Little16 species; + Little16 hair_style; + Little16 weapon; + Little16 shield; + Little16 head_bottom; + Little32 tick; + Little16 head_top; + Little16 head_mid; + Little16 hair_color; + Little16 clothes_color; + Byte head_dir; + Byte unused2; + Little32 guild_id; + Little16 guild_emblem_id; + Little16 manner; + Little16 opt3; + Byte karma; + Byte sex; + NetPosition2 pos2; + Little16 gm_bits; + Byte five; + Little16 unused; +}; +static_assert(offsetof(NetPacket_Fixed<0x01da>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x01da>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, block_id) == 2, "offsetof(NetPacket_Fixed<0x01da>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, speed) == 6, "offsetof(NetPacket_Fixed<0x01da>, speed) == 6"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, opt1) == 8, "offsetof(NetPacket_Fixed<0x01da>, opt1) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, opt2) == 10, "offsetof(NetPacket_Fixed<0x01da>, opt2) == 10"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, option) == 12, "offsetof(NetPacket_Fixed<0x01da>, option) == 12"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, species) == 14, "offsetof(NetPacket_Fixed<0x01da>, species) == 14"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, hair_style) == 16, "offsetof(NetPacket_Fixed<0x01da>, hair_style) == 16"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, weapon) == 18, "offsetof(NetPacket_Fixed<0x01da>, weapon) == 18"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, shield) == 20, "offsetof(NetPacket_Fixed<0x01da>, shield) == 20"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, head_bottom) == 22, "offsetof(NetPacket_Fixed<0x01da>, head_bottom) == 22"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, tick) == 24, "offsetof(NetPacket_Fixed<0x01da>, tick) == 24"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, head_top) == 28, "offsetof(NetPacket_Fixed<0x01da>, head_top) == 28"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, head_mid) == 30, "offsetof(NetPacket_Fixed<0x01da>, head_mid) == 30"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, hair_color) == 32, "offsetof(NetPacket_Fixed<0x01da>, hair_color) == 32"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, clothes_color) == 34, "offsetof(NetPacket_Fixed<0x01da>, clothes_color) == 34"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, head_dir) == 36, "offsetof(NetPacket_Fixed<0x01da>, head_dir) == 36"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, unused2) == 37, "offsetof(NetPacket_Fixed<0x01da>, unused2) == 37"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, guild_id) == 38, "offsetof(NetPacket_Fixed<0x01da>, guild_id) == 38"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, guild_emblem_id) == 42, "offsetof(NetPacket_Fixed<0x01da>, guild_emblem_id) == 42"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, manner) == 44, "offsetof(NetPacket_Fixed<0x01da>, manner) == 44"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, opt3) == 46, "offsetof(NetPacket_Fixed<0x01da>, opt3) == 46"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, karma) == 48, "offsetof(NetPacket_Fixed<0x01da>, karma) == 48"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, sex) == 49, "offsetof(NetPacket_Fixed<0x01da>, sex) == 49"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, pos2) == 50, "offsetof(NetPacket_Fixed<0x01da>, pos2) == 50"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, gm_bits) == 55, "offsetof(NetPacket_Fixed<0x01da>, gm_bits) == 55"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, five) == 57, "offsetof(NetPacket_Fixed<0x01da>, five) == 57"); +static_assert(offsetof(NetPacket_Fixed<0x01da>, unused) == 58, "offsetof(NetPacket_Fixed<0x01da>, unused) == 58"); +static_assert(sizeof(NetPacket_Fixed<0x01da>) == 60, "sizeof(NetPacket_Fixed<0x01da>) == 60"); +static_assert(alignof(NetPacket_Fixed<0x01da>) == 1, "alignof(NetPacket_Fixed<0x01da>) == 1"); + +template<> +struct NetPacket_Fixed<0x01de> +{ + Little16 magic_packet_id; + Little16 skill_id; + Little32 src_id; + Little32 dst_id; + Little32 tick; + Little32 sdelay; + Little32 ddelay; + Little32 damage; + Little16 skill_level; + Little16 div; + Byte type_or_hit; +}; +static_assert(offsetof(NetPacket_Fixed<0x01de>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x01de>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x01de>, skill_id) == 2, "offsetof(NetPacket_Fixed<0x01de>, skill_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x01de>, src_id) == 4, "offsetof(NetPacket_Fixed<0x01de>, src_id) == 4"); +static_assert(offsetof(NetPacket_Fixed<0x01de>, dst_id) == 8, "offsetof(NetPacket_Fixed<0x01de>, dst_id) == 8"); +static_assert(offsetof(NetPacket_Fixed<0x01de>, tick) == 12, "offsetof(NetPacket_Fixed<0x01de>, tick) == 12"); +static_assert(offsetof(NetPacket_Fixed<0x01de>, sdelay) == 16, "offsetof(NetPacket_Fixed<0x01de>, sdelay) == 16"); +static_assert(offsetof(NetPacket_Fixed<0x01de>, ddelay) == 20, "offsetof(NetPacket_Fixed<0x01de>, ddelay) == 20"); +static_assert(offsetof(NetPacket_Fixed<0x01de>, damage) == 24, "offsetof(NetPacket_Fixed<0x01de>, damage) == 24"); +static_assert(offsetof(NetPacket_Fixed<0x01de>, skill_level) == 28, "offsetof(NetPacket_Fixed<0x01de>, skill_level) == 28"); +static_assert(offsetof(NetPacket_Fixed<0x01de>, div) == 30, "offsetof(NetPacket_Fixed<0x01de>, div) == 30"); +static_assert(offsetof(NetPacket_Fixed<0x01de>, type_or_hit) == 32, "offsetof(NetPacket_Fixed<0x01de>, type_or_hit) == 32"); +static_assert(sizeof(NetPacket_Fixed<0x01de>) == 33, "sizeof(NetPacket_Fixed<0x01de>) == 33"); +static_assert(alignof(NetPacket_Fixed<0x01de>) == 1, "alignof(NetPacket_Fixed<0x01de>) == 1"); + +template<> +struct NetPacket_Head<0x01ee> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; +}; +static_assert(offsetof(NetPacket_Head<0x01ee>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x01ee>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x01ee>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x01ee>, magic_packet_length) == 2"); +static_assert(sizeof(NetPacket_Head<0x01ee>) == 4, "sizeof(NetPacket_Head<0x01ee>) == 4"); +static_assert(alignof(NetPacket_Head<0x01ee>) == 1, "alignof(NetPacket_Head<0x01ee>) == 1"); +template<> +struct NetPacket_Repeat<0x01ee> +{ + Little16 ioff2; + Little16 name_id; + Byte item_type; + Byte identify; + Little16 amount; + Little16 epos; + Little16 card0; + Little16 card1; + Little16 card2; + Little16 card3; +}; +static_assert(offsetof(NetPacket_Repeat<0x01ee>, ioff2) == 0, "offsetof(NetPacket_Repeat<0x01ee>, ioff2) == 0"); +static_assert(offsetof(NetPacket_Repeat<0x01ee>, name_id) == 2, "offsetof(NetPacket_Repeat<0x01ee>, name_id) == 2"); +static_assert(offsetof(NetPacket_Repeat<0x01ee>, item_type) == 4, "offsetof(NetPacket_Repeat<0x01ee>, item_type) == 4"); +static_assert(offsetof(NetPacket_Repeat<0x01ee>, identify) == 5, "offsetof(NetPacket_Repeat<0x01ee>, identify) == 5"); +static_assert(offsetof(NetPacket_Repeat<0x01ee>, amount) == 6, "offsetof(NetPacket_Repeat<0x01ee>, amount) == 6"); +static_assert(offsetof(NetPacket_Repeat<0x01ee>, epos) == 8, "offsetof(NetPacket_Repeat<0x01ee>, epos) == 8"); +static_assert(offsetof(NetPacket_Repeat<0x01ee>, card0) == 10, "offsetof(NetPacket_Repeat<0x01ee>, card0) == 10"); +static_assert(offsetof(NetPacket_Repeat<0x01ee>, card1) == 12, "offsetof(NetPacket_Repeat<0x01ee>, card1) == 12"); +static_assert(offsetof(NetPacket_Repeat<0x01ee>, card2) == 14, "offsetof(NetPacket_Repeat<0x01ee>, card2) == 14"); +static_assert(offsetof(NetPacket_Repeat<0x01ee>, card3) == 16, "offsetof(NetPacket_Repeat<0x01ee>, card3) == 16"); +static_assert(sizeof(NetPacket_Repeat<0x01ee>) == 18, "sizeof(NetPacket_Repeat<0x01ee>) == 18"); +static_assert(alignof(NetPacket_Repeat<0x01ee>) == 1, "alignof(NetPacket_Repeat<0x01ee>) == 1"); + +template<> +struct NetPacket_Head<0x01f0> +{ + Little16 magic_packet_id; + Little16 magic_packet_length; +}; +static_assert(offsetof(NetPacket_Head<0x01f0>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x01f0>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Head<0x01f0>, magic_packet_length) == 2, "offsetof(NetPacket_Head<0x01f0>, magic_packet_length) == 2"); +static_assert(sizeof(NetPacket_Head<0x01f0>) == 4, "sizeof(NetPacket_Head<0x01f0>) == 4"); +static_assert(alignof(NetPacket_Head<0x01f0>) == 1, "alignof(NetPacket_Head<0x01f0>) == 1"); +template<> +struct NetPacket_Repeat<0x01f0> +{ + Little16 soff1; + Little16 name_id; + Byte item_type; + Byte identify; + Little16 amount; + Little16 epos_zero; + Little16 card0; + Little16 card1; + Little16 card2; + Little16 card3; +}; +static_assert(offsetof(NetPacket_Repeat<0x01f0>, soff1) == 0, "offsetof(NetPacket_Repeat<0x01f0>, soff1) == 0"); +static_assert(offsetof(NetPacket_Repeat<0x01f0>, name_id) == 2, "offsetof(NetPacket_Repeat<0x01f0>, name_id) == 2"); +static_assert(offsetof(NetPacket_Repeat<0x01f0>, item_type) == 4, "offsetof(NetPacket_Repeat<0x01f0>, item_type) == 4"); +static_assert(offsetof(NetPacket_Repeat<0x01f0>, identify) == 5, "offsetof(NetPacket_Repeat<0x01f0>, identify) == 5"); +static_assert(offsetof(NetPacket_Repeat<0x01f0>, amount) == 6, "offsetof(NetPacket_Repeat<0x01f0>, amount) == 6"); +static_assert(offsetof(NetPacket_Repeat<0x01f0>, epos_zero) == 8, "offsetof(NetPacket_Repeat<0x01f0>, epos_zero) == 8"); +static_assert(offsetof(NetPacket_Repeat<0x01f0>, card0) == 10, "offsetof(NetPacket_Repeat<0x01f0>, card0) == 10"); +static_assert(offsetof(NetPacket_Repeat<0x01f0>, card1) == 12, "offsetof(NetPacket_Repeat<0x01f0>, card1) == 12"); +static_assert(offsetof(NetPacket_Repeat<0x01f0>, card2) == 14, "offsetof(NetPacket_Repeat<0x01f0>, card2) == 14"); +static_assert(offsetof(NetPacket_Repeat<0x01f0>, card3) == 16, "offsetof(NetPacket_Repeat<0x01f0>, card3) == 16"); +static_assert(sizeof(NetPacket_Repeat<0x01f0>) == 18, "sizeof(NetPacket_Repeat<0x01f0>) == 18"); +static_assert(alignof(NetPacket_Repeat<0x01f0>) == 1, "alignof(NetPacket_Repeat<0x01f0>) == 1"); + +template<> +struct NetPacket_Fixed<0x020c> +{ + Little16 magic_packet_id; + Little32 block_id; + IP4Address ip; +}; +static_assert(offsetof(NetPacket_Fixed<0x020c>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x020c>, magic_packet_id) == 0"); +static_assert(offsetof(NetPacket_Fixed<0x020c>, block_id) == 2, "offsetof(NetPacket_Fixed<0x020c>, block_id) == 2"); +static_assert(offsetof(NetPacket_Fixed<0x020c>, ip) == 6, "offsetof(NetPacket_Fixed<0x020c>, ip) == 6"); +static_assert(sizeof(NetPacket_Fixed<0x020c>) == 10, "sizeof(NetPacket_Fixed<0x020c>) == 10"); +static_assert(alignof(NetPacket_Fixed<0x020c>) == 1, "alignof(NetPacket_Fixed<0x020c>) == 1"); + +template<> struct NetPacket_Fixed<0x0212> { Little16 magic_packet_id; @@ -62,7 +4472,3438 @@ static_assert(offsetof(NetPacket_Fixed<0x0212>, id) == 8, "offsetof(NetPacket_Fi static_assert(offsetof(NetPacket_Fixed<0x0212>, x) == 12, "offsetof(NetPacket_Fixed<0x0212>, x) == 12"); static_assert(offsetof(NetPacket_Fixed<0x0212>, y) == 14, "offsetof(NetPacket_Fixed<0x0212>, y) == 14"); static_assert(sizeof(NetPacket_Fixed<0x0212>) == 16, "sizeof(NetPacket_Fixed<0x0212>) == 16"); +static_assert(alignof(NetPacket_Fixed<0x0212>) == 1, "alignof(NetPacket_Fixed<0x0212>) == 1"); + + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0072> *network, Packet_Fixed<0x0072> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->account_id, native.account_id); + rv &= native_to_network(&network->char_id, native.char_id); + rv &= native_to_network(&network->login_id1, native.login_id1); + rv &= native_to_network(&network->client_tick, native.client_tick); + rv &= native_to_network(&network->sex, native.sex); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0072> *native, NetPacket_Fixed<0x0072> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->account_id, network.account_id); + rv &= network_to_native(&native->char_id, network.char_id); + rv &= network_to_native(&native->login_id1, network.login_id1); + rv &= network_to_native(&native->client_tick, network.client_tick); + rv &= network_to_native(&native->sex, network.sex); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0073> *network, Packet_Fixed<0x0073> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->tick, native.tick); + rv &= native_to_network(&network->pos, native.pos); + rv &= native_to_network(&network->five1, native.five1); + rv &= native_to_network(&network->five2, native.five2); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0073> *native, NetPacket_Fixed<0x0073> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->tick, network.tick); + rv &= network_to_native(&native->pos, network.pos); + rv &= network_to_native(&native->five1, network.five1); + rv &= network_to_native(&native->five2, network.five2); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0078> *network, Packet_Fixed<0x0078> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->speed, native.speed); + rv &= native_to_network(&network->opt1, native.opt1); + rv &= native_to_network(&network->opt2, native.opt2); + rv &= native_to_network(&network->option, native.option); + rv &= native_to_network(&network->species, native.species); + rv &= native_to_network(&network->unused_hair_style, native.unused_hair_style); + rv &= native_to_network(&network->unused_weapon, native.unused_weapon); + rv &= native_to_network(&network->unused_head_bottom_or_species_again, native.unused_head_bottom_or_species_again); + rv &= native_to_network(&network->unused_shield_or_part_of_guild_emblem, native.unused_shield_or_part_of_guild_emblem); + rv &= native_to_network(&network->unused_head_top_or_unused_part_of_guild_emblem, native.unused_head_top_or_unused_part_of_guild_emblem); + rv &= native_to_network(&network->unused_head_mid_or_part_of_guild_id, native.unused_head_mid_or_part_of_guild_id); + rv &= native_to_network(&network->unused_hair_color_or_part_of_guild_id, native.unused_hair_color_or_part_of_guild_id); + rv &= native_to_network(&network->unused_clothes_color, native.unused_clothes_color); + rv &= native_to_network(&network->unused_1, native.unused_1); + rv &= native_to_network(&network->unused_2, native.unused_2); + rv &= native_to_network(&network->unused_pos_again, native.unused_pos_again); + rv &= native_to_network(&network->unused_4b, native.unused_4b); + rv &= native_to_network(&network->unused_5, native.unused_5); + rv &= native_to_network(&network->unused_zero_1, native.unused_zero_1); + rv &= native_to_network(&network->unused_zero_2, native.unused_zero_2); + rv &= native_to_network(&network->unused_sex, native.unused_sex); + rv &= native_to_network(&network->pos, native.pos); + rv &= native_to_network(&network->five1, native.five1); + rv &= native_to_network(&network->five2, native.five2); + rv &= native_to_network(&network->zero, native.zero); + rv &= native_to_network(&network->level, native.level); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0078> *native, NetPacket_Fixed<0x0078> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->speed, network.speed); + rv &= network_to_native(&native->opt1, network.opt1); + rv &= network_to_native(&native->opt2, network.opt2); + rv &= network_to_native(&native->option, network.option); + rv &= network_to_native(&native->species, network.species); + rv &= network_to_native(&native->unused_hair_style, network.unused_hair_style); + rv &= network_to_native(&native->unused_weapon, network.unused_weapon); + rv &= network_to_native(&native->unused_head_bottom_or_species_again, network.unused_head_bottom_or_species_again); + rv &= network_to_native(&native->unused_shield_or_part_of_guild_emblem, network.unused_shield_or_part_of_guild_emblem); + rv &= network_to_native(&native->unused_head_top_or_unused_part_of_guild_emblem, network.unused_head_top_or_unused_part_of_guild_emblem); + rv &= network_to_native(&native->unused_head_mid_or_part_of_guild_id, network.unused_head_mid_or_part_of_guild_id); + rv &= network_to_native(&native->unused_hair_color_or_part_of_guild_id, network.unused_hair_color_or_part_of_guild_id); + rv &= network_to_native(&native->unused_clothes_color, network.unused_clothes_color); + rv &= network_to_native(&native->unused_1, network.unused_1); + rv &= network_to_native(&native->unused_2, network.unused_2); + rv &= network_to_native(&native->unused_pos_again, network.unused_pos_again); + rv &= network_to_native(&native->unused_4b, network.unused_4b); + rv &= network_to_native(&native->unused_5, network.unused_5); + rv &= network_to_native(&native->unused_zero_1, network.unused_zero_1); + rv &= network_to_native(&native->unused_zero_2, network.unused_zero_2); + rv &= network_to_native(&native->unused_sex, network.unused_sex); + rv &= network_to_native(&native->pos, network.pos); + rv &= network_to_native(&native->five1, network.five1); + rv &= network_to_native(&native->five2, network.five2); + rv &= network_to_native(&native->zero, network.zero); + rv &= network_to_native(&native->level, network.level); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x007b> *network, Packet_Fixed<0x007b> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->speed, native.speed); + rv &= native_to_network(&network->opt1, native.opt1); + rv &= native_to_network(&network->opt2, native.opt2); + rv &= native_to_network(&network->option, native.option); + rv &= native_to_network(&network->mob_class, native.mob_class); + rv &= native_to_network(&network->unused_hair_style, native.unused_hair_style); + rv &= native_to_network(&network->unused_weapon, native.unused_weapon); + rv &= native_to_network(&network->unused_head_bottom, native.unused_head_bottom); + rv &= native_to_network(&network->tick_and_maybe_part_of_guild_emblem, native.tick_and_maybe_part_of_guild_emblem); + rv &= native_to_network(&network->unused_shield_or_maybe_part_of_guild_emblem, native.unused_shield_or_maybe_part_of_guild_emblem); + rv &= native_to_network(&network->unused_head_top_or_maybe_part_of_guild_id, native.unused_head_top_or_maybe_part_of_guild_id); + rv &= native_to_network(&network->unused_head_mid_or_maybe_part_of_guild_id, native.unused_head_mid_or_maybe_part_of_guild_id); + rv &= native_to_network(&network->unused_hair_color, native.unused_hair_color); + rv &= native_to_network(&network->unused_clothes_color, native.unused_clothes_color); + rv &= native_to_network(&network->unused_1, native.unused_1); + rv &= native_to_network(&network->unused_2, native.unused_2); + rv &= native_to_network(&network->unused_3, native.unused_3); + rv &= native_to_network(&network->unused_4, native.unused_4); + rv &= native_to_network(&network->unused_5, native.unused_5); + rv &= native_to_network(&network->unused_zero_1, native.unused_zero_1); + rv &= native_to_network(&network->unused_zero_2, native.unused_zero_2); + rv &= native_to_network(&network->unused_sex, native.unused_sex); + rv &= native_to_network(&network->pos2, native.pos2); + rv &= native_to_network(&network->zero, native.zero); + rv &= native_to_network(&network->five1, native.five1); + rv &= native_to_network(&network->five2, native.five2); + rv &= native_to_network(&network->level, native.level); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x007b> *native, NetPacket_Fixed<0x007b> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->speed, network.speed); + rv &= network_to_native(&native->opt1, network.opt1); + rv &= network_to_native(&native->opt2, network.opt2); + rv &= network_to_native(&native->option, network.option); + rv &= network_to_native(&native->mob_class, network.mob_class); + rv &= network_to_native(&native->unused_hair_style, network.unused_hair_style); + rv &= network_to_native(&native->unused_weapon, network.unused_weapon); + rv &= network_to_native(&native->unused_head_bottom, network.unused_head_bottom); + rv &= network_to_native(&native->tick_and_maybe_part_of_guild_emblem, network.tick_and_maybe_part_of_guild_emblem); + rv &= network_to_native(&native->unused_shield_or_maybe_part_of_guild_emblem, network.unused_shield_or_maybe_part_of_guild_emblem); + rv &= network_to_native(&native->unused_head_top_or_maybe_part_of_guild_id, network.unused_head_top_or_maybe_part_of_guild_id); + rv &= network_to_native(&native->unused_head_mid_or_maybe_part_of_guild_id, network.unused_head_mid_or_maybe_part_of_guild_id); + rv &= network_to_native(&native->unused_hair_color, network.unused_hair_color); + rv &= network_to_native(&native->unused_clothes_color, network.unused_clothes_color); + rv &= network_to_native(&native->unused_1, network.unused_1); + rv &= network_to_native(&native->unused_2, network.unused_2); + rv &= network_to_native(&native->unused_3, network.unused_3); + rv &= network_to_native(&native->unused_4, network.unused_4); + rv &= network_to_native(&native->unused_5, network.unused_5); + rv &= network_to_native(&native->unused_zero_1, network.unused_zero_1); + rv &= network_to_native(&native->unused_zero_2, network.unused_zero_2); + rv &= network_to_native(&native->unused_sex, network.unused_sex); + rv &= network_to_native(&native->pos2, network.pos2); + rv &= network_to_native(&native->zero, network.zero); + rv &= network_to_native(&native->five1, network.five1); + rv &= network_to_native(&native->five2, network.five2); + rv &= network_to_native(&native->level, network.level); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x007c> *network, Packet_Fixed<0x007c> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->speed, native.speed); + rv &= native_to_network(&network->opt1, native.opt1); + rv &= native_to_network(&network->opt2, native.opt2); + rv &= native_to_network(&network->option, native.option); + rv &= native_to_network(&network->unknown_1, native.unknown_1); + rv &= native_to_network(&network->unknown_2, native.unknown_2); + rv &= native_to_network(&network->unknown_3, native.unknown_3); + rv &= native_to_network(&network->species, native.species); + rv &= native_to_network(&network->unknown_4, native.unknown_4); + rv &= native_to_network(&network->unknown_5, native.unknown_5); + rv &= native_to_network(&network->unknown_6, native.unknown_6); + rv &= native_to_network(&network->unknown_7, native.unknown_7); + rv &= native_to_network(&network->unknown_8, native.unknown_8); + rv &= native_to_network(&network->unknown_9, native.unknown_9); + rv &= native_to_network(&network->unknown_10, native.unknown_10); + rv &= native_to_network(&network->pos, native.pos); + rv &= native_to_network(&network->unknown_11, native.unknown_11); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x007c> *native, NetPacket_Fixed<0x007c> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->speed, network.speed); + rv &= network_to_native(&native->opt1, network.opt1); + rv &= network_to_native(&native->opt2, network.opt2); + rv &= network_to_native(&native->option, network.option); + rv &= network_to_native(&native->unknown_1, network.unknown_1); + rv &= network_to_native(&native->unknown_2, network.unknown_2); + rv &= network_to_native(&native->unknown_3, network.unknown_3); + rv &= network_to_native(&native->species, network.species); + rv &= network_to_native(&native->unknown_4, network.unknown_4); + rv &= network_to_native(&native->unknown_5, network.unknown_5); + rv &= network_to_native(&native->unknown_6, network.unknown_6); + rv &= network_to_native(&native->unknown_7, network.unknown_7); + rv &= network_to_native(&native->unknown_8, network.unknown_8); + rv &= network_to_native(&native->unknown_9, network.unknown_9); + rv &= network_to_native(&native->unknown_10, network.unknown_10); + rv &= network_to_native(&native->pos, network.pos); + rv &= network_to_native(&native->unknown_11, network.unknown_11); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x007d> *network, Packet_Fixed<0x007d> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x007d> *native, NetPacket_Fixed<0x007d> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x007e> *network, Packet_Fixed<0x007e> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->client_tick, native.client_tick); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x007e> *native, NetPacket_Fixed<0x007e> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->client_tick, network.client_tick); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x007f> *network, Packet_Fixed<0x007f> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->tick, native.tick); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x007f> *native, NetPacket_Fixed<0x007f> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->tick, network.tick); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0080> *network, Packet_Fixed<0x0080> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->type, native.type); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0080> *native, NetPacket_Fixed<0x0080> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->type, network.type); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0085> *network, Packet_Fixed<0x0085> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->pos, native.pos); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0085> *native, NetPacket_Fixed<0x0085> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->pos, network.pos); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0087> *network, Packet_Fixed<0x0087> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->tick, native.tick); + rv &= native_to_network(&network->pos2, native.pos2); + rv &= native_to_network(&network->zero, native.zero); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0087> *native, NetPacket_Fixed<0x0087> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->tick, network.tick); + rv &= network_to_native(&native->pos2, network.pos2); + rv &= network_to_native(&native->zero, network.zero); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0088> *network, Packet_Fixed<0x0088> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->x, native.x); + rv &= native_to_network(&network->y, native.y); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0088> *native, NetPacket_Fixed<0x0088> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->x, network.x); + rv &= network_to_native(&native->y, network.y); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0089> *network, Packet_Fixed<0x0089> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->target_id, native.target_id); + rv &= native_to_network(&network->action, native.action); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0089> *native, NetPacket_Fixed<0x0089> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->target_id, network.target_id); + rv &= network_to_native(&native->action, network.action); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x008a> *network, Packet_Fixed<0x008a> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->src_id, native.src_id); + rv &= native_to_network(&network->dst_id, native.dst_id); + rv &= native_to_network(&network->tick, native.tick); + rv &= native_to_network(&network->sdelay, native.sdelay); + rv &= native_to_network(&network->ddelay, native.ddelay); + rv &= native_to_network(&network->damage, native.damage); + rv &= native_to_network(&network->div, native.div); + rv &= native_to_network(&network->damage_type, native.damage_type); + rv &= native_to_network(&network->damage2, native.damage2); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x008a> *native, NetPacket_Fixed<0x008a> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->src_id, network.src_id); + rv &= network_to_native(&native->dst_id, network.dst_id); + rv &= network_to_native(&native->tick, network.tick); + rv &= network_to_native(&native->sdelay, network.sdelay); + rv &= network_to_native(&native->ddelay, network.ddelay); + rv &= network_to_native(&native->damage, network.damage); + rv &= network_to_native(&native->div, network.div); + rv &= network_to_native(&native->damage_type, network.damage_type); + rv &= network_to_native(&native->damage2, network.damage2); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x008c> *network, Packet_Head<0x008c> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x008c> *native, NetPacket_Head<0x008c> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x008c> *network, Packet_Repeat<0x008c> native) +{ + bool rv = true; + rv &= native_to_network(&network->c, native.c); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x008c> *native, NetPacket_Repeat<0x008c> network) +{ + bool rv = true; + rv &= network_to_native(&native->c, network.c); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x008d> *network, Packet_Head<0x008d> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + rv &= native_to_network(&network->block_id, native.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x008d> *native, NetPacket_Head<0x008d> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + rv &= network_to_native(&native->block_id, network.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x008d> *network, Packet_Repeat<0x008d> native) +{ + bool rv = true; + rv &= native_to_network(&network->c, native.c); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x008d> *native, NetPacket_Repeat<0x008d> network) +{ + bool rv = true; + rv &= network_to_native(&native->c, network.c); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x008e> *network, Packet_Head<0x008e> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x008e> *native, NetPacket_Head<0x008e> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x008e> *network, Packet_Repeat<0x008e> native) +{ + bool rv = true; + rv &= native_to_network(&network->c, native.c); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x008e> *native, NetPacket_Repeat<0x008e> network) +{ + bool rv = true; + rv &= network_to_native(&native->c, network.c); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0090> *network, Packet_Fixed<0x0090> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->unused, native.unused); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0090> *native, NetPacket_Fixed<0x0090> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->unused, network.unused); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0091> *network, Packet_Fixed<0x0091> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->map_name, native.map_name); + rv &= native_to_network(&network->x, native.x); + rv &= native_to_network(&network->y, native.y); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0091> *native, NetPacket_Fixed<0x0091> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->map_name, network.map_name); + rv &= network_to_native(&native->x, network.x); + rv &= network_to_native(&native->y, network.y); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0092> *network, Packet_Fixed<0x0092> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->map_name, native.map_name); + rv &= native_to_network(&network->x, native.x); + rv &= native_to_network(&network->y, native.y); + rv &= native_to_network(&network->ip, native.ip); + rv &= native_to_network(&network->port, native.port); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0092> *native, NetPacket_Fixed<0x0092> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->map_name, network.map_name); + rv &= network_to_native(&native->x, network.x); + rv &= network_to_native(&native->y, network.y); + rv &= network_to_native(&native->ip, network.ip); + rv &= network_to_native(&native->port, network.port); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0094> *network, Packet_Fixed<0x0094> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0094> *native, NetPacket_Fixed<0x0094> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0095> *network, Packet_Fixed<0x0095> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->char_name, native.char_name); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0095> *native, NetPacket_Fixed<0x0095> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->char_name, network.char_name); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x0096> *network, Packet_Head<0x0096> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + rv &= native_to_network(&network->target_name, native.target_name); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x0096> *native, NetPacket_Head<0x0096> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + rv &= network_to_native(&native->target_name, network.target_name); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x0096> *network, Packet_Repeat<0x0096> native) +{ + bool rv = true; + rv &= native_to_network(&network->c, native.c); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x0096> *native, NetPacket_Repeat<0x0096> network) +{ + bool rv = true; + rv &= network_to_native(&native->c, network.c); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x0097> *network, Packet_Head<0x0097> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + rv &= native_to_network(&network->char_name, native.char_name); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x0097> *native, NetPacket_Head<0x0097> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + rv &= network_to_native(&native->char_name, network.char_name); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x0097> *network, Packet_Repeat<0x0097> native) +{ + bool rv = true; + rv &= native_to_network(&network->c, native.c); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x0097> *native, NetPacket_Repeat<0x0097> network) +{ + bool rv = true; + rv &= network_to_native(&native->c, network.c); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0098> *network, Packet_Fixed<0x0098> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->flag, native.flag); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0098> *native, NetPacket_Fixed<0x0098> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->flag, network.flag); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x009a> *network, Packet_Head<0x009a> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x009a> *native, NetPacket_Head<0x009a> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x009a> *network, Packet_Repeat<0x009a> native) +{ + bool rv = true; + rv &= native_to_network(&network->c, native.c); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x009a> *native, NetPacket_Repeat<0x009a> network) +{ + bool rv = true; + rv &= network_to_native(&native->c, network.c); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x009b> *network, Packet_Fixed<0x009b> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->unused, native.unused); + rv &= native_to_network(&network->client_dir, native.client_dir); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x009b> *native, NetPacket_Fixed<0x009b> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->unused, network.unused); + rv &= network_to_native(&native->client_dir, network.client_dir); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x009c> *network, Packet_Fixed<0x009c> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->zero, native.zero); + rv &= native_to_network(&network->client_dir, native.client_dir); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x009c> *native, NetPacket_Fixed<0x009c> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->zero, network.zero); + rv &= network_to_native(&native->client_dir, network.client_dir); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x009d> *network, Packet_Fixed<0x009d> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->name_id, native.name_id); + rv &= native_to_network(&network->identify, native.identify); + rv &= native_to_network(&network->x, native.x); + rv &= native_to_network(&network->y, native.y); + rv &= native_to_network(&network->amount, native.amount); + rv &= native_to_network(&network->subx, native.subx); + rv &= native_to_network(&network->suby, native.suby); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x009d> *native, NetPacket_Fixed<0x009d> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->name_id, network.name_id); + rv &= network_to_native(&native->identify, network.identify); + rv &= network_to_native(&native->x, network.x); + rv &= network_to_native(&native->y, network.y); + rv &= network_to_native(&native->amount, network.amount); + rv &= network_to_native(&native->subx, network.subx); + rv &= network_to_native(&native->suby, network.suby); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x009e> *network, Packet_Fixed<0x009e> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->name_id, native.name_id); + rv &= native_to_network(&network->identify, native.identify); + rv &= native_to_network(&network->x, native.x); + rv &= native_to_network(&network->y, native.y); + rv &= native_to_network(&network->subx, native.subx); + rv &= native_to_network(&network->suby, native.suby); + rv &= native_to_network(&network->amount, native.amount); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x009e> *native, NetPacket_Fixed<0x009e> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->name_id, network.name_id); + rv &= network_to_native(&native->identify, network.identify); + rv &= network_to_native(&native->x, network.x); + rv &= network_to_native(&native->y, network.y); + rv &= network_to_native(&native->subx, network.subx); + rv &= network_to_native(&native->suby, network.suby); + rv &= network_to_native(&native->amount, network.amount); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x009f> *network, Packet_Fixed<0x009f> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->object_id, native.object_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x009f> *native, NetPacket_Fixed<0x009f> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->object_id, network.object_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00a0> *network, Packet_Fixed<0x00a0> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->ioff2, native.ioff2); + rv &= native_to_network(&network->amount, native.amount); + rv &= native_to_network(&network->name_id, native.name_id); + rv &= native_to_network(&network->identify, native.identify); + rv &= native_to_network(&network->broken_or_attribute, native.broken_or_attribute); + rv &= native_to_network(&network->refine, native.refine); + rv &= native_to_network(&network->card0, native.card0); + rv &= native_to_network(&network->card1, native.card1); + rv &= native_to_network(&network->card2, native.card2); + rv &= native_to_network(&network->card3, native.card3); + rv &= native_to_network(&network->epos, native.epos); + rv &= native_to_network(&network->item_type, native.item_type); + rv &= native_to_network(&network->pickup_fail, native.pickup_fail); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00a0> *native, NetPacket_Fixed<0x00a0> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->ioff2, network.ioff2); + rv &= network_to_native(&native->amount, network.amount); + rv &= network_to_native(&native->name_id, network.name_id); + rv &= network_to_native(&native->identify, network.identify); + rv &= network_to_native(&native->broken_or_attribute, network.broken_or_attribute); + rv &= network_to_native(&native->refine, network.refine); + rv &= network_to_native(&native->card0, network.card0); + rv &= network_to_native(&native->card1, network.card1); + rv &= network_to_native(&native->card2, network.card2); + rv &= network_to_native(&native->card3, network.card3); + rv &= network_to_native(&native->epos, network.epos); + rv &= network_to_native(&native->item_type, network.item_type); + rv &= network_to_native(&native->pickup_fail, network.pickup_fail); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00a1> *network, Packet_Fixed<0x00a1> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00a1> *native, NetPacket_Fixed<0x00a1> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00a2> *network, Packet_Fixed<0x00a2> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->ioff2, native.ioff2); + rv &= native_to_network(&network->amount, native.amount); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00a2> *native, NetPacket_Fixed<0x00a2> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->ioff2, network.ioff2); + rv &= network_to_native(&native->amount, network.amount); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x00a4> *network, Packet_Head<0x00a4> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x00a4> *native, NetPacket_Head<0x00a4> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x00a4> *network, Packet_Repeat<0x00a4> native) +{ + bool rv = true; + rv &= native_to_network(&network->ioff2, native.ioff2); + rv &= native_to_network(&network->name_id, native.name_id); + rv &= native_to_network(&network->item_type, native.item_type); + rv &= native_to_network(&network->identify, native.identify); + rv &= native_to_network(&network->epos_pc, native.epos_pc); + rv &= native_to_network(&network->epos_inv, native.epos_inv); + rv &= native_to_network(&network->broken_or_attribute, native.broken_or_attribute); + rv &= native_to_network(&network->refine, native.refine); + rv &= native_to_network(&network->card0, native.card0); + rv &= native_to_network(&network->card1, native.card1); + rv &= native_to_network(&network->card2, native.card2); + rv &= native_to_network(&network->card3, native.card3); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x00a4> *native, NetPacket_Repeat<0x00a4> network) +{ + bool rv = true; + rv &= network_to_native(&native->ioff2, network.ioff2); + rv &= network_to_native(&native->name_id, network.name_id); + rv &= network_to_native(&native->item_type, network.item_type); + rv &= network_to_native(&native->identify, network.identify); + rv &= network_to_native(&native->epos_pc, network.epos_pc); + rv &= network_to_native(&native->epos_inv, network.epos_inv); + rv &= network_to_native(&native->broken_or_attribute, network.broken_or_attribute); + rv &= network_to_native(&native->refine, network.refine); + rv &= network_to_native(&native->card0, network.card0); + rv &= network_to_native(&native->card1, network.card1); + rv &= network_to_native(&native->card2, network.card2); + rv &= network_to_native(&native->card3, network.card3); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x00a6> *network, Packet_Head<0x00a6> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x00a6> *native, NetPacket_Head<0x00a6> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x00a6> *network, Packet_Repeat<0x00a6> native) +{ + bool rv = true; + rv &= native_to_network(&network->soff1, native.soff1); + rv &= native_to_network(&network->name_id, native.name_id); + rv &= native_to_network(&network->item_type, native.item_type); + rv &= native_to_network(&network->identify, native.identify); + rv &= native_to_network(&network->epos_id, native.epos_id); + rv &= native_to_network(&network->epos_stor, native.epos_stor); + rv &= native_to_network(&network->broken_or_attribute, native.broken_or_attribute); + rv &= native_to_network(&network->refine, native.refine); + rv &= native_to_network(&network->card0, native.card0); + rv &= native_to_network(&network->card1, native.card1); + rv &= native_to_network(&network->card2, native.card2); + rv &= native_to_network(&network->card3, native.card3); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x00a6> *native, NetPacket_Repeat<0x00a6> network) +{ + bool rv = true; + rv &= network_to_native(&native->soff1, network.soff1); + rv &= network_to_native(&native->name_id, network.name_id); + rv &= network_to_native(&native->item_type, network.item_type); + rv &= network_to_native(&native->identify, network.identify); + rv &= network_to_native(&native->epos_id, network.epos_id); + rv &= network_to_native(&native->epos_stor, network.epos_stor); + rv &= network_to_native(&native->broken_or_attribute, network.broken_or_attribute); + rv &= network_to_native(&native->refine, network.refine); + rv &= network_to_native(&native->card0, network.card0); + rv &= network_to_native(&native->card1, network.card1); + rv &= network_to_native(&native->card2, network.card2); + rv &= network_to_native(&native->card3, network.card3); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00a7> *network, Packet_Fixed<0x00a7> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->ioff2, native.ioff2); + rv &= native_to_network(&network->unused_id, native.unused_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00a7> *native, NetPacket_Fixed<0x00a7> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->ioff2, network.ioff2); + rv &= network_to_native(&native->unused_id, network.unused_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00a8> *network, Packet_Fixed<0x00a8> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->ioff2, native.ioff2); + rv &= native_to_network(&network->amount, native.amount); + rv &= native_to_network(&network->ok, native.ok); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00a8> *native, NetPacket_Fixed<0x00a8> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->ioff2, network.ioff2); + rv &= network_to_native(&native->amount, network.amount); + rv &= network_to_native(&native->ok, network.ok); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00a9> *network, Packet_Fixed<0x00a9> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->ioff2, native.ioff2); + rv &= native_to_network(&network->epos_ignored, native.epos_ignored); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00a9> *native, NetPacket_Fixed<0x00a9> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->ioff2, network.ioff2); + rv &= network_to_native(&native->epos_ignored, network.epos_ignored); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00aa> *network, Packet_Fixed<0x00aa> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->ioff2, native.ioff2); + rv &= native_to_network(&network->epos, native.epos); + rv &= native_to_network(&network->ok, native.ok); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00aa> *native, NetPacket_Fixed<0x00aa> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->ioff2, network.ioff2); + rv &= network_to_native(&native->epos, network.epos); + rv &= network_to_native(&native->ok, network.ok); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00ab> *network, Packet_Fixed<0x00ab> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->ioff2, native.ioff2); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00ab> *native, NetPacket_Fixed<0x00ab> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->ioff2, network.ioff2); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00ac> *network, Packet_Fixed<0x00ac> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->ioff2, native.ioff2); + rv &= native_to_network(&network->epos, native.epos); + rv &= native_to_network(&network->ok, native.ok); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00ac> *native, NetPacket_Fixed<0x00ac> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->ioff2, network.ioff2); + rv &= network_to_native(&native->epos, network.epos); + rv &= network_to_native(&native->ok, network.ok); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00af> *network, Packet_Fixed<0x00af> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->ioff2, native.ioff2); + rv &= native_to_network(&network->amount, native.amount); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00af> *native, NetPacket_Fixed<0x00af> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->ioff2, network.ioff2); + rv &= network_to_native(&native->amount, network.amount); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00b0> *network, Packet_Fixed<0x00b0> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->sp_type, native.sp_type); + rv &= native_to_network(&network->value, native.value); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00b0> *native, NetPacket_Fixed<0x00b0> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->sp_type, network.sp_type); + rv &= network_to_native(&native->value, network.value); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00b1> *network, Packet_Fixed<0x00b1> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->sp_type, native.sp_type); + rv &= native_to_network(&network->value, native.value); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00b1> *native, NetPacket_Fixed<0x00b1> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->sp_type, network.sp_type); + rv &= network_to_native(&native->value, network.value); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00b2> *network, Packet_Fixed<0x00b2> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->flag, native.flag); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00b2> *native, NetPacket_Fixed<0x00b2> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->flag, network.flag); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00b3> *network, Packet_Fixed<0x00b3> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->one, native.one); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00b3> *native, NetPacket_Fixed<0x00b3> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->one, network.one); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x00b4> *network, Packet_Head<0x00b4> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + rv &= native_to_network(&network->block_id, native.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x00b4> *native, NetPacket_Head<0x00b4> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + rv &= network_to_native(&native->block_id, network.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x00b4> *network, Packet_Repeat<0x00b4> native) +{ + bool rv = true; + rv &= native_to_network(&network->c, native.c); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x00b4> *native, NetPacket_Repeat<0x00b4> network) +{ + bool rv = true; + rv &= network_to_native(&native->c, network.c); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00b5> *network, Packet_Fixed<0x00b5> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00b5> *native, NetPacket_Fixed<0x00b5> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00b6> *network, Packet_Fixed<0x00b6> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00b6> *native, NetPacket_Fixed<0x00b6> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x00b7> *network, Packet_Head<0x00b7> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + rv &= native_to_network(&network->block_id, native.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x00b7> *native, NetPacket_Head<0x00b7> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + rv &= network_to_native(&native->block_id, network.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x00b7> *network, Packet_Repeat<0x00b7> native) +{ + bool rv = true; + rv &= native_to_network(&network->c, native.c); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x00b7> *native, NetPacket_Repeat<0x00b7> network) +{ + bool rv = true; + rv &= network_to_native(&native->c, network.c); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00b8> *network, Packet_Fixed<0x00b8> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->npc_id, native.npc_id); + rv &= native_to_network(&network->menu_entry, native.menu_entry); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00b8> *native, NetPacket_Fixed<0x00b8> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->npc_id, network.npc_id); + rv &= network_to_native(&native->menu_entry, network.menu_entry); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00b9> *network, Packet_Fixed<0x00b9> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->npc_id, native.npc_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00b9> *native, NetPacket_Fixed<0x00b9> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->npc_id, network.npc_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00bb> *network, Packet_Fixed<0x00bb> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->asp, native.asp); + rv &= native_to_network(&network->unused, native.unused); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00bb> *native, NetPacket_Fixed<0x00bb> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->asp, network.asp); + rv &= network_to_native(&native->unused, network.unused); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00bc> *network, Packet_Fixed<0x00bc> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->sp_type, native.sp_type); + rv &= native_to_network(&network->ok, native.ok); + rv &= native_to_network(&network->val, native.val); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00bc> *native, NetPacket_Fixed<0x00bc> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->sp_type, network.sp_type); + rv &= network_to_native(&native->ok, network.ok); + rv &= network_to_native(&native->val, network.val); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00bd> *network, Packet_Fixed<0x00bd> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->status_point, native.status_point); + rv &= native_to_network(&network->str_attr, native.str_attr); + rv &= native_to_network(&network->str_upd, native.str_upd); + rv &= native_to_network(&network->agi_attr, native.agi_attr); + rv &= native_to_network(&network->agi_upd, native.agi_upd); + rv &= native_to_network(&network->vit_attr, native.vit_attr); + rv &= native_to_network(&network->vit_upd, native.vit_upd); + rv &= native_to_network(&network->int_attr, native.int_attr); + rv &= native_to_network(&network->int_upd, native.int_upd); + rv &= native_to_network(&network->dex_attr, native.dex_attr); + rv &= native_to_network(&network->dex_upd, native.dex_upd); + rv &= native_to_network(&network->luk_attr, native.luk_attr); + rv &= native_to_network(&network->luk_upd, native.luk_upd); + rv &= native_to_network(&network->atk_sum, native.atk_sum); + rv &= native_to_network(&network->watk2, native.watk2); + rv &= native_to_network(&network->matk1, native.matk1); + rv &= native_to_network(&network->matk2, native.matk2); + rv &= native_to_network(&network->def, native.def); + rv &= native_to_network(&network->def2, native.def2); + rv &= native_to_network(&network->mdef, native.mdef); + rv &= native_to_network(&network->mdef2, native.mdef2); + rv &= native_to_network(&network->hit, native.hit); + rv &= native_to_network(&network->flee, native.flee); + rv &= native_to_network(&network->flee2, native.flee2); + rv &= native_to_network(&network->critical, native.critical); + rv &= native_to_network(&network->karma, native.karma); + rv &= native_to_network(&network->manner, native.manner); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00bd> *native, NetPacket_Fixed<0x00bd> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->status_point, network.status_point); + rv &= network_to_native(&native->str_attr, network.str_attr); + rv &= network_to_native(&native->str_upd, network.str_upd); + rv &= network_to_native(&native->agi_attr, network.agi_attr); + rv &= network_to_native(&native->agi_upd, network.agi_upd); + rv &= network_to_native(&native->vit_attr, network.vit_attr); + rv &= network_to_native(&native->vit_upd, network.vit_upd); + rv &= network_to_native(&native->int_attr, network.int_attr); + rv &= network_to_native(&native->int_upd, network.int_upd); + rv &= network_to_native(&native->dex_attr, network.dex_attr); + rv &= network_to_native(&native->dex_upd, network.dex_upd); + rv &= network_to_native(&native->luk_attr, network.luk_attr); + rv &= network_to_native(&native->luk_upd, network.luk_upd); + rv &= network_to_native(&native->atk_sum, network.atk_sum); + rv &= network_to_native(&native->watk2, network.watk2); + rv &= network_to_native(&native->matk1, network.matk1); + rv &= network_to_native(&native->matk2, network.matk2); + rv &= network_to_native(&native->def, network.def); + rv &= network_to_native(&native->def2, network.def2); + rv &= network_to_native(&native->mdef, network.mdef); + rv &= network_to_native(&native->mdef2, network.mdef2); + rv &= network_to_native(&native->hit, network.hit); + rv &= network_to_native(&native->flee, network.flee); + rv &= network_to_native(&native->flee2, network.flee2); + rv &= network_to_native(&native->critical, network.critical); + rv &= network_to_native(&native->karma, network.karma); + rv &= network_to_native(&native->manner, network.manner); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00be> *network, Packet_Fixed<0x00be> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->sp_type, native.sp_type); + rv &= native_to_network(&network->value, native.value); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00be> *native, NetPacket_Fixed<0x00be> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->sp_type, network.sp_type); + rv &= network_to_native(&native->value, network.value); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00bf> *network, Packet_Fixed<0x00bf> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->emote, native.emote); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00bf> *native, NetPacket_Fixed<0x00bf> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->emote, network.emote); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00c0> *network, Packet_Fixed<0x00c0> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->type, native.type); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00c0> *native, NetPacket_Fixed<0x00c0> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->type, network.type); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00c1> *network, Packet_Fixed<0x00c1> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00c1> *native, NetPacket_Fixed<0x00c1> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00c2> *network, Packet_Fixed<0x00c2> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->users, native.users); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00c2> *native, NetPacket_Fixed<0x00c2> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->users, network.users); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00c4> *network, Packet_Fixed<0x00c4> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00c4> *native, NetPacket_Fixed<0x00c4> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00c5> *network, Packet_Fixed<0x00c5> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->type, native.type); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00c5> *native, NetPacket_Fixed<0x00c5> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->type, network.type); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x00c6> *network, Packet_Head<0x00c6> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x00c6> *native, NetPacket_Head<0x00c6> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x00c6> *network, Packet_Repeat<0x00c6> native) +{ + bool rv = true; + rv &= native_to_network(&network->base_price, native.base_price); + rv &= native_to_network(&network->actual_price, native.actual_price); + rv &= native_to_network(&network->type, native.type); + rv &= native_to_network(&network->name_id, native.name_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x00c6> *native, NetPacket_Repeat<0x00c6> network) +{ + bool rv = true; + rv &= network_to_native(&native->base_price, network.base_price); + rv &= network_to_native(&native->actual_price, network.actual_price); + rv &= network_to_native(&native->type, network.type); + rv &= network_to_native(&native->name_id, network.name_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x00c7> *network, Packet_Head<0x00c7> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x00c7> *native, NetPacket_Head<0x00c7> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x00c7> *network, Packet_Repeat<0x00c7> native) +{ + bool rv = true; + rv &= native_to_network(&network->ioff2, native.ioff2); + rv &= native_to_network(&network->base_price, native.base_price); + rv &= native_to_network(&network->actual_price, native.actual_price); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x00c7> *native, NetPacket_Repeat<0x00c7> network) +{ + bool rv = true; + rv &= network_to_native(&native->ioff2, network.ioff2); + rv &= network_to_native(&native->base_price, network.base_price); + rv &= network_to_native(&native->actual_price, network.actual_price); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x00c8> *network, Packet_Head<0x00c8> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x00c8> *native, NetPacket_Head<0x00c8> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x00c8> *network, Packet_Repeat<0x00c8> native) +{ + bool rv = true; + rv &= native_to_network(&network->count, native.count); + rv &= native_to_network(&network->name_id, native.name_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x00c8> *native, NetPacket_Repeat<0x00c8> network) +{ + bool rv = true; + rv &= network_to_native(&native->count, network.count); + rv &= network_to_native(&native->name_id, network.name_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x00c9> *network, Packet_Head<0x00c9> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x00c9> *native, NetPacket_Head<0x00c9> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x00c9> *network, Packet_Repeat<0x00c9> native) +{ + bool rv = true; + rv &= native_to_network(&network->ioff2, native.ioff2); + rv &= native_to_network(&network->count, native.count); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x00c9> *native, NetPacket_Repeat<0x00c9> network) +{ + bool rv = true; + rv &= network_to_native(&native->ioff2, network.ioff2); + rv &= network_to_native(&native->count, network.count); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00ca> *network, Packet_Fixed<0x00ca> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->fail, native.fail); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00ca> *native, NetPacket_Fixed<0x00ca> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->fail, network.fail); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00cb> *network, Packet_Fixed<0x00cb> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->fail, native.fail); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00cb> *native, NetPacket_Fixed<0x00cb> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->fail, network.fail); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00cd> *network, Packet_Fixed<0x00cd> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->account_id, native.account_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00cd> *native, NetPacket_Fixed<0x00cd> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->account_id, network.account_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00e4> *network, Packet_Fixed<0x00e4> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00e4> *native, NetPacket_Fixed<0x00e4> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00e5> *network, Packet_Fixed<0x00e5> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->char_name, native.char_name); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00e5> *native, NetPacket_Fixed<0x00e5> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->char_name, network.char_name); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00e6> *network, Packet_Fixed<0x00e6> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->type, native.type); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00e6> *native, NetPacket_Fixed<0x00e6> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->type, network.type); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00e7> *network, Packet_Fixed<0x00e7> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->type, native.type); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00e7> *native, NetPacket_Fixed<0x00e7> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->type, network.type); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00e8> *network, Packet_Fixed<0x00e8> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->zeny_or_ioff2, native.zeny_or_ioff2); + rv &= native_to_network(&network->amount, native.amount); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00e8> *native, NetPacket_Fixed<0x00e8> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->zeny_or_ioff2, network.zeny_or_ioff2); + rv &= network_to_native(&native->amount, network.amount); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00e9> *network, Packet_Fixed<0x00e9> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->amount, native.amount); + rv &= native_to_network(&network->name_id, native.name_id); + rv &= native_to_network(&network->identify, native.identify); + rv &= native_to_network(&network->broken_or_attribute, native.broken_or_attribute); + rv &= native_to_network(&network->refine, native.refine); + rv &= native_to_network(&network->card0, native.card0); + rv &= native_to_network(&network->card1, native.card1); + rv &= native_to_network(&network->card2, native.card2); + rv &= native_to_network(&network->card3, native.card3); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00e9> *native, NetPacket_Fixed<0x00e9> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->amount, network.amount); + rv &= network_to_native(&native->name_id, network.name_id); + rv &= network_to_native(&native->identify, network.identify); + rv &= network_to_native(&native->broken_or_attribute, network.broken_or_attribute); + rv &= network_to_native(&native->refine, network.refine); + rv &= network_to_native(&native->card0, network.card0); + rv &= network_to_native(&native->card1, network.card1); + rv &= network_to_native(&native->card2, network.card2); + rv &= network_to_native(&native->card3, network.card3); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00eb> *network, Packet_Fixed<0x00eb> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00eb> *native, NetPacket_Fixed<0x00eb> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00ec> *network, Packet_Fixed<0x00ec> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->fail, native.fail); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00ec> *native, NetPacket_Fixed<0x00ec> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->fail, network.fail); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00ed> *network, Packet_Fixed<0x00ed> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00ed> *native, NetPacket_Fixed<0x00ed> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00ee> *network, Packet_Fixed<0x00ee> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00ee> *native, NetPacket_Fixed<0x00ee> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00ef> *network, Packet_Fixed<0x00ef> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00ef> *native, NetPacket_Fixed<0x00ef> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00f0> *network, Packet_Fixed<0x00f0> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->fail, native.fail); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00f0> *native, NetPacket_Fixed<0x00f0> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->fail, network.fail); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00f2> *network, Packet_Fixed<0x00f2> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->current_slots, native.current_slots); + rv &= native_to_network(&network->max_slots, native.max_slots); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00f2> *native, NetPacket_Fixed<0x00f2> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->current_slots, network.current_slots); + rv &= network_to_native(&native->max_slots, network.max_slots); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00f3> *network, Packet_Fixed<0x00f3> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->ioff2, native.ioff2); + rv &= native_to_network(&network->amount, native.amount); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00f3> *native, NetPacket_Fixed<0x00f3> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->ioff2, network.ioff2); + rv &= network_to_native(&native->amount, network.amount); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00f4> *network, Packet_Fixed<0x00f4> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->soff1, native.soff1); + rv &= native_to_network(&network->amount, native.amount); + rv &= native_to_network(&network->name_id, native.name_id); + rv &= native_to_network(&network->identify, native.identify); + rv &= native_to_network(&network->broken_or_attribute, native.broken_or_attribute); + rv &= native_to_network(&network->refine, native.refine); + rv &= native_to_network(&network->card0, native.card0); + rv &= native_to_network(&network->card1, native.card1); + rv &= native_to_network(&network->card2, native.card2); + rv &= native_to_network(&network->card3, native.card3); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00f4> *native, NetPacket_Fixed<0x00f4> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->soff1, network.soff1); + rv &= network_to_native(&native->amount, network.amount); + rv &= network_to_native(&native->name_id, network.name_id); + rv &= network_to_native(&native->identify, network.identify); + rv &= network_to_native(&native->broken_or_attribute, network.broken_or_attribute); + rv &= network_to_native(&native->refine, network.refine); + rv &= network_to_native(&native->card0, network.card0); + rv &= network_to_native(&native->card1, network.card1); + rv &= network_to_native(&native->card2, network.card2); + rv &= network_to_native(&native->card3, network.card3); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00f5> *network, Packet_Fixed<0x00f5> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->soff1, native.soff1); + rv &= native_to_network(&network->amount, native.amount); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00f5> *native, NetPacket_Fixed<0x00f5> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->soff1, network.soff1); + rv &= network_to_native(&native->amount, network.amount); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00f6> *network, Packet_Fixed<0x00f6> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->soff1, native.soff1); + rv &= native_to_network(&network->amount, native.amount); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00f6> *native, NetPacket_Fixed<0x00f6> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->soff1, network.soff1); + rv &= network_to_native(&native->amount, network.amount); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00f7> *network, Packet_Fixed<0x00f7> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00f7> *native, NetPacket_Fixed<0x00f7> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00f8> *network, Packet_Fixed<0x00f8> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00f8> *native, NetPacket_Fixed<0x00f8> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00f9> *network, Packet_Fixed<0x00f9> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->party_name, native.party_name); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00f9> *native, NetPacket_Fixed<0x00f9> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->party_name, network.party_name); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00fa> *network, Packet_Fixed<0x00fa> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->flag, native.flag); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00fa> *native, NetPacket_Fixed<0x00fa> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->flag, network.flag); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x00fb> *network, Packet_Head<0x00fb> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + rv &= native_to_network(&network->party_name, native.party_name); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x00fb> *native, NetPacket_Head<0x00fb> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + rv &= network_to_native(&native->party_name, network.party_name); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x00fb> *network, Packet_Repeat<0x00fb> native) +{ + bool rv = true; + rv &= native_to_network(&network->account_id, native.account_id); + rv &= native_to_network(&network->char_name, native.char_name); + rv &= native_to_network(&network->map_name, native.map_name); + rv &= native_to_network(&network->leader, native.leader); + rv &= native_to_network(&network->online, native.online); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x00fb> *native, NetPacket_Repeat<0x00fb> network) +{ + bool rv = true; + rv &= network_to_native(&native->account_id, network.account_id); + rv &= network_to_native(&native->char_name, network.char_name); + rv &= network_to_native(&native->map_name, network.map_name); + rv &= network_to_native(&native->leader, network.leader); + rv &= network_to_native(&native->online, network.online); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00fc> *network, Packet_Fixed<0x00fc> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->account_id, native.account_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00fc> *native, NetPacket_Fixed<0x00fc> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->account_id, network.account_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00fd> *network, Packet_Fixed<0x00fd> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->char_name, native.char_name); + rv &= native_to_network(&network->flag, native.flag); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00fd> *native, NetPacket_Fixed<0x00fd> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->char_name, network.char_name); + rv &= network_to_native(&native->flag, network.flag); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00fe> *network, Packet_Fixed<0x00fe> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->account_id, native.account_id); + rv &= native_to_network(&network->party_name, native.party_name); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00fe> *native, NetPacket_Fixed<0x00fe> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->account_id, network.account_id); + rv &= network_to_native(&native->party_name, network.party_name); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x00ff> *network, Packet_Fixed<0x00ff> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->account_id, native.account_id); + rv &= native_to_network(&network->flag, native.flag); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x00ff> *native, NetPacket_Fixed<0x00ff> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->account_id, network.account_id); + rv &= network_to_native(&native->flag, network.flag); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0100> *network, Packet_Fixed<0x0100> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0100> *native, NetPacket_Fixed<0x0100> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0101> *network, Packet_Fixed<0x0101> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->exp, native.exp); + rv &= native_to_network(&network->item, native.item); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0101> *native, NetPacket_Fixed<0x0101> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->exp, network.exp); + rv &= network_to_native(&native->item, network.item); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0102> *network, Packet_Fixed<0x0102> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->exp, native.exp); + rv &= native_to_network(&network->item, native.item); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0102> *native, NetPacket_Fixed<0x0102> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->exp, network.exp); + rv &= network_to_native(&native->item, network.item); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0103> *network, Packet_Fixed<0x0103> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->account_id, native.account_id); + rv &= native_to_network(&network->unused_char_name, native.unused_char_name); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0103> *native, NetPacket_Fixed<0x0103> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->account_id, network.account_id); + rv &= network_to_native(&native->unused_char_name, network.unused_char_name); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0105> *network, Packet_Fixed<0x0105> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->account_id, native.account_id); + rv &= native_to_network(&network->char_name, native.char_name); + rv &= native_to_network(&network->flag, native.flag); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0105> *native, NetPacket_Fixed<0x0105> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->account_id, network.account_id); + rv &= network_to_native(&native->char_name, network.char_name); + rv &= network_to_native(&native->flag, network.flag); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0106> *network, Packet_Fixed<0x0106> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->account_id, native.account_id); + rv &= native_to_network(&network->hp, native.hp); + rv &= native_to_network(&network->max_hp, native.max_hp); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0106> *native, NetPacket_Fixed<0x0106> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->account_id, network.account_id); + rv &= network_to_native(&native->hp, network.hp); + rv &= network_to_native(&native->max_hp, network.max_hp); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0107> *network, Packet_Fixed<0x0107> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->account_id, native.account_id); + rv &= native_to_network(&network->x, native.x); + rv &= native_to_network(&network->y, native.y); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0107> *native, NetPacket_Fixed<0x0107> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->account_id, network.account_id); + rv &= network_to_native(&native->x, network.x); + rv &= network_to_native(&native->y, network.y); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x0108> *network, Packet_Head<0x0108> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x0108> *native, NetPacket_Head<0x0108> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x0108> *network, Packet_Repeat<0x0108> native) +{ + bool rv = true; + rv &= native_to_network(&network->c, native.c); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x0108> *native, NetPacket_Repeat<0x0108> network) +{ + bool rv = true; + rv &= network_to_native(&native->c, network.c); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x0109> *network, Packet_Head<0x0109> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + rv &= native_to_network(&network->account_id, native.account_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x0109> *native, NetPacket_Head<0x0109> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + rv &= network_to_native(&native->account_id, network.account_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x0109> *network, Packet_Repeat<0x0109> native) +{ + bool rv = true; + rv &= native_to_network(&network->c, native.c); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x0109> *native, NetPacket_Repeat<0x0109> network) +{ + bool rv = true; + rv &= network_to_native(&native->c, network.c); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x010c> *network, Packet_Fixed<0x010c> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x010c> *native, NetPacket_Fixed<0x010c> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x010e> *network, Packet_Fixed<0x010e> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->skill_id, native.skill_id); + rv &= native_to_network(&network->level, native.level); + rv &= native_to_network(&network->sp, native.sp); + rv &= native_to_network(&network->range, native.range); + rv &= native_to_network(&network->can_raise, native.can_raise); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x010e> *native, NetPacket_Fixed<0x010e> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->skill_id, network.skill_id); + rv &= network_to_native(&native->level, network.level); + rv &= network_to_native(&native->sp, network.sp); + rv &= network_to_native(&native->range, network.range); + rv &= network_to_native(&native->can_raise, network.can_raise); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x010f> *network, Packet_Head<0x010f> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x010f> *native, NetPacket_Head<0x010f> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x010f> *network, Packet_Repeat<0x010f> native) +{ + bool rv = true; + rv &= native_to_network(&network->info, native.info); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x010f> *native, NetPacket_Repeat<0x010f> network) +{ + bool rv = true; + rv &= network_to_native(&native->info, network.info); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0110> *network, Packet_Fixed<0x0110> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->skill_id, native.skill_id); + rv &= native_to_network(&network->btype, native.btype); + rv &= native_to_network(&network->zero1, native.zero1); + rv &= native_to_network(&network->zero2, native.zero2); + rv &= native_to_network(&network->type, native.type); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0110> *native, NetPacket_Fixed<0x0110> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->skill_id, network.skill_id); + rv &= network_to_native(&native->btype, network.btype); + rv &= network_to_native(&native->zero1, network.zero1); + rv &= network_to_native(&native->zero2, network.zero2); + rv &= network_to_native(&native->type, network.type); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0112> *network, Packet_Fixed<0x0112> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->skill_id, native.skill_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0112> *native, NetPacket_Fixed<0x0112> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->skill_id, network.skill_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0118> *network, Packet_Fixed<0x0118> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0118> *native, NetPacket_Fixed<0x0118> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0119> *network, Packet_Fixed<0x0119> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->opt1, native.opt1); + rv &= native_to_network(&network->opt2, native.opt2); + rv &= native_to_network(&network->option, native.option); + rv &= native_to_network(&network->zero, native.zero); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0119> *native, NetPacket_Fixed<0x0119> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->opt1, network.opt1); + rv &= network_to_native(&native->opt2, network.opt2); + rv &= network_to_native(&native->option, network.option); + rv &= network_to_native(&native->zero, network.zero); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0139> *network, Packet_Fixed<0x0139> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->bl_x, native.bl_x); + rv &= native_to_network(&network->bl_y, native.bl_y); + rv &= native_to_network(&network->sd_x, native.sd_x); + rv &= native_to_network(&network->sd_y, native.sd_y); + rv &= native_to_network(&network->range, native.range); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0139> *native, NetPacket_Fixed<0x0139> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->bl_x, network.bl_x); + rv &= network_to_native(&native->bl_y, network.bl_y); + rv &= network_to_native(&native->sd_x, network.sd_x); + rv &= network_to_native(&native->sd_y, network.sd_y); + rv &= network_to_native(&native->range, network.range); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x013a> *network, Packet_Fixed<0x013a> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->attack_range, native.attack_range); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x013a> *native, NetPacket_Fixed<0x013a> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->attack_range, network.attack_range); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x013b> *network, Packet_Fixed<0x013b> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->type, native.type); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x013b> *native, NetPacket_Fixed<0x013b> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->type, network.type); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x013c> *network, Packet_Fixed<0x013c> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->ioff2, native.ioff2); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x013c> *native, NetPacket_Fixed<0x013c> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->ioff2, network.ioff2); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0141> *network, Packet_Fixed<0x0141> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->sp_type, native.sp_type); + rv &= native_to_network(&network->zero, native.zero); + rv &= native_to_network(&network->value_status, native.value_status); + rv &= native_to_network(&network->value_b_e, native.value_b_e); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0141> *native, NetPacket_Fixed<0x0141> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->sp_type, network.sp_type); + rv &= network_to_native(&native->zero, network.zero); + rv &= network_to_native(&native->value_status, network.value_status); + rv &= network_to_native(&native->value_b_e, network.value_b_e); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0142> *network, Packet_Fixed<0x0142> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0142> *native, NetPacket_Fixed<0x0142> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0143> *network, Packet_Fixed<0x0143> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->input_int_value, native.input_int_value); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0143> *native, NetPacket_Fixed<0x0143> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->input_int_value, network.input_int_value); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0146> *network, Packet_Fixed<0x0146> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0146> *native, NetPacket_Fixed<0x0146> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0147> *network, Packet_Fixed<0x0147> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->info, native.info); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0147> *native, NetPacket_Fixed<0x0147> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->info, network.info); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0148> *network, Packet_Fixed<0x0148> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->type, native.type); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0148> *native, NetPacket_Fixed<0x0148> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->type, network.type); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x014d> *network, Packet_Fixed<0x014d> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x014d> *native, NetPacket_Fixed<0x014d> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x018a> *network, Packet_Fixed<0x018a> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->unused, native.unused); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x018a> *native, NetPacket_Fixed<0x018a> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->unused, network.unused); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x018b> *network, Packet_Fixed<0x018b> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->okay, native.okay); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x018b> *native, NetPacket_Fixed<0x018b> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->okay, network.okay); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0195> *network, Packet_Fixed<0x0195> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->party_name, native.party_name); + rv &= native_to_network(&network->guild_name, native.guild_name); + rv &= native_to_network(&network->guild_pos, native.guild_pos); + rv &= native_to_network(&network->guild_pos_again, native.guild_pos_again); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0195> *native, NetPacket_Fixed<0x0195> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->party_name, network.party_name); + rv &= network_to_native(&native->guild_name, network.guild_name); + rv &= network_to_native(&native->guild_pos, network.guild_pos); + rv &= network_to_native(&native->guild_pos_again, network.guild_pos_again); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x0196> *network, Packet_Fixed<0x0196> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->sc_type, native.sc_type); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->flag, native.flag); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x0196> *native, NetPacket_Fixed<0x0196> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->sc_type, network.sc_type); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->flag, network.flag); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x019b> *network, Packet_Fixed<0x019b> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->type, native.type); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x019b> *native, NetPacket_Fixed<0x019b> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->type, network.type); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x01b1> *network, Packet_Fixed<0x01b1> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->ioff2, native.ioff2); + rv &= native_to_network(&network->amount, native.amount); + rv &= native_to_network(&network->fail, native.fail); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x01b1> *native, NetPacket_Fixed<0x01b1> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->ioff2, network.ioff2); + rv &= network_to_native(&native->amount, network.amount); + rv &= network_to_native(&native->fail, network.fail); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x01c8> *network, Packet_Fixed<0x01c8> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->ioff2, native.ioff2); + rv &= native_to_network(&network->name_id, native.name_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->amount, native.amount); + rv &= native_to_network(&network->ok, native.ok); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x01c8> *native, NetPacket_Fixed<0x01c8> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->ioff2, network.ioff2); + rv &= network_to_native(&native->name_id, network.name_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->amount, network.amount); + rv &= network_to_native(&native->ok, network.ok); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x01d4> *network, Packet_Fixed<0x01d4> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x01d4> *native, NetPacket_Fixed<0x01d4> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x01d5> *network, Packet_Head<0x01d5> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + rv &= native_to_network(&network->block_id, native.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x01d5> *native, NetPacket_Head<0x01d5> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + rv &= network_to_native(&native->block_id, network.block_id); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x01d5> *network, Packet_Repeat<0x01d5> native) +{ + bool rv = true; + rv &= native_to_network(&network->c, native.c); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x01d5> *native, NetPacket_Repeat<0x01d5> network) +{ + bool rv = true; + rv &= network_to_native(&native->c, network.c); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x01d7> *network, Packet_Fixed<0x01d7> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->look_type, native.look_type); + rv &= native_to_network(&network->weapon_or_name_id_or_value, native.weapon_or_name_id_or_value); + rv &= native_to_network(&network->shield, native.shield); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x01d7> *native, NetPacket_Fixed<0x01d7> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->look_type, network.look_type); + rv &= network_to_native(&native->weapon_or_name_id_or_value, network.weapon_or_name_id_or_value); + rv &= network_to_native(&native->shield, network.shield); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x01d8> *network, Packet_Fixed<0x01d8> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->speed, native.speed); + rv &= native_to_network(&network->opt1, native.opt1); + rv &= native_to_network(&network->opt2, native.opt2); + rv &= native_to_network(&network->option, native.option); + rv &= native_to_network(&network->species, native.species); + rv &= native_to_network(&network->hair_style, native.hair_style); + rv &= native_to_network(&network->weapon, native.weapon); + rv &= native_to_network(&network->shield, native.shield); + rv &= native_to_network(&network->head_bottom, native.head_bottom); + rv &= native_to_network(&network->head_top, native.head_top); + rv &= native_to_network(&network->head_mid, native.head_mid); + rv &= native_to_network(&network->hair_color, native.hair_color); + rv &= native_to_network(&network->clothes_color, native.clothes_color); + rv &= native_to_network(&network->head_dir, native.head_dir); + rv &= native_to_network(&network->unused2, native.unused2); + rv &= native_to_network(&network->guild_id, native.guild_id); + rv &= native_to_network(&network->guild_emblem_id, native.guild_emblem_id); + rv &= native_to_network(&network->manner, native.manner); + rv &= native_to_network(&network->opt3, native.opt3); + rv &= native_to_network(&network->karma, native.karma); + rv &= native_to_network(&network->sex, native.sex); + rv &= native_to_network(&network->pos, native.pos); + rv &= native_to_network(&network->gm_bits, native.gm_bits); + rv &= native_to_network(&network->dead_sit, native.dead_sit); + rv &= native_to_network(&network->unused, native.unused); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x01d8> *native, NetPacket_Fixed<0x01d8> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->speed, network.speed); + rv &= network_to_native(&native->opt1, network.opt1); + rv &= network_to_native(&native->opt2, network.opt2); + rv &= network_to_native(&native->option, network.option); + rv &= network_to_native(&native->species, network.species); + rv &= network_to_native(&native->hair_style, network.hair_style); + rv &= network_to_native(&native->weapon, network.weapon); + rv &= network_to_native(&native->shield, network.shield); + rv &= network_to_native(&native->head_bottom, network.head_bottom); + rv &= network_to_native(&native->head_top, network.head_top); + rv &= network_to_native(&native->head_mid, network.head_mid); + rv &= network_to_native(&native->hair_color, network.hair_color); + rv &= network_to_native(&native->clothes_color, network.clothes_color); + rv &= network_to_native(&native->head_dir, network.head_dir); + rv &= network_to_native(&native->unused2, network.unused2); + rv &= network_to_native(&native->guild_id, network.guild_id); + rv &= network_to_native(&native->guild_emblem_id, network.guild_emblem_id); + rv &= network_to_native(&native->manner, network.manner); + rv &= network_to_native(&native->opt3, network.opt3); + rv &= network_to_native(&native->karma, network.karma); + rv &= network_to_native(&native->sex, network.sex); + rv &= network_to_native(&native->pos, network.pos); + rv &= network_to_native(&native->gm_bits, network.gm_bits); + rv &= network_to_native(&native->dead_sit, network.dead_sit); + rv &= network_to_native(&native->unused, network.unused); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x01d9> *network, Packet_Fixed<0x01d9> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->speed, native.speed); + rv &= native_to_network(&network->opt1, native.opt1); + rv &= native_to_network(&network->opt2, native.opt2); + rv &= native_to_network(&network->option, native.option); + rv &= native_to_network(&network->species, native.species); + rv &= native_to_network(&network->hair_style, native.hair_style); + rv &= native_to_network(&network->weapon, native.weapon); + rv &= native_to_network(&network->shield, native.shield); + rv &= native_to_network(&network->head_bottom, native.head_bottom); + rv &= native_to_network(&network->head_top, native.head_top); + rv &= native_to_network(&network->head_mid, native.head_mid); + rv &= native_to_network(&network->hair_color, native.hair_color); + rv &= native_to_network(&network->clothes_color, native.clothes_color); + rv &= native_to_network(&network->head_dir, native.head_dir); + rv &= native_to_network(&network->unused2, native.unused2); + rv &= native_to_network(&network->guild_id, native.guild_id); + rv &= native_to_network(&network->guild_emblem_id, native.guild_emblem_id); + rv &= native_to_network(&network->manner, native.manner); + rv &= native_to_network(&network->opt3, native.opt3); + rv &= native_to_network(&network->karma, native.karma); + rv &= native_to_network(&network->sex, native.sex); + rv &= native_to_network(&network->pos, native.pos); + rv &= native_to_network(&network->gm_bits, native.gm_bits); + rv &= native_to_network(&network->unused, native.unused); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x01d9> *native, NetPacket_Fixed<0x01d9> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->speed, network.speed); + rv &= network_to_native(&native->opt1, network.opt1); + rv &= network_to_native(&native->opt2, network.opt2); + rv &= network_to_native(&native->option, network.option); + rv &= network_to_native(&native->species, network.species); + rv &= network_to_native(&native->hair_style, network.hair_style); + rv &= network_to_native(&native->weapon, network.weapon); + rv &= network_to_native(&native->shield, network.shield); + rv &= network_to_native(&native->head_bottom, network.head_bottom); + rv &= network_to_native(&native->head_top, network.head_top); + rv &= network_to_native(&native->head_mid, network.head_mid); + rv &= network_to_native(&native->hair_color, network.hair_color); + rv &= network_to_native(&native->clothes_color, network.clothes_color); + rv &= network_to_native(&native->head_dir, network.head_dir); + rv &= network_to_native(&native->unused2, network.unused2); + rv &= network_to_native(&native->guild_id, network.guild_id); + rv &= network_to_native(&native->guild_emblem_id, network.guild_emblem_id); + rv &= network_to_native(&native->manner, network.manner); + rv &= network_to_native(&native->opt3, network.opt3); + rv &= network_to_native(&native->karma, network.karma); + rv &= network_to_native(&native->sex, network.sex); + rv &= network_to_native(&native->pos, network.pos); + rv &= network_to_native(&native->gm_bits, network.gm_bits); + rv &= network_to_native(&native->unused, network.unused); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x01da> *network, Packet_Fixed<0x01da> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->speed, native.speed); + rv &= native_to_network(&network->opt1, native.opt1); + rv &= native_to_network(&network->opt2, native.opt2); + rv &= native_to_network(&network->option, native.option); + rv &= native_to_network(&network->species, native.species); + rv &= native_to_network(&network->hair_style, native.hair_style); + rv &= native_to_network(&network->weapon, native.weapon); + rv &= native_to_network(&network->shield, native.shield); + rv &= native_to_network(&network->head_bottom, native.head_bottom); + rv &= native_to_network(&network->tick, native.tick); + rv &= native_to_network(&network->head_top, native.head_top); + rv &= native_to_network(&network->head_mid, native.head_mid); + rv &= native_to_network(&network->hair_color, native.hair_color); + rv &= native_to_network(&network->clothes_color, native.clothes_color); + rv &= native_to_network(&network->head_dir, native.head_dir); + rv &= native_to_network(&network->unused2, native.unused2); + rv &= native_to_network(&network->guild_id, native.guild_id); + rv &= native_to_network(&network->guild_emblem_id, native.guild_emblem_id); + rv &= native_to_network(&network->manner, native.manner); + rv &= native_to_network(&network->opt3, native.opt3); + rv &= native_to_network(&network->karma, native.karma); + rv &= native_to_network(&network->sex, native.sex); + rv &= native_to_network(&network->pos2, native.pos2); + rv &= native_to_network(&network->gm_bits, native.gm_bits); + rv &= native_to_network(&network->five, native.five); + rv &= native_to_network(&network->unused, native.unused); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x01da> *native, NetPacket_Fixed<0x01da> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->speed, network.speed); + rv &= network_to_native(&native->opt1, network.opt1); + rv &= network_to_native(&native->opt2, network.opt2); + rv &= network_to_native(&native->option, network.option); + rv &= network_to_native(&native->species, network.species); + rv &= network_to_native(&native->hair_style, network.hair_style); + rv &= network_to_native(&native->weapon, network.weapon); + rv &= network_to_native(&native->shield, network.shield); + rv &= network_to_native(&native->head_bottom, network.head_bottom); + rv &= network_to_native(&native->tick, network.tick); + rv &= network_to_native(&native->head_top, network.head_top); + rv &= network_to_native(&native->head_mid, network.head_mid); + rv &= network_to_native(&native->hair_color, network.hair_color); + rv &= network_to_native(&native->clothes_color, network.clothes_color); + rv &= network_to_native(&native->head_dir, network.head_dir); + rv &= network_to_native(&native->unused2, network.unused2); + rv &= network_to_native(&native->guild_id, network.guild_id); + rv &= network_to_native(&native->guild_emblem_id, network.guild_emblem_id); + rv &= network_to_native(&native->manner, network.manner); + rv &= network_to_native(&native->opt3, network.opt3); + rv &= network_to_native(&native->karma, network.karma); + rv &= network_to_native(&native->sex, network.sex); + rv &= network_to_native(&native->pos2, network.pos2); + rv &= network_to_native(&native->gm_bits, network.gm_bits); + rv &= network_to_native(&native->five, network.five); + rv &= network_to_native(&native->unused, network.unused); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x01de> *network, Packet_Fixed<0x01de> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->skill_id, native.skill_id); + rv &= native_to_network(&network->src_id, native.src_id); + rv &= native_to_network(&network->dst_id, native.dst_id); + rv &= native_to_network(&network->tick, native.tick); + rv &= native_to_network(&network->sdelay, native.sdelay); + rv &= native_to_network(&network->ddelay, native.ddelay); + rv &= native_to_network(&network->damage, native.damage); + rv &= native_to_network(&network->skill_level, native.skill_level); + rv &= native_to_network(&network->div, native.div); + rv &= native_to_network(&network->type_or_hit, native.type_or_hit); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x01de> *native, NetPacket_Fixed<0x01de> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->skill_id, network.skill_id); + rv &= network_to_native(&native->src_id, network.src_id); + rv &= network_to_native(&native->dst_id, network.dst_id); + rv &= network_to_native(&native->tick, network.tick); + rv &= network_to_native(&native->sdelay, network.sdelay); + rv &= network_to_native(&native->ddelay, network.ddelay); + rv &= network_to_native(&native->damage, network.damage); + rv &= network_to_native(&native->skill_level, network.skill_level); + rv &= network_to_native(&native->div, network.div); + rv &= network_to_native(&native->type_or_hit, network.type_or_hit); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x01ee> *network, Packet_Head<0x01ee> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x01ee> *native, NetPacket_Head<0x01ee> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x01ee> *network, Packet_Repeat<0x01ee> native) +{ + bool rv = true; + rv &= native_to_network(&network->ioff2, native.ioff2); + rv &= native_to_network(&network->name_id, native.name_id); + rv &= native_to_network(&network->item_type, native.item_type); + rv &= native_to_network(&network->identify, native.identify); + rv &= native_to_network(&network->amount, native.amount); + rv &= native_to_network(&network->epos, native.epos); + rv &= native_to_network(&network->card0, native.card0); + rv &= native_to_network(&network->card1, native.card1); + rv &= native_to_network(&network->card2, native.card2); + rv &= native_to_network(&network->card3, native.card3); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x01ee> *native, NetPacket_Repeat<0x01ee> network) +{ + bool rv = true; + rv &= network_to_native(&native->ioff2, network.ioff2); + rv &= network_to_native(&native->name_id, network.name_id); + rv &= network_to_native(&native->item_type, network.item_type); + rv &= network_to_native(&native->identify, network.identify); + rv &= network_to_native(&native->amount, network.amount); + rv &= network_to_native(&native->epos, network.epos); + rv &= network_to_native(&native->card0, network.card0); + rv &= network_to_native(&native->card1, network.card1); + rv &= network_to_native(&native->card2, network.card2); + rv &= network_to_native(&native->card3, network.card3); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Head<0x01f0> *network, Packet_Head<0x01f0> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->magic_packet_length, native.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Head<0x01f0> *native, NetPacket_Head<0x01f0> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->magic_packet_length, network.magic_packet_length); + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Repeat<0x01f0> *network, Packet_Repeat<0x01f0> native) +{ + bool rv = true; + rv &= native_to_network(&network->soff1, native.soff1); + rv &= native_to_network(&network->name_id, native.name_id); + rv &= native_to_network(&network->item_type, native.item_type); + rv &= native_to_network(&network->identify, native.identify); + rv &= native_to_network(&network->amount, native.amount); + rv &= native_to_network(&network->epos_zero, native.epos_zero); + rv &= native_to_network(&network->card0, native.card0); + rv &= native_to_network(&network->card1, native.card1); + rv &= native_to_network(&network->card2, native.card2); + rv &= native_to_network(&network->card3, native.card3); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Repeat<0x01f0> *native, NetPacket_Repeat<0x01f0> network) +{ + bool rv = true; + rv &= network_to_native(&native->soff1, network.soff1); + rv &= network_to_native(&native->name_id, network.name_id); + rv &= network_to_native(&native->item_type, network.item_type); + rv &= network_to_native(&native->identify, network.identify); + rv &= network_to_native(&native->amount, network.amount); + rv &= network_to_native(&native->epos_zero, network.epos_zero); + rv &= network_to_native(&native->card0, network.card0); + rv &= network_to_native(&native->card1, network.card1); + rv &= network_to_native(&native->card2, network.card2); + rv &= network_to_native(&native->card3, network.card3); + return rv; +} + +inline __attribute__((warn_unused_result)) +bool native_to_network(NetPacket_Fixed<0x020c> *network, Packet_Fixed<0x020c> native) +{ + bool rv = true; + rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); + rv &= native_to_network(&network->block_id, native.block_id); + rv &= native_to_network(&network->ip, native.ip); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Packet_Fixed<0x020c> *native, NetPacket_Fixed<0x020c> network) +{ + bool rv = true; + rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); + rv &= network_to_native(&native->block_id, network.block_id); + rv &= network_to_native(&native->ip, network.ip); + return rv; +} inline __attribute__((warn_unused_result)) bool native_to_network(NetPacket_Fixed<0x0212> *network, Packet_Fixed<0x0212> native) @@ -90,6 +7931,6 @@ bool network_to_native(Packet_Fixed<0x0212> *native, NetPacket_Fixed<0x0212> net } -#pragma pack(pop) +# pragma pack(pop) #endif // TMWA_PROTO2_MAP_USER_HPP diff --git a/src/proto2/types.hpp b/src/proto2/types.hpp index 594be22..0113138 100644 --- a/src/proto2/types.hpp +++ b/src/proto2/types.hpp @@ -26,6 +26,7 @@ # include "../ints/little.hpp" # include "../strings/vstring.hpp" # include "../net/ip.hpp" +# include "../net/timer.t.hpp" # include "../mmo/enums.hpp" # include "../mmo/human_time_diff.hpp" # include "../mmo/ids.hpp" @@ -33,7 +34,9 @@ # include "../mmo/strs.hpp" # include "../mmo/utils.hpp" # include "../mmo/version.hpp" -# include "../login/types.hpp" +# include "../login/login.t.hpp" +# include "../map/clif.t.hpp" +# include "../map/skill.t.hpp" template<class T> bool native_to_network(T *network, T native) { @@ -124,6 +127,240 @@ bool network_to_native(U *native, SkewedLength<T, N> network) } inline __attribute__((warn_unused_result)) +bool native_to_network(Byte *network, DIR native) +{ + bool rv = true; + uint8_t tmp = static_cast<uint8_t>(native); + rv &= native_to_network(network, tmp); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(DIR *native, Byte network) +{ + bool rv = true; + uint8_t tmp; + rv &= network_to_native(&tmp, network); + *native = static_cast<DIR>(tmp); + // TODO this is what really should be doing a checked cast + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(Byte *network, BeingRemoveWhy native) +{ + bool rv = true; + uint8_t tmp = static_cast<uint8_t>(native); + rv &= native_to_network(network, tmp); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(BeingRemoveWhy *native, Byte network) +{ + bool rv = true; + uint8_t tmp; + rv &= network_to_native(&tmp, network); + *native = static_cast<BeingRemoveWhy>(tmp); + // TODO this is what really should be doing a checked cast + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(Little16 *network, Opt1 native) +{ + bool rv = true; + uint16_t tmp = static_cast<uint16_t>(native); + rv &= native_to_network(network, tmp); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Opt1 *native, Little16 network) +{ + bool rv = true; + uint16_t tmp; + rv &= network_to_native(&tmp, network); + *native = static_cast<Opt1>(tmp); + // TODO this is what really should be doing a checked cast + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(Little16 *network, Opt2 native) +{ + bool rv = true; + uint16_t tmp = static_cast<uint16_t>(native); + rv &= native_to_network(network, tmp); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Opt2 *native, Little16 network) +{ + bool rv = true; + uint16_t tmp; + rv &= network_to_native(&tmp, network); + *native = static_cast<Opt2>(tmp); + // TODO this is what really should be doing a checked cast + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(Little16 *network, Opt3 native) +{ + bool rv = true; + uint16_t tmp = static_cast<uint16_t>(native); + rv &= native_to_network(network, tmp); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(Opt3 *native, Little16 network) +{ + bool rv = true; + uint16_t tmp; + rv &= network_to_native(&tmp, network); + *native = static_cast<Opt3>(tmp); + // TODO this is what really should be doing a checked cast + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(Byte *network, ItemType native) +{ + bool rv = true; + uint8_t tmp = static_cast<uint8_t>(native); + rv &= native_to_network(network, tmp); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(ItemType *native, Byte network) +{ + bool rv = true; + uint8_t tmp; + rv &= network_to_native(&tmp, network); + *native = static_cast<ItemType>(tmp); + // TODO this is what really should be doing a checked cast + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(Byte *network, PickupFail native) +{ + bool rv = true; + uint8_t tmp = static_cast<uint8_t>(native); + rv &= native_to_network(network, tmp); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(PickupFail *native, Byte network) +{ + bool rv = true; + uint8_t tmp; + rv &= network_to_native(&tmp, network); + *native = static_cast<PickupFail>(tmp); + // TODO this is what really should be doing a checked cast + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(Byte *network, DamageType native) +{ + bool rv = true; + uint8_t tmp = static_cast<uint8_t>(native); + rv &= native_to_network(network, tmp); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(DamageType *native, Byte network) +{ + bool rv = true; + uint8_t tmp; + rv &= network_to_native(&tmp, network); + *native = static_cast<DamageType>(tmp); + // TODO this is what really should be doing a checked cast + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(Little16 *network, SP native) +{ + bool rv = true; + uint16_t tmp = static_cast<uint16_t>(native); + rv &= native_to_network(network, tmp); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(SP *native, Little16 network) +{ + bool rv = true; + uint16_t tmp; + rv &= network_to_native(&tmp, network); + *native = static_cast<SP>(tmp); + // TODO this is what really should be doing a checked cast + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(Byte *network, LOOK native) +{ + bool rv = true; + uint8_t tmp = static_cast<uint8_t>(native); + rv &= native_to_network(network, tmp); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(LOOK *native, Byte network) +{ + bool rv = true; + uint8_t tmp; + rv &= network_to_native(&tmp, network); + *native = static_cast<LOOK>(tmp); + // TODO this is what really should be doing a checked cast + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(Little16 *network, SkillID native) +{ + bool rv = true; + uint16_t tmp = static_cast<uint16_t>(native); + rv &= native_to_network(network, tmp); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(SkillID *native, Little16 network) +{ + bool rv = true; + uint16_t tmp; + rv &= network_to_native(&tmp, network); + *native = static_cast<SkillID>(tmp); + // TODO this is what really should be doing a checked cast + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(Little16 *network, StatusChange native) +{ + bool rv = true; + uint16_t tmp = static_cast<uint16_t>(native); + rv &= native_to_network(network, tmp); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(StatusChange *native, Little16 network) +{ + bool rv = true; + uint16_t tmp; + rv &= network_to_native(&tmp, network); + *native = static_cast<StatusChange>(tmp); + // TODO this is what really should be doing a checked cast + return rv; +} +inline __attribute__((warn_unused_result)) +bool native_to_network(Little16 *network, SkillFlags native) +{ + bool rv = true; + uint16_t tmp = static_cast<uint16_t>(native); + rv &= native_to_network(network, tmp); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(SkillFlags *native, Little16 network) +{ + bool rv = true; + uint16_t tmp; + rv &= network_to_native(&tmp, network); + *native = static_cast<SkillFlags>(tmp); + // TODO this is what really should be doing a checked cast + return rv; +} +inline __attribute__((warn_unused_result)) bool native_to_network(Byte *network, SEX native) { bool rv = true; @@ -160,6 +397,24 @@ bool network_to_native(Option *native, Little16 network) return rv; } inline __attribute__((warn_unused_result)) +bool native_to_network(Little16 *network, EPOS native) +{ + bool rv = true; + uint16_t tmp = static_cast<uint16_t>(native); + rv &= native_to_network(network, tmp); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(EPOS *native, Little16 network) +{ + bool rv = true; + uint16_t tmp; + rv &= network_to_native(&tmp, network); + *native = static_cast<EPOS>(tmp); + // TODO this is what really should be doing a checked cast + return rv; +} +inline __attribute__((warn_unused_result)) bool native_to_network(Little16 *network, Species native) { bool rv = true; @@ -392,6 +647,7 @@ static_assert(offsetof(NetStats6, int_) == 3, "offsetof(NetStats6, int_) == 3"); static_assert(offsetof(NetStats6, dex) == 4, "offsetof(NetStats6, dex) == 4"); static_assert(offsetof(NetStats6, luk) == 5, "offsetof(NetStats6, luk) == 5"); static_assert(sizeof(NetStats6) == 6, "sizeof(NetStats6) == 6"); +static_assert(alignof(NetStats6) == 1, "alignof(NetStats6) == 1"); inline __attribute__((warn_unused_result)) bool native_to_network(NetStats6 *network, Stats6 native) { @@ -526,6 +782,7 @@ static_assert(offsetof(NetCharSelect, stats) == 98, "offsetof(NetCharSelect, sta static_assert(offsetof(NetCharSelect, char_num) == 104, "offsetof(NetCharSelect, char_num) == 104"); static_assert(offsetof(NetCharSelect, unused2) == 105, "offsetof(NetCharSelect, unused2) == 105"); static_assert(sizeof(NetCharSelect) == 106, "sizeof(NetCharSelect) == 106"); +static_assert(alignof(NetCharSelect) == 1, "alignof(NetCharSelect) == 1"); inline __attribute__((warn_unused_result)) bool native_to_network(NetCharSelect *network, CharSelect native) { @@ -607,4 +864,65 @@ bool network_to_native(CharSelect *native, NetCharSelect network) return rv; } +struct SkillInfo +{ + SkillID skill_id = {}; + uint16_t type_or_inf = {}; + SkillFlags flags = {}; + uint16_t level = {}; + uint16_t sp = {}; + uint16_t range = {}; + VString<23> unused = {}; + uint8_t can_raise = {}; +}; +struct NetSkillInfo +{ + Little16 skill_id; + Little16 type_or_inf; + Little16 flags; + Little16 level; + Little16 sp; + Little16 range; + NetString<sizeof(VString<23>)> unused; + Byte can_raise; +}; +static_assert(offsetof(NetSkillInfo, skill_id) == 0, "offsetof(NetSkillInfo, skill_id) == 0"); +static_assert(offsetof(NetSkillInfo, type_or_inf) == 2, "offsetof(NetSkillInfo, type_or_inf) == 2"); +static_assert(offsetof(NetSkillInfo, flags) == 4, "offsetof(NetSkillInfo, flags) == 4"); +static_assert(offsetof(NetSkillInfo, level) == 6, "offsetof(NetSkillInfo, level) == 6"); +static_assert(offsetof(NetSkillInfo, sp) == 8, "offsetof(NetSkillInfo, sp) == 8"); +static_assert(offsetof(NetSkillInfo, range) == 10, "offsetof(NetSkillInfo, range) == 10"); +static_assert(offsetof(NetSkillInfo, unused) == 12, "offsetof(NetSkillInfo, unused) == 12"); +static_assert(offsetof(NetSkillInfo, can_raise) == 36, "offsetof(NetSkillInfo, can_raise) == 36"); +static_assert(sizeof(NetSkillInfo) == 37, "sizeof(NetSkillInfo) == 37"); +static_assert(alignof(NetSkillInfo) == 1, "alignof(NetSkillInfo) == 1"); +inline __attribute__((warn_unused_result)) +bool native_to_network(NetSkillInfo *network, SkillInfo native) +{ + bool rv = true; + rv &= native_to_network(&network->skill_id, native.skill_id); + rv &= native_to_network(&network->type_or_inf, native.type_or_inf); + rv &= native_to_network(&network->flags, native.flags); + rv &= native_to_network(&network->level, native.level); + rv &= native_to_network(&network->sp, native.sp); + rv &= native_to_network(&network->range, native.range); + rv &= native_to_network(&network->unused, native.unused); + rv &= native_to_network(&network->can_raise, native.can_raise); + return rv; +} +inline __attribute__((warn_unused_result)) +bool network_to_native(SkillInfo *native, NetSkillInfo network) +{ + bool rv = true; + rv &= network_to_native(&native->skill_id, network.skill_id); + rv &= network_to_native(&native->type_or_inf, network.type_or_inf); + rv &= network_to_native(&native->flags, network.flags); + rv &= network_to_native(&native->level, network.level); + rv &= network_to_native(&native->sp, network.sp); + rv &= network_to_native(&native->range, network.range); + rv &= network_to_native(&native->unused, network.unused); + rv &= network_to_native(&native->can_raise, network.can_raise); + return rv; +} + #endif // TMWA_PROTO2_TYPES_HPP diff --git a/tools/protocol.py b/tools/protocol.py index 45cf966..e92144b 100755 --- a/tools/protocol.py +++ b/tools/protocol.py @@ -271,6 +271,8 @@ class StructType(Type): if self.size is not None: s = 'sizeof(%s) == %d' % (name, self.size) f.write('static_assert({0}, "{0}");\n'.format(s)) + s = 'alignof(%s) == 1' % (name) + f.write('static_assert({0}, "{0}");\n'.format(s)) def dump_convert(self, f): f.write('inline __attribute__((warn_unused_result))\n') @@ -340,7 +342,7 @@ class Include(object): def testcase(self, outdir): basename = os.path.basename(self.path.strip('<">')) root = os.path.splitext(basename)[0] - filename = 'include_%s_test.cpp' % root + filename = 'include_%s_test.cpp' % root.replace('.', '_') desc = 'testsuite for protocol includes' poison = relpath('src/poison.hpp', outdir) with open(os.path.join(outdir, filename), 'w') as f: @@ -463,9 +465,10 @@ class Channel(object): self.client = client self.packets = [] - def s(self, id, **kwargs): + def x(self, id, **kwargs): self.packets.append(packet(id, **kwargs)) - r = s + r = x + s = x def dump(self, outdir, fwd): server = self.server @@ -491,7 +494,7 @@ class Channel(object): f.write('// This is an internal protocol, and can be changed without notice\n') f.write('\n') f.write('// this is only needed for the payload packet right now, and that needs to die\n') - f.write('#pragma pack(push, 1)\n') + f.write('# pragma pack(push, 1)\n') f.write('\n') for p in self.packets: p.dump_fwd(fwd) @@ -505,7 +508,7 @@ class Channel(object): for p in self.packets: p.dump_convert(f) f.write('\n') - f.write('#pragma pack(pop)\n') + f.write('# pragma pack(pop)\n') f.write('\n') f.write('#endif // %s\n' % define) @@ -720,12 +723,12 @@ class Context(object): def main(): - # setup + ## setup ctx = Context(outdir='src/proto2/') - # headers + ## headers cstdint = ctx.sysinclude('cstdint') @@ -734,6 +737,7 @@ def main(): vstring_h = ctx.include('src/strings/vstring.hpp') ip_h = ctx.include('src/net/ip.hpp') + timer_th = ctx.include('src/net/timer.t.hpp') enums_h = ctx.include('src/mmo/enums.hpp') human_time_diff_h = ctx.include('src/mmo/human_time_diff.hpp') @@ -743,9 +747,12 @@ def main(): utils_h = ctx.include('src/mmo/utils.hpp') version_h = ctx.include('src/mmo/version.hpp') - login_types_h = ctx.include('src/login/types.hpp') + login_th = ctx.include('src/login/login.t.hpp') - # included types + clif_th = ctx.include('src/map/clif.t.hpp') + skill_th = ctx.include('src/map/skill.t.hpp') + + ## included types uint8_t = cstdint.native('uint8_t') uint16_t = cstdint.native('uint16_t') @@ -759,6 +766,7 @@ def main(): SEX = enums_h.native('SEX') Option = enums_h.native('Option') + EPOS = enums_h.native('EPOS') Species = ids_h.native('Species') AccountId = ids_h.native('AccountId') @@ -802,7 +810,8 @@ def main(): #md5_native = md5_h.native('md5_native') #SaltString = md5_h.native('SaltString') - VERSION_2 = login_types_h.native('VERSION_2') + VERSION_2 = login_th.native('VERSION_2') + # TODO: fix LIES char_key = mmo_h.neutral('CharKey') @@ -810,7 +819,30 @@ def main(): party_most = mmo_h.neutral('PartyMost') storage = mmo_h.neutral('Storage') - # generated types + + Position1 = clif_th.native('Position1') + NetPosition1 = clif_th.network('NetPosition1') + Position2 = clif_th.native('Position2') + NetPosition2 = clif_th.network('NetPosition2') + BeingRemoveWhy = clif_th.native('BeingRemoveWhy') + DIR = clif_th.native('DIR') + Opt1 = clif_th.native('Opt1') + Opt2 = clif_th.native('Opt2') + Opt3 = clif_th.native('Opt3') + ItemType = clif_th.native('ItemType') + PickupFail = clif_th.native('PickupFail') + DamageType = clif_th.native('DamageType') + SP = clif_th.native('SP') + LOOK = clif_th.native('LOOK') + + SkillID = skill_th.native('SkillID') + StatusChange = skill_th.native('StatusChange') + SkillFlags = skill_th.native('SkillFlags') + + tick_t = timer_th.native('tick_t') + interval_t = timer_th.native('interval_t') + + ## generated types u8 = ctx.provided(uint8_t, Byte) u16 = ctx.provided(uint16_t, Little16) @@ -819,8 +851,30 @@ def main(): sex_char = ctx.provided(SEX, NeutralType('char')) + dir = ctx.enum(DIR, u8) + pos1 = ctx.provided(Position1, NetPosition1) + pos2 = ctx.provided(Position2, NetPosition2) + being_remove_why = ctx.enum(BeingRemoveWhy, u8) + opt1 = ctx.enum(Opt1, u16) + opt2 = ctx.enum(Opt2, u16) + opt3 = ctx.enum(Opt3, u16) + item_type = ctx.enum(ItemType, u8) + pickup_fail = ctx.enum(PickupFail, u8) + damage_type = ctx.enum(DamageType, u8) + sp = ctx.enum(SP, u16) + look = ctx.enum(LOOK, u8) + + skill_id = ctx.enum(SkillID, u16) + status_change = ctx.enum(StatusChange, u16) + skill_flags = ctx.enum(SkillFlags, u16) + + tick32 = ctx.provided(tick_t, Little32) + interval32 = ctx.provided(interval_t, Little32) + interval16 = ctx.provided(interval_t, Little16) + sex = ctx.enum(SEX, u8) option = ctx.enum(Option, u16) + epos = ctx.enum(EPOS, u16) species = ctx.wrap(Species, u16) account_id = ctx.wrap(AccountId, u32) @@ -927,7 +981,7 @@ def main(): at(48, u16, 'max sp'), at(50, u16, 'speed'), at(52, species, 'species'), - at(54, u16, 'hair_style'), + at(54, u16, 'hair style'), at(56, u16, 'weapon'), at(58, u16, 'base level'), at(60, u16, 'skill point'), @@ -946,8 +1000,22 @@ def main(): ], size=106, ) + skill_info = ctx.struct( + 'SkillInfo', + [ + at(0, skill_id, 'skill id'), + at(2, u16, 'type or inf'), + at(4, skill_flags, 'flags'), + at(6, u16, 'level'), + at(8, u16, 'sp'), + at(10, u16, 'range'), + at(12, str24, 'unused'), + at(36, u8, 'can raise'), + ], + size=37, + ) - # packets + ## packet channels # this is a somewhat simplistic view. For packets that get forwarded, # it may be worth pretending something like admin->char, map->login ... @@ -970,6 +1038,8 @@ def main(): any_user = ctx.chan('any', 'user') + ## legacy packets + # * user char_user.r(0x0061, fixed=[ @@ -1042,7 +1112,6 @@ def main(): ], fixed_size=46, ) - login_user.r(0x0069, head=[ at(0, u16, 'packet id'), @@ -1130,7 +1199,146 @@ def main(): ], fixed_size=28, ) - + map_user.r(0x0072, + fixed=[ + at(0, u16, 'packet id'), + at(2, account_id, 'account id'), + at(6, char_id, 'char id'), + at(10, u32, 'login id1'), + at(14, u32, 'client tick'), + at(18, sex, 'sex'), + ], + fixed_size=19, + ) + map_user.s(0x0073, + fixed=[ + at(0, u16, 'packet id'), + at(2, tick32, 'tick'), + at(6, pos1, 'pos'), + at(9, u8, 'five1'), + at(10, u8, 'five2'), + ], + fixed_size=11, + ) + map_user.s(0x0078, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, interval16, 'speed'), + at(8, opt1, 'opt1'), + at(10, opt2, 'opt2'), + at(12, option, 'option'), + at(14, species, 'species'), + at(16, u16, 'unused hair style'), + at(18, u16, 'unused weapon'), + at(20, u16, 'unused head bottom or species again'), + at(22, u16, 'unused shield or part of guild emblem'), + at(24, u16, 'unused head top or unused part of guild emblem'), + at(26, u16, 'unused head mid or part of guild id'), + at(28, u16, 'unused hair color or part of guild id'), + at(30, u16, 'unused clothes color'), + at(32, u16, 'unused 1'), + at(34, u16, 'unused 2'), + at(36, pos1, 'unused pos again'), + at(39, u8, 'unused 4b'), + at(40, u16, 'unused 5'), + at(42, u16, 'unused zero 1'), + at(44, u8, 'unused zero 2'), + at(45, u8, 'unused sex'), + at(46, pos1, 'pos'), + at(49, u8, 'five1'), + at(50, u8, 'five2'), + at(51, u8, 'zero'), + at(52, u16, 'level'), + ], + fixed_size=54, + ) + map_user.s(0x007b, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, interval16, 'speed'), + at(8, opt1, 'opt1'), + at(10, opt2, 'opt2'), + at(12, option, 'option'), + at(14, species, 'mob class'), + at(16, u16, 'unused hair style'), + at(18, u16, 'unused weapon'), + at(20, u16, 'unused head bottom'), + at(22, tick32, 'tick and maybe part of guild emblem'), + at(26, u16, 'unused shield or maybe part of guild emblem'), + at(28, u16, 'unused head top or maybe part of guild id'), + at(30, u16, 'unused head mid or maybe part of guild id'), + at(32, u16, 'unused hair color'), + at(34, u16, 'unused clothes color'), + at(36, u16, 'unused 1'), + at(38, u16, 'unused 2'), + at(40, u16, 'unused 3'), + at(42, u16, 'unused 4'), + at(44, u16, 'unused 5'), + at(46, u16, 'unused zero 1'), + at(48, u8, 'unused zero 2'), + at(49, u8, 'unused sex'), + at(50, pos2, 'pos2'), + at(55, u8, 'zero'), + at(56, u8, 'five1'), + at(57, u8, 'five2'), + at(58, u16, 'level'), + ], + fixed_size=60, + ) + map_user.s(0x007c, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, interval16, 'speed'), + at(8, opt1, 'opt1'), + at(10, opt2, 'opt2'), + at(12, option, 'option'), + at(14, u16, 'unknown 1'), + at(16, u16, 'unknown 2'), + at(18, u16, 'unknown 3'), + at(20, species, 'species'), + at(22, u16, 'unknown 4'), + at(24, u16, 'unknown 5'), + at(26, u16, 'unknown 6'), + at(28, u16, 'unknown 7'), + at(30, u16, 'unknown 8'), + at(32, u16, 'unknown 9'), + at(34, u16, 'unknown 10'), + at(36, pos1, 'pos'), + at(39, u16, 'unknown 11'), + ], + fixed_size=41, + ) + map_user.r(0x007d, + fixed=[ + at(0, u16, 'packet id'), + ], + fixed_size=2, + ) + map_user.r(0x007e, + fixed=[ + at(0, u16, 'packet id'), + at(2, u32, 'client tick'), + ], + fixed_size=6, + ) + map_user.s(0x007f, + fixed=[ + at(0, u16, 'packet id'), + at(2, tick32, 'tick'), + ], + fixed_size=6, + ) + map_user.s(0x0080, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, being_remove_why, 'type'), + ], + fixed_size=7, + ) any_user.s(0x0081, fixed=[ at(0, u16, 'packet id'), @@ -1138,7 +1346,1311 @@ def main(): ], fixed_size=3, ) - + map_user.r(0x0085, + fixed=[ + at(0, u16, 'packet id'), + at(2, pos1, 'pos'), + ], + fixed_size=5, + ) + map_user.s(0x0087, + fixed=[ + at(0, u16, 'packet id'), + at(2, tick32, 'tick'), + at(6, pos2, 'pos2'), + at(11, u8, 'zero'), + ], + fixed_size=12, + ) + map_user.s(0x0088, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, u16, 'x'), + at(8, u16, 'y'), + ], + fixed_size=10, + ) + map_user.r(0x0089, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'target id'), + at(6, damage_type, 'action'), + ], + fixed_size=7, + ) + map_user.s(0x008a, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'src id'), + at(6, block_id, 'dst id'), + at(10, tick32, 'tick'), + at(14, interval32, 'sdelay'), + at(18, interval32, 'ddelay'), + at(22, u16, 'damage'), + at(24, u16, 'div'), + at(26, damage_type, 'damage type'), + at(27, u16, 'damage2'), + ], + fixed_size=29, + ) + map_user.r(0x008c, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + ], + head_size=4, + repeat=[ + at(0, u8, 'c'), + ], + repeat_size=1, + ) + map_user.s(0x008d, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + at(4, block_id, 'block id'), + ], + head_size=8, + repeat=[ + at(0, u8, 'c'), + ], + repeat_size=1, + ) + map_user.s(0x008e, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + ], + head_size=4, + repeat=[ + at(0, u8, 'c'), + ], + repeat_size=1, + ) + map_user.r(0x0090, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, u8, 'unused'), + ], + fixed_size=7, + ) + map_user.s(0x0091, + fixed=[ + at(0, u16, 'packet id'), + at(2, map_name, 'map name'), + at(18, u16, 'x'), + at(20, u16, 'y'), + ], + fixed_size=22, + ) + map_user.s(0x0092, + fixed=[ + at(0, u16, 'packet id'), + at(2, map_name, 'map name'), + at(18, u16, 'x'), + at(20, u16, 'y'), + at(22, ip4, 'ip'), + at(26, u16, 'port'), + ], + fixed_size=28, + ) + map_user.r(0x0094, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + ], + fixed_size=6, + ) + map_user.s(0x0095, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, char_name, 'char name'), + ], + fixed_size=30, + ) + map_user.r(0x0096, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + at(4, char_name, 'target name'), + ], + head_size=28, + repeat=[ + at(0, u8, 'c'), + ], + repeat_size=1, + ) + map_user.s(0x0097, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + at(4, char_name, 'char name'), + ], + head_size=28, + repeat=[ + at(0, u8, 'c'), + ], + repeat_size=1, + ) + map_user.s(0x0098, + fixed=[ + at(0, u16, 'packet id'), + at(2, u8, 'flag'), + ], + fixed_size=3, + ) + map_user.s(0x009a, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + ], + head_size=4, + repeat=[ + at(0, u8, 'c'), + ], + repeat_size=1, + ) + map_user.r(0x009b, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'unused'), + at(4, u8, 'client dir'), + ], + fixed_size=5, + ) + map_user.s(0x009c, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, u16, 'zero'), + at(8, u8, 'client dir'), + ], + fixed_size=9, + ) + map_user.s(0x009d, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, item_name_id, 'name id'), + at(8, u8, 'identify'), + at(9, u16, 'x'), + at(11, u16, 'y'), + at(13, u16, 'amount'), + at(15, u8, 'subx'), + at(16, u8, 'suby'), + ], + fixed_size=17, + ) + map_user.s(0x009e, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, item_name_id, 'name id'), + at(8, u8, 'identify'), + at(9, u16, 'x'), + at(11, u16, 'y'), + at(13, u8, 'subx'), + at(14, u8, 'suby'), + at(15, u16, 'amount'), + ], + fixed_size=17, + ) + map_user.r(0x009f, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'object id'), + ], + fixed_size=6, + ) + map_user.s(0x00a0, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'ioff2'), + at(4, u16, 'amount'), + at(6, item_name_id, 'name id'), + at(8, u8, 'identify'), + at(9, u8, 'broken or attribute'), + at(10, u8, 'refine'), + at(11, u16, 'card0'), + at(13, u16, 'card1'), + at(15, u16, 'card2'), + at(17, u16, 'card3'), + at(19, epos, 'epos'), + at(21, item_type, 'item type'), + at(22, pickup_fail, 'pickup fail'), + ], + fixed_size=23, + ) + map_user.s(0x00a1, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + ], + fixed_size=6, + ) + map_user.r(0x00a2, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'ioff2'), + at(4, u16, 'amount'), + ], + fixed_size=6, + ) + map_user.s(0x00a4, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + ], + head_size=4, + repeat=[ + at(0, u16, 'ioff2'), + at(2, item_name_id, 'name id'), + at(4, item_type, 'item type'), + at(5, u8, 'identify'), + at(6, epos, 'epos pc'), + at(8, epos, 'epos inv'), + at(10, u8, 'broken or attribute'), + at(11, u8, 'refine'), + at(12, u16, 'card0'), + at(14, u16, 'card1'), + at(16, u16, 'card2'), + at(18, u16, 'card3'), + ], + repeat_size=20, + ) + map_user.s(0x00a6, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + ], + head_size=4, + repeat=[ + at(0, u16, 'soff1'), + at(2, item_name_id, 'name id'), + at(4, item_type, 'item type'), + at(5, u8, 'identify'), + at(6, epos, 'epos id'), + at(8, epos, 'epos stor'), + at(10, u8, 'broken or attribute'), + at(11, u8, 'refine'), + at(12, u16, 'card0'), + at(14, u16, 'card1'), + at(16, u16, 'card2'), + at(18, u16, 'card3'), + ], + repeat_size=20, + ) + map_user.r(0x00a7, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'ioff2'), + at(4, u32, 'unused id'), + ], + fixed_size=8, + ) + map_user.s(0x00a8, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'ioff2'), + at(4, u16, 'amount'), + at(6, u8, 'ok'), + ], + fixed_size=7, + ) + map_user.r(0x00a9, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'ioff2'), + at(4, epos, 'epos ignored'), + ], + fixed_size=6, + ) + map_user.s(0x00aa, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'ioff2'), + at(4, epos, 'epos'), + at(6, u8, 'ok'), + ], + fixed_size=7, + ) + map_user.r(0x00ab, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'ioff2'), + ], + fixed_size=4, + ) + map_user.s(0x00ac, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'ioff2'), + at(4, epos, 'epos'), + at(6, u8, 'ok'), + ], + fixed_size=7, + ) + map_user.s(0x00af, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'ioff2'), + at(4, u16, 'amount'), + ], + fixed_size=6, + ) + map_user.s(0x00b0, + fixed=[ + at(0, u16, 'packet id'), + at(2, sp, 'sp type'), + at(4, u32, 'value'), + ], + fixed_size=8, + ) + map_user.s(0x00b1, + fixed=[ + at(0, u16, 'packet id'), + at(2, sp, 'sp type'), + at(4, u32, 'value'), + ], + fixed_size=8, + ) + map_user.r(0x00b2, + fixed=[ + at(0, u16, 'packet id'), + at(2, u8, 'flag'), + ], + fixed_size=3, + ) + map_user.s(0x00b3, + fixed=[ + at(0, u16, 'packet id'), + at(2, u8, 'one'), + ], + fixed_size=3, + ) + map_user.s(0x00b4, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + at(4, block_id, 'block id'), + ], + head_size=8, + repeat=[ + at(0, u8, 'c'), + ], + repeat_size=1, + ) + map_user.s(0x00b5, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + ], + fixed_size=6, + ) + map_user.s(0x00b6, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + ], + fixed_size=6, + ) + map_user.s(0x00b7, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + at(4, block_id, 'block id'), + ], + head_size=8, + repeat=[ + at(0, u8, 'c'), + ], + repeat_size=1, + ) + map_user.r(0x00b8, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'npc id'), + at(6, u8, 'menu entry'), + ], + fixed_size=7, + ) + map_user.r(0x00b9, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'npc id'), + ], + fixed_size=6, + ) + map_user.r(0x00bb, + fixed=[ + at(0, u16, 'packet id'), + at(2, sp, 'asp'), + at(4, u8, 'unused'), + ], + fixed_size=5, + ) + map_user.s(0x00bc, + fixed=[ + at(0, u16, 'packet id'), + at(2, sp, 'sp type'), + at(4, u8, 'ok'), + at(5, u8, 'val'), + ], + fixed_size=6, + ) + map_user.s(0x00bd, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'status point'), + at(4, u8, 'str attr'), + at(5, u8, 'str upd'), + at(6, u8, 'agi attr'), + at(7, u8, 'agi upd'), + at(8, u8, 'vit attr'), + at(9, u8, 'vit upd'), + at(10, u8, 'int attr'), + at(11, u8, 'int upd'), + at(12, u8, 'dex attr'), + at(13, u8, 'dex upd'), + at(14, u8, 'luk attr'), + at(15, u8, 'luk upd'), + at(16, u16, 'atk sum'), + at(18, u16, 'watk2'), + at(20, u16, 'matk1'), + at(22, u16, 'matk2'), + at(24, u16, 'def'), + at(26, u16, 'def2'), + at(28, u16, 'mdef'), + at(30, u16, 'mdef2'), + at(32, u16, 'hit'), + at(34, u16, 'flee'), + at(36, u16, 'flee2'), + at(38, u16, 'critical'), + at(40, u16, 'karma'), + at(42, u16, 'manner'), + ], + fixed_size=44, + ) + map_user.s(0x00be, + fixed=[ + at(0, u16, 'packet id'), + at(2, sp, 'sp type'), + at(4, u8, 'value'), + ], + fixed_size=5, + ) + map_user.r(0x00bf, + fixed=[ + at(0, u16, 'packet id'), + at(2, u8, 'emote'), + ], + fixed_size=3, + ) + map_user.s(0x00c0, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, u8, 'type'), + ], + fixed_size=7, + ) + map_user.r(0x00c1, + fixed=[ + at(0, u16, 'packet id'), + ], + fixed_size=2, + ) + map_user.s(0x00c2, + fixed=[ + at(0, u16, 'packet id'), + at(2, u32, 'users'), + ], + fixed_size=6, + ) + map_user.s(0x00c4, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + ], + fixed_size=6, + ) + map_user.r(0x00c5, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, u8, 'type'), + ], + fixed_size=7, + ) + map_user.s(0x00c6, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + ], + head_size=4, + repeat=[ + at(0, u32, 'base price'), + at(4, u32, 'actual price'), + at(8, item_type, 'type'), + at(9, item_name_id, 'name id'), + ], + repeat_size=11, + ) + map_user.s(0x00c7, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + ], + head_size=4, + repeat=[ + at(0, u16, 'ioff2'), + at(2, u32, 'base price'), + at(6, u32, 'actual price'), + ], + repeat_size=10, + ) + map_user.r(0x00c8, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + ], + head_size=4, + repeat=[ + at(0, u16, 'count'), + at(2, item_name_id, 'name id'), + ], + repeat_size=4, + ) + map_user.r(0x00c9, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + ], + head_size=4, + repeat=[ + at(0, u16, 'ioff2'), + at(2, u16, 'count'), + ], + repeat_size=4, + ) + map_user.s(0x00ca, + fixed=[ + at(0, u16, 'packet id'), + at(2, u8, 'fail'), + ], + fixed_size=3, + ) + map_user.s(0x00cb, + fixed=[ + at(0, u16, 'packet id'), + at(2, u8, 'fail'), + ], + fixed_size=3, + ) + map_user.s(0x00cd, + fixed=[ + at(0, u16, 'packet id'), + at(2, account_id, 'account id'), + ], + fixed_size=6, + ) + map_user.r(0x00e4, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + ], + fixed_size=6, + ) + map_user.s(0x00e5, + fixed=[ + at(0, u16, 'packet id'), + at(2, char_name, 'char name'), + ], + fixed_size=26, + ) + map_user.r(0x00e6, + fixed=[ + at(0, u16, 'packet id'), + at(2, u8, 'type'), + ], + fixed_size=3, + ) + map_user.s(0x00e7, + fixed=[ + at(0, u16, 'packet id'), + at(2, u8, 'type'), + ], + fixed_size=3, + ) + map_user.r(0x00e8, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'zeny or ioff2'), + at(4, u32, 'amount'), + ], + fixed_size=8, + ) + map_user.s(0x00e9, + fixed=[ + at(0, u16, 'packet id'), + at(2, u32, 'amount'), + at(6, item_name_id, 'name id'), + at(8, u8, 'identify'), + at(9, u8, 'broken or attribute'), + at(10, u8, 'refine'), + at(11, u16, 'card0'), + at(13, u16, 'card1'), + at(15, u16, 'card2'), + at(17, u16, 'card3'), + ], + fixed_size=19, + ) + map_user.r(0x00eb, + fixed=[ + at(0, u16, 'packet id'), + ], + fixed_size=2, + ) + map_user.s(0x00ec, + fixed=[ + at(0, u16, 'packet id'), + at(2, u8, 'fail'), + ], + fixed_size=3, + ) + map_user.r(0x00ed, + fixed=[ + at(0, u16, 'packet id'), + ], + fixed_size=2, + ) + map_user.s(0x00ee, + fixed=[ + at(0, u16, 'packet id'), + ], + fixed_size=2, + ) + map_user.r(0x00ef, + fixed=[ + at(0, u16, 'packet id'), + ], + fixed_size=2, + ) + map_user.s(0x00f0, + fixed=[ + at(0, u16, 'packet id'), + at(2, u8, 'fail'), + ], + fixed_size=3, + ) + map_user.s(0x00f2, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'current slots'), + at(4, u16, 'max slots'), + ], + fixed_size=6, + ) + map_user.r(0x00f3, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'ioff2'), + at(4, u32, 'amount'), + ], + fixed_size=8, + ) + map_user.s(0x00f4, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'soff1'), + at(4, u32, 'amount'), + at(8, item_name_id, 'name id'), + at(10, u8, 'identify'), + at(11, u8, 'broken or attribute'), + at(12, u8, 'refine'), + at(13, u16, 'card0'), + at(15, u16, 'card1'), + at(17, u16, 'card2'), + at(19, u16, 'card3'), + ], + fixed_size=21, + ) + map_user.r(0x00f5, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'soff1'), + at(4, u32, 'amount'), + ], + fixed_size=8, + ) + map_user.s(0x00f6, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'soff1'), + at(4, u32, 'amount'), + ], + fixed_size=8, + ) + map_user.r(0x00f7, + fixed=[ + at(0, u16, 'packet id'), + ], + fixed_size=2, + ) + map_user.s(0x00f8, + fixed=[ + at(0, u16, 'packet id'), + ], + fixed_size=2, + ) + map_user.r(0x00f9, + fixed=[ + at(0, u16, 'packet id'), + at(2, party_name, 'party name'), + ], + fixed_size=26, + ) + map_user.s(0x00fa, + fixed=[ + at(0, u16, 'packet id'), + at(2, u8, 'flag'), + ], + fixed_size=3, + ) + map_user.s(0x00fb, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + at(4, party_name, 'party name'), + ], + head_size=28, + repeat=[ + at(0, account_id, 'account id'), + at(4, char_name, 'char name'), + at(28, map_name, 'map name'), + at(44, u8, 'leader'), + at(45, u8, 'online'), + ], + repeat_size=46, + ) + map_user.r(0x00fc, + fixed=[ + at(0, u16, 'packet id'), + at(2, account_id, 'account id'), + ], + fixed_size=6, + ) + map_user.s(0x00fd, + fixed=[ + at(0, u16, 'packet id'), + at(2, char_name, 'char name'), + at(26, u8, 'flag'), + ], + fixed_size=27, + ) + map_user.s(0x00fe, + fixed=[ + at(0, u16, 'packet id'), + at(2, account_id, 'account id'), + at(6, party_name, 'party name'), + ], + fixed_size=30, + ) + map_user.r(0x00ff, + fixed=[ + at(0, u16, 'packet id'), + at(2, account_id, 'account id'), + at(6, u32, 'flag'), + ], + fixed_size=10, + ) + map_user.r(0x0100, + fixed=[ + at(0, u16, 'packet id'), + ], + fixed_size=2, + ) + map_user.s(0x0101, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'exp'), + at(4, u16, 'item'), + ], + fixed_size=6, + ) + map_user.r(0x0102, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'exp'), + at(4, u16, 'item'), + ], + fixed_size=6, + ) + map_user.r(0x0103, + fixed=[ + at(0, u16, 'packet id'), + at(2, account_id, 'account id'), + at(6, char_name, 'unused char name'), + ], + fixed_size=30, + ) + map_user.s(0x0105, + fixed=[ + at(0, u16, 'packet id'), + at(2, account_id, 'account id'), + at(6, char_name, 'char name'), + at(30, u8, 'flag'), + ], + fixed_size=31, + ) + map_user.s(0x0106, + fixed=[ + at(0, u16, 'packet id'), + at(2, account_id, 'account id'), + at(6, u16, 'hp'), + at(8, u16, 'max hp'), + ], + fixed_size=10, + ) + map_user.s(0x0107, + fixed=[ + at(0, u16, 'packet id'), + at(2, account_id, 'account id'), + at(6, u16, 'x'), + at(8, u16, 'y'), + ], + fixed_size=10, + ) + map_user.r(0x0108, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + ], + head_size=4, + repeat=[ + at(0, u8, 'c'), + ], + repeat_size=1, + ) + map_user.s(0x0109, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + at(4, account_id, 'account id'), + ], + head_size=8, + repeat=[ + at(0, u8, 'c'), + ], + repeat_size=1 + ) + map_user.s(0x010c, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + ], + fixed_size=6, + ) + map_user.s(0x010e, + fixed=[ + at(0, u16, 'packet id'), + at(2, skill_id, 'skill id'), + at(4, u16, 'level'), + at(6, u16, 'sp'), + at(8, u16, 'range'), + at(10, u8, 'can raise'), + ], + fixed_size=11, + ) + map_user.s(0x010f, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + ], + head_size=4, + repeat=[ + at(0, skill_info, 'info'), + ], + repeat_size=37, + ) + map_user.s(0x0110, + fixed=[ + at(0, u16, 'packet id'), + at(2, skill_id, 'skill id'), + at(4, u16, 'btype'), + at(6, u16, 'zero1'), + at(8, u8, 'zero2'), + at(9, u8, 'type'), + ], + fixed_size=10, + ) + map_user.r(0x0112, + fixed=[ + at(0, u16, 'packet id'), + at(2, skill_id, 'skill id'), + ], + fixed_size=4, + ) + map_user.r(0x0118, + fixed=[ + at(0, u16, 'packet id'), + ], + fixed_size=2, + ) + map_user.s(0x0119, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, opt1, 'opt1'), + at(8, opt2, 'opt2'), + at(10, option, 'option'), + at(12, u8, 'zero'), + ], + fixed_size=13, + ) + map_user.s(0x0139, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, u16, 'bl x'), + at(8, u16, 'bl y'), + at(10, u16, 'sd x'), + at(12, u16, 'sd y'), + at(14, u16, 'range'), + ], + fixed_size=16, + ) + map_user.s(0x013a, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'attack range'), + ], + fixed_size=4, + ) + map_user.s(0x013b, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'type'), + ], + fixed_size=4, + ) + map_user.s(0x013c, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'ioff2'), + ], + fixed_size=4, + ) + map_user.s(0x0141, + fixed=[ + at(0, u16, 'packet id'), + at(2, sp, 'sp type'), + at(4, u16, 'zero'), + at(6, u32, 'value status'), + at(10, u32, 'value b e'), + ], + fixed_size=14, + ) + map_user.s(0x0142, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + ], + fixed_size=6, + ) + map_user.r(0x0143, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, u32, 'input int value'), + ], + fixed_size=10, + ) + map_user.r(0x0146, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + ], + fixed_size=6, + ) + map_user.s(0x0147, + fixed=[ + at(0, u16, 'packet id'), + at(2, skill_info, 'info'), + ], + fixed_size=39, + ) + map_user.s(0x0148, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, u16, 'type'), + ], + fixed_size=8, + ) + map_user.r(0x014d, + fixed=[ + at(0, u16, 'packet id'), + ], + fixed_size=2, + ) + map_user.r(0x018a, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'unused'), + ], + fixed_size=4, + ) + map_user.s(0x018b, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'okay'), + ], + fixed_size=4, + ) + map_user.s(0x0195, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, party_name, 'party name'), + at(30, str24, 'guild name'), + at(54, str24, 'guild pos'), + at(78, str24, 'guild pos again'), + ], + fixed_size=102, + ) + map_user.s(0x0196, + fixed=[ + at(0, u16, 'packet id'), + at(2, status_change, 'sc type'), + at(4, block_id, 'block id'), + at(8, u8, 'flag'), + ], + fixed_size=9, + ) + map_user.s(0x019b, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, u32, 'type'), + ], + fixed_size=10, + ) + map_user.s(0x01b1, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'ioff2'), + at(4, u16, 'amount'), + at(6, u8, 'fail'), + ], + fixed_size=7, + ) + map_user.s(0x01c8, + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'ioff2'), + at(4, item_name_id, 'name id'), + at(6, block_id, 'block id'), + at(10, u16, 'amount'), + at(12, u8, 'ok'), + ], + fixed_size=13, + ) + map_user.s(0x01d4, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + ], + fixed_size=6, + ) + map_user.r(0x01d5, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + at(4, block_id, 'block id'), + ], + head_size=8, + repeat=[ + at(0, u8, 'c'), + ], + repeat_size=1, + ) + map_user.s(0x01d7, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, look, 'look type'), + at(7, u16, 'weapon or name id or value'), + at(9, item_name_id, 'shield'), + ], + fixed_size=11, + ) + # very similar to, but not compatible with, 0x01d9 and 0x01da + map_user.s(0x01d8, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, interval16, 'speed'), + at(8, opt1, 'opt1'), + at(10, opt2, 'opt2'), + at(12, option, 'option'), + at(14, species, 'species'), + at(16, u16, 'hair style'), + at(18, item_name_id, 'weapon'), + at(20, item_name_id, 'shield'), + at(22, item_name_id, 'head bottom'), + at(24, item_name_id, 'head top'), + at(26, item_name_id, 'head mid'), + at(28, u16, 'hair color'), + at(30, u16, 'clothes color'), + at(32, dir, 'head dir'), + at(33, u8, 'unused2'), + at(34, u32, 'guild id'), + at(38, u16, 'guild emblem id'), + at(40, u16, 'manner'), + at(42, opt3, 'opt3'), + at(44, u8, 'karma'), + at(45, sex, 'sex'), + at(46, pos1, 'pos'), + at(49, u16, 'gm bits'), + at(51, u8, 'dead sit'), + at(52, u16, 'unused'), + ], + fixed_size=54, + ) + # very similar to, but not compatible with, 0x01d8 and 0x01da + map_user.s(0x01d9, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, interval16, 'speed'), + at(8, opt1, 'opt1'), + at(10, opt2, 'opt2'), + at(12, option, 'option'), + at(14, species, 'species'), + at(16, u16, 'hair style'), + at(18, item_name_id, 'weapon'), + at(20, item_name_id, 'shield'), + at(22, item_name_id, 'head bottom'), + at(24, item_name_id, 'head top'), + at(26, item_name_id, 'head mid'), + at(28, u16, 'hair color'), + at(30, u16, 'clothes color'), + at(32, dir, 'head dir'), + at(33, u8, 'unused2'), + at(34, u32, 'guild id'), + at(38, u16, 'guild emblem id'), + at(40, u16, 'manner'), + at(42, opt3, 'opt3'), + at(44, u8, 'karma'), + at(45, sex, 'sex'), + at(46, pos1, 'pos'), + at(49, u16, 'gm bits'), + at(51, u16, 'unused'), + ], + fixed_size=53, + ) + # very similar to, but not compatible with, 0x01d8 and 0x01d9 + map_user.s(0x01da, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, interval16, 'speed'), + at(8, opt1, 'opt1'), + at(10, opt2, 'opt2'), + at(12, option, 'option'), + at(14, species, 'species'), + at(16, u16, 'hair style'), + at(18, item_name_id, 'weapon'), + at(20, item_name_id, 'shield'), + at(22, item_name_id, 'head bottom'), + at(24, tick32, 'tick'), + at(28, item_name_id, 'head top'), + at(30, item_name_id, 'head mid'), + at(32, u16, 'hair color'), + at(34, u16, 'clothes color'), + at(36, dir, 'head dir'), + at(37, u8, 'unused2'), + at(38, u32, 'guild id'), + at(42, u16, 'guild emblem id'), + at(44, u16, 'manner'), + at(46, opt3, 'opt3'), + at(48, u8, 'karma'), + at(49, sex, 'sex'), + at(50, pos2, 'pos2'), + at(55, u16, 'gm bits'), + at(57, u8, 'five'), + at(58, u16, 'unused'), + ], + fixed_size=60, + ) + map_user.s(0x01de, + fixed=[ + at(0, u16, 'packet id'), + at(2, skill_id, 'skill id'), + at(4, block_id, 'src id'), + at(8, block_id, 'dst id'), + at(12, tick32, 'tick'), + at(16, interval32, 'sdelay'), + at(20, interval32, 'ddelay'), + at(24, u32, 'damage'), + at(28, u16, 'skill level'), + at(30, u16, 'div'), + at(32, u8, 'type or hit'), + ], + fixed_size=33, + ) + map_user.s(0x01ee, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + ], + head_size=4, + repeat=[ + at(0, u16, 'ioff2'), + at(2, item_name_id, 'name id'), + at(4, item_type, 'item type'), + at(5, u8, 'identify'), + at(6, u16, 'amount'), + at(8, epos, 'epos'), + at(10, u16, 'card0'), + at(12, u16, 'card1'), + at(14, u16, 'card2'), + at(16, u16, 'card3'), + ], + repeat_size=18, + ) + map_user.s(0x01f0, + head=[ + at(0, u16, 'packet id'), + at(2, u16, 'packet length'), + ], + head_size=4, + repeat=[ + at(0, u16, 'soff1'), + at(2, item_name_id, 'name id'), + at(4, item_type, 'item type'), + at(5, u8, 'identify'), + at(6, u16, 'amount'), + at(8, epos, 'epos zero'), + at(10, u16, 'card0'), + at(12, u16, 'card1'), + at(14, u16, 'card2'), + at(16, u16, 'card3'), + ], + repeat_size=18, + ) + map_user.s(0x020c, + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, ip4, 'ip'), + ], + fixed_size=10, + ) map_user.s(0x0212, fixed=[ at(0, u16, 'packet id'), @@ -1169,7 +2681,7 @@ def main(): at(60, server_name, 'server name'), at(80, u16, 'unknown2'), at(82, u16, 'maintenance'), - at(84, u16, 'is_new'), + at(84, u16, 'is new'), ], fixed_size=86, ) @@ -1532,10 +3044,10 @@ def main(): at(18, map_name, 'map name'), at(34, u16, 'x'), at(36, u16, 'y'), - at(38, ip4, 'map_ip'), - at(42, u16, 'map_port'), + at(38, ip4, 'map ip'), + at(42, u16, 'map port'), at(44, sex, 'sex'), - at(45, ip4, 'client_ip'), + at(45, ip4, 'client ip'), ], fixed_size=49, ) @@ -1549,8 +3061,8 @@ def main(): at(18, map_name, 'map name'), at(34, u16, 'x'), at(36, u16, 'y'), - at(38, ip4, 'map_ip'), - at(42, u16, 'map_port'), + at(38, ip4, 'map ip'), + at(42, u16, 'map port'), ], fixed_size=44, ) @@ -2166,7 +3678,7 @@ def main(): at(6, server_name, 'name'), at(26, u16, 'users'), at(28, u16, 'maintenance'), - at(30, u16, 'is_new'), + at(30, u16, 'is new'), ], repeat_size=32, ) @@ -2418,8 +3930,18 @@ def main(): fixed_size=2, ) + ## new-style packets + # general packets + any_user.x(0x8000, + payload=[ + at(0, u16, 'packet id'), + # packet 0x8000 is handled specially + at(2, u16, 'packet length'), + ], + payload_size=4, + ) - # teardown + ## teardown ctx.dump() if __name__ == '__main__': |