mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-04-11 14:00:51 -04:00
Merge pull request #7564 from Techjar/netplay-sync-wii-shutdown
NetPlay: Sync power button event
This commit is contained in:
@@ -569,6 +569,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;
|
||||
@@ -1702,6 +1708,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
|
||||
{
|
||||
@@ -1884,6 +1897,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