core, web_service: Check for error when registering rooms

The `Register()` function can now handle error results and the error will be passed immediately to the Qt frontend, instead of being ignored silently and failing later with a "Room is not registered".
This commit is contained in:
zhupengfei
2019-04-20 12:50:14 +08:00
parent 81988d96fe
commit 36051204cc
7 changed files with 67 additions and 33 deletions
+5 -8
View File
@@ -174,14 +174,11 @@ void MultiplayerState::OnNetworkError(const Network::RoomMember::Error& error) {
void MultiplayerState::OnAnnounceFailed(const Common::WebResult& result) {
announce_multiplayer_session->Stop();
QMessageBox::warning(
this, tr("Error"),
tr("Failed to announce the room to the public lobby. In order to host a room publicly, you "
"must have a valid Citra account configured in Emulation -> Configure -> Web. If you do "
"not want to publish a room in the public lobby, then select Unlisted instead.\n"
"Debug Message: ") +
QString::fromStdString(result.result_string),
QMessageBox::Ok);
QMessageBox::warning(this, tr("Error"),
tr("Failed to update the room information. Please check your Internet "
"connection and try hosting the room again.\nDebug Message: ") +
QString::fromStdString(result.result_string),
QMessageBox::Ok);
}
void MultiplayerState::UpdateThemedIcons() {