clean up meet user extension structure
This commit is contained in:
+23
-26
@@ -762,26 +762,31 @@ struct C_GuildCardSearch_40 {
|
|||||||
|
|
||||||
// 41 (S->C): Guild card search result
|
// 41 (S->C): Guild card search result
|
||||||
|
|
||||||
|
template <typename CharT>
|
||||||
|
struct SC_MeetUserExtension {
|
||||||
|
le_uint32_t menu_id;
|
||||||
|
le_uint32_t lobby_id;
|
||||||
|
parray<uint8_t, 0x3C> unknown_a1;
|
||||||
|
ptext<CharT, 0x20> player_name;
|
||||||
|
};
|
||||||
|
|
||||||
template <typename HeaderT, typename CharT>
|
template <typename HeaderT, typename CharT>
|
||||||
struct S_GuildCardSearchResult {
|
struct S_GuildCardSearchResult {
|
||||||
le_uint32_t player_tag;
|
le_uint32_t player_tag;
|
||||||
le_uint32_t searcher_guild_card_number;
|
le_uint32_t searcher_guild_card_number;
|
||||||
le_uint32_t result_guild_card_number;
|
le_uint32_t result_guild_card_number;
|
||||||
HeaderT reconnect_command_header;
|
HeaderT reconnect_command_header; // Ignored by the client
|
||||||
S_Reconnect_19 reconnect_command;
|
S_Reconnect_19 reconnect_command;
|
||||||
// The format of this string is "ROOM-NAME,BLOCK##,SERVER-NAME". If the result
|
// The format of this string is "GAME-NAME,BLOCK##,SERVER-NAME". If the result
|
||||||
// player is not in a game, GAME-NAME should be the lobby name - for standard
|
// player is not in a game, GAME-NAME should be the lobby name - for standard
|
||||||
// lobbies this is "BLOCK<blocknum>-<lobbynum>"; for CARD lobbies this is
|
// lobbies this is "BLOCK<blocknum>-<lobbynum>"; for CARD lobbies this is
|
||||||
// "BLOCK<blocknum>-C<lobbynum>".
|
// "BLOCK<blocknum>-C<lobbynum>".
|
||||||
ptext<CharT, 0x44> location_string;
|
ptext<CharT, 0x44> location_string;
|
||||||
// If the player chooses to meet the user, this menu ID and lobby ID is sent
|
// If the player chooses to meet the user, this extension data is sent in the
|
||||||
// in the login command (9D/9E) after connecting to the server designated in
|
// login command (9D/9E) after connecting to the server designated in
|
||||||
// reconnect_command. In fact, the remaining fields in this structure directly
|
// reconnect_command. When processing the 9D/9E, newserv uses only the
|
||||||
// match the fields in the extended 9D/9E commands.
|
// lobby_id field within, but it fills in all fields when sengind a 41.
|
||||||
le_uint32_t menu_id;
|
SC_MeetUserExtension<CharT> extension;
|
||||||
le_uint32_t lobby_id;
|
|
||||||
ptext<uint8_t, 0x3C> unused;
|
|
||||||
ptext<CharT, 0x20> name;
|
|
||||||
};
|
};
|
||||||
struct S_GuildCardSearchResult_PC_41
|
struct S_GuildCardSearchResult_PC_41
|
||||||
: S_GuildCardSearchResult<PSOCommandHeaderPC, char16_t> { };
|
: S_GuildCardSearchResult<PSOCommandHeaderPC, char16_t> { };
|
||||||
@@ -1227,14 +1232,6 @@ struct C_RegisterV1_DC_92 {
|
|||||||
|
|
||||||
// 93 (C->S): Log in (DCv1)
|
// 93 (C->S): Log in (DCv1)
|
||||||
|
|
||||||
template <typename CharT>
|
|
||||||
struct C_Login_MeetUserExtension {
|
|
||||||
le_uint32_t menu_id;
|
|
||||||
le_uint32_t preferred_lobby_id;
|
|
||||||
parray<uint8_t, 0x3C> unknown_a1;
|
|
||||||
ptext<CharT, 0x20> target_player_name;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct C_LoginV1_DC_93 {
|
struct C_LoginV1_DC_93 {
|
||||||
le_uint32_t player_tag;
|
le_uint32_t player_tag;
|
||||||
le_uint32_t guild_card_number;
|
le_uint32_t guild_card_number;
|
||||||
@@ -1254,7 +1251,7 @@ struct C_LoginV1_DC_93 {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct C_LoginExtendedV1_DC_93 : C_LoginV1_DC_93 {
|
struct C_LoginExtendedV1_DC_93 : C_LoginV1_DC_93 {
|
||||||
C_Login_MeetUserExtension<char> extension;
|
SC_MeetUserExtension<char> extension;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 93 (C->S): Log in (BB)
|
// 93 (C->S): Log in (BB)
|
||||||
@@ -1267,8 +1264,8 @@ struct C_Login_BB_93 {
|
|||||||
ptext<char, 0x30> username;
|
ptext<char, 0x30> username;
|
||||||
ptext<char, 0x30> password;
|
ptext<char, 0x30> password;
|
||||||
|
|
||||||
// These fields map to the same fields in C_Login_MeetUserExtension. There is
|
// These fields map to the same fields in SC_MeetUserExtension. There is no
|
||||||
// no equivalent of the name field from that structure on BB (though newserv
|
// equivalent of the name field from that structure on BB (though newserv
|
||||||
// doesn't use it anyway).
|
// doesn't use it anyway).
|
||||||
le_uint32_t menu_id;
|
le_uint32_t menu_id;
|
||||||
le_uint32_t preferred_lobby_id;
|
le_uint32_t preferred_lobby_id;
|
||||||
@@ -1441,10 +1438,10 @@ struct C_Login_DC_PC_GC_9D {
|
|||||||
ptext<char, 0x10> name;
|
ptext<char, 0x10> name;
|
||||||
};
|
};
|
||||||
struct C_LoginExtended_DC_GC_9D : C_Login_DC_PC_GC_9D {
|
struct C_LoginExtended_DC_GC_9D : C_Login_DC_PC_GC_9D {
|
||||||
C_Login_MeetUserExtension<char> extension;
|
SC_MeetUserExtension<char> extension;
|
||||||
};
|
};
|
||||||
struct C_LoginExtended_PC_9D : C_Login_DC_PC_GC_9D {
|
struct C_LoginExtended_PC_9D : C_Login_DC_PC_GC_9D {
|
||||||
C_Login_MeetUserExtension<char16_t> extension;
|
SC_MeetUserExtension<char16_t> extension;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 9E (C->S): Log in with client config (V3/BB)
|
// 9E (C->S): Log in with client config (V3/BB)
|
||||||
@@ -1461,7 +1458,7 @@ struct C_Login_GC_9E : C_Login_DC_PC_GC_9D {
|
|||||||
} client_config;
|
} client_config;
|
||||||
};
|
};
|
||||||
struct C_LoginExtended_GC_9E : C_Login_GC_9E {
|
struct C_LoginExtended_GC_9E : C_Login_GC_9E {
|
||||||
C_Login_MeetUserExtension<char> extension;
|
SC_MeetUserExtension<char> extension;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct C_Login_XB_9E : C_Login_GC_9E {
|
struct C_Login_XB_9E : C_Login_GC_9E {
|
||||||
@@ -1469,7 +1466,7 @@ struct C_Login_XB_9E : C_Login_GC_9E {
|
|||||||
parray<le_uint32_t, 6> unknown_a1;
|
parray<le_uint32_t, 6> unknown_a1;
|
||||||
};
|
};
|
||||||
struct C_LoginExtended_XB_9E : C_Login_XB_9E {
|
struct C_LoginExtended_XB_9E : C_Login_XB_9E {
|
||||||
C_Login_MeetUserExtension<char> extension;
|
SC_MeetUserExtension<char> extension;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct C_LoginExtended_BB_9E {
|
struct C_LoginExtended_BB_9E {
|
||||||
@@ -1486,7 +1483,7 @@ struct C_LoginExtended_BB_9E {
|
|||||||
ptext<char, 0x30> password;
|
ptext<char, 0x30> password;
|
||||||
ptext<char, 0x10> guild_card_number_str;
|
ptext<char, 0x10> guild_card_number_str;
|
||||||
parray<le_uint32_t, 10> unknown_a7;
|
parray<le_uint32_t, 10> unknown_a7;
|
||||||
C_Login_MeetUserExtension<char16_t> extension;
|
SC_MeetUserExtension<char16_t> extension;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 9F (S->C): Request client config / security data (V3/BB)
|
// 9F (S->C): Request client config / security data (V3/BB)
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ static void on_login_3_dc_pc_v3(shared_ptr<ServerState> s, shared_ptr<Client> c,
|
|||||||
if (cmd.is_extended) {
|
if (cmd.is_extended) {
|
||||||
const auto& ext_cmd = check_size_t<C_LoginExtendedV1_DC_93>(data);
|
const auto& ext_cmd = check_size_t<C_LoginExtendedV1_DC_93>(data);
|
||||||
if (ext_cmd.extension.menu_id == MenuID::LOBBY) {
|
if (ext_cmd.extension.menu_id == MenuID::LOBBY) {
|
||||||
c->preferred_lobby_id = ext_cmd.extension.preferred_lobby_id;
|
c->preferred_lobby_id = ext_cmd.extension.lobby_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -420,12 +420,12 @@ static void on_login_d_e_dc_pc_v3(shared_ptr<ServerState> s, shared_ptr<Client>
|
|||||||
if (c->version() == GameVersion::PC) {
|
if (c->version() == GameVersion::PC) {
|
||||||
const auto& cmd = check_size_t<C_LoginExtended_PC_9D>(data);
|
const auto& cmd = check_size_t<C_LoginExtended_PC_9D>(data);
|
||||||
if (cmd.extension.menu_id == MenuID::LOBBY) {
|
if (cmd.extension.menu_id == MenuID::LOBBY) {
|
||||||
c->preferred_lobby_id = cmd.extension.preferred_lobby_id;
|
c->preferred_lobby_id = cmd.extension.lobby_id;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const auto& cmd = check_size_t<C_LoginExtended_DC_GC_9D>(data);
|
const auto& cmd = check_size_t<C_LoginExtended_DC_GC_9D>(data);
|
||||||
if (cmd.extension.menu_id == MenuID::LOBBY) {
|
if (cmd.extension.menu_id == MenuID::LOBBY) {
|
||||||
c->preferred_lobby_id = cmd.extension.preferred_lobby_id;
|
c->preferred_lobby_id = cmd.extension.lobby_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -451,7 +451,7 @@ static void on_login_d_e_dc_pc_v3(shared_ptr<ServerState> s, shared_ptr<Client>
|
|||||||
if (cmd.is_extended) {
|
if (cmd.is_extended) {
|
||||||
const auto& cmd = check_size_t<C_LoginExtended_GC_9E>(data);
|
const auto& cmd = check_size_t<C_LoginExtended_GC_9E>(data);
|
||||||
if (cmd.extension.menu_id == MenuID::LOBBY) {
|
if (cmd.extension.menu_id == MenuID::LOBBY) {
|
||||||
c->preferred_lobby_id = cmd.extension.preferred_lobby_id;
|
c->preferred_lobby_id = cmd.extension.lobby_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -739,9 +739,9 @@ void send_card_search_result_t(
|
|||||||
result_lobby->lobby_id, encoded_server_name.c_str());
|
result_lobby->lobby_id, encoded_server_name.c_str());
|
||||||
}
|
}
|
||||||
cmd.location_string = location_string;
|
cmd.location_string = location_string;
|
||||||
cmd.menu_id = MenuID::LOBBY;
|
cmd.extension.menu_id = MenuID::LOBBY;
|
||||||
cmd.lobby_id = result->lobby_id;
|
cmd.extension.lobby_id = result->lobby_id;
|
||||||
cmd.name = result->game_data.player()->disp.name;
|
cmd.extension.player_name = result->game_data.player()->disp.name;
|
||||||
|
|
||||||
send_command_t(c, 0x41, 0x00, cmd);
|
send_command_t(c, 0x41, 0x00, cmd);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user