fix spectators not seeing each other's names when joining spectator team
This commit is contained in:
+11
-4
@@ -3124,14 +3124,21 @@ struct S_JoinSpectatorTeam_GC_Ep3_E8 {
|
||||
/* 1182 */ uint8_t solo_mode = 0;
|
||||
/* 1183 */ uint8_t unused3 = 0;
|
||||
struct SpectatorEntry {
|
||||
// It seems that at some point Sega intended to show each player's rank in
|
||||
// spectator teams. The unused1 and unused3 fields are intended for the
|
||||
// player's encrypted rank text and rank color (according to old Sega logs),
|
||||
// but the client ignores them. It's not clear what unused4 may have been
|
||||
// for, but the client also completely ignores it.
|
||||
/* 00 */ le_uint32_t player_tag = 0;
|
||||
/* 04 */ le_uint32_t guild_card_number = 0;
|
||||
/* 08 */ ptext<char, 0x20> name;
|
||||
/* 08 */ ptext<char, 0x10> name;
|
||||
/* 18 */ ptext<char, 0x10> unused1;
|
||||
/* 28 */ uint8_t present = 0;
|
||||
/* 29 */ uint8_t unknown_a3 = 0;
|
||||
/* 29 */ uint8_t unused2 = 0;
|
||||
/* 2A */ le_uint16_t level = 0;
|
||||
/* 2C */ parray<le_uint32_t, 2> unknown_a5;
|
||||
/* 34 */ parray<le_uint16_t, 2> unknown_a6;
|
||||
/* 2C */ le_uint32_t unused3 = 0xFFFFFFFF;
|
||||
/* 30 */ le_uint32_t name_color; // ARGB8888
|
||||
/* 34 */ parray<le_uint16_t, 2> unused4;
|
||||
/* 38 */
|
||||
} __packed__;
|
||||
// Somewhat misleadingly, this array also includes the players actually in the
|
||||
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
PlayerLobbyDataDCGC lobby_data;
|
||||
PlayerInventory inventory;
|
||||
PlayerDispDataDCPCV3 disp;
|
||||
uint32_t level;
|
||||
le_uint32_t level;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct Event {
|
||||
|
||||
+20
-11
@@ -1439,28 +1439,30 @@ static void send_join_spectator_team(shared_ptr<Client> c, shared_ptr<Lobby> l)
|
||||
if (!wc) {
|
||||
continue;
|
||||
}
|
||||
auto wc_p = wc->game_data.player();
|
||||
auto& p = cmd.players[z];
|
||||
p.lobby_data.player_tag = 0x00010000;
|
||||
p.lobby_data.guild_card = wc->license->serial_number;
|
||||
p.lobby_data.client_id = wc->lobby_client_id;
|
||||
p.lobby_data.name = wc->game_data.player()->disp.name;
|
||||
p.lobby_data.name = wc_p->disp.name;
|
||||
remove_language_marker_inplace(p.lobby_data.name);
|
||||
p.inventory = wc->game_data.player()->inventory;
|
||||
p.inventory = wc_p->inventory;
|
||||
for (size_t y = 0; y < 30; y++) {
|
||||
p.inventory.items[y].data.bswap_data2_if_mag();
|
||||
}
|
||||
p.disp = wc->game_data.player()->disp.to_dcpcv3();
|
||||
p.disp = wc_p->disp.to_dcpcv3();
|
||||
remove_language_marker_inplace(p.disp.visual.name);
|
||||
|
||||
auto& e = cmd.entries[z];
|
||||
e.player_tag = 0x00010000;
|
||||
e.guild_card_number = wc->license->serial_number;
|
||||
e.name = wc->game_data.player()->disp.name;
|
||||
e.name = wc_p->disp.name;
|
||||
remove_language_marker_inplace(e.name);
|
||||
e.present = 1;
|
||||
e.level = wc->game_data.ep3_config
|
||||
? (wc->game_data.ep3_config->online_clv_exp / 100)
|
||||
: wc->game_data.player()->disp.stats.level.load();
|
||||
: wc_p->disp.stats.level.load();
|
||||
e.name_color = wc_p->disp.visual.name_color;
|
||||
|
||||
player_count++;
|
||||
}
|
||||
@@ -1499,7 +1501,8 @@ static void send_join_spectator_team(shared_ptr<Client> c, shared_ptr<Lobby> l)
|
||||
e.name = entry.disp.visual.name;
|
||||
remove_language_marker_inplace(e.name);
|
||||
e.present = 1;
|
||||
e.level = entry.disp.stats.level.load();
|
||||
e.level = entry.level.load();
|
||||
e.name_color = entry.disp.visual.name_color;
|
||||
|
||||
player_count++;
|
||||
}
|
||||
@@ -1510,22 +1513,28 @@ static void send_join_spectator_team(shared_ptr<Client> c, shared_ptr<Lobby> l)
|
||||
|
||||
for (size_t z = 4; z < 12; z++) {
|
||||
if (l->clients[z]) {
|
||||
auto& gd = l->clients[z]->game_data;
|
||||
auto& p = cmd.spectator_players[z - 4];
|
||||
auto& e = cmd.entries[z];
|
||||
p.lobby_data.player_tag = 0x00010000;
|
||||
p.lobby_data.guild_card = l->clients[z]->license->serial_number;
|
||||
p.lobby_data.client_id = l->clients[z]->lobby_client_id;
|
||||
p.lobby_data.name = l->clients[z]->game_data.player()->disp.name;
|
||||
p.lobby_data.name = gd.player()->disp.name;
|
||||
remove_language_marker_inplace(p.lobby_data.name);
|
||||
p.inventory = l->clients[z]->game_data.player()->inventory;
|
||||
p.disp = l->clients[z]->game_data.player()->disp.to_dcpcv3();
|
||||
p.inventory = gd.player()->inventory;
|
||||
p.disp = gd.player()->disp.to_dcpcv3();
|
||||
remove_language_marker_inplace(p.disp.visual.name);
|
||||
|
||||
e.player_tag = 0x00010000;
|
||||
e.guild_card_number = l->clients[z]->license->serial_number;
|
||||
e.name = l->clients[z]->game_data.player()->disp.name;
|
||||
e.name = gd.player()->disp.name;
|
||||
remove_language_marker_inplace(e.name);
|
||||
e.present = 1;
|
||||
e.level = l->clients[z]->game_data.player()->disp.stats.level.load();
|
||||
e.level = gd.ep3_config
|
||||
? (gd.ep3_config->online_clv_exp / 100)
|
||||
: gd.player()->disp.stats.level.load();
|
||||
e.name_color = gd.player()->disp.visual.name_color;
|
||||
|
||||
player_count++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user