summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml2
-rw-r--r--src/login/login.cpp166
-rw-r--r--src/net/packets.cpp4
-rw-r--r--src/net/packets.hpp215
-rw-r--r--src/proto2/any-user.hpp50
-rw-r--r--src/proto2/fwd.hpp483
-rw-r--r--src/proto2/login-admin.hpp986
-rw-r--r--src/proto2/login-char.hpp512
-rw-r--r--src/proto2/map-user.hpp26
-rwxr-xr-xtools/protocol.py28
10 files changed, 1389 insertions, 1083 deletions
diff --git a/.travis.yml b/.travis.yml
index 85e98c1..05dd795 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -53,7 +53,7 @@ script:
- make -R -k -j2 test TESTER='valgrind --error-exitcode=1 --track-fds=yes'
## Do something after the main test script
-after_script:
+#after_script:
- make -R -k -j2 format
- git --git-dir=../.git --work-tree=.. diff --exit-code
- make -R -k -j2 dist
diff --git a/src/login/login.cpp b/src/login/login.cpp
index d553d7c..7170a59 100644
--- a/src/login/login.cpp
+++ b/src/login/login.cpp
@@ -731,14 +731,14 @@ auto iter_char_sessions() -> decltype(filter_iterator<Session *>(&server_session
static
void send_GM_accounts(void)
{
- std::vector<SPacket_0x2732_Repeat> tail;
+ std::vector<Packet_Repeat<0x2732>> tail;
for (const AuthData& ad : auth_data)
{
// send only existing accounts. We can not create a GM account when server is online.
if (GmLevel GM_value = isGM(ad.account_id))
{
- SPacket_0x2732_Repeat item;
+ Packet_Repeat<0x2732> item;
item.account_id = ad.account_id;
item.gm_level = GM_value;
tail.push_back(item);
@@ -1001,7 +1001,7 @@ void parse_fromchar(Session *s)
// request from map-server via char-server to reload GM accounts (by Yor).
case 0x2709:
{
- RPacket_0x2709_Fixed fixed;
+ Packet_Fixed<0x2709> fixed;
rv = recv_fpacket<0x2709, 2>(s, fixed);
if (rv != RecvResult::Complete)
break;
@@ -1016,7 +1016,7 @@ void parse_fromchar(Session *s)
case 0x2712: // request from char-server to authentify an account
{
- RPacket_0x2712_Fixed fixed;
+ Packet_Fixed<0x2712> fixed;
rv = recv_fpacket<0x2712, 19>(s, fixed);
if (rv != RecvResult::Complete)
break;
@@ -1041,22 +1041,22 @@ void parse_fromchar(Session *s)
{
if (ad.account_id == acc)
{
- SPacket_0x2729_Head head_29;
+ Packet_Head<0x2729> head_29;
head_29.account_id = acc;
- std::vector<SPacket_0x2729_Repeat> repeat_29;
+ std::vector<Packet_Repeat<0x2729>> repeat_29;
int j;
for (j = 0;
j < ad.account_reg2_num;
j++)
{
- SPacket_0x2729_Repeat item;
+ Packet_Repeat<0x2729> item;
item.name = ad.account_reg2[j].str;
item.value = ad.account_reg2[j].value;
repeat_29.push_back(item);
}
send_vpacket<0x2729, 8, 36>(s, head_29, repeat_29);
- SPacket_0x2713_Fixed fixed_13;
+ Packet_Fixed<0x2713> fixed_13;
fixed_13.account_id = acc;
fixed_13.invalid = 0;
fixed_13.email = ad.email;
@@ -1075,7 +1075,7 @@ void parse_fromchar(Session *s)
LOGIN_LOG("Char-server '%s': authentification of the account %d REFUSED (ip: %s).\n"_fmt,
server[id].name, acc, ip);
- SPacket_0x2713_Fixed fixed_13;
+ Packet_Fixed<0x2713> fixed_13;
fixed_13.account_id = acc;
fixed_13.invalid = 1;
// fixed_13.email
@@ -1089,7 +1089,7 @@ void parse_fromchar(Session *s)
case 0x2714:
{
- RPacket_0x2714_Fixed fixed;
+ Packet_Fixed<0x2714> fixed;
rv = recv_fpacket<0x2714, 6>(s, fixed);
if (rv != RecvResult::Complete)
break;
@@ -1103,7 +1103,7 @@ void parse_fromchar(Session *s)
// we receive a e-mail creation of an account with a default e-mail (no answer)
case 0x2715:
{
- RPacket_0x2715_Fixed fixed;
+ Packet_Fixed<0x2715> fixed;
rv = recv_fpacket<0x2715, 46>(s, fixed);
if (rv != RecvResult::Complete)
break;
@@ -1135,7 +1135,7 @@ void parse_fromchar(Session *s)
// We receive an e-mail/limited time request, because a player comes back from a map-server to the char-server
case 0x2716:
{
- RPacket_0x2716_Fixed fixed;
+ Packet_Fixed<0x2716> fixed;
rv = recv_fpacket<0x2716, 6>(s, fixed);
if (rv != RecvResult::Complete)
break;
@@ -1148,7 +1148,7 @@ void parse_fromchar(Session *s)
LOGIN_LOG("Char-server '%s': e-mail of the account %d found (ip: %s).\n"_fmt,
server[id].name, account_id, ip);
- SPacket_0x2717_Fixed fixed_17;
+ Packet_Fixed<0x2717> fixed_17;
fixed_17.account_id = account_id;
fixed_17.email = ad.email;
fixed_17.connect_until = ad.connect_until_time;
@@ -1167,7 +1167,7 @@ void parse_fromchar(Session *s)
case 0x2720: // To become GM request
{
- RPacket_0x2720_Head head;
+ Packet_Head<0x2720> head;
AString repeat;
rv = recv_vpacket<0x2720, 8, 1>(s, head, repeat);
if (rv != RecvResult::Complete)
@@ -1176,7 +1176,7 @@ void parse_fromchar(Session *s)
{
AccountId acc = head.account_id;
- SPacket_0x2721_Fixed fixed_21;
+ Packet_Fixed<0x2721> fixed_21;
fixed_21.account_id = acc;
fixed_21.gm_level = GmLevel();
@@ -1255,7 +1255,7 @@ void parse_fromchar(Session *s)
// Map server send information to change an email of an account via char-server
case 0x2722: // 0x2722 <account_id>.L <actual_e-mail>.40B <new_e-mail>.40B
{
- RPacket_0x2722_Fixed fixed;
+ Packet_Fixed<0x2722> fixed;
rv = recv_fpacket<0x2722, 86>(s, fixed);
if (rv != RecvResult::Complete)
break;
@@ -1305,7 +1305,7 @@ void parse_fromchar(Session *s)
// Receiving of map-server via char-server a status change resquest (by Yor)
case 0x2724:
{
- RPacket_0x2724_Fixed fixed;
+ Packet_Fixed<0x2724> fixed;
rv = recv_fpacket<0x2724, 10>(s, fixed);
if (rv != RecvResult::Complete)
break;
@@ -1324,7 +1324,7 @@ void parse_fromchar(Session *s)
ip);
if (statut != 0)
{
- SPacket_0x2731_Fixed fixed_31;
+ Packet_Fixed<0x2731> fixed_31;
fixed_31.account_id = acc;
fixed_31.ban_not_status = 0;
fixed_31.status_or_ban_until = static_cast<time_t>(statut);
@@ -1359,7 +1359,7 @@ void parse_fromchar(Session *s)
case 0x2725: // Receiving of map-server via char-server a ban resquest (by Yor)
{
- RPacket_0x2725_Fixed fixed;
+ Packet_Fixed<0x2725> fixed;
rv = recv_fpacket<0x2725, 18>(s, fixed);
if (rv != RecvResult::Complete)
break;
@@ -1402,7 +1402,7 @@ void parse_fromchar(Session *s)
timestamp,
tmpstr,
ip);
- SPacket_0x2731_Fixed fixed_31;
+ Packet_Fixed<0x2731> fixed_31;
fixed_31.account_id = ad.account_id;
fixed_31.ban_not_status = 1;
fixed_31.status_or_ban_until = timestamp;
@@ -1450,7 +1450,7 @@ void parse_fromchar(Session *s)
case 0x2727: // Change of sex (sex is reversed)
{
- RPacket_0x2727_Fixed fixed;
+ Packet_Fixed<0x2727> fixed;
rv = recv_fpacket<0x2727, 6>(s, fixed);
if (rv != RecvResult::Complete)
break;
@@ -1478,7 +1478,7 @@ void parse_fromchar(Session *s)
}
ad.sex = sex;
- SPacket_0x2723_Fixed fixed_23;
+ Packet_Fixed<0x2723> fixed_23;
fixed_23.account_id = acc;
fixed_23.sex = sex;
@@ -1500,8 +1500,8 @@ void parse_fromchar(Session *s)
case 0x2728: // We receive account_reg2 from a char-server, and we send them to other char-servers.
{
- RPacket_0x2728_Head head;
- std::vector<RPacket_0x2728_Repeat> repeat;
+ Packet_Head<0x2728> head;
+ std::vector<Packet_Repeat<0x2728>> repeat;
rv = recv_vpacket<0x2728, 8, 36>(s, head, repeat);
if (rv != RecvResult::Complete)
break;
@@ -1524,8 +1524,8 @@ void parse_fromchar(Session *s)
ad.account_reg2_num = count;
// Sending information towards the other char-servers.
- SPacket_0x2729_Head head_29;
- std::vector<SPacket_0x2729_Repeat> repeat_29(repeat.size());
+ Packet_Head<0x2729> head_29;
+ std::vector<Packet_Repeat<0x2729>> repeat_29(repeat.size());
head_29.account_id = head.account_id;
for (size_t j = 0; j < count; ++j)
{
@@ -1551,7 +1551,7 @@ void parse_fromchar(Session *s)
case 0x272a: // Receiving of map-server via char-server a unban resquest (by Yor)
{
- RPacket_0x272a_Fixed fixed;
+ Packet_Fixed<0x272a> fixed;
rv = recv_fpacket<0x272a, 6>(s, fixed);
if (rv != RecvResult::Complete)
break;
@@ -1587,7 +1587,7 @@ void parse_fromchar(Session *s)
// request from char-server to change account password
case 0x2740: // 0x2740 <account_id>.L <actual_password>.24B <new_password>.24B
{
- RPacket_0x2740_Fixed fixed;
+ Packet_Fixed<0x2740> fixed;
rv = recv_fpacket<0x2740, 54>(s, fixed);
if (rv != RecvResult::Complete)
break;
@@ -1627,7 +1627,7 @@ void parse_fromchar(Session *s)
}
}
x2740_out:
- SPacket_0x2741_Fixed fixed_41;
+ Packet_Fixed<0x2741> fixed_41;
fixed_41.account_id = acc;
fixed_41.status = status;
send_fpacket<0x2741, 7>(s, fixed_41);
@@ -1684,7 +1684,7 @@ void parse_admin(Session *s)
{
case 0x7530: // Request of the server version
{
- RPacket_0x7530_Fixed fixed;
+ Packet_Fixed<0x7530> fixed;
rv = recv_fpacket<0x7530, 2>(s, fixed);
if (rv != RecvResult::Complete)
break;
@@ -1692,7 +1692,7 @@ void parse_admin(Session *s)
LOGIN_LOG("'ladmin': Sending of the server version (ip: %s)\n"_fmt,
ip);
- SPacket_0x7531_Fixed fixed_31;
+ Packet_Fixed<0x7531> fixed_31;
fixed_31.version = CURRENT_LOGIN_SERVER_VERSION;
send_fpacket<0x7531, 10>(s, fixed_31);
break;
@@ -1700,7 +1700,7 @@ void parse_admin(Session *s)
case 0x7532: // Request of end of connection
{
- RPacket_0x7532_Fixed fixed;
+ Packet_Fixed<0x7532> fixed;
rv = recv_fpacket<0x7532, 2>(s, fixed);
if (rv != RecvResult::Complete)
break;
@@ -1713,7 +1713,7 @@ void parse_admin(Session *s)
case 0x7920: // Request of an accounts list
{
- RPacket_0x7920_Fixed fixed;
+ Packet_Fixed<0x7920> fixed;
rv = recv_fpacket<0x7920, 10>(s, fixed);
if (rv != RecvResult::Complete)
break;
@@ -1728,14 +1728,14 @@ void parse_admin(Session *s)
st, ed, ip);
// Sending accounts information
- std::vector<SPacket_0x7921_Repeat> repeat_21;
+ std::vector<Packet_Repeat<0x7921>> repeat_21;
for (const AuthData& ad : auth_data)
{
AccountId account_id = ad.account_id;
if (!(account_id < st) && !(ed < account_id))
{
- SPacket_0x7921_Repeat info;
+ Packet_Repeat<0x7921> info;
info.account_id = account_id;
info.gm_level = isGM(account_id);
info.account_name = ad.userid;
@@ -1755,7 +1755,7 @@ void parse_admin(Session *s)
case 0x7924:
{ // [Fate] Itemfrob package: change item IDs
- RPacket_0x7924_Fixed fixed;
+ Packet_Fixed<0x7924> fixed;
rv = recv_fpacket<0x7924, 10>(s, fixed);
if (rv != RecvResult::Complete)
break;
@@ -1765,14 +1765,14 @@ void parse_admin(Session *s)
send_fpacket<0x7924, 10>(ss, fixed);
}
- SPacket_0x7925_Fixed fixed_25;
+ Packet_Fixed<0x7925> fixed_25;
send_fpacket<0x7925, 2>(s, fixed_25);
break;
}
case 0x7930: // Request for an account creation
{
- RPacket_0x7930_Fixed fixed;
+ Packet_Fixed<0x7930> fixed;
rv = recv_fpacket<0x7930, 91>(s, fixed);
if (rv != RecvResult::Complete)
break;
@@ -1785,7 +1785,7 @@ void parse_admin(Session *s)
ma.lastlogin = stringish<timestamp_milliseconds_buffer>("-"_s);
ma.sex = fixed.sex;
- SPacket_0x7931_Fixed fixed_31;
+ Packet_Fixed<0x7931> fixed_31;
fixed_31.account_id = AccountId();
fixed_31.account_name = ma.userid;
if (ma.userid.size() < 4 || ma.passwd.size() < 4)
@@ -1831,19 +1831,19 @@ void parse_admin(Session *s)
case 0x7932: // Request for an account deletion
{
- RPacket_0x7932_Fixed fixed;
+ Packet_Fixed<0x7932> fixed;
rv = recv_fpacket<0x7932, 26>(s, fixed);
if (rv != RecvResult::Complete)
break;
- SPacket_0x7933_Fixed fixed_33;
+ Packet_Fixed<0x7933> fixed_33;
fixed_33.account_id = AccountId();
AccountName account_name = stringish<AccountName>(fixed.account_name.to_print());
AuthData *ad = search_account(account_name);
if (ad)
{
// Char-server is notified of deletion (for characters deletion).
- SPacket_0x2730_Fixed fixed_30;
+ Packet_Fixed<0x2730> fixed_30;
fixed_30.account_id = ad->account_id;
for (Session *ss : iter_char_sessions())
@@ -1878,12 +1878,12 @@ void parse_admin(Session *s)
case 0x7934: // Request to change a password
{
- RPacket_0x7934_Fixed fixed;
+ Packet_Fixed<0x7934> fixed;
rv = recv_fpacket<0x7934, 50>(s, fixed);
if (rv != RecvResult::Complete)
break;
- SPacket_0x7935_Fixed fixed_35;
+ Packet_Fixed<0x7935> fixed_35;
fixed_35.account_id = AccountId();
AccountName account_name = stringish<AccountName>(fixed.account_name.to_print());
AuthData *ad = search_account(account_name);
@@ -1908,13 +1908,13 @@ void parse_admin(Session *s)
case 0x7936: // Request to modify a state
{
- RPacket_0x7936_Fixed fixed;
+ Packet_Fixed<0x7936> fixed;
rv = recv_fpacket<0x7936, 50>(s, fixed);
if (rv != RecvResult::Complete)
break;
{
- SPacket_0x7937_Fixed fixed_37;
+ Packet_Fixed<0x7937> fixed_37;
fixed_37.account_id = AccountId();
AccountName account_name = stringish<AccountName>(fixed.account_name.to_print());
int statut = fixed.status;
@@ -1944,7 +1944,7 @@ void parse_admin(Session *s)
ad->userid, statut, ip);
if (ad->state == 0)
{
- SPacket_0x2731_Fixed fixed_31;
+ Packet_Fixed<0x2731> fixed_31;
fixed_31.account_id = ad->account_id;
fixed_31.ban_not_status = 0;
fixed_31.status_or_ban_until = static_cast<time_t>(statut);
@@ -1977,18 +1977,18 @@ void parse_admin(Session *s)
case 0x7938: // Request for servers list and # of online players
{
- RPacket_0x7938_Fixed fixed;
+ Packet_Fixed<0x7938> fixed;
rv = recv_fpacket<0x7938, 2>(s, fixed);
if (rv != RecvResult::Complete)
break;
LOGIN_LOG("'ladmin': Sending of servers list (ip: %s)\n"_fmt, ip);
- std::vector<SPacket_0x7939_Repeat> repeat_39;
+ std::vector<Packet_Repeat<0x7939>> repeat_39;
for (int i = 0; i < MAX_SERVERS; i++)
{
if (server_session[i])
{
- SPacket_0x7939_Repeat info;
+ Packet_Repeat<0x7939> info;
info.ip = server[i].ip;
info.port = server[i].port;
info.name = server[i].name;
@@ -2004,12 +2004,12 @@ void parse_admin(Session *s)
case 0x793a: // Request to password check
{
- RPacket_0x793a_Fixed fixed;
+ Packet_Fixed<0x793a> fixed;
rv = recv_fpacket<0x793a, 50>(s, fixed);
if (rv != RecvResult::Complete)
break;
- SPacket_0x793b_Fixed fixed_3b;
+ Packet_Fixed<0x793b> fixed_3b;
fixed_3b.account_id = AccountId();
AccountName account_name = stringish<AccountName>(fixed.account_name.to_print());
const AuthData *ad = search_account(account_name);
@@ -2042,12 +2042,12 @@ void parse_admin(Session *s)
case 0x793c: // Request to modify sex
{
- RPacket_0x793c_Fixed fixed;
+ Packet_Fixed<0x793c> fixed;
rv = recv_fpacket<0x793c, 27>(s, fixed);
if (rv != RecvResult::Complete)
break;
- SPacket_0x793d_Fixed fixed_3d;
+ Packet_Fixed<0x793d> fixed_3d;
fixed_3d.account_id = AccountId();
AccountName account_name = stringish<AccountName>(fixed.account_name.to_print());
fixed_3d.account_name = account_name;
@@ -2079,7 +2079,7 @@ void parse_admin(Session *s)
ad->userid, sex_to_char(sex), ip);
// send to all char-server the change
- SPacket_0x2723_Fixed fixed_23;
+ Packet_Fixed<0x2723> fixed_23;
fixed_23.account_id = ad->account_id;
fixed_23.sex = ad->sex;
@@ -2107,12 +2107,12 @@ void parse_admin(Session *s)
case 0x793e: // Request to modify GM level
{
- RPacket_0x793e_Fixed fixed;
+ Packet_Fixed<0x793e> fixed;
rv = recv_fpacket<0x793e, 27>(s, fixed);
if (rv != RecvResult::Complete)
break;
- SPacket_0x793f_Fixed fixed_3f;
+ Packet_Fixed<0x793f> fixed_3f;
fixed_3f.account_id = AccountId();
AccountName account_name = stringish<AccountName>(fixed.account_name.to_print());
fixed_3f.account_name = account_name;
@@ -2229,12 +2229,12 @@ void parse_admin(Session *s)
case 0x7940: // Request to modify e-mail
{
- RPacket_0x7940_Fixed fixed;
+ Packet_Fixed<0x7940> fixed;
rv = recv_fpacket<0x7940, 66>(s, fixed);
if (rv != RecvResult::Complete)
break;
- SPacket_0x7941_Fixed fixed_41;
+ Packet_Fixed<0x7941> fixed_41;
fixed_41.account_id = AccountId();
AccountName account_name = stringish<AccountName>(fixed.account_name.to_print());
fixed_41.account_name = account_name;
@@ -2269,13 +2269,13 @@ void parse_admin(Session *s)
case 0x7942: // Request to modify memo field
{
- RPacket_0x7942_Head head;
+ Packet_Head<0x7942> head;
AString repeat;
rv = recv_vpacket<0x7942, 28, 1>(s, head, repeat);
if (rv != RecvResult::Complete)
break;
- SPacket_0x7943_Fixed fixed_43;
+ Packet_Fixed<0x7943> fixed_43;
fixed_43.account_id = AccountId();
AccountName account_name = stringish<AccountName>(head.account_name.to_print());
AuthData *ad = search_account(account_name);
@@ -2309,12 +2309,12 @@ void parse_admin(Session *s)
case 0x7944: // Request to found an account id
{
- RPacket_0x7944_Fixed fixed;
+ Packet_Fixed<0x7944> fixed;
rv = recv_fpacket<0x7944, 26>(s, fixed);
if (rv != RecvResult::Complete)
break;
- SPacket_0x7945_Fixed fixed_45;
+ Packet_Fixed<0x7945> fixed_45;
fixed_45.account_id = AccountId();
AccountName account_name = stringish<AccountName>(fixed.account_name.to_print());
const AuthData *ad = search_account(account_name);
@@ -2338,13 +2338,13 @@ void parse_admin(Session *s)
case 0x7946: // Request to found an account name
{
- RPacket_0x7946_Fixed fixed;
+ Packet_Fixed<0x7946> fixed;
rv = recv_fpacket<0x7946, 6>(s, fixed);
if (rv != RecvResult::Complete)
break;
AccountId account_id = fixed.account_id;
- SPacket_0x7947_Fixed fixed_47;
+ Packet_Fixed<0x7947> fixed_47;
fixed_47.account_id = account_id;
fixed_47.account_name = {};
for (const AuthData& ad : auth_data)
@@ -2367,12 +2367,12 @@ void parse_admin(Session *s)
case 0x7948: // Request to change the validity limit (timestamp) (absolute value)
{
- RPacket_0x7948_Fixed fixed;
+ Packet_Fixed<0x7948> fixed;
rv = recv_fpacket<0x7948, 30>(s, fixed);
if (rv != RecvResult::Complete)
break;
- SPacket_0x7949_Fixed fixed_49;
+ Packet_Fixed<0x7949> fixed_49;
{
fixed_49.account_id = AccountId();
AccountName account_name = stringish<AccountName>(fixed.account_name.to_print());
@@ -2409,12 +2409,12 @@ void parse_admin(Session *s)
case 0x794a: // Request to change the final date of a banishment (timestamp) (absolute value)
{
- RPacket_0x794a_Fixed fixed;
+ Packet_Fixed<0x794a> fixed;
rv = recv_fpacket<0x794a, 30>(s, fixed);
if (rv != RecvResult::Complete)
break;
- SPacket_0x794b_Fixed fixed_4b;
+ Packet_Fixed<0x794b> fixed_4b;
{
fixed_4b.account_id = AccountId();
AccountName account_name = stringish<AccountName>(fixed.account_name.to_print());
@@ -2437,7 +2437,7 @@ void parse_admin(Session *s)
{
if (timestamp)
{
- SPacket_0x2731_Fixed fixed_31;
+ Packet_Fixed<0x2731> fixed_31;
fixed_31.account_id = ad->account_id;
fixed_31.ban_not_status = 1;
fixed_31.status_or_ban_until = timestamp;
@@ -2473,12 +2473,12 @@ void parse_admin(Session *s)
case 0x794c: // Request to change the final date of a banishment (timestamp) (relative change)
{
- RPacket_0x794c_Fixed fixed;
+ Packet_Fixed<0x794c> fixed;
rv = recv_fpacket<0x794c, 38>(s, fixed);
if (rv != RecvResult::Complete)
break;
- SPacket_0x794d_Fixed fixed_4d;
+ Packet_Fixed<0x794d> fixed_4d;
{
fixed_4d.account_id = AccountId();
AccountName account_name = stringish<AccountName>(fixed.account_name.to_print());
@@ -2522,7 +2522,7 @@ void parse_admin(Session *s)
{
if (timestamp)
{
- SPacket_0x2731_Fixed fixed_31;
+ Packet_Fixed<0x2731> fixed_31;
fixed_31.account_id = ad->account_id;
fixed_31.ban_not_status = 1;
fixed_31.status_or_ban_until = timestamp;
@@ -2572,13 +2572,13 @@ void parse_admin(Session *s)
case 0x794e: // Request to send a broadcast message
{
- RPacket_0x794e_Head head;
+ Packet_Head<0x794e> head;
AString repeat;
rv = recv_vpacket<0x794e, 8, 1>(s, head, repeat);
if (rv != RecvResult::Complete)
break;
- SPacket_0x794f_Fixed fixed_4f;
+ Packet_Fixed<0x794f> fixed_4f;
fixed_4f.error = -1;
if (!repeat)
{
@@ -2604,7 +2604,7 @@ void parse_admin(Session *s)
message, ip);
// send same message to all char-servers (no answer)
- SPacket_0x2726_Head head_26;
+ Packet_Head<0x2726> head_26;
head_26.unused = head.unused;
for (Session *ss : iter_char_sessions())
@@ -2620,12 +2620,12 @@ void parse_admin(Session *s)
case 0x7950: // Request to change the validity limite (timestamp) (relative change)
{
- RPacket_0x7950_Fixed fixed;
+ Packet_Fixed<0x7950> fixed;
rv = recv_fpacket<0x7950, 38>(s, fixed);
if (rv != RecvResult::Complete)
break;
- SPacket_0x7951_Fixed fixed_51;
+ Packet_Fixed<0x7951> fixed_51;
{
fixed_51.account_id = AccountId();
AccountName account_name = stringish<AccountName>(fixed.account_name.to_print());
@@ -2713,12 +2713,12 @@ void parse_admin(Session *s)
case 0x7952: // Request about informations of an account (by account name)
{
- RPacket_0x7952_Fixed fixed;
+ Packet_Fixed<0x7952> fixed;
rv = recv_fpacket<0x7952, 26>(s, fixed);
if (rv != RecvResult::Complete)
break;
- SPacket_0x7953_Head head_53;
+ Packet_Head<0x7953> head_53;
head_53.account_id = AccountId();
AccountName account_name = stringish<AccountName>(fixed.account_name.to_print());
const AuthData *ad = search_account(account_name);
@@ -2756,13 +2756,13 @@ void parse_admin(Session *s)
case 0x7954: // Request about information of an account (by account id)
{
- RPacket_0x7954_Fixed fixed;
+ Packet_Fixed<0x7954> fixed;
rv = recv_fpacket<0x7954, 6>(s, fixed);
if (rv != RecvResult::Complete)
break;
AccountId account_id = fixed.account_id;
- SPacket_0x7953_Head head_53;
+ Packet_Head<0x7953> head_53;
head_53.account_id = account_id;
head_53.account_name = AccountName();
for (const AuthData& ad : auth_data)
@@ -2799,7 +2799,7 @@ void parse_admin(Session *s)
case 0x7955: // Request to reload GM file (no answer)
{
- RPacket_0x7955_Fixed fixed;
+ Packet_Fixed<0x7955> fixed;
rv = recv_fpacket<0x7955, 2>(s, fixed);
if (rv != RecvResult::Complete)
break;
diff --git a/src/net/packets.cpp b/src/net/packets.cpp
index 5595b1d..112bed0 100644
--- a/src/net/packets.cpp
+++ b/src/net/packets.cpp
@@ -18,8 +18,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-# include "../io/cxxstdio.hpp"
-# include "../io/write.hpp"
+#include "../io/cxxstdio.hpp"
+#include "../io/write.hpp"
#include "vomit.hpp"
diff --git a/src/net/packets.hpp b/src/net/packets.hpp
index 2e3d77c..c0f3ecb 100644
--- a/src/net/packets.hpp
+++ b/src/net/packets.hpp
@@ -25,7 +25,10 @@
# include "../ints/little.hpp"
- #include "../io/fwd.hpp"
+# include "../io/fwd.hpp"
+
+// ordering violation, should invert
+# include "../proto2/fwd.hpp"
# include "socket.hpp"
@@ -66,55 +69,55 @@ bool packet_peek_id(Session *s, uint16_t *packet_id)
return okay;
}
-template<class F>
+template<uint16_t id>
__attribute__((warn_unused_result))
-SendResult net_send_fpacket(Session *s, const F& fixed)
+SendResult net_send_fpacket(Session *s, const NetPacket_Fixed<id>& fixed)
{
- bool ok = packet_send(s, reinterpret_cast<const Byte *>(&fixed), sizeof(F));
+ bool ok = packet_send(s, reinterpret_cast<const Byte *>(&fixed), sizeof(NetPacket_Fixed<id>));
return ok ? SendResult::Success : SendResult::Fail;
}
-template<class H, class R>
+template<uint16_t id>
__attribute__((warn_unused_result))
-SendResult net_send_vpacket(Session *s, const H& head, const std::vector<R>& repeat)
+SendResult net_send_vpacket(Session *s, const NetPacket_Head<id>& head, const std::vector<NetPacket_Repeat<id>>& repeat)
{
- bool ok = packet_send(s, reinterpret_cast<const Byte *>(&head), sizeof(H));
- ok &= packet_send(s, reinterpret_cast<const Byte *>(repeat.data()), repeat.size() * sizeof(R));
+ bool ok = packet_send(s, reinterpret_cast<const Byte *>(&head), sizeof(NetPacket_Head<id>));
+ ok &= packet_send(s, reinterpret_cast<const Byte *>(repeat.data()), repeat.size() * sizeof(NetPacket_Repeat<id>));
return ok ? SendResult::Success : SendResult::Fail;
}
-template<class F>
+template<uint16_t id>
__attribute__((warn_unused_result))
-RecvResult net_recv_fpacket(Session *s, F& fixed)
+RecvResult net_recv_fpacket(Session *s, NetPacket_Fixed<id>& fixed)
{
- bool ok = packet_fetch(s, 0, reinterpret_cast<Byte *>(&fixed), sizeof(F));
+ bool ok = packet_fetch(s, 0, reinterpret_cast<Byte *>(&fixed), sizeof(NetPacket_Fixed<id>));
if (ok)
{
- packet_discard(s, sizeof(F));
+ packet_discard(s, sizeof(NetPacket_Fixed<id>));
return RecvResult::Complete;
}
return RecvResult::Incomplete;
}
-template<class HNat, class H, class R>
+template<uint16_t id>
__attribute__((warn_unused_result))
-RecvResult net_recv_vpacket(Session *s, H& head, std::vector<R>& repeat)
+RecvResult net_recv_vpacket(Session *s, NetPacket_Head<id>& head, std::vector<NetPacket_Repeat<id>>& repeat)
{
- bool ok = packet_fetch(s, 0, reinterpret_cast<Byte *>(&head), sizeof(H));
+ bool ok = packet_fetch(s, 0, reinterpret_cast<Byte *>(&head), sizeof(NetPacket_Head<id>));
if (ok)
{
- HNat nat;
+ Packet_Head<id> nat;
if (!network_to_native(&nat, head))
return RecvResult::Error;
if (packet_avail(s) < nat.magic_packet_length)
return RecvResult::Incomplete;
- if (nat.magic_packet_length < sizeof(H))
+ if (nat.magic_packet_length < sizeof(NetPacket_Head<id>))
return RecvResult::Error;
- size_t bytes_repeat = nat.magic_packet_length - sizeof(H);
- if (bytes_repeat % sizeof(R))
+ size_t bytes_repeat = nat.magic_packet_length - sizeof(NetPacket_Head<id>);
+ if (bytes_repeat % sizeof(NetPacket_Repeat<id>))
return RecvResult::Error;
- repeat.resize(bytes_repeat / sizeof(R));
- if (packet_fetch(s, sizeof(H), reinterpret_cast<Byte *>(repeat.data()), bytes_repeat))
+ repeat.resize(bytes_repeat / sizeof(NetPacket_Repeat<id>));
+ if (packet_fetch(s, sizeof(NetPacket_Head<id>), reinterpret_cast<Byte *>(repeat.data()), bytes_repeat))
{
packet_discard(s, nat.magic_packet_length);
return RecvResult::Complete;
@@ -125,13 +128,13 @@ RecvResult net_recv_vpacket(Session *s, H& head, std::vector<R>& repeat)
}
-template<uint16_t id, uint16_t size, class F>
-void send_fpacket(Session *s, const F& fixed)
+template<uint16_t id, uint16_t size>
+void send_fpacket(Session *s, const Packet_Fixed<id>& fixed)
{
- static_assert(id == F::PACKET_ID, "F::PACKET_ID");
- static_assert(size == sizeof(typename F::NetType), "F::NetType");
+ static_assert(id == Packet_Fixed<id>::PACKET_ID, "Packet_Fixed<id>::PACKET_ID");
+ static_assert(size == sizeof(NetPacket_Fixed<id>), "sizeof(NetPacket_Fixed<id>)");
- typename F::NetType net_fixed;
+ NetPacket_Fixed<id> net_fixed;
if (!native_to_network(&net_fixed, fixed))
{
s->set_eof();
@@ -142,17 +145,17 @@ void send_fpacket(Session *s, const F& fixed)
s->set_eof();
}
-template<uint16_t id, uint16_t headsize, uint16_t repeatsize, class H, class R>
-void send_vpacket(Session *s, H& head, const std::vector<R>& repeat)
+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)
{
- static_assert(id == H::PACKET_ID, "H::PACKET_ID");
- static_assert(headsize == sizeof(typename H::NetType), "H::NetType");
- static_assert(id == R::PACKET_ID, "R::PACKET_ID");
- static_assert(repeatsize == sizeof(typename R::NetType), "R::NetType");
+ 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>)");
- typename H::NetType net_head;
+ NetPacket_Head<id> net_head;
// since these are already allocated, can't overflow address space
- size_t total_size = sizeof(typename H::NetType) + repeat.size() * sizeof(typename R::NetType);
+ 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)
@@ -161,7 +164,7 @@ void send_vpacket(Session *s, H& head, const std::vector<R>& repeat)
return;
}
// TODO potentially avoid the allocation
- std::vector<typename R::NetType> net_repeat(repeat.size());
+ std::vector<NetPacket_Repeat<id>> net_repeat(repeat.size());
if (!native_to_network(&net_head, head))
{
s->set_eof();
@@ -180,16 +183,16 @@ void send_vpacket(Session *s, H& head, const std::vector<R>& repeat)
s->set_eof();
}
-template<uint16_t id, uint16_t size, class F>
+template<uint16_t id, uint16_t size>
__attribute__((warn_unused_result))
-RecvResult recv_fpacket(Session *s, F& fixed)
+RecvResult recv_fpacket(Session *s, Packet_Fixed<id>& fixed)
{
- static_assert(id == F::PACKET_ID, "F::PACKET_ID");
- static_assert(size == sizeof(typename F::NetType), "F::NetType");
+ static_assert(id == Packet_Fixed<id>::PACKET_ID, "Packet_Fixed<id>::PACKET_ID");
+ static_assert(size == sizeof(NetPacket_Fixed<id>), "NetPacket_Fixed<id>");
- typename F::NetType net_fixed;
+ NetPacket_Fixed<id> net_fixed;
RecvResult rv = net_recv_fpacket(s, net_fixed);
- assert (fixed.magic_packet_id == F::PACKET_ID);
+ assert (fixed.magic_packet_id == Packet_Fixed<id>::PACKET_ID);
if (rv == RecvResult::Complete)
{
if (!network_to_native(&fixed, net_fixed))
@@ -198,19 +201,19 @@ RecvResult recv_fpacket(Session *s, F& fixed)
return rv;
}
-template<uint16_t id, uint16_t headsize, uint16_t repeatsize, class H, class R>
+template<uint16_t id, uint16_t headsize, uint16_t repeatsize>
__attribute__((warn_unused_result))
-RecvResult recv_vpacket(Session *s, H& head, std::vector<R>& repeat)
+RecvResult recv_vpacket(Session *s, Packet_Head<id>& head, std::vector<Packet_Repeat<id>>& repeat)
{
- static_assert(id == H::PACKET_ID, "H::PACKET_ID");
- static_assert(headsize == sizeof(typename H::NetType), "H::NetType");
- static_assert(id == R::PACKET_ID, "R::PACKET_ID");
- static_assert(repeatsize == sizeof(typename R::NetType), "R::NetType");
-
- typename H::NetType net_head;
- std::vector<typename R::NetType> net_repeat;
- RecvResult rv = net_recv_vpacket<H>(s, net_head, net_repeat);
- assert (head.magic_packet_id == H::PACKET_ID);
+ static_assert(id == Packet_Head<id>::PACKET_ID, "Packet_Head<id>::PACKET_ID");
+ static_assert(headsize == sizeof(NetPacket_Head<id>), "NetPacket_Head<id>");
+ static_assert(id == Packet_Repeat<id>::PACKET_ID, "Packet_Repeat<id>::PACKET_ID");
+ static_assert(repeatsize == sizeof(NetPacket_Repeat<id>), "NetPacket_Repeat<id>");
+
+ NetPacket_Head<id> net_head;
+ std::vector<NetPacket_Repeat<id>> net_repeat;
+ RecvResult rv = net_recv_vpacket(s, net_head, net_repeat);
+ assert (head.magic_packet_id == Packet_Head<id>::PACKET_ID);
if (rv == RecvResult::Complete)
{
if (!network_to_native(&head, net_head))
@@ -227,22 +230,18 @@ RecvResult recv_vpacket(Session *s, H& head, std::vector<R>& repeat)
// convenience for trailing strings
-struct VarStringNetType
+template<uint16_t id, uint16_t headsize, uint16_t repeatsize>
+void send_vpacket(Session *s, Packet_Head<id>& head, const XString& repeat)
{
- char c;
-};
+ static_assert(id == Packet_Head<id>::PACKET_ID, "Packet_Head<id>::PACKET_ID");
+ static_assert(headsize == sizeof(NetPacket_Head<id>), "NetPacket_Head<id>");
+ static_assert(id == Packet_Repeat<id>::PACKET_ID, "Packet_Repeat<id>::PACKET_ID");
+ static_assert(repeatsize == sizeof(NetPacket_Repeat<id>), "NetPacket_Repeat<id>");
+ static_assert(repeatsize == 1, "repeatsize");
-template<uint16_t id, uint16_t headsize, uint16_t repeatsize, class H>
-void send_vpacket(Session *s, H& head, const XString& repeat)
-{
- static_assert(id == H::PACKET_ID, "H::PACKET_ID");
- static_assert(headsize == sizeof(typename H::NetType), "H::NetType");
- // static_assert(id == R::PACKET_ID, "R::PACKET_ID");
- static_assert(repeatsize == 1, "R::NetType");
-
- typename H::NetType net_head;
+ NetPacket_Head<id> net_head;
// since it's already allocated, it can't overflow address space
- size_t total_length = sizeof(typename H::NetType) + (repeat.size() + 1) * sizeof(VarStringNetType);
+ 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)
{
@@ -250,7 +249,7 @@ void send_vpacket(Session *s, H& head, const XString& repeat)
return;
}
// TODO potentially avoid the allocation
- std::vector<VarStringNetType> net_repeat(repeat.size() + 1);
+ std::vector<NetPacket_Repeat<id>> net_repeat(repeat.size() + 1);
if (!native_to_network(&net_head, head))
{
s->set_eof();
@@ -258,27 +257,28 @@ void send_vpacket(Session *s, H& head, const XString& repeat)
}
for (size_t i = 0; i < repeat.size(); ++i)
{
- net_repeat[i].c = repeat[i];
+ net_repeat[i].c = Byte{static_cast<uint8_t>(repeat[i])};
}
- net_repeat[repeat.size()].c = '\0';
+ 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();
}
-template<uint16_t id, uint16_t headsize, uint16_t repeatsize, class H>
+template<uint16_t id, uint16_t headsize, uint16_t repeatsize>
__attribute__((warn_unused_result))
-RecvResult recv_vpacket(Session *s, H& head, AString& repeat)
+RecvResult recv_vpacket(Session *s, Packet_Head<id>& head, AString& repeat)
{
- static_assert(id == H::PACKET_ID, "H::PACKET_ID");
- static_assert(headsize == sizeof(typename H::NetType), "H::NetType");
- //static_assert(id == R::PACKET_ID, "R::PACKET_ID");
- static_assert(repeatsize == 1, "R::NetType");
-
- typename H::NetType net_head;
- std::vector<VarStringNetType> net_repeat;
- RecvResult rv = net_recv_vpacket<H>(s, net_head, net_repeat);
- assert (head.magic_packet_id == H::PACKET_ID);
+ static_assert(id == Packet_Head<id>::PACKET_ID, "Packet_Head<id>::PACKET_ID");
+ static_assert(headsize == sizeof(NetPacket_Head<id>), "NetPacket_Head<id>");
+ static_assert(id == Packet_Repeat<id>::PACKET_ID, "Packet_Repeat<id>::PACKET_ID");
+ static_assert(repeatsize == sizeof(NetPacket_Repeat<id>), "NetPacket_Repeat<id>");
+ static_assert(repeatsize == 1, "repeatsize");
+
+ NetPacket_Head<id> net_head;
+ std::vector<NetPacket_Repeat<id>> net_repeat;
+ RecvResult rv = net_recv_vpacket(s, net_head, net_repeat);
+ assert (head.magic_packet_id == Packet_Head<id>::PACKET_ID);
if (rv == RecvResult::Complete)
{
if (!network_to_native(&head, net_head))
@@ -295,59 +295,30 @@ RecvResult recv_vpacket(Session *s, H& head, AString& repeat)
// if there is nothing in the head but the id and length, use the below
-// TODO make this go away with template specialization
-
-template<uint16_t PKT_ID>
-struct NetCommonPacketHead
-{
- Little16 magic_packet_id;
- Little16 magic_packet_length;
-};
-
-template<uint16_t PKT_ID>
-struct CommonPacketHead
-{
- using NetType = NetCommonPacketHead<PKT_ID>;
- static const uint16_t PACKET_ID = PKT_ID;
-
- uint16_t magic_packet_id = PACKET_ID;
- uint16_t magic_packet_length;
-};
-
-template<uint16_t PKT_ID>
-bool native_to_network(NetCommonPacketHead<PKT_ID> *net, CommonPacketHead<PKT_ID> nat)
-{
- return native_to_network(&net->magic_packet_id, nat.magic_packet_id)
- && native_to_network(&net->magic_packet_length, nat.magic_packet_length);
-}
-
-template<uint16_t PKT_ID>
-bool network_to_native(CommonPacketHead<PKT_ID> *nat, NetCommonPacketHead<PKT_ID> net)
-{
- return network_to_native(&nat->magic_packet_id, net.magic_packet_id)
- && network_to_native(&nat->magic_packet_length, net.magic_packet_length);
-}
-
-template<uint16_t id, uint16_t headsize, uint16_t repeatsize, class R>
-void send_packet_repeatonly(Session *s, const std::vector<R>& 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");
+ static_assert(headsize == sizeof(NetPacket_Head<id>), "repeat headsize");
static_assert(headsize == 4, "repeat headsize");
- static_assert(id == R::PACKET_ID, "R::PACKET_ID");
- static_assert(repeatsize == sizeof(typename R::NetType), "R::NetType");
+ static_assert(id == Packet_Repeat<id>::PACKET_ID, "Packet_Repeat<id>::PACKET_ID");
+ static_assert(repeatsize == sizeof(NetPacket_Repeat<id>), "sizeof(NetPacket_Repeat<id>)");
- CommonPacketHead<R::PACKET_ID> head;
+ Packet_Head<id> head;
send_vpacket<id, 4, repeatsize>(s, head, v);
}
-template<uint16_t id, uint16_t headsize, uint16_t repeatsize, class R>
+template<uint16_t id, uint16_t headsize, uint16_t repeatsize>
__attribute__((warn_unused_result))
-RecvResult recv_packet_repeatonly(Session *s, std::vector<R>& v)
+RecvResult recv_packet_repeatonly(Session *s, 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 == R::PACKET_ID, "R::PACKET_ID");
- static_assert(repeatsize == sizeof(typename R::NetType), "R::NetType");
+ static_assert(id == Packet_Repeat<id>::PACKET_ID, "Packet_Repeat<id>::PACKET_ID");
+ static_assert(repeatsize == sizeof(NetPacket_Repeat<id>), "sizeof(NetPacket_Repeat<id>)");
- CommonPacketHead<R::PACKET_ID> head;
+ Packet_Head<id> head;
return recv_vpacket<id, 4, repeatsize>(s, head, v);
}
diff --git a/src/proto2/any-user.hpp b/src/proto2/any-user.hpp
index 037171c..ea2e20d 100644
--- a/src/proto2/any-user.hpp
+++ b/src/proto2/any-user.hpp
@@ -27,66 +27,72 @@
// This is a public protocol, and changes require client cooperation
-struct RPacket_0x7530_Fixed
+template<>
+struct Packet_Fixed<0x7530>
{
- using NetType = NetRPacket_0x7530_Fixed;
static const uint16_t PACKET_ID = 0x7530;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
};
-struct SPacket_0x7531_Fixed
+template<>
+struct Packet_Fixed<0x7531>
{
- using NetType = NetSPacket_0x7531_Fixed;
static const uint16_t PACKET_ID = 0x7531;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
Version version = {};
};
-struct RPacket_0x7532_Fixed
+template<>
+struct Packet_Fixed<0x7532>
{
- using NetType = NetRPacket_0x7532_Fixed;
static const uint16_t PACKET_ID = 0x7532;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
};
-struct NetRPacket_0x7530_Fixed
+template<>
+struct NetPacket_Fixed<0x7530>
{
Little16 magic_packet_id;
};
-static_assert(offsetof(NetRPacket_0x7530_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7530_Fixed, magic_packet_id) == 0");
-static_assert(sizeof(NetRPacket_0x7530_Fixed) == 2, "sizeof(NetRPacket_0x7530_Fixed) == 2");
-struct NetSPacket_0x7531_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x7531>
{
Little16 magic_packet_id;
NetVersion version;
};
-static_assert(offsetof(NetSPacket_0x7531_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x7531_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x7531_Fixed, version) == 2, "offsetof(NetSPacket_0x7531_Fixed, version) == 2");
-static_assert(sizeof(NetSPacket_0x7531_Fixed) == 10, "sizeof(NetSPacket_0x7531_Fixed) == 10");
-struct NetRPacket_0x7532_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x7532>
{
Little16 magic_packet_id;
};
-static_assert(offsetof(NetRPacket_0x7532_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7532_Fixed, magic_packet_id) == 0");
-static_assert(sizeof(NetRPacket_0x7532_Fixed) == 2, "sizeof(NetRPacket_0x7532_Fixed) == 2");
+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");
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7530_Fixed *network, RPacket_0x7530_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7530> *network, Packet_Fixed<0x7530> 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(RPacket_0x7530_Fixed *native, NetRPacket_0x7530_Fixed network)
+bool network_to_native(Packet_Fixed<0x7530> *native, NetPacket_Fixed<0x7530> 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(NetSPacket_0x7531_Fixed *network, SPacket_0x7531_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7531> *network, Packet_Fixed<0x7531> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -94,7 +100,7 @@ bool native_to_network(NetSPacket_0x7531_Fixed *network, SPacket_0x7531_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7531_Fixed *native, NetSPacket_0x7531_Fixed network)
+bool network_to_native(Packet_Fixed<0x7531> *native, NetPacket_Fixed<0x7531> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -102,14 +108,14 @@ bool network_to_native(SPacket_0x7531_Fixed *native, NetSPacket_0x7531_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7532_Fixed *network, RPacket_0x7532_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7532> *network, Packet_Fixed<0x7532> 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(RPacket_0x7532_Fixed *native, NetRPacket_0x7532_Fixed network)
+bool network_to_native(Packet_Fixed<0x7532> *native, NetPacket_Fixed<0x7532> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
diff --git a/src/proto2/fwd.hpp b/src/proto2/fwd.hpp
index a18d0ef..f8dc786 100644
--- a/src/proto2/fwd.hpp
+++ b/src/proto2/fwd.hpp
@@ -21,170 +21,337 @@
# include "../sanity.hpp"
-struct RPacket_0x2709_Fixed;
-struct NetRPacket_0x2709_Fixed;
-struct RPacket_0x2712_Fixed;
-struct NetRPacket_0x2712_Fixed;
-struct SPacket_0x2713_Fixed;
-struct NetSPacket_0x2713_Fixed;
-struct RPacket_0x2714_Fixed;
-struct NetRPacket_0x2714_Fixed;
-struct RPacket_0x2715_Fixed;
-struct NetRPacket_0x2715_Fixed;
-struct RPacket_0x2716_Fixed;
-struct NetRPacket_0x2716_Fixed;
-struct SPacket_0x2717_Fixed;
-struct NetSPacket_0x2717_Fixed;
-struct RPacket_0x2720_Head;
-struct NetRPacket_0x2720_Head;
-struct RPacket_0x2720_Repeat;
-struct NetRPacket_0x2720_Repeat;
-struct SPacket_0x2721_Fixed;
-struct NetSPacket_0x2721_Fixed;
-struct RPacket_0x2722_Fixed;
-struct NetRPacket_0x2722_Fixed;
-struct SPacket_0x2723_Fixed;
-struct NetSPacket_0x2723_Fixed;
-struct RPacket_0x2724_Fixed;
-struct NetRPacket_0x2724_Fixed;
-struct RPacket_0x2725_Fixed;
-struct NetRPacket_0x2725_Fixed;
-struct RPacket_0x2727_Fixed;
-struct NetRPacket_0x2727_Fixed;
-struct RPacket_0x2728_Head;
-struct NetRPacket_0x2728_Head;
-struct RPacket_0x2728_Repeat;
-struct NetRPacket_0x2728_Repeat;
-struct SPacket_0x2729_Head;
-struct NetSPacket_0x2729_Head;
-struct SPacket_0x2729_Repeat;
-struct NetSPacket_0x2729_Repeat;
-struct RPacket_0x272a_Fixed;
-struct NetRPacket_0x272a_Fixed;
-struct SPacket_0x2730_Fixed;
-struct NetSPacket_0x2730_Fixed;
-struct SPacket_0x2731_Fixed;
-struct NetSPacket_0x2731_Fixed;
-struct SPacket_0x2732_Head;
-struct NetSPacket_0x2732_Head;
-struct SPacket_0x2732_Repeat;
-struct NetSPacket_0x2732_Repeat;
-struct RPacket_0x2740_Fixed;
-struct NetRPacket_0x2740_Fixed;
-struct SPacket_0x2741_Fixed;
-struct NetSPacket_0x2741_Fixed;
+# include <cstdint>
-struct SPacket_0x2726_Head;
-struct NetSPacket_0x2726_Head;
-struct SPacket_0x2726_Repeat;
-struct NetSPacket_0x2726_Repeat;
-struct RPacket_0x7920_Fixed;
-struct NetRPacket_0x7920_Fixed;
-struct SPacket_0x7921_Head;
-struct NetSPacket_0x7921_Head;
-struct SPacket_0x7921_Repeat;
-struct NetSPacket_0x7921_Repeat;
-struct RPacket_0x7924_Fixed;
-struct NetRPacket_0x7924_Fixed;
-struct SPacket_0x7925_Fixed;
-struct NetSPacket_0x7925_Fixed;
-struct RPacket_0x7930_Fixed;
-struct NetRPacket_0x7930_Fixed;
-struct SPacket_0x7931_Fixed;
-struct NetSPacket_0x7931_Fixed;
-struct RPacket_0x7932_Fixed;
-struct NetRPacket_0x7932_Fixed;
-struct SPacket_0x7933_Fixed;
-struct NetSPacket_0x7933_Fixed;
-struct RPacket_0x7934_Fixed;
-struct NetRPacket_0x7934_Fixed;
-struct SPacket_0x7935_Fixed;
-struct NetSPacket_0x7935_Fixed;
-struct RPacket_0x7936_Fixed;
-struct NetRPacket_0x7936_Fixed;
-struct SPacket_0x7937_Fixed;
-struct NetSPacket_0x7937_Fixed;
-struct RPacket_0x7938_Fixed;
-struct NetRPacket_0x7938_Fixed;
-struct SPacket_0x7939_Head;
-struct NetSPacket_0x7939_Head;
-struct SPacket_0x7939_Repeat;
-struct NetSPacket_0x7939_Repeat;
-struct RPacket_0x793a_Fixed;
-struct NetRPacket_0x793a_Fixed;
-struct SPacket_0x793b_Fixed;
-struct NetSPacket_0x793b_Fixed;
-struct RPacket_0x793c_Fixed;
-struct NetRPacket_0x793c_Fixed;
-struct SPacket_0x793d_Fixed;
-struct NetSPacket_0x793d_Fixed;
-struct RPacket_0x793e_Fixed;
-struct NetRPacket_0x793e_Fixed;
-struct SPacket_0x793f_Fixed;
-struct NetSPacket_0x793f_Fixed;
-struct RPacket_0x7940_Fixed;
-struct NetRPacket_0x7940_Fixed;
-struct SPacket_0x7941_Fixed;
-struct NetSPacket_0x7941_Fixed;
-struct RPacket_0x7942_Head;
-struct NetRPacket_0x7942_Head;
-struct RPacket_0x7942_Repeat;
-struct NetRPacket_0x7942_Repeat;
-struct SPacket_0x7943_Fixed;
-struct NetSPacket_0x7943_Fixed;
-struct RPacket_0x7944_Fixed;
-struct NetRPacket_0x7944_Fixed;
-struct SPacket_0x7945_Fixed;
-struct NetSPacket_0x7945_Fixed;
-struct RPacket_0x7946_Fixed;
-struct NetRPacket_0x7946_Fixed;
-struct SPacket_0x7947_Fixed;
-struct NetSPacket_0x7947_Fixed;
-struct RPacket_0x7948_Fixed;
-struct NetRPacket_0x7948_Fixed;
-struct SPacket_0x7949_Fixed;
-struct NetSPacket_0x7949_Fixed;
-struct RPacket_0x794a_Fixed;
-struct NetRPacket_0x794a_Fixed;
-struct SPacket_0x794b_Fixed;
-struct NetSPacket_0x794b_Fixed;
-struct RPacket_0x794c_Fixed;
-struct NetRPacket_0x794c_Fixed;
-struct SPacket_0x794d_Fixed;
-struct NetSPacket_0x794d_Fixed;
-struct RPacket_0x794e_Head;
-struct NetRPacket_0x794e_Head;
-struct RPacket_0x794e_Repeat;
-struct NetRPacket_0x794e_Repeat;
-struct SPacket_0x794f_Fixed;
-struct NetSPacket_0x794f_Fixed;
-struct RPacket_0x7950_Fixed;
-struct NetRPacket_0x7950_Fixed;
-struct SPacket_0x7951_Fixed;
-struct NetSPacket_0x7951_Fixed;
-struct RPacket_0x7952_Fixed;
-struct NetRPacket_0x7952_Fixed;
-struct SPacket_0x7953_Head;
-struct NetSPacket_0x7953_Head;
-struct SPacket_0x7953_Repeat;
-struct NetSPacket_0x7953_Repeat;
-struct RPacket_0x7954_Fixed;
-struct NetRPacket_0x7954_Fixed;
-struct RPacket_0x7955_Fixed;
-struct NetRPacket_0x7955_Fixed;
+template<uint16_t PACKET_ID> class Packet_Fixed;
+template<uint16_t PACKET_ID> class NetPacket_Fixed;
+template<uint16_t PACKET_ID> class Packet_Head;
+template<uint16_t PACKET_ID> class NetPacket_Head;
+template<uint16_t PACKET_ID> class Packet_Repeat;
+template<uint16_t PACKET_ID> class NetPacket_Repeat;
+template<>
+struct Packet_Fixed<0x2709>;
+template<>
+struct NetPacket_Fixed<0x2709>;
+template<>
+struct Packet_Fixed<0x2712>;
+template<>
+struct NetPacket_Fixed<0x2712>;
+template<>
+struct Packet_Fixed<0x2713>;
+template<>
+struct NetPacket_Fixed<0x2713>;
+template<>
+struct Packet_Fixed<0x2714>;
+template<>
+struct NetPacket_Fixed<0x2714>;
+template<>
+struct Packet_Fixed<0x2715>;
+template<>
+struct NetPacket_Fixed<0x2715>;
+template<>
+struct Packet_Fixed<0x2716>;
+template<>
+struct NetPacket_Fixed<0x2716>;
+template<>
+struct Packet_Fixed<0x2717>;
+template<>
+struct NetPacket_Fixed<0x2717>;
+template<>
+struct Packet_Head<0x2720>;
+template<>
+struct NetPacket_Head<0x2720>;
+template<>
+struct Packet_Repeat<0x2720>;
+template<>
+struct NetPacket_Repeat<0x2720>;
+template<>
+struct Packet_Fixed<0x2721>;
+template<>
+struct NetPacket_Fixed<0x2721>;
+template<>
+struct Packet_Fixed<0x2722>;
+template<>
+struct NetPacket_Fixed<0x2722>;
+template<>
+struct Packet_Fixed<0x2723>;
+template<>
+struct NetPacket_Fixed<0x2723>;
+template<>
+struct Packet_Fixed<0x2724>;
+template<>
+struct NetPacket_Fixed<0x2724>;
+template<>
+struct Packet_Fixed<0x2725>;
+template<>
+struct NetPacket_Fixed<0x2725>;
+template<>
+struct Packet_Fixed<0x2727>;
+template<>
+struct NetPacket_Fixed<0x2727>;
+template<>
+struct Packet_Head<0x2728>;
+template<>
+struct NetPacket_Head<0x2728>;
+template<>
+struct Packet_Repeat<0x2728>;
+template<>
+struct NetPacket_Repeat<0x2728>;
+template<>
+struct Packet_Head<0x2729>;
+template<>
+struct NetPacket_Head<0x2729>;
+template<>
+struct Packet_Repeat<0x2729>;
+template<>
+struct NetPacket_Repeat<0x2729>;
+template<>
+struct Packet_Fixed<0x272a>;
+template<>
+struct NetPacket_Fixed<0x272a>;
+template<>
+struct Packet_Fixed<0x2730>;
+template<>
+struct NetPacket_Fixed<0x2730>;
+template<>
+struct Packet_Fixed<0x2731>;
+template<>
+struct NetPacket_Fixed<0x2731>;
+template<>
+struct Packet_Head<0x2732>;
+template<>
+struct NetPacket_Head<0x2732>;
+template<>
+struct Packet_Repeat<0x2732>;
+template<>
+struct NetPacket_Repeat<0x2732>;
+template<>
+struct Packet_Fixed<0x2740>;
+template<>
+struct NetPacket_Fixed<0x2740>;
+template<>
+struct Packet_Fixed<0x2741>;
+template<>
+struct NetPacket_Fixed<0x2741>;
+template<>
+struct Packet_Head<0x2726>;
+template<>
+struct NetPacket_Head<0x2726>;
+template<>
+struct Packet_Repeat<0x2726>;
+template<>
+struct NetPacket_Repeat<0x2726>;
+template<>
+struct Packet_Fixed<0x7920>;
+template<>
+struct NetPacket_Fixed<0x7920>;
+template<>
+struct Packet_Head<0x7921>;
+template<>
+struct NetPacket_Head<0x7921>;
+template<>
+struct Packet_Repeat<0x7921>;
+template<>
+struct NetPacket_Repeat<0x7921>;
+template<>
+struct Packet_Fixed<0x7924>;
+template<>
+struct NetPacket_Fixed<0x7924>;
+template<>
+struct Packet_Fixed<0x7925>;
+template<>
+struct NetPacket_Fixed<0x7925>;
+template<>
+struct Packet_Fixed<0x7930>;
+template<>
+struct NetPacket_Fixed<0x7930>;
+template<>
+struct Packet_Fixed<0x7931>;
+template<>
+struct NetPacket_Fixed<0x7931>;
+template<>
+struct Packet_Fixed<0x7932>;
+template<>
+struct NetPacket_Fixed<0x7932>;
+template<>
+struct Packet_Fixed<0x7933>;
+template<>
+struct NetPacket_Fixed<0x7933>;
+template<>
+struct Packet_Fixed<0x7934>;
+template<>
+struct NetPacket_Fixed<0x7934>;
+template<>
+struct Packet_Fixed<0x7935>;
+template<>
+struct NetPacket_Fixed<0x7935>;
+template<>
+struct Packet_Fixed<0x7936>;
+template<>
+struct NetPacket_Fixed<0x7936>;
+template<>
+struct Packet_Fixed<0x7937>;
+template<>
+struct NetPacket_Fixed<0x7937>;
+template<>
+struct Packet_Fixed<0x7938>;
+template<>
+struct NetPacket_Fixed<0x7938>;
+template<>
+struct Packet_Head<0x7939>;
+template<>
+struct NetPacket_Head<0x7939>;
+template<>
+struct Packet_Repeat<0x7939>;
+template<>
+struct NetPacket_Repeat<0x7939>;
+template<>
+struct Packet_Fixed<0x793a>;
+template<>
+struct NetPacket_Fixed<0x793a>;
+template<>
+struct Packet_Fixed<0x793b>;
+template<>
+struct NetPacket_Fixed<0x793b>;
+template<>
+struct Packet_Fixed<0x793c>;
+template<>
+struct NetPacket_Fixed<0x793c>;
+template<>
+struct Packet_Fixed<0x793d>;
+template<>
+struct NetPacket_Fixed<0x793d>;
+template<>
+struct Packet_Fixed<0x793e>;
+template<>
+struct NetPacket_Fixed<0x793e>;
+template<>
+struct Packet_Fixed<0x793f>;
+template<>
+struct NetPacket_Fixed<0x793f>;
+template<>
+struct Packet_Fixed<0x7940>;
+template<>
+struct NetPacket_Fixed<0x7940>;
+template<>
+struct Packet_Fixed<0x7941>;
+template<>
+struct NetPacket_Fixed<0x7941>;
+template<>
+struct Packet_Head<0x7942>;
+template<>
+struct NetPacket_Head<0x7942>;
+template<>
+struct Packet_Repeat<0x7942>;
+template<>
+struct NetPacket_Repeat<0x7942>;
+template<>
+struct Packet_Fixed<0x7943>;
+template<>
+struct NetPacket_Fixed<0x7943>;
+template<>
+struct Packet_Fixed<0x7944>;
+template<>
+struct NetPacket_Fixed<0x7944>;
+template<>
+struct Packet_Fixed<0x7945>;
+template<>
+struct NetPacket_Fixed<0x7945>;
+template<>
+struct Packet_Fixed<0x7946>;
+template<>
+struct NetPacket_Fixed<0x7946>;
+template<>
+struct Packet_Fixed<0x7947>;
+template<>
+struct NetPacket_Fixed<0x7947>;
+template<>
+struct Packet_Fixed<0x7948>;
+template<>
+struct NetPacket_Fixed<0x7948>;
+template<>
+struct Packet_Fixed<0x7949>;
+template<>
+struct NetPacket_Fixed<0x7949>;
+template<>
+struct Packet_Fixed<0x794a>;
+template<>
+struct NetPacket_Fixed<0x794a>;
+template<>
+struct Packet_Fixed<0x794b>;
+template<>
+struct NetPacket_Fixed<0x794b>;
+template<>
+struct Packet_Fixed<0x794c>;
+template<>
+struct NetPacket_Fixed<0x794c>;
+template<>
+struct Packet_Fixed<0x794d>;
+template<>
+struct NetPacket_Fixed<0x794d>;
+template<>
+struct Packet_Head<0x794e>;
+template<>
+struct NetPacket_Head<0x794e>;
+template<>
+struct Packet_Repeat<0x794e>;
+template<>
+struct NetPacket_Repeat<0x794e>;
+template<>
+struct Packet_Fixed<0x794f>;
+template<>
+struct NetPacket_Fixed<0x794f>;
+template<>
+struct Packet_Fixed<0x7950>;
+template<>
+struct NetPacket_Fixed<0x7950>;
+template<>
+struct Packet_Fixed<0x7951>;
+template<>
+struct NetPacket_Fixed<0x7951>;
+template<>
+struct Packet_Fixed<0x7952>;
+template<>
+struct NetPacket_Fixed<0x7952>;
+template<>
+struct Packet_Head<0x7953>;
+template<>
+struct NetPacket_Head<0x7953>;
+template<>
+struct Packet_Repeat<0x7953>;
+template<>
+struct NetPacket_Repeat<0x7953>;
+template<>
+struct Packet_Fixed<0x7954>;
+template<>
+struct NetPacket_Fixed<0x7954>;
+template<>
+struct Packet_Fixed<0x7955>;
+template<>
+struct NetPacket_Fixed<0x7955>;
-struct SPacket_0x0212_Fixed;
-struct NetSPacket_0x0212_Fixed;
-struct RPacket_0x7530_Fixed;
-struct NetRPacket_0x7530_Fixed;
-struct SPacket_0x7531_Fixed;
-struct NetSPacket_0x7531_Fixed;
-struct RPacket_0x7532_Fixed;
-struct NetRPacket_0x7532_Fixed;
+
+template<>
+struct Packet_Fixed<0x0212>;
+template<>
+struct NetPacket_Fixed<0x0212>;
+
+template<>
+struct Packet_Fixed<0x7530>;
+template<>
+struct NetPacket_Fixed<0x7530>;
+template<>
+struct Packet_Fixed<0x7531>;
+template<>
+struct NetPacket_Fixed<0x7531>;
+template<>
+struct Packet_Fixed<0x7532>;
+template<>
+struct NetPacket_Fixed<0x7532>;
#endif // TMWA_PROTO2_FWD_HPP
diff --git a/src/proto2/login-admin.hpp b/src/proto2/login-admin.hpp
index 005ecfc..fed3ad6 100644
--- a/src/proto2/login-admin.hpp
+++ b/src/proto2/login-admin.hpp
@@ -27,42 +27,47 @@
// This is an internal protocol, and can be changed without notice
-struct SPacket_0x2726_Head
+template<>
+struct Packet_Head<0x2726>
{
- using NetType = NetSPacket_0x2726_Head;
static const uint16_t PACKET_ID = 0x2726;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
uint16_t unused = {};
+ // TODO remove this
uint32_t magic_packet_length = {};
};
-struct SPacket_0x2726_Repeat
+template<>
+struct Packet_Repeat<0x2726>
{
- using NetType = NetSPacket_0x2726_Repeat;
static const uint16_t PACKET_ID = 0x2726;
uint8_t c = {};
};
-struct RPacket_0x7920_Fixed
+template<>
+struct Packet_Fixed<0x7920>
{
- using NetType = NetRPacket_0x7920_Fixed;
static const uint16_t PACKET_ID = 0x7920;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId start_account_id = {};
AccountId end_account_id = {};
};
-struct SPacket_0x7921_Head
+template<>
+struct Packet_Head<0x7921>
{
- using NetType = NetSPacket_0x7921_Head;
static const uint16_t PACKET_ID = 0x7921;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
+ // TODO remove this
uint16_t magic_packet_length = {};
};
-struct SPacket_0x7921_Repeat
+template<>
+struct Packet_Repeat<0x7921>
{
- using NetType = NetSPacket_0x7921_Repeat;
static const uint16_t PACKET_ID = 0x7921;
AccountId account_id = {};
@@ -72,115 +77,128 @@ struct SPacket_0x7921_Repeat
uint32_t login_count = {};
uint32_t status = {};
};
-struct RPacket_0x7924_Fixed
+template<>
+struct Packet_Fixed<0x7924>
{
- using NetType = NetRPacket_0x7924_Fixed;
static const uint16_t PACKET_ID = 0x7924;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
ItemNameId source_item_id = {};
ItemNameId dest_item_id = {};
};
-struct SPacket_0x7925_Fixed
+template<>
+struct Packet_Fixed<0x7925>
{
- using NetType = NetSPacket_0x7925_Fixed;
static const uint16_t PACKET_ID = 0x7925;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
};
-struct RPacket_0x7930_Fixed
+template<>
+struct Packet_Fixed<0x7930>
{
- using NetType = NetRPacket_0x7930_Fixed;
static const uint16_t PACKET_ID = 0x7930;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountName account_name = {};
AccountPass password = {};
SEX sex = {};
AccountEmail email = {};
};
-struct SPacket_0x7931_Fixed
+template<>
+struct Packet_Fixed<0x7931>
{
- using NetType = NetSPacket_0x7931_Fixed;
static const uint16_t PACKET_ID = 0x7931;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountName account_name = {};
};
-struct RPacket_0x7932_Fixed
+template<>
+struct Packet_Fixed<0x7932>
{
- using NetType = NetRPacket_0x7932_Fixed;
static const uint16_t PACKET_ID = 0x7932;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountName account_name = {};
};
-struct SPacket_0x7933_Fixed
+template<>
+struct Packet_Fixed<0x7933>
{
- using NetType = NetSPacket_0x7933_Fixed;
static const uint16_t PACKET_ID = 0x7933;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountName account_name = {};
};
-struct RPacket_0x7934_Fixed
+template<>
+struct Packet_Fixed<0x7934>
{
- using NetType = NetRPacket_0x7934_Fixed;
static const uint16_t PACKET_ID = 0x7934;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountName account_name = {};
AccountPass password = {};
};
-struct SPacket_0x7935_Fixed
+template<>
+struct Packet_Fixed<0x7935>
{
- using NetType = NetSPacket_0x7935_Fixed;
static const uint16_t PACKET_ID = 0x7935;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountName account_name = {};
};
-struct RPacket_0x7936_Fixed
+template<>
+struct Packet_Fixed<0x7936>
{
- using NetType = NetRPacket_0x7936_Fixed;
static const uint16_t PACKET_ID = 0x7936;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountName account_name = {};
uint32_t status = {};
timestamp_seconds_buffer error_message = {};
};
-struct SPacket_0x7937_Fixed
+template<>
+struct Packet_Fixed<0x7937>
{
- using NetType = NetSPacket_0x7937_Fixed;
static const uint16_t PACKET_ID = 0x7937;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountName account_name = {};
uint32_t status = {};
};
-struct RPacket_0x7938_Fixed
+template<>
+struct Packet_Fixed<0x7938>
{
- using NetType = NetRPacket_0x7938_Fixed;
static const uint16_t PACKET_ID = 0x7938;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
};
-struct SPacket_0x7939_Head
+template<>
+struct Packet_Head<0x7939>
{
- using NetType = NetSPacket_0x7939_Head;
static const uint16_t PACKET_ID = 0x7939;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
+ // TODO remove this
uint16_t magic_packet_length = {};
};
-struct SPacket_0x7939_Repeat
+template<>
+struct Packet_Repeat<0x7939>
{
- using NetType = NetSPacket_0x7939_Repeat;
static const uint16_t PACKET_ID = 0x7939;
IP4Address ip = {};
@@ -190,250 +208,278 @@ struct SPacket_0x7939_Repeat
uint16_t maintenance = {};
uint16_t is_new = {};
};
-struct RPacket_0x793a_Fixed
+template<>
+struct Packet_Fixed<0x793a>
{
- using NetType = NetRPacket_0x793a_Fixed;
static const uint16_t PACKET_ID = 0x793a;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountName account_name = {};
AccountPass password = {};
};
-struct SPacket_0x793b_Fixed
+template<>
+struct Packet_Fixed<0x793b>
{
- using NetType = NetSPacket_0x793b_Fixed;
static const uint16_t PACKET_ID = 0x793b;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountName account_name = {};
};
-struct RPacket_0x793c_Fixed
+template<>
+struct Packet_Fixed<0x793c>
{
- using NetType = NetRPacket_0x793c_Fixed;
static const uint16_t PACKET_ID = 0x793c;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountName account_name = {};
SEX sex = {};
};
-struct SPacket_0x793d_Fixed
+template<>
+struct Packet_Fixed<0x793d>
{
- using NetType = NetSPacket_0x793d_Fixed;
static const uint16_t PACKET_ID = 0x793d;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountName account_name = {};
};
-struct RPacket_0x793e_Fixed
+template<>
+struct Packet_Fixed<0x793e>
{
- using NetType = NetRPacket_0x793e_Fixed;
static const uint16_t PACKET_ID = 0x793e;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountName account_name = {};
GmLevel gm_level = {};
};
-struct SPacket_0x793f_Fixed
+template<>
+struct Packet_Fixed<0x793f>
{
- using NetType = NetSPacket_0x793f_Fixed;
static const uint16_t PACKET_ID = 0x793f;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountName account_name = {};
};
-struct RPacket_0x7940_Fixed
+template<>
+struct Packet_Fixed<0x7940>
{
- using NetType = NetRPacket_0x7940_Fixed;
static const uint16_t PACKET_ID = 0x7940;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountName account_name = {};
AccountEmail email = {};
};
-struct SPacket_0x7941_Fixed
+template<>
+struct Packet_Fixed<0x7941>
{
- using NetType = NetSPacket_0x7941_Fixed;
static const uint16_t PACKET_ID = 0x7941;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountName account_name = {};
};
-struct RPacket_0x7942_Head
+template<>
+struct Packet_Head<0x7942>
{
- using NetType = NetRPacket_0x7942_Head;
static const uint16_t PACKET_ID = 0x7942;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountName account_name = {};
+ // TODO remove this
uint16_t magic_packet_length = {};
};
-struct RPacket_0x7942_Repeat
+template<>
+struct Packet_Repeat<0x7942>
{
- using NetType = NetRPacket_0x7942_Repeat;
static const uint16_t PACKET_ID = 0x7942;
uint8_t c = {};
};
-struct SPacket_0x7943_Fixed
+template<>
+struct Packet_Fixed<0x7943>
{
- using NetType = NetSPacket_0x7943_Fixed;
static const uint16_t PACKET_ID = 0x7943;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountName account_name = {};
};
-struct RPacket_0x7944_Fixed
+template<>
+struct Packet_Fixed<0x7944>
{
- using NetType = NetRPacket_0x7944_Fixed;
static const uint16_t PACKET_ID = 0x7944;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountName account_name = {};
};
-struct SPacket_0x7945_Fixed
+template<>
+struct Packet_Fixed<0x7945>
{
- using NetType = NetSPacket_0x7945_Fixed;
static const uint16_t PACKET_ID = 0x7945;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountName account_name = {};
};
-struct RPacket_0x7946_Fixed
+template<>
+struct Packet_Fixed<0x7946>
{
- using NetType = NetRPacket_0x7946_Fixed;
static const uint16_t PACKET_ID = 0x7946;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
};
-struct SPacket_0x7947_Fixed
+template<>
+struct Packet_Fixed<0x7947>
{
- using NetType = NetSPacket_0x7947_Fixed;
static const uint16_t PACKET_ID = 0x7947;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountName account_name = {};
};
-struct RPacket_0x7948_Fixed
+template<>
+struct Packet_Fixed<0x7948>
{
- using NetType = NetRPacket_0x7948_Fixed;
static const uint16_t PACKET_ID = 0x7948;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountName account_name = {};
TimeT valid_until = {};
};
-struct SPacket_0x7949_Fixed
+template<>
+struct Packet_Fixed<0x7949>
{
- using NetType = NetSPacket_0x7949_Fixed;
static const uint16_t PACKET_ID = 0x7949;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountName account_name = {};
TimeT valid_until = {};
};
-struct RPacket_0x794a_Fixed
+template<>
+struct Packet_Fixed<0x794a>
{
- using NetType = NetRPacket_0x794a_Fixed;
static const uint16_t PACKET_ID = 0x794a;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountName account_name = {};
TimeT ban_until = {};
};
-struct SPacket_0x794b_Fixed
+template<>
+struct Packet_Fixed<0x794b>
{
- using NetType = NetSPacket_0x794b_Fixed;
static const uint16_t PACKET_ID = 0x794b;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountName account_name = {};
TimeT ban_until = {};
};
-struct RPacket_0x794c_Fixed
+template<>
+struct Packet_Fixed<0x794c>
{
- using NetType = NetRPacket_0x794c_Fixed;
static const uint16_t PACKET_ID = 0x794c;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountName account_name = {};
HumanTimeDiff ban_add = {};
};
-struct SPacket_0x794d_Fixed
+template<>
+struct Packet_Fixed<0x794d>
{
- using NetType = NetSPacket_0x794d_Fixed;
static const uint16_t PACKET_ID = 0x794d;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountName account_name = {};
TimeT ban_until = {};
};
-struct RPacket_0x794e_Head
+template<>
+struct Packet_Head<0x794e>
{
- using NetType = NetRPacket_0x794e_Head;
static const uint16_t PACKET_ID = 0x794e;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
uint16_t unused = {};
+ // TODO remove this
uint32_t magic_packet_length = {};
};
-struct RPacket_0x794e_Repeat
+template<>
+struct Packet_Repeat<0x794e>
{
- using NetType = NetRPacket_0x794e_Repeat;
static const uint16_t PACKET_ID = 0x794e;
uint8_t c = {};
};
-struct SPacket_0x794f_Fixed
+template<>
+struct Packet_Fixed<0x794f>
{
- using NetType = NetSPacket_0x794f_Fixed;
static const uint16_t PACKET_ID = 0x794f;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
uint16_t error = {};
};
-struct RPacket_0x7950_Fixed
+template<>
+struct Packet_Fixed<0x7950>
{
- using NetType = NetRPacket_0x7950_Fixed;
static const uint16_t PACKET_ID = 0x7950;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountName account_name = {};
HumanTimeDiff valid_add = {};
};
-struct SPacket_0x7951_Fixed
+template<>
+struct Packet_Fixed<0x7951>
{
- using NetType = NetSPacket_0x7951_Fixed;
static const uint16_t PACKET_ID = 0x7951;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountName account_name = {};
TimeT valid_until = {};
};
-struct RPacket_0x7952_Fixed
+template<>
+struct Packet_Fixed<0x7952>
{
- using NetType = NetRPacket_0x7952_Fixed;
static const uint16_t PACKET_ID = 0x7952;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountName account_name = {};
};
-struct SPacket_0x7953_Head
+template<>
+struct Packet_Head<0x7953>
{
- using NetType = NetSPacket_0x7953_Head;
static const uint16_t PACKET_ID = 0x7953;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
GmLevel gm_level = {};
@@ -447,66 +493,74 @@ struct SPacket_0x7953_Head
AccountEmail email = {};
TimeT connect_until = {};
TimeT ban_until = {};
+ // TODO remove this
uint16_t magic_packet_length = {};
};
-struct SPacket_0x7953_Repeat
+template<>
+struct Packet_Repeat<0x7953>
{
- using NetType = NetSPacket_0x7953_Repeat;
static const uint16_t PACKET_ID = 0x7953;
uint8_t c = {};
};
-struct RPacket_0x7954_Fixed
+template<>
+struct Packet_Fixed<0x7954>
{
- using NetType = NetRPacket_0x7954_Fixed;
static const uint16_t PACKET_ID = 0x7954;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
};
-struct RPacket_0x7955_Fixed
+template<>
+struct Packet_Fixed<0x7955>
{
- using NetType = NetRPacket_0x7955_Fixed;
static const uint16_t PACKET_ID = 0x7955;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
};
-struct NetSPacket_0x2726_Head
+template<>
+struct NetPacket_Head<0x2726>
{
Little16 magic_packet_id;
Little16 unused;
SkewedLength<Little32, 8> magic_packet_length;
};
-static_assert(offsetof(NetSPacket_0x2726_Head, magic_packet_id) == 0, "offsetof(NetSPacket_0x2726_Head, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x2726_Head, unused) == 2, "offsetof(NetSPacket_0x2726_Head, unused) == 2");
-static_assert(offsetof(NetSPacket_0x2726_Head, magic_packet_length) == 4, "offsetof(NetSPacket_0x2726_Head, magic_packet_length) == 4");
-static_assert(sizeof(NetSPacket_0x2726_Head) == 8, "sizeof(NetSPacket_0x2726_Head) == 8");
-struct NetSPacket_0x2726_Repeat
+static_assert(offsetof(NetPacket_Head<0x2726>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x2726>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Repeat<0x2726>
{
Byte c;
};
-static_assert(offsetof(NetSPacket_0x2726_Repeat, c) == 0, "offsetof(NetSPacket_0x2726_Repeat, c) == 0");
-static_assert(sizeof(NetSPacket_0x2726_Repeat) == 1, "sizeof(NetSPacket_0x2726_Repeat) == 1");
-struct NetRPacket_0x7920_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x7920>
{
Little16 magic_packet_id;
Little32 start_account_id;
Little32 end_account_id;
};
-static_assert(offsetof(NetRPacket_0x7920_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7920_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x7920_Fixed, start_account_id) == 2, "offsetof(NetRPacket_0x7920_Fixed, start_account_id) == 2");
-static_assert(offsetof(NetRPacket_0x7920_Fixed, end_account_id) == 6, "offsetof(NetRPacket_0x7920_Fixed, end_account_id) == 6");
-static_assert(sizeof(NetRPacket_0x7920_Fixed) == 10, "sizeof(NetRPacket_0x7920_Fixed) == 10");
-struct NetSPacket_0x7921_Head
+static_assert(offsetof(NetPacket_Fixed<0x7920>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7920>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Head<0x7921>
{
Little16 magic_packet_id;
Little16 magic_packet_length;
};
-static_assert(offsetof(NetSPacket_0x7921_Head, magic_packet_id) == 0, "offsetof(NetSPacket_0x7921_Head, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x7921_Head, magic_packet_length) == 2, "offsetof(NetSPacket_0x7921_Head, magic_packet_length) == 2");
-static_assert(sizeof(NetSPacket_0x7921_Head) == 4, "sizeof(NetSPacket_0x7921_Head) == 4");
-struct NetSPacket_0x7921_Repeat
+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");
+template<>
+struct NetPacket_Repeat<0x7921>
{
Little32 account_id;
Byte gm_level;
@@ -515,30 +569,33 @@ struct NetSPacket_0x7921_Repeat
Little32 login_count;
Little32 status;
};
-static_assert(offsetof(NetSPacket_0x7921_Repeat, account_id) == 0, "offsetof(NetSPacket_0x7921_Repeat, account_id) == 0");
-static_assert(offsetof(NetSPacket_0x7921_Repeat, gm_level) == 4, "offsetof(NetSPacket_0x7921_Repeat, gm_level) == 4");
-static_assert(offsetof(NetSPacket_0x7921_Repeat, account_name) == 5, "offsetof(NetSPacket_0x7921_Repeat, account_name) == 5");
-static_assert(offsetof(NetSPacket_0x7921_Repeat, sex) == 29, "offsetof(NetSPacket_0x7921_Repeat, sex) == 29");
-static_assert(offsetof(NetSPacket_0x7921_Repeat, login_count) == 30, "offsetof(NetSPacket_0x7921_Repeat, login_count) == 30");
-static_assert(offsetof(NetSPacket_0x7921_Repeat, status) == 34, "offsetof(NetSPacket_0x7921_Repeat, status) == 34");
-static_assert(sizeof(NetSPacket_0x7921_Repeat) == 38, "sizeof(NetSPacket_0x7921_Repeat) == 38");
-struct NetRPacket_0x7924_Fixed
+static_assert(offsetof(NetPacket_Repeat<0x7921>, account_id) == 0, "offsetof(NetPacket_Repeat<0x7921>, account_id) == 0");
+static_assert(offsetof(NetPacket_Repeat<0x7921>, gm_level) == 4, "offsetof(NetPacket_Repeat<0x7921>, gm_level) == 4");
+static_assert(offsetof(NetPacket_Repeat<0x7921>, account_name) == 5, "offsetof(NetPacket_Repeat<0x7921>, account_name) == 5");
+static_assert(offsetof(NetPacket_Repeat<0x7921>, sex) == 29, "offsetof(NetPacket_Repeat<0x7921>, sex) == 29");
+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");
+template<>
+struct NetPacket_Fixed<0x7924>
{
Little16 magic_packet_id;
Little32 source_item_id;
Little32 dest_item_id;
};
-static_assert(offsetof(NetRPacket_0x7924_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7924_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x7924_Fixed, source_item_id) == 2, "offsetof(NetRPacket_0x7924_Fixed, source_item_id) == 2");
-static_assert(offsetof(NetRPacket_0x7924_Fixed, dest_item_id) == 6, "offsetof(NetRPacket_0x7924_Fixed, dest_item_id) == 6");
-static_assert(sizeof(NetRPacket_0x7924_Fixed) == 10, "sizeof(NetRPacket_0x7924_Fixed) == 10");
-struct NetSPacket_0x7925_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x7924>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7924>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x7925>
{
Little16 magic_packet_id;
};
-static_assert(offsetof(NetSPacket_0x7925_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x7925_Fixed, magic_packet_id) == 0");
-static_assert(sizeof(NetSPacket_0x7925_Fixed) == 2, "sizeof(NetSPacket_0x7925_Fixed) == 2");
-struct NetRPacket_0x7930_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x7930>
{
Little16 magic_packet_id;
NetString<sizeof(AccountName)> account_name;
@@ -546,99 +603,109 @@ struct NetRPacket_0x7930_Fixed
char sex;
NetString<sizeof(AccountEmail)> email;
};
-static_assert(offsetof(NetRPacket_0x7930_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7930_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x7930_Fixed, account_name) == 2, "offsetof(NetRPacket_0x7930_Fixed, account_name) == 2");
-static_assert(offsetof(NetRPacket_0x7930_Fixed, password) == 26, "offsetof(NetRPacket_0x7930_Fixed, password) == 26");
-static_assert(offsetof(NetRPacket_0x7930_Fixed, sex) == 50, "offsetof(NetRPacket_0x7930_Fixed, sex) == 50");
-static_assert(offsetof(NetRPacket_0x7930_Fixed, email) == 51, "offsetof(NetRPacket_0x7930_Fixed, email) == 51");
-static_assert(sizeof(NetRPacket_0x7930_Fixed) == 91, "sizeof(NetRPacket_0x7930_Fixed) == 91");
-struct NetSPacket_0x7931_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x7930>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7930>, magic_packet_id) == 0");
+static_assert(offsetof(NetPacket_Fixed<0x7930>, account_name) == 2, "offsetof(NetPacket_Fixed<0x7930>, account_name) == 2");
+static_assert(offsetof(NetPacket_Fixed<0x7930>, password) == 26, "offsetof(NetPacket_Fixed<0x7930>, password) == 26");
+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");
+template<>
+struct NetPacket_Fixed<0x7931>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountName)> account_name;
};
-static_assert(offsetof(NetSPacket_0x7931_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x7931_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x7931_Fixed, account_id) == 2, "offsetof(NetSPacket_0x7931_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x7931_Fixed, account_name) == 6, "offsetof(NetSPacket_0x7931_Fixed, account_name) == 6");
-static_assert(sizeof(NetSPacket_0x7931_Fixed) == 30, "sizeof(NetSPacket_0x7931_Fixed) == 30");
-struct NetRPacket_0x7932_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x7931>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7931>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x7932>
{
Little16 magic_packet_id;
NetString<sizeof(AccountName)> account_name;
};
-static_assert(offsetof(NetRPacket_0x7932_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7932_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x7932_Fixed, account_name) == 2, "offsetof(NetRPacket_0x7932_Fixed, account_name) == 2");
-static_assert(sizeof(NetRPacket_0x7932_Fixed) == 26, "sizeof(NetRPacket_0x7932_Fixed) == 26");
-struct NetSPacket_0x7933_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x7933>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountName)> account_name;
};
-static_assert(offsetof(NetSPacket_0x7933_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x7933_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x7933_Fixed, account_id) == 2, "offsetof(NetSPacket_0x7933_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x7933_Fixed, account_name) == 6, "offsetof(NetSPacket_0x7933_Fixed, account_name) == 6");
-static_assert(sizeof(NetSPacket_0x7933_Fixed) == 30, "sizeof(NetSPacket_0x7933_Fixed) == 30");
-struct NetRPacket_0x7934_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x7933>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7933>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x7934>
{
Little16 magic_packet_id;
NetString<sizeof(AccountName)> account_name;
NetString<sizeof(AccountPass)> password;
};
-static_assert(offsetof(NetRPacket_0x7934_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7934_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x7934_Fixed, account_name) == 2, "offsetof(NetRPacket_0x7934_Fixed, account_name) == 2");
-static_assert(offsetof(NetRPacket_0x7934_Fixed, password) == 26, "offsetof(NetRPacket_0x7934_Fixed, password) == 26");
-static_assert(sizeof(NetRPacket_0x7934_Fixed) == 50, "sizeof(NetRPacket_0x7934_Fixed) == 50");
-struct NetSPacket_0x7935_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x7934>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7934>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x7935>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountName)> account_name;
};
-static_assert(offsetof(NetSPacket_0x7935_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x7935_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x7935_Fixed, account_id) == 2, "offsetof(NetSPacket_0x7935_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x7935_Fixed, account_name) == 6, "offsetof(NetSPacket_0x7935_Fixed, account_name) == 6");
-static_assert(sizeof(NetSPacket_0x7935_Fixed) == 30, "sizeof(NetSPacket_0x7935_Fixed) == 30");
-struct NetRPacket_0x7936_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x7935>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7935>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x7936>
{
Little16 magic_packet_id;
NetString<sizeof(AccountName)> account_name;
Little32 status;
NetString<sizeof(timestamp_seconds_buffer)> error_message;
};
-static_assert(offsetof(NetRPacket_0x7936_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7936_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x7936_Fixed, account_name) == 2, "offsetof(NetRPacket_0x7936_Fixed, account_name) == 2");
-static_assert(offsetof(NetRPacket_0x7936_Fixed, status) == 26, "offsetof(NetRPacket_0x7936_Fixed, status) == 26");
-static_assert(offsetof(NetRPacket_0x7936_Fixed, error_message) == 30, "offsetof(NetRPacket_0x7936_Fixed, error_message) == 30");
-static_assert(sizeof(NetRPacket_0x7936_Fixed) == 50, "sizeof(NetRPacket_0x7936_Fixed) == 50");
-struct NetSPacket_0x7937_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x7936>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7936>, magic_packet_id) == 0");
+static_assert(offsetof(NetPacket_Fixed<0x7936>, account_name) == 2, "offsetof(NetPacket_Fixed<0x7936>, account_name) == 2");
+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");
+template<>
+struct NetPacket_Fixed<0x7937>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountName)> account_name;
Little32 status;
};
-static_assert(offsetof(NetSPacket_0x7937_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x7937_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x7937_Fixed, account_id) == 2, "offsetof(NetSPacket_0x7937_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x7937_Fixed, account_name) == 6, "offsetof(NetSPacket_0x7937_Fixed, account_name) == 6");
-static_assert(offsetof(NetSPacket_0x7937_Fixed, status) == 30, "offsetof(NetSPacket_0x7937_Fixed, status) == 30");
-static_assert(sizeof(NetSPacket_0x7937_Fixed) == 34, "sizeof(NetSPacket_0x7937_Fixed) == 34");
-struct NetRPacket_0x7938_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x7937>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7937>, magic_packet_id) == 0");
+static_assert(offsetof(NetPacket_Fixed<0x7937>, account_id) == 2, "offsetof(NetPacket_Fixed<0x7937>, account_id) == 2");
+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");
+template<>
+struct NetPacket_Fixed<0x7938>
{
Little16 magic_packet_id;
};
-static_assert(offsetof(NetRPacket_0x7938_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7938_Fixed, magic_packet_id) == 0");
-static_assert(sizeof(NetRPacket_0x7938_Fixed) == 2, "sizeof(NetRPacket_0x7938_Fixed) == 2");
-struct NetSPacket_0x7939_Head
+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");
+template<>
+struct NetPacket_Head<0x7939>
{
Little16 magic_packet_id;
Little16 magic_packet_length;
};
-static_assert(offsetof(NetSPacket_0x7939_Head, magic_packet_id) == 0, "offsetof(NetSPacket_0x7939_Head, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x7939_Head, magic_packet_length) == 2, "offsetof(NetSPacket_0x7939_Head, magic_packet_length) == 2");
-static_assert(sizeof(NetSPacket_0x7939_Head) == 4, "sizeof(NetSPacket_0x7939_Head) == 4");
-struct NetSPacket_0x7939_Repeat
+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");
+template<>
+struct NetPacket_Repeat<0x7939>
{
IP4Address ip;
Little16 port;
@@ -647,276 +714,304 @@ struct NetSPacket_0x7939_Repeat
Little16 maintenance;
Little16 is_new;
};
-static_assert(offsetof(NetSPacket_0x7939_Repeat, ip) == 0, "offsetof(NetSPacket_0x7939_Repeat, ip) == 0");
-static_assert(offsetof(NetSPacket_0x7939_Repeat, port) == 4, "offsetof(NetSPacket_0x7939_Repeat, port) == 4");
-static_assert(offsetof(NetSPacket_0x7939_Repeat, name) == 6, "offsetof(NetSPacket_0x7939_Repeat, name) == 6");
-static_assert(offsetof(NetSPacket_0x7939_Repeat, users) == 26, "offsetof(NetSPacket_0x7939_Repeat, users) == 26");
-static_assert(offsetof(NetSPacket_0x7939_Repeat, maintenance) == 28, "offsetof(NetSPacket_0x7939_Repeat, maintenance) == 28");
-static_assert(offsetof(NetSPacket_0x7939_Repeat, is_new) == 30, "offsetof(NetSPacket_0x7939_Repeat, is_new) == 30");
-static_assert(sizeof(NetSPacket_0x7939_Repeat) == 32, "sizeof(NetSPacket_0x7939_Repeat) == 32");
-struct NetRPacket_0x793a_Fixed
+static_assert(offsetof(NetPacket_Repeat<0x7939>, ip) == 0, "offsetof(NetPacket_Repeat<0x7939>, ip) == 0");
+static_assert(offsetof(NetPacket_Repeat<0x7939>, port) == 4, "offsetof(NetPacket_Repeat<0x7939>, port) == 4");
+static_assert(offsetof(NetPacket_Repeat<0x7939>, name) == 6, "offsetof(NetPacket_Repeat<0x7939>, name) == 6");
+static_assert(offsetof(NetPacket_Repeat<0x7939>, users) == 26, "offsetof(NetPacket_Repeat<0x7939>, users) == 26");
+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");
+template<>
+struct NetPacket_Fixed<0x793a>
{
Little16 magic_packet_id;
NetString<sizeof(AccountName)> account_name;
NetString<sizeof(AccountPass)> password;
};
-static_assert(offsetof(NetRPacket_0x793a_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x793a_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x793a_Fixed, account_name) == 2, "offsetof(NetRPacket_0x793a_Fixed, account_name) == 2");
-static_assert(offsetof(NetRPacket_0x793a_Fixed, password) == 26, "offsetof(NetRPacket_0x793a_Fixed, password) == 26");
-static_assert(sizeof(NetRPacket_0x793a_Fixed) == 50, "sizeof(NetRPacket_0x793a_Fixed) == 50");
-struct NetSPacket_0x793b_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x793a>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x793a>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x793b>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountName)> account_name;
};
-static_assert(offsetof(NetSPacket_0x793b_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x793b_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x793b_Fixed, account_id) == 2, "offsetof(NetSPacket_0x793b_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x793b_Fixed, account_name) == 6, "offsetof(NetSPacket_0x793b_Fixed, account_name) == 6");
-static_assert(sizeof(NetSPacket_0x793b_Fixed) == 30, "sizeof(NetSPacket_0x793b_Fixed) == 30");
-struct NetRPacket_0x793c_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x793b>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x793b>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x793c>
{
Little16 magic_packet_id;
NetString<sizeof(AccountName)> account_name;
char sex;
};
-static_assert(offsetof(NetRPacket_0x793c_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x793c_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x793c_Fixed, account_name) == 2, "offsetof(NetRPacket_0x793c_Fixed, account_name) == 2");
-static_assert(offsetof(NetRPacket_0x793c_Fixed, sex) == 26, "offsetof(NetRPacket_0x793c_Fixed, sex) == 26");
-static_assert(sizeof(NetRPacket_0x793c_Fixed) == 27, "sizeof(NetRPacket_0x793c_Fixed) == 27");
-struct NetSPacket_0x793d_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x793c>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x793c>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x793d>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountName)> account_name;
};
-static_assert(offsetof(NetSPacket_0x793d_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x793d_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x793d_Fixed, account_id) == 2, "offsetof(NetSPacket_0x793d_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x793d_Fixed, account_name) == 6, "offsetof(NetSPacket_0x793d_Fixed, account_name) == 6");
-static_assert(sizeof(NetSPacket_0x793d_Fixed) == 30, "sizeof(NetSPacket_0x793d_Fixed) == 30");
-struct NetRPacket_0x793e_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x793d>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x793d>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x793e>
{
Little16 magic_packet_id;
NetString<sizeof(AccountName)> account_name;
Byte gm_level;
};
-static_assert(offsetof(NetRPacket_0x793e_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x793e_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x793e_Fixed, account_name) == 2, "offsetof(NetRPacket_0x793e_Fixed, account_name) == 2");
-static_assert(offsetof(NetRPacket_0x793e_Fixed, gm_level) == 26, "offsetof(NetRPacket_0x793e_Fixed, gm_level) == 26");
-static_assert(sizeof(NetRPacket_0x793e_Fixed) == 27, "sizeof(NetRPacket_0x793e_Fixed) == 27");
-struct NetSPacket_0x793f_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x793e>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x793e>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x793f>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountName)> account_name;
};
-static_assert(offsetof(NetSPacket_0x793f_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x793f_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x793f_Fixed, account_id) == 2, "offsetof(NetSPacket_0x793f_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x793f_Fixed, account_name) == 6, "offsetof(NetSPacket_0x793f_Fixed, account_name) == 6");
-static_assert(sizeof(NetSPacket_0x793f_Fixed) == 30, "sizeof(NetSPacket_0x793f_Fixed) == 30");
-struct NetRPacket_0x7940_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x793f>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x793f>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x7940>
{
Little16 magic_packet_id;
NetString<sizeof(AccountName)> account_name;
NetString<sizeof(AccountEmail)> email;
};
-static_assert(offsetof(NetRPacket_0x7940_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7940_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x7940_Fixed, account_name) == 2, "offsetof(NetRPacket_0x7940_Fixed, account_name) == 2");
-static_assert(offsetof(NetRPacket_0x7940_Fixed, email) == 26, "offsetof(NetRPacket_0x7940_Fixed, email) == 26");
-static_assert(sizeof(NetRPacket_0x7940_Fixed) == 66, "sizeof(NetRPacket_0x7940_Fixed) == 66");
-struct NetSPacket_0x7941_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x7940>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7940>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x7941>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountName)> account_name;
};
-static_assert(offsetof(NetSPacket_0x7941_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x7941_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x7941_Fixed, account_id) == 2, "offsetof(NetSPacket_0x7941_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x7941_Fixed, account_name) == 6, "offsetof(NetSPacket_0x7941_Fixed, account_name) == 6");
-static_assert(sizeof(NetSPacket_0x7941_Fixed) == 30, "sizeof(NetSPacket_0x7941_Fixed) == 30");
-struct NetRPacket_0x7942_Head
+static_assert(offsetof(NetPacket_Fixed<0x7941>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7941>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Head<0x7942>
{
Little16 magic_packet_id;
NetString<sizeof(AccountName)> account_name;
SkewedLength<Little16, 28> magic_packet_length;
};
-static_assert(offsetof(NetRPacket_0x7942_Head, magic_packet_id) == 0, "offsetof(NetRPacket_0x7942_Head, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x7942_Head, account_name) == 2, "offsetof(NetRPacket_0x7942_Head, account_name) == 2");
-static_assert(offsetof(NetRPacket_0x7942_Head, magic_packet_length) == 26, "offsetof(NetRPacket_0x7942_Head, magic_packet_length) == 26");
-static_assert(sizeof(NetRPacket_0x7942_Head) == 28, "sizeof(NetRPacket_0x7942_Head) == 28");
-struct NetRPacket_0x7942_Repeat
+static_assert(offsetof(NetPacket_Head<0x7942>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x7942>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Repeat<0x7942>
{
Byte c;
};
-static_assert(offsetof(NetRPacket_0x7942_Repeat, c) == 0, "offsetof(NetRPacket_0x7942_Repeat, c) == 0");
-static_assert(sizeof(NetRPacket_0x7942_Repeat) == 1, "sizeof(NetRPacket_0x7942_Repeat) == 1");
-struct NetSPacket_0x7943_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x7943>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountName)> account_name;
};
-static_assert(offsetof(NetSPacket_0x7943_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x7943_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x7943_Fixed, account_id) == 2, "offsetof(NetSPacket_0x7943_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x7943_Fixed, account_name) == 6, "offsetof(NetSPacket_0x7943_Fixed, account_name) == 6");
-static_assert(sizeof(NetSPacket_0x7943_Fixed) == 30, "sizeof(NetSPacket_0x7943_Fixed) == 30");
-struct NetRPacket_0x7944_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x7943>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7943>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x7944>
{
Little16 magic_packet_id;
NetString<sizeof(AccountName)> account_name;
};
-static_assert(offsetof(NetRPacket_0x7944_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7944_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x7944_Fixed, account_name) == 2, "offsetof(NetRPacket_0x7944_Fixed, account_name) == 2");
-static_assert(sizeof(NetRPacket_0x7944_Fixed) == 26, "sizeof(NetRPacket_0x7944_Fixed) == 26");
-struct NetSPacket_0x7945_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x7945>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountName)> account_name;
};
-static_assert(offsetof(NetSPacket_0x7945_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x7945_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x7945_Fixed, account_id) == 2, "offsetof(NetSPacket_0x7945_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x7945_Fixed, account_name) == 6, "offsetof(NetSPacket_0x7945_Fixed, account_name) == 6");
-static_assert(sizeof(NetSPacket_0x7945_Fixed) == 30, "sizeof(NetSPacket_0x7945_Fixed) == 30");
-struct NetRPacket_0x7946_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x7945>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7945>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x7946>
{
Little16 magic_packet_id;
Little32 account_id;
};
-static_assert(offsetof(NetRPacket_0x7946_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7946_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x7946_Fixed, account_id) == 2, "offsetof(NetRPacket_0x7946_Fixed, account_id) == 2");
-static_assert(sizeof(NetRPacket_0x7946_Fixed) == 6, "sizeof(NetRPacket_0x7946_Fixed) == 6");
-struct NetSPacket_0x7947_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x7947>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountName)> account_name;
};
-static_assert(offsetof(NetSPacket_0x7947_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x7947_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x7947_Fixed, account_id) == 2, "offsetof(NetSPacket_0x7947_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x7947_Fixed, account_name) == 6, "offsetof(NetSPacket_0x7947_Fixed, account_name) == 6");
-static_assert(sizeof(NetSPacket_0x7947_Fixed) == 30, "sizeof(NetSPacket_0x7947_Fixed) == 30");
-struct NetRPacket_0x7948_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x7947>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7947>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x7948>
{
Little16 magic_packet_id;
NetString<sizeof(AccountName)> account_name;
Little32 valid_until;
};
-static_assert(offsetof(NetRPacket_0x7948_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7948_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x7948_Fixed, account_name) == 2, "offsetof(NetRPacket_0x7948_Fixed, account_name) == 2");
-static_assert(offsetof(NetRPacket_0x7948_Fixed, valid_until) == 26, "offsetof(NetRPacket_0x7948_Fixed, valid_until) == 26");
-static_assert(sizeof(NetRPacket_0x7948_Fixed) == 30, "sizeof(NetRPacket_0x7948_Fixed) == 30");
-struct NetSPacket_0x7949_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x7948>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7948>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x7949>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountName)> account_name;
Little32 valid_until;
};
-static_assert(offsetof(NetSPacket_0x7949_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x7949_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x7949_Fixed, account_id) == 2, "offsetof(NetSPacket_0x7949_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x7949_Fixed, account_name) == 6, "offsetof(NetSPacket_0x7949_Fixed, account_name) == 6");
-static_assert(offsetof(NetSPacket_0x7949_Fixed, valid_until) == 30, "offsetof(NetSPacket_0x7949_Fixed, valid_until) == 30");
-static_assert(sizeof(NetSPacket_0x7949_Fixed) == 34, "sizeof(NetSPacket_0x7949_Fixed) == 34");
-struct NetRPacket_0x794a_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x7949>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7949>, magic_packet_id) == 0");
+static_assert(offsetof(NetPacket_Fixed<0x7949>, account_id) == 2, "offsetof(NetPacket_Fixed<0x7949>, account_id) == 2");
+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");
+template<>
+struct NetPacket_Fixed<0x794a>
{
Little16 magic_packet_id;
NetString<sizeof(AccountName)> account_name;
Little32 ban_until;
};
-static_assert(offsetof(NetRPacket_0x794a_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x794a_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x794a_Fixed, account_name) == 2, "offsetof(NetRPacket_0x794a_Fixed, account_name) == 2");
-static_assert(offsetof(NetRPacket_0x794a_Fixed, ban_until) == 26, "offsetof(NetRPacket_0x794a_Fixed, ban_until) == 26");
-static_assert(sizeof(NetRPacket_0x794a_Fixed) == 30, "sizeof(NetRPacket_0x794a_Fixed) == 30");
-struct NetSPacket_0x794b_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x794a>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x794a>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x794b>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountName)> account_name;
Little32 ban_until;
};
-static_assert(offsetof(NetSPacket_0x794b_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x794b_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x794b_Fixed, account_id) == 2, "offsetof(NetSPacket_0x794b_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x794b_Fixed, account_name) == 6, "offsetof(NetSPacket_0x794b_Fixed, account_name) == 6");
-static_assert(offsetof(NetSPacket_0x794b_Fixed, ban_until) == 30, "offsetof(NetSPacket_0x794b_Fixed, ban_until) == 30");
-static_assert(sizeof(NetSPacket_0x794b_Fixed) == 34, "sizeof(NetSPacket_0x794b_Fixed) == 34");
-struct NetRPacket_0x794c_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x794b>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x794b>, magic_packet_id) == 0");
+static_assert(offsetof(NetPacket_Fixed<0x794b>, account_id) == 2, "offsetof(NetPacket_Fixed<0x794b>, account_id) == 2");
+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");
+template<>
+struct NetPacket_Fixed<0x794c>
{
Little16 magic_packet_id;
NetString<sizeof(AccountName)> account_name;
NetHumanTimeDiff ban_add;
};
-static_assert(offsetof(NetRPacket_0x794c_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x794c_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x794c_Fixed, account_name) == 2, "offsetof(NetRPacket_0x794c_Fixed, account_name) == 2");
-static_assert(offsetof(NetRPacket_0x794c_Fixed, ban_add) == 26, "offsetof(NetRPacket_0x794c_Fixed, ban_add) == 26");
-static_assert(sizeof(NetRPacket_0x794c_Fixed) == 38, "sizeof(NetRPacket_0x794c_Fixed) == 38");
-struct NetSPacket_0x794d_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x794c>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x794c>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x794d>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountName)> account_name;
Little32 ban_until;
};
-static_assert(offsetof(NetSPacket_0x794d_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x794d_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x794d_Fixed, account_id) == 2, "offsetof(NetSPacket_0x794d_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x794d_Fixed, account_name) == 6, "offsetof(NetSPacket_0x794d_Fixed, account_name) == 6");
-static_assert(offsetof(NetSPacket_0x794d_Fixed, ban_until) == 30, "offsetof(NetSPacket_0x794d_Fixed, ban_until) == 30");
-static_assert(sizeof(NetSPacket_0x794d_Fixed) == 34, "sizeof(NetSPacket_0x794d_Fixed) == 34");
-struct NetRPacket_0x794e_Head
+static_assert(offsetof(NetPacket_Fixed<0x794d>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x794d>, magic_packet_id) == 0");
+static_assert(offsetof(NetPacket_Fixed<0x794d>, account_id) == 2, "offsetof(NetPacket_Fixed<0x794d>, account_id) == 2");
+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");
+template<>
+struct NetPacket_Head<0x794e>
{
Little16 magic_packet_id;
Little16 unused;
SkewedLength<Little32, 8> magic_packet_length;
};
-static_assert(offsetof(NetRPacket_0x794e_Head, magic_packet_id) == 0, "offsetof(NetRPacket_0x794e_Head, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x794e_Head, unused) == 2, "offsetof(NetRPacket_0x794e_Head, unused) == 2");
-static_assert(offsetof(NetRPacket_0x794e_Head, magic_packet_length) == 4, "offsetof(NetRPacket_0x794e_Head, magic_packet_length) == 4");
-static_assert(sizeof(NetRPacket_0x794e_Head) == 8, "sizeof(NetRPacket_0x794e_Head) == 8");
-struct NetRPacket_0x794e_Repeat
+static_assert(offsetof(NetPacket_Head<0x794e>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x794e>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Repeat<0x794e>
{
Byte c;
};
-static_assert(offsetof(NetRPacket_0x794e_Repeat, c) == 0, "offsetof(NetRPacket_0x794e_Repeat, c) == 0");
-static_assert(sizeof(NetRPacket_0x794e_Repeat) == 1, "sizeof(NetRPacket_0x794e_Repeat) == 1");
-struct NetSPacket_0x794f_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x794f>
{
Little16 magic_packet_id;
Little16 error;
};
-static_assert(offsetof(NetSPacket_0x794f_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x794f_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x794f_Fixed, error) == 2, "offsetof(NetSPacket_0x794f_Fixed, error) == 2");
-static_assert(sizeof(NetSPacket_0x794f_Fixed) == 4, "sizeof(NetSPacket_0x794f_Fixed) == 4");
-struct NetRPacket_0x7950_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x7950>
{
Little16 magic_packet_id;
NetString<sizeof(AccountName)> account_name;
NetHumanTimeDiff valid_add;
};
-static_assert(offsetof(NetRPacket_0x7950_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7950_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x7950_Fixed, account_name) == 2, "offsetof(NetRPacket_0x7950_Fixed, account_name) == 2");
-static_assert(offsetof(NetRPacket_0x7950_Fixed, valid_add) == 26, "offsetof(NetRPacket_0x7950_Fixed, valid_add) == 26");
-static_assert(sizeof(NetRPacket_0x7950_Fixed) == 38, "sizeof(NetRPacket_0x7950_Fixed) == 38");
-struct NetSPacket_0x7951_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x7950>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7950>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x7951>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountName)> account_name;
Little32 valid_until;
};
-static_assert(offsetof(NetSPacket_0x7951_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x7951_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x7951_Fixed, account_id) == 2, "offsetof(NetSPacket_0x7951_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x7951_Fixed, account_name) == 6, "offsetof(NetSPacket_0x7951_Fixed, account_name) == 6");
-static_assert(offsetof(NetSPacket_0x7951_Fixed, valid_until) == 30, "offsetof(NetSPacket_0x7951_Fixed, valid_until) == 30");
-static_assert(sizeof(NetSPacket_0x7951_Fixed) == 34, "sizeof(NetSPacket_0x7951_Fixed) == 34");
-struct NetRPacket_0x7952_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x7951>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x7951>, magic_packet_id) == 0");
+static_assert(offsetof(NetPacket_Fixed<0x7951>, account_id) == 2, "offsetof(NetPacket_Fixed<0x7951>, account_id) == 2");
+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");
+template<>
+struct NetPacket_Fixed<0x7952>
{
Little16 magic_packet_id;
NetString<sizeof(AccountName)> account_name;
};
-static_assert(offsetof(NetRPacket_0x7952_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7952_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x7952_Fixed, account_name) == 2, "offsetof(NetRPacket_0x7952_Fixed, account_name) == 2");
-static_assert(sizeof(NetRPacket_0x7952_Fixed) == 26, "sizeof(NetRPacket_0x7952_Fixed) == 26");
-struct NetSPacket_0x7953_Head
+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");
+template<>
+struct NetPacket_Head<0x7953>
{
Little16 magic_packet_id;
Little32 account_id;
@@ -933,44 +1028,47 @@ struct NetSPacket_0x7953_Head
Little32 ban_until;
SkewedLength<Little16, 150> magic_packet_length;
};
-static_assert(offsetof(NetSPacket_0x7953_Head, magic_packet_id) == 0, "offsetof(NetSPacket_0x7953_Head, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x7953_Head, account_id) == 2, "offsetof(NetSPacket_0x7953_Head, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x7953_Head, gm_level) == 6, "offsetof(NetSPacket_0x7953_Head, gm_level) == 6");
-static_assert(offsetof(NetSPacket_0x7953_Head, account_name) == 7, "offsetof(NetSPacket_0x7953_Head, account_name) == 7");
-static_assert(offsetof(NetSPacket_0x7953_Head, sex) == 31, "offsetof(NetSPacket_0x7953_Head, sex) == 31");
-static_assert(offsetof(NetSPacket_0x7953_Head, login_count) == 32, "offsetof(NetSPacket_0x7953_Head, login_count) == 32");
-static_assert(offsetof(NetSPacket_0x7953_Head, state) == 36, "offsetof(NetSPacket_0x7953_Head, state) == 36");
-static_assert(offsetof(NetSPacket_0x7953_Head, error_message) == 40, "offsetof(NetSPacket_0x7953_Head, error_message) == 40");
-static_assert(offsetof(NetSPacket_0x7953_Head, last_login_string) == 60, "offsetof(NetSPacket_0x7953_Head, last_login_string) == 60");
-static_assert(offsetof(NetSPacket_0x7953_Head, ip_string) == 84, "offsetof(NetSPacket_0x7953_Head, ip_string) == 84");
-static_assert(offsetof(NetSPacket_0x7953_Head, email) == 100, "offsetof(NetSPacket_0x7953_Head, email) == 100");
-static_assert(offsetof(NetSPacket_0x7953_Head, connect_until) == 140, "offsetof(NetSPacket_0x7953_Head, connect_until) == 140");
-static_assert(offsetof(NetSPacket_0x7953_Head, ban_until) == 144, "offsetof(NetSPacket_0x7953_Head, ban_until) == 144");
-static_assert(offsetof(NetSPacket_0x7953_Head, magic_packet_length) == 148, "offsetof(NetSPacket_0x7953_Head, magic_packet_length) == 148");
-static_assert(sizeof(NetSPacket_0x7953_Head) == 150, "sizeof(NetSPacket_0x7953_Head) == 150");
-struct NetSPacket_0x7953_Repeat
+static_assert(offsetof(NetPacket_Head<0x7953>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x7953>, magic_packet_id) == 0");
+static_assert(offsetof(NetPacket_Head<0x7953>, account_id) == 2, "offsetof(NetPacket_Head<0x7953>, account_id) == 2");
+static_assert(offsetof(NetPacket_Head<0x7953>, gm_level) == 6, "offsetof(NetPacket_Head<0x7953>, gm_level) == 6");
+static_assert(offsetof(NetPacket_Head<0x7953>, account_name) == 7, "offsetof(NetPacket_Head<0x7953>, account_name) == 7");
+static_assert(offsetof(NetPacket_Head<0x7953>, sex) == 31, "offsetof(NetPacket_Head<0x7953>, sex) == 31");
+static_assert(offsetof(NetPacket_Head<0x7953>, login_count) == 32, "offsetof(NetPacket_Head<0x7953>, login_count) == 32");
+static_assert(offsetof(NetPacket_Head<0x7953>, state) == 36, "offsetof(NetPacket_Head<0x7953>, state) == 36");
+static_assert(offsetof(NetPacket_Head<0x7953>, error_message) == 40, "offsetof(NetPacket_Head<0x7953>, error_message) == 40");
+static_assert(offsetof(NetPacket_Head<0x7953>, last_login_string) == 60, "offsetof(NetPacket_Head<0x7953>, last_login_string) == 60");
+static_assert(offsetof(NetPacket_Head<0x7953>, ip_string) == 84, "offsetof(NetPacket_Head<0x7953>, ip_string) == 84");
+static_assert(offsetof(NetPacket_Head<0x7953>, email) == 100, "offsetof(NetPacket_Head<0x7953>, email) == 100");
+static_assert(offsetof(NetPacket_Head<0x7953>, connect_until) == 140, "offsetof(NetPacket_Head<0x7953>, connect_until) == 140");
+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");
+template<>
+struct NetPacket_Repeat<0x7953>
{
Byte c;
};
-static_assert(offsetof(NetSPacket_0x7953_Repeat, c) == 0, "offsetof(NetSPacket_0x7953_Repeat, c) == 0");
-static_assert(sizeof(NetSPacket_0x7953_Repeat) == 1, "sizeof(NetSPacket_0x7953_Repeat) == 1");
-struct NetRPacket_0x7954_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x7954>
{
Little16 magic_packet_id;
Little32 account_id;
};
-static_assert(offsetof(NetRPacket_0x7954_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7954_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x7954_Fixed, account_id) == 2, "offsetof(NetRPacket_0x7954_Fixed, account_id) == 2");
-static_assert(sizeof(NetRPacket_0x7954_Fixed) == 6, "sizeof(NetRPacket_0x7954_Fixed) == 6");
-struct NetRPacket_0x7955_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x7955>
{
Little16 magic_packet_id;
};
-static_assert(offsetof(NetRPacket_0x7955_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x7955_Fixed, magic_packet_id) == 0");
-static_assert(sizeof(NetRPacket_0x7955_Fixed) == 2, "sizeof(NetRPacket_0x7955_Fixed) == 2");
+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");
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x2726_Head *network, SPacket_0x2726_Head native)
+bool native_to_network(NetPacket_Head<0x2726> *network, Packet_Head<0x2726> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -979,7 +1077,7 @@ bool native_to_network(NetSPacket_0x2726_Head *network, SPacket_0x2726_Head nati
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x2726_Head *native, NetSPacket_0x2726_Head network)
+bool network_to_native(Packet_Head<0x2726> *native, NetPacket_Head<0x2726> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -988,21 +1086,21 @@ bool network_to_native(SPacket_0x2726_Head *native, NetSPacket_0x2726_Head netwo
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x2726_Repeat *network, SPacket_0x2726_Repeat native)
+bool native_to_network(NetPacket_Repeat<0x2726> *network, Packet_Repeat<0x2726> native)
{
bool rv = true;
rv &= native_to_network(&network->c, native.c);
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x2726_Repeat *native, NetSPacket_0x2726_Repeat network)
+bool network_to_native(Packet_Repeat<0x2726> *native, NetPacket_Repeat<0x2726> network)
{
bool rv = true;
rv &= network_to_native(&native->c, network.c);
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7920_Fixed *network, RPacket_0x7920_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7920> *network, Packet_Fixed<0x7920> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1011,7 +1109,7 @@ bool native_to_network(NetRPacket_0x7920_Fixed *network, RPacket_0x7920_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x7920_Fixed *native, NetRPacket_0x7920_Fixed network)
+bool network_to_native(Packet_Fixed<0x7920> *native, NetPacket_Fixed<0x7920> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1020,7 +1118,7 @@ bool network_to_native(RPacket_0x7920_Fixed *native, NetRPacket_0x7920_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x7921_Head *network, SPacket_0x7921_Head native)
+bool native_to_network(NetPacket_Head<0x7921> *network, Packet_Head<0x7921> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1028,7 +1126,7 @@ bool native_to_network(NetSPacket_0x7921_Head *network, SPacket_0x7921_Head nati
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7921_Head *native, NetSPacket_0x7921_Head network)
+bool network_to_native(Packet_Head<0x7921> *native, NetPacket_Head<0x7921> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1036,7 +1134,7 @@ bool network_to_native(SPacket_0x7921_Head *native, NetSPacket_0x7921_Head netwo
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x7921_Repeat *network, SPacket_0x7921_Repeat native)
+bool native_to_network(NetPacket_Repeat<0x7921> *network, Packet_Repeat<0x7921> native)
{
bool rv = true;
rv &= native_to_network(&network->account_id, native.account_id);
@@ -1048,7 +1146,7 @@ bool native_to_network(NetSPacket_0x7921_Repeat *network, SPacket_0x7921_Repeat
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7921_Repeat *native, NetSPacket_0x7921_Repeat network)
+bool network_to_native(Packet_Repeat<0x7921> *native, NetPacket_Repeat<0x7921> network)
{
bool rv = true;
rv &= network_to_native(&native->account_id, network.account_id);
@@ -1060,7 +1158,7 @@ bool network_to_native(SPacket_0x7921_Repeat *native, NetSPacket_0x7921_Repeat n
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7924_Fixed *network, RPacket_0x7924_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7924> *network, Packet_Fixed<0x7924> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1069,7 +1167,7 @@ bool native_to_network(NetRPacket_0x7924_Fixed *network, RPacket_0x7924_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x7924_Fixed *native, NetRPacket_0x7924_Fixed network)
+bool network_to_native(Packet_Fixed<0x7924> *native, NetPacket_Fixed<0x7924> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1078,21 +1176,21 @@ bool network_to_native(RPacket_0x7924_Fixed *native, NetRPacket_0x7924_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x7925_Fixed *network, SPacket_0x7925_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7925> *network, Packet_Fixed<0x7925> 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(SPacket_0x7925_Fixed *native, NetSPacket_0x7925_Fixed network)
+bool network_to_native(Packet_Fixed<0x7925> *native, NetPacket_Fixed<0x7925> 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(NetRPacket_0x7930_Fixed *network, RPacket_0x7930_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7930> *network, Packet_Fixed<0x7930> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1103,7 +1201,7 @@ bool native_to_network(NetRPacket_0x7930_Fixed *network, RPacket_0x7930_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x7930_Fixed *native, NetRPacket_0x7930_Fixed network)
+bool network_to_native(Packet_Fixed<0x7930> *native, NetPacket_Fixed<0x7930> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1114,7 +1212,7 @@ bool network_to_native(RPacket_0x7930_Fixed *native, NetRPacket_0x7930_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x7931_Fixed *network, SPacket_0x7931_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7931> *network, Packet_Fixed<0x7931> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1123,7 +1221,7 @@ bool native_to_network(NetSPacket_0x7931_Fixed *network, SPacket_0x7931_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7931_Fixed *native, NetSPacket_0x7931_Fixed network)
+bool network_to_native(Packet_Fixed<0x7931> *native, NetPacket_Fixed<0x7931> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1132,7 +1230,7 @@ bool network_to_native(SPacket_0x7931_Fixed *native, NetSPacket_0x7931_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7932_Fixed *network, RPacket_0x7932_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7932> *network, Packet_Fixed<0x7932> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1140,7 +1238,7 @@ bool native_to_network(NetRPacket_0x7932_Fixed *network, RPacket_0x7932_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x7932_Fixed *native, NetRPacket_0x7932_Fixed network)
+bool network_to_native(Packet_Fixed<0x7932> *native, NetPacket_Fixed<0x7932> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1148,7 +1246,7 @@ bool network_to_native(RPacket_0x7932_Fixed *native, NetRPacket_0x7932_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x7933_Fixed *network, SPacket_0x7933_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7933> *network, Packet_Fixed<0x7933> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1157,7 +1255,7 @@ bool native_to_network(NetSPacket_0x7933_Fixed *network, SPacket_0x7933_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7933_Fixed *native, NetSPacket_0x7933_Fixed network)
+bool network_to_native(Packet_Fixed<0x7933> *native, NetPacket_Fixed<0x7933> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1166,7 +1264,7 @@ bool network_to_native(SPacket_0x7933_Fixed *native, NetSPacket_0x7933_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7934_Fixed *network, RPacket_0x7934_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7934> *network, Packet_Fixed<0x7934> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1175,7 +1273,7 @@ bool native_to_network(NetRPacket_0x7934_Fixed *network, RPacket_0x7934_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x7934_Fixed *native, NetRPacket_0x7934_Fixed network)
+bool network_to_native(Packet_Fixed<0x7934> *native, NetPacket_Fixed<0x7934> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1184,7 +1282,7 @@ bool network_to_native(RPacket_0x7934_Fixed *native, NetRPacket_0x7934_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x7935_Fixed *network, SPacket_0x7935_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7935> *network, Packet_Fixed<0x7935> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1193,7 +1291,7 @@ bool native_to_network(NetSPacket_0x7935_Fixed *network, SPacket_0x7935_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7935_Fixed *native, NetSPacket_0x7935_Fixed network)
+bool network_to_native(Packet_Fixed<0x7935> *native, NetPacket_Fixed<0x7935> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1202,7 +1300,7 @@ bool network_to_native(SPacket_0x7935_Fixed *native, NetSPacket_0x7935_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7936_Fixed *network, RPacket_0x7936_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7936> *network, Packet_Fixed<0x7936> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1212,7 +1310,7 @@ bool native_to_network(NetRPacket_0x7936_Fixed *network, RPacket_0x7936_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x7936_Fixed *native, NetRPacket_0x7936_Fixed network)
+bool network_to_native(Packet_Fixed<0x7936> *native, NetPacket_Fixed<0x7936> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1222,7 +1320,7 @@ bool network_to_native(RPacket_0x7936_Fixed *native, NetRPacket_0x7936_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x7937_Fixed *network, SPacket_0x7937_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7937> *network, Packet_Fixed<0x7937> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1232,7 +1330,7 @@ bool native_to_network(NetSPacket_0x7937_Fixed *network, SPacket_0x7937_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7937_Fixed *native, NetSPacket_0x7937_Fixed network)
+bool network_to_native(Packet_Fixed<0x7937> *native, NetPacket_Fixed<0x7937> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1242,21 +1340,21 @@ bool network_to_native(SPacket_0x7937_Fixed *native, NetSPacket_0x7937_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7938_Fixed *network, RPacket_0x7938_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7938> *network, Packet_Fixed<0x7938> 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(RPacket_0x7938_Fixed *native, NetRPacket_0x7938_Fixed network)
+bool network_to_native(Packet_Fixed<0x7938> *native, NetPacket_Fixed<0x7938> 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(NetSPacket_0x7939_Head *network, SPacket_0x7939_Head native)
+bool native_to_network(NetPacket_Head<0x7939> *network, Packet_Head<0x7939> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1264,7 +1362,7 @@ bool native_to_network(NetSPacket_0x7939_Head *network, SPacket_0x7939_Head nati
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7939_Head *native, NetSPacket_0x7939_Head network)
+bool network_to_native(Packet_Head<0x7939> *native, NetPacket_Head<0x7939> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1272,7 +1370,7 @@ bool network_to_native(SPacket_0x7939_Head *native, NetSPacket_0x7939_Head netwo
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x7939_Repeat *network, SPacket_0x7939_Repeat native)
+bool native_to_network(NetPacket_Repeat<0x7939> *network, Packet_Repeat<0x7939> native)
{
bool rv = true;
rv &= native_to_network(&network->ip, native.ip);
@@ -1284,7 +1382,7 @@ bool native_to_network(NetSPacket_0x7939_Repeat *network, SPacket_0x7939_Repeat
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7939_Repeat *native, NetSPacket_0x7939_Repeat network)
+bool network_to_native(Packet_Repeat<0x7939> *native, NetPacket_Repeat<0x7939> network)
{
bool rv = true;
rv &= network_to_native(&native->ip, network.ip);
@@ -1296,7 +1394,7 @@ bool network_to_native(SPacket_0x7939_Repeat *native, NetSPacket_0x7939_Repeat n
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x793a_Fixed *network, RPacket_0x793a_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x793a> *network, Packet_Fixed<0x793a> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1305,7 +1403,7 @@ bool native_to_network(NetRPacket_0x793a_Fixed *network, RPacket_0x793a_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x793a_Fixed *native, NetRPacket_0x793a_Fixed network)
+bool network_to_native(Packet_Fixed<0x793a> *native, NetPacket_Fixed<0x793a> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1314,7 +1412,7 @@ bool network_to_native(RPacket_0x793a_Fixed *native, NetRPacket_0x793a_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x793b_Fixed *network, SPacket_0x793b_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x793b> *network, Packet_Fixed<0x793b> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1323,7 +1421,7 @@ bool native_to_network(NetSPacket_0x793b_Fixed *network, SPacket_0x793b_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x793b_Fixed *native, NetSPacket_0x793b_Fixed network)
+bool network_to_native(Packet_Fixed<0x793b> *native, NetPacket_Fixed<0x793b> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1332,7 +1430,7 @@ bool network_to_native(SPacket_0x793b_Fixed *native, NetSPacket_0x793b_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x793c_Fixed *network, RPacket_0x793c_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x793c> *network, Packet_Fixed<0x793c> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1341,7 +1439,7 @@ bool native_to_network(NetRPacket_0x793c_Fixed *network, RPacket_0x793c_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x793c_Fixed *native, NetRPacket_0x793c_Fixed network)
+bool network_to_native(Packet_Fixed<0x793c> *native, NetPacket_Fixed<0x793c> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1350,7 +1448,7 @@ bool network_to_native(RPacket_0x793c_Fixed *native, NetRPacket_0x793c_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x793d_Fixed *network, SPacket_0x793d_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x793d> *network, Packet_Fixed<0x793d> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1359,7 +1457,7 @@ bool native_to_network(NetSPacket_0x793d_Fixed *network, SPacket_0x793d_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x793d_Fixed *native, NetSPacket_0x793d_Fixed network)
+bool network_to_native(Packet_Fixed<0x793d> *native, NetPacket_Fixed<0x793d> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1368,7 +1466,7 @@ bool network_to_native(SPacket_0x793d_Fixed *native, NetSPacket_0x793d_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x793e_Fixed *network, RPacket_0x793e_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x793e> *network, Packet_Fixed<0x793e> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1377,7 +1475,7 @@ bool native_to_network(NetRPacket_0x793e_Fixed *network, RPacket_0x793e_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x793e_Fixed *native, NetRPacket_0x793e_Fixed network)
+bool network_to_native(Packet_Fixed<0x793e> *native, NetPacket_Fixed<0x793e> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1386,7 +1484,7 @@ bool network_to_native(RPacket_0x793e_Fixed *native, NetRPacket_0x793e_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x793f_Fixed *network, SPacket_0x793f_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x793f> *network, Packet_Fixed<0x793f> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1395,7 +1493,7 @@ bool native_to_network(NetSPacket_0x793f_Fixed *network, SPacket_0x793f_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x793f_Fixed *native, NetSPacket_0x793f_Fixed network)
+bool network_to_native(Packet_Fixed<0x793f> *native, NetPacket_Fixed<0x793f> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1404,7 +1502,7 @@ bool network_to_native(SPacket_0x793f_Fixed *native, NetSPacket_0x793f_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7940_Fixed *network, RPacket_0x7940_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7940> *network, Packet_Fixed<0x7940> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1413,7 +1511,7 @@ bool native_to_network(NetRPacket_0x7940_Fixed *network, RPacket_0x7940_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x7940_Fixed *native, NetRPacket_0x7940_Fixed network)
+bool network_to_native(Packet_Fixed<0x7940> *native, NetPacket_Fixed<0x7940> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1422,7 +1520,7 @@ bool network_to_native(RPacket_0x7940_Fixed *native, NetRPacket_0x7940_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x7941_Fixed *network, SPacket_0x7941_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7941> *network, Packet_Fixed<0x7941> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1431,7 +1529,7 @@ bool native_to_network(NetSPacket_0x7941_Fixed *network, SPacket_0x7941_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7941_Fixed *native, NetSPacket_0x7941_Fixed network)
+bool network_to_native(Packet_Fixed<0x7941> *native, NetPacket_Fixed<0x7941> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1440,7 +1538,7 @@ bool network_to_native(SPacket_0x7941_Fixed *native, NetSPacket_0x7941_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7942_Head *network, RPacket_0x7942_Head native)
+bool native_to_network(NetPacket_Head<0x7942> *network, Packet_Head<0x7942> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1449,7 +1547,7 @@ bool native_to_network(NetRPacket_0x7942_Head *network, RPacket_0x7942_Head nati
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x7942_Head *native, NetRPacket_0x7942_Head network)
+bool network_to_native(Packet_Head<0x7942> *native, NetPacket_Head<0x7942> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1458,21 +1556,21 @@ bool network_to_native(RPacket_0x7942_Head *native, NetRPacket_0x7942_Head netwo
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7942_Repeat *network, RPacket_0x7942_Repeat native)
+bool native_to_network(NetPacket_Repeat<0x7942> *network, Packet_Repeat<0x7942> native)
{
bool rv = true;
rv &= native_to_network(&network->c, native.c);
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x7942_Repeat *native, NetRPacket_0x7942_Repeat network)
+bool network_to_native(Packet_Repeat<0x7942> *native, NetPacket_Repeat<0x7942> network)
{
bool rv = true;
rv &= network_to_native(&native->c, network.c);
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x7943_Fixed *network, SPacket_0x7943_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7943> *network, Packet_Fixed<0x7943> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1481,7 +1579,7 @@ bool native_to_network(NetSPacket_0x7943_Fixed *network, SPacket_0x7943_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7943_Fixed *native, NetSPacket_0x7943_Fixed network)
+bool network_to_native(Packet_Fixed<0x7943> *native, NetPacket_Fixed<0x7943> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1490,7 +1588,7 @@ bool network_to_native(SPacket_0x7943_Fixed *native, NetSPacket_0x7943_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7944_Fixed *network, RPacket_0x7944_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7944> *network, Packet_Fixed<0x7944> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1498,7 +1596,7 @@ bool native_to_network(NetRPacket_0x7944_Fixed *network, RPacket_0x7944_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x7944_Fixed *native, NetRPacket_0x7944_Fixed network)
+bool network_to_native(Packet_Fixed<0x7944> *native, NetPacket_Fixed<0x7944> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1506,7 +1604,7 @@ bool network_to_native(RPacket_0x7944_Fixed *native, NetRPacket_0x7944_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x7945_Fixed *network, SPacket_0x7945_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7945> *network, Packet_Fixed<0x7945> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1515,7 +1613,7 @@ bool native_to_network(NetSPacket_0x7945_Fixed *network, SPacket_0x7945_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7945_Fixed *native, NetSPacket_0x7945_Fixed network)
+bool network_to_native(Packet_Fixed<0x7945> *native, NetPacket_Fixed<0x7945> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1524,7 +1622,7 @@ bool network_to_native(SPacket_0x7945_Fixed *native, NetSPacket_0x7945_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7946_Fixed *network, RPacket_0x7946_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7946> *network, Packet_Fixed<0x7946> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1532,7 +1630,7 @@ bool native_to_network(NetRPacket_0x7946_Fixed *network, RPacket_0x7946_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x7946_Fixed *native, NetRPacket_0x7946_Fixed network)
+bool network_to_native(Packet_Fixed<0x7946> *native, NetPacket_Fixed<0x7946> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1540,7 +1638,7 @@ bool network_to_native(RPacket_0x7946_Fixed *native, NetRPacket_0x7946_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x7947_Fixed *network, SPacket_0x7947_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7947> *network, Packet_Fixed<0x7947> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1549,7 +1647,7 @@ bool native_to_network(NetSPacket_0x7947_Fixed *network, SPacket_0x7947_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7947_Fixed *native, NetSPacket_0x7947_Fixed network)
+bool network_to_native(Packet_Fixed<0x7947> *native, NetPacket_Fixed<0x7947> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1558,7 +1656,7 @@ bool network_to_native(SPacket_0x7947_Fixed *native, NetSPacket_0x7947_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7948_Fixed *network, RPacket_0x7948_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7948> *network, Packet_Fixed<0x7948> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1567,7 +1665,7 @@ bool native_to_network(NetRPacket_0x7948_Fixed *network, RPacket_0x7948_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x7948_Fixed *native, NetRPacket_0x7948_Fixed network)
+bool network_to_native(Packet_Fixed<0x7948> *native, NetPacket_Fixed<0x7948> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1576,7 +1674,7 @@ bool network_to_native(RPacket_0x7948_Fixed *native, NetRPacket_0x7948_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x7949_Fixed *network, SPacket_0x7949_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7949> *network, Packet_Fixed<0x7949> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1586,7 +1684,7 @@ bool native_to_network(NetSPacket_0x7949_Fixed *network, SPacket_0x7949_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7949_Fixed *native, NetSPacket_0x7949_Fixed network)
+bool network_to_native(Packet_Fixed<0x7949> *native, NetPacket_Fixed<0x7949> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1596,7 +1694,7 @@ bool network_to_native(SPacket_0x7949_Fixed *native, NetSPacket_0x7949_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x794a_Fixed *network, RPacket_0x794a_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x794a> *network, Packet_Fixed<0x794a> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1605,7 +1703,7 @@ bool native_to_network(NetRPacket_0x794a_Fixed *network, RPacket_0x794a_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x794a_Fixed *native, NetRPacket_0x794a_Fixed network)
+bool network_to_native(Packet_Fixed<0x794a> *native, NetPacket_Fixed<0x794a> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1614,7 +1712,7 @@ bool network_to_native(RPacket_0x794a_Fixed *native, NetRPacket_0x794a_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x794b_Fixed *network, SPacket_0x794b_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x794b> *network, Packet_Fixed<0x794b> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1624,7 +1722,7 @@ bool native_to_network(NetSPacket_0x794b_Fixed *network, SPacket_0x794b_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x794b_Fixed *native, NetSPacket_0x794b_Fixed network)
+bool network_to_native(Packet_Fixed<0x794b> *native, NetPacket_Fixed<0x794b> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1634,7 +1732,7 @@ bool network_to_native(SPacket_0x794b_Fixed *native, NetSPacket_0x794b_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x794c_Fixed *network, RPacket_0x794c_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x794c> *network, Packet_Fixed<0x794c> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1643,7 +1741,7 @@ bool native_to_network(NetRPacket_0x794c_Fixed *network, RPacket_0x794c_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x794c_Fixed *native, NetRPacket_0x794c_Fixed network)
+bool network_to_native(Packet_Fixed<0x794c> *native, NetPacket_Fixed<0x794c> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1652,7 +1750,7 @@ bool network_to_native(RPacket_0x794c_Fixed *native, NetRPacket_0x794c_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x794d_Fixed *network, SPacket_0x794d_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x794d> *network, Packet_Fixed<0x794d> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1662,7 +1760,7 @@ bool native_to_network(NetSPacket_0x794d_Fixed *network, SPacket_0x794d_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x794d_Fixed *native, NetSPacket_0x794d_Fixed network)
+bool network_to_native(Packet_Fixed<0x794d> *native, NetPacket_Fixed<0x794d> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1672,7 +1770,7 @@ bool network_to_native(SPacket_0x794d_Fixed *native, NetSPacket_0x794d_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x794e_Head *network, RPacket_0x794e_Head native)
+bool native_to_network(NetPacket_Head<0x794e> *network, Packet_Head<0x794e> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1681,7 +1779,7 @@ bool native_to_network(NetRPacket_0x794e_Head *network, RPacket_0x794e_Head nati
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x794e_Head *native, NetRPacket_0x794e_Head network)
+bool network_to_native(Packet_Head<0x794e> *native, NetPacket_Head<0x794e> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1690,21 +1788,21 @@ bool network_to_native(RPacket_0x794e_Head *native, NetRPacket_0x794e_Head netwo
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x794e_Repeat *network, RPacket_0x794e_Repeat native)
+bool native_to_network(NetPacket_Repeat<0x794e> *network, Packet_Repeat<0x794e> native)
{
bool rv = true;
rv &= native_to_network(&network->c, native.c);
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x794e_Repeat *native, NetRPacket_0x794e_Repeat network)
+bool network_to_native(Packet_Repeat<0x794e> *native, NetPacket_Repeat<0x794e> network)
{
bool rv = true;
rv &= network_to_native(&native->c, network.c);
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x794f_Fixed *network, SPacket_0x794f_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x794f> *network, Packet_Fixed<0x794f> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1712,7 +1810,7 @@ bool native_to_network(NetSPacket_0x794f_Fixed *network, SPacket_0x794f_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x794f_Fixed *native, NetSPacket_0x794f_Fixed network)
+bool network_to_native(Packet_Fixed<0x794f> *native, NetPacket_Fixed<0x794f> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1720,7 +1818,7 @@ bool network_to_native(SPacket_0x794f_Fixed *native, NetSPacket_0x794f_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7950_Fixed *network, RPacket_0x7950_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7950> *network, Packet_Fixed<0x7950> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1729,7 +1827,7 @@ bool native_to_network(NetRPacket_0x7950_Fixed *network, RPacket_0x7950_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x7950_Fixed *native, NetRPacket_0x7950_Fixed network)
+bool network_to_native(Packet_Fixed<0x7950> *native, NetPacket_Fixed<0x7950> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1738,7 +1836,7 @@ bool network_to_native(RPacket_0x7950_Fixed *native, NetRPacket_0x7950_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x7951_Fixed *network, SPacket_0x7951_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7951> *network, Packet_Fixed<0x7951> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1748,7 +1846,7 @@ bool native_to_network(NetSPacket_0x7951_Fixed *network, SPacket_0x7951_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7951_Fixed *native, NetSPacket_0x7951_Fixed network)
+bool network_to_native(Packet_Fixed<0x7951> *native, NetPacket_Fixed<0x7951> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1758,7 +1856,7 @@ bool network_to_native(SPacket_0x7951_Fixed *native, NetSPacket_0x7951_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7952_Fixed *network, RPacket_0x7952_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7952> *network, Packet_Fixed<0x7952> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1766,7 +1864,7 @@ bool native_to_network(NetRPacket_0x7952_Fixed *network, RPacket_0x7952_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x7952_Fixed *native, NetRPacket_0x7952_Fixed network)
+bool network_to_native(Packet_Fixed<0x7952> *native, NetPacket_Fixed<0x7952> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1774,7 +1872,7 @@ bool network_to_native(RPacket_0x7952_Fixed *native, NetRPacket_0x7952_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x7953_Head *network, SPacket_0x7953_Head native)
+bool native_to_network(NetPacket_Head<0x7953> *network, Packet_Head<0x7953> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1794,7 +1892,7 @@ bool native_to_network(NetSPacket_0x7953_Head *network, SPacket_0x7953_Head nati
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7953_Head *native, NetSPacket_0x7953_Head network)
+bool network_to_native(Packet_Head<0x7953> *native, NetPacket_Head<0x7953> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1814,21 +1912,21 @@ bool network_to_native(SPacket_0x7953_Head *native, NetSPacket_0x7953_Head netwo
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x7953_Repeat *network, SPacket_0x7953_Repeat native)
+bool native_to_network(NetPacket_Repeat<0x7953> *network, Packet_Repeat<0x7953> native)
{
bool rv = true;
rv &= native_to_network(&network->c, native.c);
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x7953_Repeat *native, NetSPacket_0x7953_Repeat network)
+bool network_to_native(Packet_Repeat<0x7953> *native, NetPacket_Repeat<0x7953> network)
{
bool rv = true;
rv &= network_to_native(&native->c, network.c);
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7954_Fixed *network, RPacket_0x7954_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7954> *network, Packet_Fixed<0x7954> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -1836,7 +1934,7 @@ bool native_to_network(NetRPacket_0x7954_Fixed *network, RPacket_0x7954_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x7954_Fixed *native, NetRPacket_0x7954_Fixed network)
+bool network_to_native(Packet_Fixed<0x7954> *native, NetPacket_Fixed<0x7954> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -1844,14 +1942,14 @@ bool network_to_native(RPacket_0x7954_Fixed *native, NetRPacket_0x7954_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x7955_Fixed *network, RPacket_0x7955_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x7955> *network, Packet_Fixed<0x7955> 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(RPacket_0x7955_Fixed *native, NetRPacket_0x7955_Fixed network)
+bool network_to_native(Packet_Fixed<0x7955> *native, NetPacket_Fixed<0x7955> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
diff --git a/src/proto2/login-char.hpp b/src/proto2/login-char.hpp
index 9c0ba74..8f3a99e 100644
--- a/src/proto2/login-char.hpp
+++ b/src/proto2/login-char.hpp
@@ -27,18 +27,20 @@
// This is an internal protocol, and can be changed without notice
-struct RPacket_0x2709_Fixed
+template<>
+struct Packet_Fixed<0x2709>
{
- using NetType = NetRPacket_0x2709_Fixed;
static const uint16_t PACKET_ID = 0x2709;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
};
-struct RPacket_0x2712_Fixed
+template<>
+struct Packet_Fixed<0x2712>
{
- using NetType = NetRPacket_0x2712_Fixed;
static const uint16_t PACKET_ID = 0x2712;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
uint32_t login_id1 = {};
@@ -46,225 +48,251 @@ struct RPacket_0x2712_Fixed
SEX sex = {};
IP4Address ip = {};
};
-struct SPacket_0x2713_Fixed
+template<>
+struct Packet_Fixed<0x2713>
{
- using NetType = NetSPacket_0x2713_Fixed;
static const uint16_t PACKET_ID = 0x2713;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
uint8_t invalid = {};
AccountEmail email = {};
TimeT connect_until = {};
};
-struct RPacket_0x2714_Fixed
+template<>
+struct Packet_Fixed<0x2714>
{
- using NetType = NetRPacket_0x2714_Fixed;
static const uint16_t PACKET_ID = 0x2714;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
uint32_t users = {};
};
-struct RPacket_0x2715_Fixed
+template<>
+struct Packet_Fixed<0x2715>
{
- using NetType = NetRPacket_0x2715_Fixed;
static const uint16_t PACKET_ID = 0x2715;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountEmail email = {};
};
-struct RPacket_0x2716_Fixed
+template<>
+struct Packet_Fixed<0x2716>
{
- using NetType = NetRPacket_0x2716_Fixed;
static const uint16_t PACKET_ID = 0x2716;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
};
-struct SPacket_0x2717_Fixed
+template<>
+struct Packet_Fixed<0x2717>
{
- using NetType = NetSPacket_0x2717_Fixed;
static const uint16_t PACKET_ID = 0x2717;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountEmail email = {};
TimeT connect_until = {};
};
-struct RPacket_0x2720_Head
+template<>
+struct Packet_Head<0x2720>
{
- using NetType = NetRPacket_0x2720_Head;
static const uint16_t PACKET_ID = 0x2720;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
+ // TODO remove this
uint16_t magic_packet_length = {};
AccountId account_id = {};
};
-struct RPacket_0x2720_Repeat
+template<>
+struct Packet_Repeat<0x2720>
{
- using NetType = NetRPacket_0x2720_Repeat;
static const uint16_t PACKET_ID = 0x2720;
uint8_t c = {};
};
-struct SPacket_0x2721_Fixed
+template<>
+struct Packet_Fixed<0x2721>
{
- using NetType = NetSPacket_0x2721_Fixed;
static const uint16_t PACKET_ID = 0x2721;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
GmLevel gm_level = {};
};
-struct RPacket_0x2722_Fixed
+template<>
+struct Packet_Fixed<0x2722>
{
- using NetType = NetRPacket_0x2722_Fixed;
static const uint16_t PACKET_ID = 0x2722;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountEmail old_email = {};
AccountEmail new_email = {};
};
-struct SPacket_0x2723_Fixed
+template<>
+struct Packet_Fixed<0x2723>
{
- using NetType = NetSPacket_0x2723_Fixed;
static const uint16_t PACKET_ID = 0x2723;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
SEX sex = {};
};
-struct RPacket_0x2724_Fixed
+template<>
+struct Packet_Fixed<0x2724>
{
- using NetType = NetRPacket_0x2724_Fixed;
static const uint16_t PACKET_ID = 0x2724;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
uint32_t status = {};
};
-struct RPacket_0x2725_Fixed
+template<>
+struct Packet_Fixed<0x2725>
{
- using NetType = NetRPacket_0x2725_Fixed;
static const uint16_t PACKET_ID = 0x2725;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
HumanTimeDiff deltas = {};
};
-struct RPacket_0x2727_Fixed
+template<>
+struct Packet_Fixed<0x2727>
{
- using NetType = NetRPacket_0x2727_Fixed;
static const uint16_t PACKET_ID = 0x2727;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
};
-struct RPacket_0x2728_Head
+template<>
+struct Packet_Head<0x2728>
{
- using NetType = NetRPacket_0x2728_Head;
static const uint16_t PACKET_ID = 0x2728;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
+ // TODO remove this
uint16_t magic_packet_length = {};
AccountId account_id = {};
};
-struct RPacket_0x2728_Repeat
+template<>
+struct Packet_Repeat<0x2728>
{
- using NetType = NetRPacket_0x2728_Repeat;
static const uint16_t PACKET_ID = 0x2728;
VarName name = {};
uint32_t value = {};
};
-struct SPacket_0x2729_Head
+template<>
+struct Packet_Head<0x2729>
{
- using NetType = NetSPacket_0x2729_Head;
static const uint16_t PACKET_ID = 0x2729;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
+ // TODO remove this
uint16_t magic_packet_length = {};
AccountId account_id = {};
};
-struct SPacket_0x2729_Repeat
+template<>
+struct Packet_Repeat<0x2729>
{
- using NetType = NetSPacket_0x2729_Repeat;
static const uint16_t PACKET_ID = 0x2729;
VarName name = {};
uint32_t value = {};
};
-struct RPacket_0x272a_Fixed
+template<>
+struct Packet_Fixed<0x272a>
{
- using NetType = NetRPacket_0x272a_Fixed;
static const uint16_t PACKET_ID = 0x272a;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
};
-struct SPacket_0x2730_Fixed
+template<>
+struct Packet_Fixed<0x2730>
{
- using NetType = NetSPacket_0x2730_Fixed;
static const uint16_t PACKET_ID = 0x2730;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
};
-struct SPacket_0x2731_Fixed
+template<>
+struct Packet_Fixed<0x2731>
{
- using NetType = NetSPacket_0x2731_Fixed;
static const uint16_t PACKET_ID = 0x2731;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
uint8_t ban_not_status = {};
TimeT status_or_ban_until = {};
};
-struct SPacket_0x2732_Head
+template<>
+struct Packet_Head<0x2732>
{
- using NetType = NetSPacket_0x2732_Head;
static const uint16_t PACKET_ID = 0x2732;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
+ // TODO remove this
uint16_t magic_packet_length = {};
};
-struct SPacket_0x2732_Repeat
+template<>
+struct Packet_Repeat<0x2732>
{
- using NetType = NetSPacket_0x2732_Repeat;
static const uint16_t PACKET_ID = 0x2732;
AccountId account_id = {};
GmLevel gm_level = {};
};
-struct RPacket_0x2740_Fixed
+template<>
+struct Packet_Fixed<0x2740>
{
- using NetType = NetRPacket_0x2740_Fixed;
static const uint16_t PACKET_ID = 0x2740;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
AccountPass old_pass = {};
AccountPass new_pass = {};
};
-struct SPacket_0x2741_Fixed
+template<>
+struct Packet_Fixed<0x2741>
{
- using NetType = NetSPacket_0x2741_Fixed;
static const uint16_t PACKET_ID = 0x2741;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
AccountId account_id = {};
uint8_t status = {};
};
-struct NetRPacket_0x2709_Fixed
+template<>
+struct NetPacket_Fixed<0x2709>
{
Little16 magic_packet_id;
};
-static_assert(offsetof(NetRPacket_0x2709_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x2709_Fixed, magic_packet_id) == 0");
-static_assert(sizeof(NetRPacket_0x2709_Fixed) == 2, "sizeof(NetRPacket_0x2709_Fixed) == 2");
-struct NetRPacket_0x2712_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x2712>
{
Little16 magic_packet_id;
Little32 account_id;
@@ -273,14 +301,15 @@ struct NetRPacket_0x2712_Fixed
Byte sex;
IP4Address ip;
};
-static_assert(offsetof(NetRPacket_0x2712_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x2712_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x2712_Fixed, account_id) == 2, "offsetof(NetRPacket_0x2712_Fixed, account_id) == 2");
-static_assert(offsetof(NetRPacket_0x2712_Fixed, login_id1) == 6, "offsetof(NetRPacket_0x2712_Fixed, login_id1) == 6");
-static_assert(offsetof(NetRPacket_0x2712_Fixed, login_id2) == 10, "offsetof(NetRPacket_0x2712_Fixed, login_id2) == 10");
-static_assert(offsetof(NetRPacket_0x2712_Fixed, sex) == 14, "offsetof(NetRPacket_0x2712_Fixed, sex) == 14");
-static_assert(offsetof(NetRPacket_0x2712_Fixed, ip) == 15, "offsetof(NetRPacket_0x2712_Fixed, ip) == 15");
-static_assert(sizeof(NetRPacket_0x2712_Fixed) == 19, "sizeof(NetRPacket_0x2712_Fixed) == 19");
-struct NetSPacket_0x2713_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x2712>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2712>, magic_packet_id) == 0");
+static_assert(offsetof(NetPacket_Fixed<0x2712>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2712>, account_id) == 2");
+static_assert(offsetof(NetPacket_Fixed<0x2712>, login_id1) == 6, "offsetof(NetPacket_Fixed<0x2712>, login_id1) == 6");
+static_assert(offsetof(NetPacket_Fixed<0x2712>, login_id2) == 10, "offsetof(NetPacket_Fixed<0x2712>, login_id2) == 10");
+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");
+template<>
+struct NetPacket_Fixed<0x2713>
{
Little16 magic_packet_id;
Little32 account_id;
@@ -288,245 +317,268 @@ struct NetSPacket_0x2713_Fixed
NetString<sizeof(AccountEmail)> email;
Little32 connect_until;
};
-static_assert(offsetof(NetSPacket_0x2713_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x2713_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x2713_Fixed, account_id) == 2, "offsetof(NetSPacket_0x2713_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x2713_Fixed, invalid) == 6, "offsetof(NetSPacket_0x2713_Fixed, invalid) == 6");
-static_assert(offsetof(NetSPacket_0x2713_Fixed, email) == 7, "offsetof(NetSPacket_0x2713_Fixed, email) == 7");
-static_assert(offsetof(NetSPacket_0x2713_Fixed, connect_until) == 47, "offsetof(NetSPacket_0x2713_Fixed, connect_until) == 47");
-static_assert(sizeof(NetSPacket_0x2713_Fixed) == 51, "sizeof(NetSPacket_0x2713_Fixed) == 51");
-struct NetRPacket_0x2714_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x2713>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2713>, magic_packet_id) == 0");
+static_assert(offsetof(NetPacket_Fixed<0x2713>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2713>, account_id) == 2");
+static_assert(offsetof(NetPacket_Fixed<0x2713>, invalid) == 6, "offsetof(NetPacket_Fixed<0x2713>, invalid) == 6");
+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");
+template<>
+struct NetPacket_Fixed<0x2714>
{
Little16 magic_packet_id;
Little32 users;
};
-static_assert(offsetof(NetRPacket_0x2714_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x2714_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x2714_Fixed, users) == 2, "offsetof(NetRPacket_0x2714_Fixed, users) == 2");
-static_assert(sizeof(NetRPacket_0x2714_Fixed) == 6, "sizeof(NetRPacket_0x2714_Fixed) == 6");
-struct NetRPacket_0x2715_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x2715>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountEmail)> email;
};
-static_assert(offsetof(NetRPacket_0x2715_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x2715_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x2715_Fixed, account_id) == 2, "offsetof(NetRPacket_0x2715_Fixed, account_id) == 2");
-static_assert(offsetof(NetRPacket_0x2715_Fixed, email) == 6, "offsetof(NetRPacket_0x2715_Fixed, email) == 6");
-static_assert(sizeof(NetRPacket_0x2715_Fixed) == 46, "sizeof(NetRPacket_0x2715_Fixed) == 46");
-struct NetRPacket_0x2716_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x2715>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2715>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x2716>
{
Little16 magic_packet_id;
Little32 account_id;
};
-static_assert(offsetof(NetRPacket_0x2716_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x2716_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x2716_Fixed, account_id) == 2, "offsetof(NetRPacket_0x2716_Fixed, account_id) == 2");
-static_assert(sizeof(NetRPacket_0x2716_Fixed) == 6, "sizeof(NetRPacket_0x2716_Fixed) == 6");
-struct NetSPacket_0x2717_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x2717>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountEmail)> email;
Little32 connect_until;
};
-static_assert(offsetof(NetSPacket_0x2717_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x2717_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x2717_Fixed, account_id) == 2, "offsetof(NetSPacket_0x2717_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x2717_Fixed, email) == 6, "offsetof(NetSPacket_0x2717_Fixed, email) == 6");
-static_assert(offsetof(NetSPacket_0x2717_Fixed, connect_until) == 46, "offsetof(NetSPacket_0x2717_Fixed, connect_until) == 46");
-static_assert(sizeof(NetSPacket_0x2717_Fixed) == 50, "sizeof(NetSPacket_0x2717_Fixed) == 50");
-struct NetRPacket_0x2720_Head
+static_assert(offsetof(NetPacket_Fixed<0x2717>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2717>, magic_packet_id) == 0");
+static_assert(offsetof(NetPacket_Fixed<0x2717>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2717>, account_id) == 2");
+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");
+template<>
+struct NetPacket_Head<0x2720>
{
Little16 magic_packet_id;
Little16 magic_packet_length;
Little32 account_id;
};
-static_assert(offsetof(NetRPacket_0x2720_Head, magic_packet_id) == 0, "offsetof(NetRPacket_0x2720_Head, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x2720_Head, magic_packet_length) == 2, "offsetof(NetRPacket_0x2720_Head, magic_packet_length) == 2");
-static_assert(offsetof(NetRPacket_0x2720_Head, account_id) == 4, "offsetof(NetRPacket_0x2720_Head, account_id) == 4");
-static_assert(sizeof(NetRPacket_0x2720_Head) == 8, "sizeof(NetRPacket_0x2720_Head) == 8");
-struct NetRPacket_0x2720_Repeat
+static_assert(offsetof(NetPacket_Head<0x2720>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x2720>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Repeat<0x2720>
{
Byte c;
};
-static_assert(offsetof(NetRPacket_0x2720_Repeat, c) == 0, "offsetof(NetRPacket_0x2720_Repeat, c) == 0");
-static_assert(sizeof(NetRPacket_0x2720_Repeat) == 1, "sizeof(NetRPacket_0x2720_Repeat) == 1");
-struct NetSPacket_0x2721_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x2721>
{
Little16 magic_packet_id;
Little32 account_id;
Little32 gm_level;
};
-static_assert(offsetof(NetSPacket_0x2721_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x2721_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x2721_Fixed, account_id) == 2, "offsetof(NetSPacket_0x2721_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x2721_Fixed, gm_level) == 6, "offsetof(NetSPacket_0x2721_Fixed, gm_level) == 6");
-static_assert(sizeof(NetSPacket_0x2721_Fixed) == 10, "sizeof(NetSPacket_0x2721_Fixed) == 10");
-struct NetRPacket_0x2722_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x2721>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2721>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x2722>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountEmail)> old_email;
NetString<sizeof(AccountEmail)> new_email;
};
-static_assert(offsetof(NetRPacket_0x2722_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x2722_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x2722_Fixed, account_id) == 2, "offsetof(NetRPacket_0x2722_Fixed, account_id) == 2");
-static_assert(offsetof(NetRPacket_0x2722_Fixed, old_email) == 6, "offsetof(NetRPacket_0x2722_Fixed, old_email) == 6");
-static_assert(offsetof(NetRPacket_0x2722_Fixed, new_email) == 46, "offsetof(NetRPacket_0x2722_Fixed, new_email) == 46");
-static_assert(sizeof(NetRPacket_0x2722_Fixed) == 86, "sizeof(NetRPacket_0x2722_Fixed) == 86");
-struct NetSPacket_0x2723_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x2722>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2722>, magic_packet_id) == 0");
+static_assert(offsetof(NetPacket_Fixed<0x2722>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2722>, account_id) == 2");
+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");
+template<>
+struct NetPacket_Fixed<0x2723>
{
Little16 magic_packet_id;
Little32 account_id;
Byte sex;
};
-static_assert(offsetof(NetSPacket_0x2723_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x2723_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x2723_Fixed, account_id) == 2, "offsetof(NetSPacket_0x2723_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x2723_Fixed, sex) == 6, "offsetof(NetSPacket_0x2723_Fixed, sex) == 6");
-static_assert(sizeof(NetSPacket_0x2723_Fixed) == 7, "sizeof(NetSPacket_0x2723_Fixed) == 7");
-struct NetRPacket_0x2724_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x2723>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2723>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x2724>
{
Little16 magic_packet_id;
Little32 account_id;
Little32 status;
};
-static_assert(offsetof(NetRPacket_0x2724_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x2724_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x2724_Fixed, account_id) == 2, "offsetof(NetRPacket_0x2724_Fixed, account_id) == 2");
-static_assert(offsetof(NetRPacket_0x2724_Fixed, status) == 6, "offsetof(NetRPacket_0x2724_Fixed, status) == 6");
-static_assert(sizeof(NetRPacket_0x2724_Fixed) == 10, "sizeof(NetRPacket_0x2724_Fixed) == 10");
-struct NetRPacket_0x2725_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x2724>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2724>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Fixed<0x2725>
{
Little16 magic_packet_id;
Little32 account_id;
NetHumanTimeDiff deltas;
};
-static_assert(offsetof(NetRPacket_0x2725_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x2725_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x2725_Fixed, account_id) == 2, "offsetof(NetRPacket_0x2725_Fixed, account_id) == 2");
-static_assert(offsetof(NetRPacket_0x2725_Fixed, deltas) == 6, "offsetof(NetRPacket_0x2725_Fixed, deltas) == 6");
-static_assert(sizeof(NetRPacket_0x2725_Fixed) == 18, "sizeof(NetRPacket_0x2725_Fixed) == 18");
-struct NetRPacket_0x2727_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x2725>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2725>, magic_packet_id) == 0");
+static_assert(offsetof(NetPacket_Fixed<0x2725>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2725>, account_id) == 2");
+static_assert(offsetof(NetPacket_Fixed<0x2725>, deltas) == 6, "offsetof(NetPacket_Fixed<0x2725>, deltas) == 6");
+static_assert(sizeof(NetPacket_Fixed<0x2725>) == 18, "sizeof(NetPacket_Fixed<0x2725>) == 18");
+template<>
+struct NetPacket_Fixed<0x2727>
{
Little16 magic_packet_id;
Little32 account_id;
};
-static_assert(offsetof(NetRPacket_0x2727_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x2727_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x2727_Fixed, account_id) == 2, "offsetof(NetRPacket_0x2727_Fixed, account_id) == 2");
-static_assert(sizeof(NetRPacket_0x2727_Fixed) == 6, "sizeof(NetRPacket_0x2727_Fixed) == 6");
-struct NetRPacket_0x2728_Head
+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");
+template<>
+struct NetPacket_Head<0x2728>
{
Little16 magic_packet_id;
Little16 magic_packet_length;
Little32 account_id;
};
-static_assert(offsetof(NetRPacket_0x2728_Head, magic_packet_id) == 0, "offsetof(NetRPacket_0x2728_Head, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x2728_Head, magic_packet_length) == 2, "offsetof(NetRPacket_0x2728_Head, magic_packet_length) == 2");
-static_assert(offsetof(NetRPacket_0x2728_Head, account_id) == 4, "offsetof(NetRPacket_0x2728_Head, account_id) == 4");
-static_assert(sizeof(NetRPacket_0x2728_Head) == 8, "sizeof(NetRPacket_0x2728_Head) == 8");
-struct NetRPacket_0x2728_Repeat
+static_assert(offsetof(NetPacket_Head<0x2728>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x2728>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Repeat<0x2728>
{
NetString<sizeof(VarName)> name;
Little32 value;
};
-static_assert(offsetof(NetRPacket_0x2728_Repeat, name) == 0, "offsetof(NetRPacket_0x2728_Repeat, name) == 0");
-static_assert(offsetof(NetRPacket_0x2728_Repeat, value) == 32, "offsetof(NetRPacket_0x2728_Repeat, value) == 32");
-static_assert(sizeof(NetRPacket_0x2728_Repeat) == 36, "sizeof(NetRPacket_0x2728_Repeat) == 36");
-struct NetSPacket_0x2729_Head
+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");
+template<>
+struct NetPacket_Head<0x2729>
{
Little16 magic_packet_id;
Little16 magic_packet_length;
Little32 account_id;
};
-static_assert(offsetof(NetSPacket_0x2729_Head, magic_packet_id) == 0, "offsetof(NetSPacket_0x2729_Head, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x2729_Head, magic_packet_length) == 2, "offsetof(NetSPacket_0x2729_Head, magic_packet_length) == 2");
-static_assert(offsetof(NetSPacket_0x2729_Head, account_id) == 4, "offsetof(NetSPacket_0x2729_Head, account_id) == 4");
-static_assert(sizeof(NetSPacket_0x2729_Head) == 8, "sizeof(NetSPacket_0x2729_Head) == 8");
-struct NetSPacket_0x2729_Repeat
+static_assert(offsetof(NetPacket_Head<0x2729>, magic_packet_id) == 0, "offsetof(NetPacket_Head<0x2729>, magic_packet_id) == 0");
+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");
+template<>
+struct NetPacket_Repeat<0x2729>
{
NetString<sizeof(VarName)> name;
Little32 value;
};
-static_assert(offsetof(NetSPacket_0x2729_Repeat, name) == 0, "offsetof(NetSPacket_0x2729_Repeat, name) == 0");
-static_assert(offsetof(NetSPacket_0x2729_Repeat, value) == 32, "offsetof(NetSPacket_0x2729_Repeat, value) == 32");
-static_assert(sizeof(NetSPacket_0x2729_Repeat) == 36, "sizeof(NetSPacket_0x2729_Repeat) == 36");
-struct NetRPacket_0x272a_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x272a>
{
Little16 magic_packet_id;
Little32 account_id;
};
-static_assert(offsetof(NetRPacket_0x272a_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x272a_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x272a_Fixed, account_id) == 2, "offsetof(NetRPacket_0x272a_Fixed, account_id) == 2");
-static_assert(sizeof(NetRPacket_0x272a_Fixed) == 6, "sizeof(NetRPacket_0x272a_Fixed) == 6");
-struct NetSPacket_0x2730_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x2730>
{
Little16 magic_packet_id;
Little32 account_id;
};
-static_assert(offsetof(NetSPacket_0x2730_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x2730_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x2730_Fixed, account_id) == 2, "offsetof(NetSPacket_0x2730_Fixed, account_id) == 2");
-static_assert(sizeof(NetSPacket_0x2730_Fixed) == 6, "sizeof(NetSPacket_0x2730_Fixed) == 6");
-struct NetSPacket_0x2731_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x2731>
{
Little16 magic_packet_id;
Little32 account_id;
Byte ban_not_status;
Little32 status_or_ban_until;
};
-static_assert(offsetof(NetSPacket_0x2731_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x2731_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x2731_Fixed, account_id) == 2, "offsetof(NetSPacket_0x2731_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x2731_Fixed, ban_not_status) == 6, "offsetof(NetSPacket_0x2731_Fixed, ban_not_status) == 6");
-static_assert(offsetof(NetSPacket_0x2731_Fixed, status_or_ban_until) == 7, "offsetof(NetSPacket_0x2731_Fixed, status_or_ban_until) == 7");
-static_assert(sizeof(NetSPacket_0x2731_Fixed) == 11, "sizeof(NetSPacket_0x2731_Fixed) == 11");
-struct NetSPacket_0x2732_Head
+static_assert(offsetof(NetPacket_Fixed<0x2731>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2731>, magic_packet_id) == 0");
+static_assert(offsetof(NetPacket_Fixed<0x2731>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2731>, account_id) == 2");
+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");
+template<>
+struct NetPacket_Head<0x2732>
{
Little16 magic_packet_id;
Little16 magic_packet_length;
};
-static_assert(offsetof(NetSPacket_0x2732_Head, magic_packet_id) == 0, "offsetof(NetSPacket_0x2732_Head, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x2732_Head, magic_packet_length) == 2, "offsetof(NetSPacket_0x2732_Head, magic_packet_length) == 2");
-static_assert(sizeof(NetSPacket_0x2732_Head) == 4, "sizeof(NetSPacket_0x2732_Head) == 4");
-struct NetSPacket_0x2732_Repeat
+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");
+template<>
+struct NetPacket_Repeat<0x2732>
{
Little32 account_id;
Byte gm_level;
};
-static_assert(offsetof(NetSPacket_0x2732_Repeat, account_id) == 0, "offsetof(NetSPacket_0x2732_Repeat, account_id) == 0");
-static_assert(offsetof(NetSPacket_0x2732_Repeat, gm_level) == 4, "offsetof(NetSPacket_0x2732_Repeat, gm_level) == 4");
-static_assert(sizeof(NetSPacket_0x2732_Repeat) == 5, "sizeof(NetSPacket_0x2732_Repeat) == 5");
-struct NetRPacket_0x2740_Fixed
+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");
+template<>
+struct NetPacket_Fixed<0x2740>
{
Little16 magic_packet_id;
Little32 account_id;
NetString<sizeof(AccountPass)> old_pass;
NetString<sizeof(AccountPass)> new_pass;
};
-static_assert(offsetof(NetRPacket_0x2740_Fixed, magic_packet_id) == 0, "offsetof(NetRPacket_0x2740_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetRPacket_0x2740_Fixed, account_id) == 2, "offsetof(NetRPacket_0x2740_Fixed, account_id) == 2");
-static_assert(offsetof(NetRPacket_0x2740_Fixed, old_pass) == 6, "offsetof(NetRPacket_0x2740_Fixed, old_pass) == 6");
-static_assert(offsetof(NetRPacket_0x2740_Fixed, new_pass) == 30, "offsetof(NetRPacket_0x2740_Fixed, new_pass) == 30");
-static_assert(sizeof(NetRPacket_0x2740_Fixed) == 54, "sizeof(NetRPacket_0x2740_Fixed) == 54");
-struct NetSPacket_0x2741_Fixed
+static_assert(offsetof(NetPacket_Fixed<0x2740>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2740>, magic_packet_id) == 0");
+static_assert(offsetof(NetPacket_Fixed<0x2740>, account_id) == 2, "offsetof(NetPacket_Fixed<0x2740>, account_id) == 2");
+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");
+template<>
+struct NetPacket_Fixed<0x2741>
{
Little16 magic_packet_id;
Little32 account_id;
Byte status;
};
-static_assert(offsetof(NetSPacket_0x2741_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x2741_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x2741_Fixed, account_id) == 2, "offsetof(NetSPacket_0x2741_Fixed, account_id) == 2");
-static_assert(offsetof(NetSPacket_0x2741_Fixed, status) == 6, "offsetof(NetSPacket_0x2741_Fixed, status) == 6");
-static_assert(sizeof(NetSPacket_0x2741_Fixed) == 7, "sizeof(NetSPacket_0x2741_Fixed) == 7");
+static_assert(offsetof(NetPacket_Fixed<0x2741>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x2741>, magic_packet_id) == 0");
+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");
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x2709_Fixed *network, RPacket_0x2709_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2709> *network, Packet_Fixed<0x2709> 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(RPacket_0x2709_Fixed *native, NetRPacket_0x2709_Fixed network)
+bool network_to_native(Packet_Fixed<0x2709> *native, NetPacket_Fixed<0x2709> 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(NetRPacket_0x2712_Fixed *network, RPacket_0x2712_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2712> *network, Packet_Fixed<0x2712> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -538,7 +590,7 @@ bool native_to_network(NetRPacket_0x2712_Fixed *network, RPacket_0x2712_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x2712_Fixed *native, NetRPacket_0x2712_Fixed network)
+bool network_to_native(Packet_Fixed<0x2712> *native, NetPacket_Fixed<0x2712> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -550,7 +602,7 @@ bool network_to_native(RPacket_0x2712_Fixed *native, NetRPacket_0x2712_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x2713_Fixed *network, SPacket_0x2713_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2713> *network, Packet_Fixed<0x2713> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -561,7 +613,7 @@ bool native_to_network(NetSPacket_0x2713_Fixed *network, SPacket_0x2713_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x2713_Fixed *native, NetSPacket_0x2713_Fixed network)
+bool network_to_native(Packet_Fixed<0x2713> *native, NetPacket_Fixed<0x2713> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -572,7 +624,7 @@ bool network_to_native(SPacket_0x2713_Fixed *native, NetSPacket_0x2713_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x2714_Fixed *network, RPacket_0x2714_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2714> *network, Packet_Fixed<0x2714> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -580,7 +632,7 @@ bool native_to_network(NetRPacket_0x2714_Fixed *network, RPacket_0x2714_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x2714_Fixed *native, NetRPacket_0x2714_Fixed network)
+bool network_to_native(Packet_Fixed<0x2714> *native, NetPacket_Fixed<0x2714> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -588,7 +640,7 @@ bool network_to_native(RPacket_0x2714_Fixed *native, NetRPacket_0x2714_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x2715_Fixed *network, RPacket_0x2715_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2715> *network, Packet_Fixed<0x2715> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -597,7 +649,7 @@ bool native_to_network(NetRPacket_0x2715_Fixed *network, RPacket_0x2715_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x2715_Fixed *native, NetRPacket_0x2715_Fixed network)
+bool network_to_native(Packet_Fixed<0x2715> *native, NetPacket_Fixed<0x2715> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -606,7 +658,7 @@ bool network_to_native(RPacket_0x2715_Fixed *native, NetRPacket_0x2715_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x2716_Fixed *network, RPacket_0x2716_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2716> *network, Packet_Fixed<0x2716> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -614,7 +666,7 @@ bool native_to_network(NetRPacket_0x2716_Fixed *network, RPacket_0x2716_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x2716_Fixed *native, NetRPacket_0x2716_Fixed network)
+bool network_to_native(Packet_Fixed<0x2716> *native, NetPacket_Fixed<0x2716> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -622,7 +674,7 @@ bool network_to_native(RPacket_0x2716_Fixed *native, NetRPacket_0x2716_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x2717_Fixed *network, SPacket_0x2717_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2717> *network, Packet_Fixed<0x2717> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -632,7 +684,7 @@ bool native_to_network(NetSPacket_0x2717_Fixed *network, SPacket_0x2717_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x2717_Fixed *native, NetSPacket_0x2717_Fixed network)
+bool network_to_native(Packet_Fixed<0x2717> *native, NetPacket_Fixed<0x2717> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -642,7 +694,7 @@ bool network_to_native(SPacket_0x2717_Fixed *native, NetSPacket_0x2717_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x2720_Head *network, RPacket_0x2720_Head native)
+bool native_to_network(NetPacket_Head<0x2720> *network, Packet_Head<0x2720> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -651,7 +703,7 @@ bool native_to_network(NetRPacket_0x2720_Head *network, RPacket_0x2720_Head nati
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x2720_Head *native, NetRPacket_0x2720_Head network)
+bool network_to_native(Packet_Head<0x2720> *native, NetPacket_Head<0x2720> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -660,21 +712,21 @@ bool network_to_native(RPacket_0x2720_Head *native, NetRPacket_0x2720_Head netwo
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x2720_Repeat *network, RPacket_0x2720_Repeat native)
+bool native_to_network(NetPacket_Repeat<0x2720> *network, Packet_Repeat<0x2720> native)
{
bool rv = true;
rv &= native_to_network(&network->c, native.c);
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x2720_Repeat *native, NetRPacket_0x2720_Repeat network)
+bool network_to_native(Packet_Repeat<0x2720> *native, NetPacket_Repeat<0x2720> network)
{
bool rv = true;
rv &= network_to_native(&native->c, network.c);
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x2721_Fixed *network, SPacket_0x2721_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2721> *network, Packet_Fixed<0x2721> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -683,7 +735,7 @@ bool native_to_network(NetSPacket_0x2721_Fixed *network, SPacket_0x2721_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x2721_Fixed *native, NetSPacket_0x2721_Fixed network)
+bool network_to_native(Packet_Fixed<0x2721> *native, NetPacket_Fixed<0x2721> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -692,7 +744,7 @@ bool network_to_native(SPacket_0x2721_Fixed *native, NetSPacket_0x2721_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x2722_Fixed *network, RPacket_0x2722_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2722> *network, Packet_Fixed<0x2722> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -702,7 +754,7 @@ bool native_to_network(NetRPacket_0x2722_Fixed *network, RPacket_0x2722_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x2722_Fixed *native, NetRPacket_0x2722_Fixed network)
+bool network_to_native(Packet_Fixed<0x2722> *native, NetPacket_Fixed<0x2722> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -712,7 +764,7 @@ bool network_to_native(RPacket_0x2722_Fixed *native, NetRPacket_0x2722_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x2723_Fixed *network, SPacket_0x2723_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2723> *network, Packet_Fixed<0x2723> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -721,7 +773,7 @@ bool native_to_network(NetSPacket_0x2723_Fixed *network, SPacket_0x2723_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x2723_Fixed *native, NetSPacket_0x2723_Fixed network)
+bool network_to_native(Packet_Fixed<0x2723> *native, NetPacket_Fixed<0x2723> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -730,7 +782,7 @@ bool network_to_native(SPacket_0x2723_Fixed *native, NetSPacket_0x2723_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x2724_Fixed *network, RPacket_0x2724_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2724> *network, Packet_Fixed<0x2724> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -739,7 +791,7 @@ bool native_to_network(NetRPacket_0x2724_Fixed *network, RPacket_0x2724_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x2724_Fixed *native, NetRPacket_0x2724_Fixed network)
+bool network_to_native(Packet_Fixed<0x2724> *native, NetPacket_Fixed<0x2724> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -748,7 +800,7 @@ bool network_to_native(RPacket_0x2724_Fixed *native, NetRPacket_0x2724_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x2725_Fixed *network, RPacket_0x2725_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2725> *network, Packet_Fixed<0x2725> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -757,7 +809,7 @@ bool native_to_network(NetRPacket_0x2725_Fixed *network, RPacket_0x2725_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x2725_Fixed *native, NetRPacket_0x2725_Fixed network)
+bool network_to_native(Packet_Fixed<0x2725> *native, NetPacket_Fixed<0x2725> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -766,7 +818,7 @@ bool network_to_native(RPacket_0x2725_Fixed *native, NetRPacket_0x2725_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x2727_Fixed *network, RPacket_0x2727_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2727> *network, Packet_Fixed<0x2727> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -774,7 +826,7 @@ bool native_to_network(NetRPacket_0x2727_Fixed *network, RPacket_0x2727_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x2727_Fixed *native, NetRPacket_0x2727_Fixed network)
+bool network_to_native(Packet_Fixed<0x2727> *native, NetPacket_Fixed<0x2727> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -782,7 +834,7 @@ bool network_to_native(RPacket_0x2727_Fixed *native, NetRPacket_0x2727_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x2728_Head *network, RPacket_0x2728_Head native)
+bool native_to_network(NetPacket_Head<0x2728> *network, Packet_Head<0x2728> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -791,7 +843,7 @@ bool native_to_network(NetRPacket_0x2728_Head *network, RPacket_0x2728_Head nati
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x2728_Head *native, NetRPacket_0x2728_Head network)
+bool network_to_native(Packet_Head<0x2728> *native, NetPacket_Head<0x2728> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -800,7 +852,7 @@ bool network_to_native(RPacket_0x2728_Head *native, NetRPacket_0x2728_Head netwo
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x2728_Repeat *network, RPacket_0x2728_Repeat native)
+bool native_to_network(NetPacket_Repeat<0x2728> *network, Packet_Repeat<0x2728> native)
{
bool rv = true;
rv &= native_to_network(&network->name, native.name);
@@ -808,7 +860,7 @@ bool native_to_network(NetRPacket_0x2728_Repeat *network, RPacket_0x2728_Repeat
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x2728_Repeat *native, NetRPacket_0x2728_Repeat network)
+bool network_to_native(Packet_Repeat<0x2728> *native, NetPacket_Repeat<0x2728> network)
{
bool rv = true;
rv &= network_to_native(&native->name, network.name);
@@ -816,7 +868,7 @@ bool network_to_native(RPacket_0x2728_Repeat *native, NetRPacket_0x2728_Repeat n
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x2729_Head *network, SPacket_0x2729_Head native)
+bool native_to_network(NetPacket_Head<0x2729> *network, Packet_Head<0x2729> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -825,7 +877,7 @@ bool native_to_network(NetSPacket_0x2729_Head *network, SPacket_0x2729_Head nati
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x2729_Head *native, NetSPacket_0x2729_Head network)
+bool network_to_native(Packet_Head<0x2729> *native, NetPacket_Head<0x2729> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -834,7 +886,7 @@ bool network_to_native(SPacket_0x2729_Head *native, NetSPacket_0x2729_Head netwo
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x2729_Repeat *network, SPacket_0x2729_Repeat native)
+bool native_to_network(NetPacket_Repeat<0x2729> *network, Packet_Repeat<0x2729> native)
{
bool rv = true;
rv &= native_to_network(&network->name, native.name);
@@ -842,7 +894,7 @@ bool native_to_network(NetSPacket_0x2729_Repeat *network, SPacket_0x2729_Repeat
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x2729_Repeat *native, NetSPacket_0x2729_Repeat network)
+bool network_to_native(Packet_Repeat<0x2729> *native, NetPacket_Repeat<0x2729> network)
{
bool rv = true;
rv &= network_to_native(&native->name, network.name);
@@ -850,7 +902,7 @@ bool network_to_native(SPacket_0x2729_Repeat *native, NetSPacket_0x2729_Repeat n
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x272a_Fixed *network, RPacket_0x272a_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x272a> *network, Packet_Fixed<0x272a> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -858,7 +910,7 @@ bool native_to_network(NetRPacket_0x272a_Fixed *network, RPacket_0x272a_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x272a_Fixed *native, NetRPacket_0x272a_Fixed network)
+bool network_to_native(Packet_Fixed<0x272a> *native, NetPacket_Fixed<0x272a> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -866,7 +918,7 @@ bool network_to_native(RPacket_0x272a_Fixed *native, NetRPacket_0x272a_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x2730_Fixed *network, SPacket_0x2730_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2730> *network, Packet_Fixed<0x2730> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -874,7 +926,7 @@ bool native_to_network(NetSPacket_0x2730_Fixed *network, SPacket_0x2730_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x2730_Fixed *native, NetSPacket_0x2730_Fixed network)
+bool network_to_native(Packet_Fixed<0x2730> *native, NetPacket_Fixed<0x2730> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -882,7 +934,7 @@ bool network_to_native(SPacket_0x2730_Fixed *native, NetSPacket_0x2730_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x2731_Fixed *network, SPacket_0x2731_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2731> *network, Packet_Fixed<0x2731> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -892,7 +944,7 @@ bool native_to_network(NetSPacket_0x2731_Fixed *network, SPacket_0x2731_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x2731_Fixed *native, NetSPacket_0x2731_Fixed network)
+bool network_to_native(Packet_Fixed<0x2731> *native, NetPacket_Fixed<0x2731> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -902,7 +954,7 @@ bool network_to_native(SPacket_0x2731_Fixed *native, NetSPacket_0x2731_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x2732_Head *network, SPacket_0x2732_Head native)
+bool native_to_network(NetPacket_Head<0x2732> *network, Packet_Head<0x2732> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -910,7 +962,7 @@ bool native_to_network(NetSPacket_0x2732_Head *network, SPacket_0x2732_Head nati
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x2732_Head *native, NetSPacket_0x2732_Head network)
+bool network_to_native(Packet_Head<0x2732> *native, NetPacket_Head<0x2732> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -918,7 +970,7 @@ bool network_to_native(SPacket_0x2732_Head *native, NetSPacket_0x2732_Head netwo
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x2732_Repeat *network, SPacket_0x2732_Repeat native)
+bool native_to_network(NetPacket_Repeat<0x2732> *network, Packet_Repeat<0x2732> native)
{
bool rv = true;
rv &= native_to_network(&network->account_id, native.account_id);
@@ -926,7 +978,7 @@ bool native_to_network(NetSPacket_0x2732_Repeat *network, SPacket_0x2732_Repeat
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x2732_Repeat *native, NetSPacket_0x2732_Repeat network)
+bool network_to_native(Packet_Repeat<0x2732> *native, NetPacket_Repeat<0x2732> network)
{
bool rv = true;
rv &= network_to_native(&native->account_id, network.account_id);
@@ -934,7 +986,7 @@ bool network_to_native(SPacket_0x2732_Repeat *native, NetSPacket_0x2732_Repeat n
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetRPacket_0x2740_Fixed *network, RPacket_0x2740_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2740> *network, Packet_Fixed<0x2740> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -944,7 +996,7 @@ bool native_to_network(NetRPacket_0x2740_Fixed *network, RPacket_0x2740_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(RPacket_0x2740_Fixed *native, NetRPacket_0x2740_Fixed network)
+bool network_to_native(Packet_Fixed<0x2740> *native, NetPacket_Fixed<0x2740> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
@@ -954,7 +1006,7 @@ bool network_to_native(RPacket_0x2740_Fixed *native, NetRPacket_0x2740_Fixed net
return rv;
}
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x2741_Fixed *network, SPacket_0x2741_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x2741> *network, Packet_Fixed<0x2741> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -963,7 +1015,7 @@ bool native_to_network(NetSPacket_0x2741_Fixed *network, SPacket_0x2741_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x2741_Fixed *native, NetSPacket_0x2741_Fixed network)
+bool network_to_native(Packet_Fixed<0x2741> *native, NetPacket_Fixed<0x2741> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
diff --git a/src/proto2/map-user.hpp b/src/proto2/map-user.hpp
index 90102f7..4da94cf 100644
--- a/src/proto2/map-user.hpp
+++ b/src/proto2/map-user.hpp
@@ -27,11 +27,12 @@
// This is a public protocol, and changes require client cooperation
-struct SPacket_0x0212_Fixed
+template<>
+struct Packet_Fixed<0x0212>
{
- using NetType = NetSPacket_0x0212_Fixed;
static const uint16_t PACKET_ID = 0x0212;
+ // TODO remove this
uint16_t magic_packet_id = PACKET_ID;
BlockId npc_id = {};
uint16_t command = {};
@@ -40,7 +41,8 @@ struct SPacket_0x0212_Fixed
uint16_t y = {};
};
-struct NetSPacket_0x0212_Fixed
+template<>
+struct NetPacket_Fixed<0x0212>
{
Little16 magic_packet_id;
Little32 npc_id;
@@ -49,16 +51,16 @@ struct NetSPacket_0x0212_Fixed
Little16 x;
Little16 y;
};
-static_assert(offsetof(NetSPacket_0x0212_Fixed, magic_packet_id) == 0, "offsetof(NetSPacket_0x0212_Fixed, magic_packet_id) == 0");
-static_assert(offsetof(NetSPacket_0x0212_Fixed, npc_id) == 2, "offsetof(NetSPacket_0x0212_Fixed, npc_id) == 2");
-static_assert(offsetof(NetSPacket_0x0212_Fixed, command) == 6, "offsetof(NetSPacket_0x0212_Fixed, command) == 6");
-static_assert(offsetof(NetSPacket_0x0212_Fixed, id) == 8, "offsetof(NetSPacket_0x0212_Fixed, id) == 8");
-static_assert(offsetof(NetSPacket_0x0212_Fixed, x) == 12, "offsetof(NetSPacket_0x0212_Fixed, x) == 12");
-static_assert(offsetof(NetSPacket_0x0212_Fixed, y) == 14, "offsetof(NetSPacket_0x0212_Fixed, y) == 14");
-static_assert(sizeof(NetSPacket_0x0212_Fixed) == 16, "sizeof(NetSPacket_0x0212_Fixed) == 16");
+static_assert(offsetof(NetPacket_Fixed<0x0212>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x0212>, magic_packet_id) == 0");
+static_assert(offsetof(NetPacket_Fixed<0x0212>, npc_id) == 2, "offsetof(NetPacket_Fixed<0x0212>, npc_id) == 2");
+static_assert(offsetof(NetPacket_Fixed<0x0212>, command) == 6, "offsetof(NetPacket_Fixed<0x0212>, command) == 6");
+static_assert(offsetof(NetPacket_Fixed<0x0212>, id) == 8, "offsetof(NetPacket_Fixed<0x0212>, id) == 8");
+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");
inline __attribute__((warn_unused_result))
-bool native_to_network(NetSPacket_0x0212_Fixed *network, SPacket_0x0212_Fixed native)
+bool native_to_network(NetPacket_Fixed<0x0212> *network, Packet_Fixed<0x0212> native)
{
bool rv = true;
rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id);
@@ -70,7 +72,7 @@ bool native_to_network(NetSPacket_0x0212_Fixed *network, SPacket_0x0212_Fixed na
return rv;
}
inline __attribute__((warn_unused_result))
-bool network_to_native(SPacket_0x0212_Fixed *native, NetSPacket_0x0212_Fixed network)
+bool network_to_native(Packet_Fixed<0x0212> *native, NetPacket_Fixed<0x0212> network)
{
bool rv = true;
rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id);
diff --git a/tools/protocol.py b/tools/protocol.py
index e3d6529..a4bedc1 100755
--- a/tools/protocol.py
+++ b/tools/protocol.py
@@ -21,6 +21,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import glob
+import itertools
import os
from posixpath import relpath
@@ -217,16 +218,20 @@ class StructType(Type):
self.size = size
def dump_fwd(self, fwd):
+ fwd.write('template<>\n')
fwd.write('struct %s;\n' % self.name)
+ fwd.write('template<>\n')
fwd.write('struct Net%s;\n' % self.name)
def dump_native(self, f):
name = self.name
+ f.write('template<>\n')
f.write('struct %s\n{\n' % name)
if self.id is not None:
- f.write(' using NetType = Net%s;\n' % name)
f.write(' static const uint16_t PACKET_ID = 0x%04x;\n\n' % self.id)
for (o, l, n) in self.fields:
+ if n in ('magic_packet_id', 'magic_packet_length'):
+ f.write(' // TODO remove this\n')
if n == 'magic_packet_id':
f.write(' %s %s = PACKET_ID;\n' % (l.native_tag(), n))
else:
@@ -235,6 +240,7 @@ class StructType(Type):
def dump_network(self, f):
name = 'Net%s' % self.name
+ f.write('template<>\n')
f.write('struct %s\n{\n' % name)
for (o, l, n) in self.fields:
f.write(' %s %s;\n' % (l.network_tag(), n))
@@ -388,7 +394,7 @@ class VarPacket(object):
self.head_struct.dump_convert(f)
self.repeat_struct.dump_convert(f)
-def packet(id, name,
+def packet(id,
fixed=None, fixed_size=None,
head=None, head_size=None,
repeat=None, repeat_size=None,
@@ -400,12 +406,12 @@ def packet(id, name,
if fixed is not None:
assert not head and not repeat
return FixedPacket(
- StructType(id, '%s_Fixed' % name, fixed, fixed_size))
+ StructType(id, 'Packet_Fixed<0x%04x>' % id, fixed, fixed_size))
else:
assert head and repeat
return VarPacket(
- StructType(id, '%s_Head' % name, head, head_size),
- StructType(id, '%s_Repeat' % name, repeat, repeat_size))
+ StructType(id, 'Packet_Head<0x%04x>' % id, head, head_size),
+ StructType(id, 'Packet_Repeat<0x%04x>' % id, repeat, repeat_size))
class Channel(object):
@@ -417,12 +423,10 @@ class Channel(object):
self.packets = []
def s(self, id, **kwargs):
- name = 'SPacket_0x%04x' % id
- self.packets.append(packet(id, name, **kwargs))
+ self.packets.append(packet(id, **kwargs))
def r(self, id, **kwargs):
- name = 'RPacket_0x%04x' % id
- self.packets.append(packet(id, name, **kwargs))
+ self.packets.append(packet(id, **kwargs))
def dump(self, outdir, fwd):
server = self.server
@@ -525,6 +529,12 @@ class Context(object):
f.write(copyright.format(filename=header, description=desc))
f.write('\n')
f.write('# include "%s"\n\n' % sanity)
+ f.write('# include <cstdint>\n\n')
+ for b in ['Fixed', 'Head', 'Repeat']:
+ c = 'Packet_' + b
+ f.write('template<uint16_t PACKET_ID> class %s;\n' % c)
+ f.write('template<uint16_t PACKET_ID> class Net%s;\n' % c)
+ f.write('\n')
for ch in self._channels:
ch.dump(outdir, f)