core, citra_qt: Allow credentials update in multiplayer announce session

Allows updating the credentials of the announce session, thus allowing credentials changes to be reflected before citra restart. To avoid race conditions and web errors (you can only update the room that you created, i.e. changing credentials halfway will make it break), now you can only use the Citra Web Services settings when not hosting a public room.
This commit is contained in:
zhupengfei
2019-04-20 10:42:20 +08:00
parent d6b168d7ed
commit 4a9ea65e49
10 changed files with 65 additions and 3 deletions

View File

@@ -278,3 +278,11 @@ void MultiplayerState::OnDirectConnectToRoom() {
}
BringWidgetToFront(direct_connect);
}
bool MultiplayerState::IsHostingPublicRoom() const {
return announce_multiplayer_session->IsRunning();
}
void MultiplayerState::UpdateCredentials() {
announce_multiplayer_session->UpdateCredentials();
}

View File

@@ -38,6 +38,14 @@ public:
void retranslateUi();
/**
* Whether a public room is being hosted or not.
* When this is true, Web Services configuration should be disabled.
*/
bool IsHostingPublicRoom() const;
void UpdateCredentials();
public slots:
void OnNetworkStateChanged(const Network::RoomMember::State& state);
void OnNetworkError(const Network::RoomMember::Error& error);