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:
@ -146,4 +146,18 @@ AnnounceMultiplayerRoom::RoomList AnnounceMultiplayerSession::GetRoomList() {
|
||||
return backend->GetRoomList();
|
||||
}
|
||||
|
||||
bool AnnounceMultiplayerSession::IsRunning() const {
|
||||
return announce_multiplayer_thread != nullptr;
|
||||
}
|
||||
|
||||
void AnnounceMultiplayerSession::UpdateCredentials() {
|
||||
ASSERT_MSG(!IsRunning(), "Credentials can only be updated when session is not running");
|
||||
|
||||
#ifdef ENABLE_WEB_SERVICE
|
||||
backend = std::make_unique<WebService::RoomJson>(Settings::values.web_api_url,
|
||||
Settings::values.citra_username,
|
||||
Settings::values.citra_token);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace Core
|
||||
|
Reference in New Issue
Block a user