mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 16:49:58 -06:00
Check if all players have the game before starting netplay
https://bugs.dolphin-emu.org/issues/8885
This commit is contained in:
@ -318,9 +318,14 @@ unsigned int NetPlayServer::OnConnect(ENetPeer* socket)
|
||||
for (const auto& p : m_players)
|
||||
{
|
||||
spac.clear();
|
||||
spac << (MessageId)NP_MSG_PLAYER_JOIN;
|
||||
spac << static_cast<MessageId>(NP_MSG_PLAYER_JOIN);
|
||||
spac << p.second.pid << p.second.name << p.second.revision;
|
||||
Send(player.socket, spac);
|
||||
|
||||
spac.clear();
|
||||
spac << static_cast<MessageId>(NP_MSG_GAME_STATUS);
|
||||
spac << p.second.pid << static_cast<u32>(p.second.game_status);
|
||||
Send(player.socket, spac);
|
||||
}
|
||||
|
||||
// add client to the player list
|
||||
@ -592,6 +597,23 @@ unsigned int NetPlayServer::OnData(sf::Packet& packet, Client& player)
|
||||
}
|
||||
break;
|
||||
|
||||
case NP_MSG_GAME_STATUS:
|
||||
{
|
||||
u32 status;
|
||||
packet >> status;
|
||||
|
||||
m_players[player.pid].game_status = static_cast<PlayerGameStatus>(status);
|
||||
|
||||
// send msg to other clients
|
||||
sf::Packet spac;
|
||||
spac << static_cast<MessageId>(NP_MSG_GAME_STATUS);
|
||||
spac << player.pid;
|
||||
spac << status;
|
||||
|
||||
SendToClients(spac);
|
||||
}
|
||||
break;
|
||||
|
||||
case NP_MSG_TIMEBASE:
|
||||
{
|
||||
u32 x, y, frame;
|
||||
|
Reference in New Issue
Block a user