fix Ep3 NTE tournament menu bugs
This commit is contained in:
+19
-3
@@ -2826,8 +2826,24 @@ struct C_CreateChallengeModeAwardItem_BB_07DF {
|
|||||||
// The client will send 09 and 10 commands to inspect or enter a tournament. The
|
// The client will send 09 and 10 commands to inspect or enter a tournament. The
|
||||||
// server should respond to an 09 command with an E3 command; the server should
|
// server should respond to an 09 command with an E3 command; the server should
|
||||||
// respond to a 10 command with an E2 command.
|
// respond to a 10 command with an E2 command.
|
||||||
|
|
||||||
// header.flag is the count of filled-in entries.
|
// header.flag is the count of filled-in entries.
|
||||||
|
|
||||||
|
struct S_TournamentList_Ep3NTE_E0 {
|
||||||
|
struct Entry {
|
||||||
|
le_uint32_t menu_id = 0;
|
||||||
|
le_uint32_t item_id = 0;
|
||||||
|
uint8_t unknown_a1 = 0;
|
||||||
|
uint8_t locked = 0;
|
||||||
|
uint8_t state = 0;
|
||||||
|
uint8_t unknown_a2 = 0;
|
||||||
|
le_uint32_t start_time = 0; // In seconds since Unix epoch
|
||||||
|
pstring<TextEncoding::MARKED, 0x20> name;
|
||||||
|
le_uint16_t num_teams = 0;
|
||||||
|
le_uint16_t max_teams = 0;
|
||||||
|
} __packed__;
|
||||||
|
parray<Entry, 0x20> entries;
|
||||||
|
} __packed__;
|
||||||
|
|
||||||
struct S_TournamentList_Ep3_E0 {
|
struct S_TournamentList_Ep3_E0 {
|
||||||
struct Entry {
|
struct Entry {
|
||||||
le_uint32_t menu_id = 0;
|
le_uint32_t menu_id = 0;
|
||||||
@@ -2856,8 +2872,8 @@ struct S_TournamentList_Ep3_E0 {
|
|||||||
pstring<TextEncoding::MARKED, 0x20> name;
|
pstring<TextEncoding::MARKED, 0x20> name;
|
||||||
le_uint16_t num_teams = 0;
|
le_uint16_t num_teams = 0;
|
||||||
le_uint16_t max_teams = 0;
|
le_uint16_t max_teams = 0;
|
||||||
le_uint16_t unknown_a3 = 0;
|
le_uint16_t unknown_a3 = 0xFFFF;
|
||||||
le_uint16_t unknown_a4 = 0;
|
le_uint16_t unknown_a4 = 0xFFFF;
|
||||||
} __packed__;
|
} __packed__;
|
||||||
parray<Entry, 0x20> entries;
|
parray<Entry, 0x20> entries;
|
||||||
} __packed__;
|
} __packed__;
|
||||||
|
|||||||
@@ -1754,7 +1754,9 @@ static void on_E2_Ep3(shared_ptr<Client> c, uint16_t, uint32_t flag, string&) {
|
|||||||
c->ep3_tournament_team.reset();
|
c->ep3_tournament_team.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
send_ep3_confirm_tournament_entry(c, nullptr);
|
if (c->version() != Version::GC_EP3_NTE) {
|
||||||
|
send_ep3_confirm_tournament_entry(c, nullptr);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0x03: // Create tournament spectator team (get battle list)
|
case 0x03: // Create tournament spectator team (get battle list)
|
||||||
|
|||||||
+11
-6
@@ -2840,12 +2840,11 @@ void send_ep3_confirm_tournament_entry(
|
|||||||
send_command_t(c, 0xCC, tourn ? 0x01 : 0x00, cmd);
|
send_command_t(c, 0xCC, tourn ? 0x01 : 0x00, cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_ep3_tournament_list(
|
template <typename CmdT>
|
||||||
shared_ptr<Client> c,
|
void send_ep3_tournament_list_t(shared_ptr<Client> c, bool is_for_spectator_team_create) {
|
||||||
bool is_for_spectator_team_create) {
|
|
||||||
auto s = c->require_server_state();
|
auto s = c->require_server_state();
|
||||||
|
|
||||||
S_TournamentList_Ep3_E0 cmd;
|
CmdT cmd;
|
||||||
size_t z = 0;
|
size_t z = 0;
|
||||||
for (const auto& it : s->ep3_tournament_index->all_tournaments()) {
|
for (const auto& it : s->ep3_tournament_index->all_tournaments()) {
|
||||||
const auto& tourn = it.second;
|
const auto& tourn = it.second;
|
||||||
@@ -2876,13 +2875,19 @@ void send_ep3_tournament_list(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
entry.max_teams = teams.size();
|
entry.max_teams = teams.size();
|
||||||
entry.unknown_a3 = 0xFFFF;
|
|
||||||
entry.unknown_a4 = 0xFFFF;
|
|
||||||
z++;
|
z++;
|
||||||
}
|
}
|
||||||
send_command_t(c, 0xE0, z, cmd);
|
send_command_t(c, 0xE0, z, cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void send_ep3_tournament_list(shared_ptr<Client> c, bool is_for_spectator_team_create) {
|
||||||
|
if (c->version() == Version::GC_EP3_NTE) {
|
||||||
|
send_ep3_tournament_list_t<S_TournamentList_Ep3NTE_E0>(c, is_for_spectator_team_create);
|
||||||
|
} else {
|
||||||
|
send_ep3_tournament_list_t<S_TournamentList_Ep3_E0>(c, is_for_spectator_team_create);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void send_ep3_tournament_entry_list(
|
void send_ep3_tournament_entry_list(
|
||||||
shared_ptr<Client> c,
|
shared_ptr<Client> c,
|
||||||
shared_ptr<const Episode3::Tournament> tourn,
|
shared_ptr<const Episode3::Tournament> tourn,
|
||||||
|
|||||||
Reference in New Issue
Block a user