Skip to content

Commit

Permalink
RMG: check failure state for reply_begin_game in NetplaySessionDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosalie241 committed Jan 26, 2025
1 parent 8312b2a commit 7b4629b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Source/RMG/UserInterface/Dialog/Netplay/NetplaySessionDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,15 @@ void NetplaySessionDialog::on_webSocket_textMessageReceived(QString message)
}
else if (type == "reply_begin_game")
{
this->started = true;
emit OnPlayGame(this->sessionFile, this->webSocket->peerAddress().toString(), this->sessionPort, this->sessionNumber);
if (json.value("accept").toInt() == 0)
{
this->started = true;
emit OnPlayGame(this->sessionFile, this->webSocket->peerAddress().toString(), this->sessionPort, this->sessionNumber);
}
else
{
QtMessageBox::Error(this, "Server Error", json.value("message").toString());
}
}
else if (type == "reply_motd")
{
Expand Down

0 comments on commit 7b4629b

Please sign in to comment.