summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2023-05-30 14:20:53 -0300
committermrb0nk500 <b0nk@b0nk.xyz>2023-05-30 14:23:02 -0300
commit569acdac5cb8e8ab352e2fbbae9660d9ad29c41a (patch)
tree6f7a02cc0cc36d7ded88e8dee3e920aa1f395350 /include
parenta77eec717e08422876315fbd81afb5d492b75315 (diff)
TProtocol: Add (and match) recv_pso_regist_{connect,check}()
Diffstat (limited to 'include')
-rw-r--r--include/pso/TProtocol.h12
-rw-r--r--include/pso/packet_classes.h68
2 files changed, 69 insertions, 11 deletions
diff --git a/include/pso/TProtocol.h b/include/pso/TProtocol.h
index 041cd56..886965c 100644
--- a/include/pso/TProtocol.h
+++ b/include/pso/TProtocol.h
@@ -69,7 +69,7 @@ struct packet : public flex_packet<0x7c00> {};
o(handle_66_recv_exit_game, int client_id, int leader_id, int disable_udp) \
o(handle_68_recv_burst_lobby, TPlyJoinLobbyEntry *entries, int leader_id) \
o(handle_69_recv_exit_lobby, int client_id, int leader_id) \
- o(handle_18_90_9A_login_response_packet, void) \
+ o(handle_18_90_9A_recv_pso_regist_check, u8 state) \
o(handle_92_9C_register_response_packet, void) \
o(unused10, void) \
o(handle_95_request_character_data_packet, void) \
@@ -126,7 +126,7 @@ public:
TPlySmth m_smth;
TPlyGuildCardTag m_guildcard_tag;
u16 m_sub_version;
- int m_login_response_state;
+ int m_regist_state;
int m_connected;
int m_joined_game;
int m_has_meet_user_settings;
@@ -145,8 +145,8 @@ public:
LobbyListEntry m_lobby_entries[16];
QuestListEntry m_quest_entries[30];
u8 m_unused5[128];
- char m_serial_number3[17];
- char m_password2[17];
+ char m_serial_number_v1[17];
+ char m_access_key_v1[17];
char m_serial_number[48];
char m_access_key[48];
char m_password[64];
@@ -251,6 +251,10 @@ public:
void recv_burst_lobby(packet &pkt);
// 0x69
void recv_exit_lobby(packet &pkt);
+ // 0x91
+ void recv_pso_regist_connect(packet &pkt);
+ // 0x18/0x90
+ void recv_pso_regist_check(packet &pkt);
// Send command handlers.
// 0x03
diff --git a/include/pso/packet_classes.h b/include/pso/packet_classes.h
index 9cd9800..f0e2fcc 100644
--- a/include/pso/packet_classes.h
+++ b/include/pso/packet_classes.h
@@ -14,6 +14,27 @@
#include <pso/TPlyGuildCardTag.h>
#include <pso/TPlySmth.h>
+#define _gc_tag_packet_templ(name, members) \
+template<bool has_gc_tag = false> \
+struct name { \
+ packet_header header; \
+ members \
+}; \
+ \
+template<> \
+struct name<true> { \
+ packet_header header; \
+ TPlyGuildCardTag tag; \
+ members \
+}
+
+_gc_tag_packet_templ(regist,
+ TPlySmth smth;
+ u32 sub_version;
+ u8 is_extended;
+ u8 language;
+);
+
template<size_t size>
struct TPlyText {
packet_header header;
@@ -233,6 +254,45 @@ _TSendAction(3,
#undef _TSendAction
#endif
+class TSendPsoRegist : public regist<false> {
+public:
+ char serial_number[48];
+ char access_key[48];
+ char password[48];
+public:
+ void bswap() {
+ header.bswap();
+ smth.bswap();
+ bswap_32(&sub_version);
+ };
+};
+
+class TSendPsoRegistConnect {
+public:
+ packet_header header;
+ char serial_number[17];
+ char access_key[17];
+ u16 padding;
+public:
+ void bswap() {
+ header.bswap();
+ };
+};
+
+class TRecvPsoRegistConnect {
+public:
+ packet_header header;
+ char copyright[64];
+ u32 server_key;
+ u32 client_key;
+public:
+ void bswap() {
+ header.bswap();
+ bswap_32(&server_key);
+ bswap_32(&client_key);
+ };
+};
+
template<bool is_lobby>
class TRecvExit {
public:
@@ -246,14 +306,8 @@ public:
};
};
-class TRegister {
+class TRegister : public regist<false> {
public:
- packet_header header;
- TPlySmth smth;
- u32 sub_version;
- u8 is_extended;
- u8 language;
- u16 unknown;
char serial_number[16];
char access_key[16];
public: