From 197f6fedf46c866123ddb37872708baf9bb2dc3f Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 30 Jun 2014 15:30:18 -0700 Subject: Finish packet naming --- src/char/int_party.cpp | 24 ------------------------ src/login/login.cpp | 32 -------------------------------- src/proto2/char-map.hpp | 38 -------------------------------------- src/proto2/fwd.hpp | 10 ---------- src/proto2/login-char.hpp | 43 ------------------------------------------- 5 files changed, 147 deletions(-) (limited to 'src') diff --git a/src/char/int_party.cpp b/src/char/int_party.cpp index fc6136b..c9ab5a4 100644 --- a/src/char/int_party.cpp +++ b/src/char/int_party.cpp @@ -650,19 +650,6 @@ void mapif_parse_PartyChangeMap(Session *s, PartyId party_id, AccountId account_ } } -// パーティ解散要求 -static -void mapif_parse_BreakParty(Session *, PartyId party_id) -{ - PartyPair p; - p.party_most = party_db.search(party_id); - if (!p) - return; - - party_db.erase(party_id); - mapif_party_broken(party_id, 0 /*unknown*/); -} - // パーティメッセージ送信 static void mapif_parse_PartyMessage(Session *, PartyId party_id, AccountId account_id, XString mes) @@ -790,17 +777,6 @@ RecvResult inter_party_parse_frommap(Session *ms, uint16_t packet_id) lv); break; } - case 0x3026: - { - Packet_Fixed<0x3026> fixed; - rv = recv_fpacket<0x3026, 6>(ms, fixed); - if (rv != RecvResult::Complete) - break; - - PartyId party_id = fixed.party_id; - mapif_parse_BreakParty(ms, party_id); - break; - } case 0x3027: { Packet_Head<0x3027> head; diff --git a/src/login/login.cpp b/src/login/login.cpp index 82ab89a..a8bc7a0 100644 --- a/src/login/login.cpp +++ b/src/login/login.cpp @@ -1097,38 +1097,6 @@ void parse_fromchar(Session *s) break; } - // we receive a e-mail creation of an account with a default e-mail (no answer) - case 0x2715: - { - Packet_Fixed<0x2715> fixed; - rv = recv_fpacket<0x2715, 46>(s, fixed); - if (rv != RecvResult::Complete) - break; - - AccountId acc = fixed.account_id; - AccountEmail email = fixed.email; - if (!e_mail_check(email)) - LOGIN_LOG("Char-server '%s': Attempt to create an e-mail on an account with a default e-mail REFUSED - e-mail is invalid (account: %d, ip: %s)\n"_fmt, - server[id].name, acc, ip); - else - { - for (AuthData& ad : auth_data) - { - if (ad.account_id == acc - && (ad.email == DEFAULT_EMAIL || !ad.email)) - { - ad.email = email; - LOGIN_LOG("Char-server '%s': Create an e-mail on an account with a default e-mail (account: %d, new e-mail: %s, ip: %s).\n"_fmt, - server[id].name, acc, email, ip); - goto x2715_out; - } - } - LOGIN_LOG("Char-server '%s': Attempt to create an e-mail on an account with a default e-mail REFUSED - account doesn't exist or e-mail of account isn't default e-mail (account: %d, ip: %s).\n"_fmt, - server[id].name, acc, ip); - } - x2715_out: - break; - } // We receive an e-mail/limited time request, because a player comes back from a map-server to the char-server case 0x2716: { diff --git a/src/proto2/char-map.hpp b/src/proto2/char-map.hpp index 23798b2..8a23be6 100644 --- a/src/proto2/char-map.hpp +++ b/src/proto2/char-map.hpp @@ -647,16 +647,6 @@ struct Packet_Fixed<0x3025> uint16_t level = {}; }; -template<> -struct Packet_Fixed<0x3026> -{ - static const uint16_t PACKET_ID = 0x3026; - - // TODO remove this - uint16_t magic_packet_id = PACKET_ID; - PartyId party_id = {}; -}; - template<> struct Packet_Head<0x3027> { @@ -1662,17 +1652,6 @@ static_assert(offsetof(NetPacket_Fixed<0x3025>, level) == 27, "offsetof(NetPacke static_assert(sizeof(NetPacket_Fixed<0x3025>) == 29, "sizeof(NetPacket_Fixed<0x3025>) == 29"); static_assert(alignof(NetPacket_Fixed<0x3025>) == 1, "alignof(NetPacket_Fixed<0x3025>) == 1"); -template<> -struct NetPacket_Fixed<0x3026> -{ - Little16 magic_packet_id; - Little32 party_id; -}; -static_assert(offsetof(NetPacket_Fixed<0x3026>, magic_packet_id) == 0, "offsetof(NetPacket_Fixed<0x3026>, magic_packet_id) == 0"); -static_assert(offsetof(NetPacket_Fixed<0x3026>, party_id) == 2, "offsetof(NetPacket_Fixed<0x3026>, party_id) == 2"); -static_assert(sizeof(NetPacket_Fixed<0x3026>) == 6, "sizeof(NetPacket_Fixed<0x3026>) == 6"); -static_assert(alignof(NetPacket_Fixed<0x3026>) == 1, "alignof(NetPacket_Fixed<0x3026>) == 1"); - template<> struct NetPacket_Head<0x3027> { @@ -3061,23 +3040,6 @@ bool network_to_native(Packet_Fixed<0x3025> *native, NetPacket_Fixed<0x3025> net return rv; } -inline __attribute__((warn_unused_result)) -bool native_to_network(NetPacket_Fixed<0x3026> *network, Packet_Fixed<0x3026> native) -{ - bool rv = true; - rv &= native_to_network(&network->magic_packet_id, native.magic_packet_id); - rv &= native_to_network(&network->party_id, native.party_id); - return rv; -} -inline __attribute__((warn_unused_result)) -bool network_to_native(Packet_Fixed<0x3026> *native, NetPacket_Fixed<0x3026> network) -{ - bool rv = true; - rv &= network_to_native(&native->magic_packet_id, network.magic_packet_id); - rv &= network_to_native(&native->party_id, network.party_id); - return rv; -} - inline __attribute__((warn_unused_result)) bool native_to_network(NetPacket_Head<0x3027> *network, Packet_Head<0x3027> native) { diff --git a/src/proto2/fwd.hpp b/src/proto2/fwd.hpp index 6077913..e1e0161 100644 --- a/src/proto2/fwd.hpp +++ b/src/proto2/fwd.hpp @@ -65,11 +65,6 @@ 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<> @@ -715,11 +710,6 @@ struct Packet_Fixed<0x3025>; template<> struct NetPacket_Fixed<0x3025>; -template<> -struct Packet_Fixed<0x3026>; -template<> -struct NetPacket_Fixed<0x3026>; - template<> struct Packet_Head<0x3027>; template<> diff --git a/src/proto2/login-char.hpp b/src/proto2/login-char.hpp index 6bd939c..00fe2ac 100644 --- a/src/proto2/login-char.hpp +++ b/src/proto2/login-char.hpp @@ -102,17 +102,6 @@ struct Packet_Fixed<0x2714> uint32_t users = {}; }; -template<> -struct Packet_Fixed<0x2715> -{ - static const uint16_t PACKET_ID = 0x2715; - - // TODO remove this - uint16_t magic_packet_id = PACKET_ID; - AccountId account_id = {}; - AccountEmail email = {}; -}; - template<> struct Packet_Fixed<0x2716> { @@ -429,19 +418,6 @@ static_assert(offsetof(NetPacket_Fixed<0x2714>, users) == 2, "offsetof(NetPacket static_assert(sizeof(NetPacket_Fixed<0x2714>) == 6, "sizeof(NetPacket_Fixed<0x2714>) == 6"); static_assert(alignof(NetPacket_Fixed<0x2714>) == 1, "alignof(NetPacket_Fixed<0x2714>) == 1"); -template<> -struct NetPacket_Fixed<0x2715> -{ - Little16 magic_packet_id; - Little32 account_id; - NetString email; -}; -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"); -static_assert(alignof(NetPacket_Fixed<0x2715>) == 1, "alignof(NetPacket_Fixed<0x2715>) == 1"); - template<> struct NetPacket_Fixed<0x2716> { @@ -830,25 +806,6 @@ bool network_to_native(Packet_Fixed<0x2714> *native, NetPacket_Fixed<0x2714> net return rv; } -inline __attribute__((warn_unused_result)) -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); - rv &= native_to_network(&network->account_id, native.account_id); - rv &= native_to_network(&network->email, native.email); - return rv; -} -inline __attribute__((warn_unused_result)) -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); - rv &= network_to_native(&native->account_id, network.account_id); - rv &= network_to_native(&native->email, network.email); - return rv; -} - inline __attribute__((warn_unused_result)) bool native_to_network(NetPacket_Fixed<0x2716> *network, Packet_Fixed<0x2716> native) { -- cgit v1.2.3-70-g09d2