mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-02-20 10:01:06 -05:00
NetPlay: Sync power button event
This fixes the deadlock on shutdown when Wii Remotes are in use.
This commit is contained in:
@@ -568,6 +568,12 @@ unsigned int NetPlayClient::OnData(sf::Packet& packet)
|
||||
}
|
||||
break;
|
||||
|
||||
case NP_MSG_POWER_BUTTON:
|
||||
{
|
||||
m_dialog->OnMsgPowerButton();
|
||||
}
|
||||
break;
|
||||
|
||||
case NP_MSG_PING:
|
||||
{
|
||||
u32 ping_key = 0;
|
||||
@@ -1701,6 +1707,13 @@ void NetPlayClient::RequestStopGame()
|
||||
SendStopGamePacket();
|
||||
}
|
||||
|
||||
void NetPlayClient::SendPowerButtonEvent()
|
||||
{
|
||||
sf::Packet packet;
|
||||
packet << static_cast<MessageId>(NP_MSG_POWER_BUTTON);
|
||||
SendAsync(std::move(packet));
|
||||
}
|
||||
|
||||
// called from ---GUI--- thread
|
||||
bool NetPlayClient::LocalPlayerHasControllerMapped() const
|
||||
{
|
||||
@@ -1883,6 +1896,12 @@ void SetSIPollBatching(bool state)
|
||||
s_si_poll_batching = state;
|
||||
}
|
||||
|
||||
void SendPowerButtonEvent()
|
||||
{
|
||||
ASSERT(IsNetPlayRunning());
|
||||
netplay_client->SendPowerButtonEvent();
|
||||
}
|
||||
|
||||
void NetPlay_Enable(NetPlayClient* const np)
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(crit_netplay_client);
|
||||
|
||||
Reference in New Issue
Block a user