Skip to content

Commit

Permalink
RMG: keep track of game launch in NetplaySessionDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosalie241 committed Jan 21, 2025
1 parent c93f829 commit 847f832
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void NetplaySessionDialog::on_webSocket_textMessageReceived(QString message)
{
this->sessionNumber = i + 1;
}
if (i == 0)
if (!this->started && i == 0)
{
QPushButton* startButton = this->buttonBox->button(QDialogButtonBox::Ok);
startButton->setEnabled(this->nickName == name);
Expand All @@ -109,6 +109,7 @@ 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);
}
else if (type == "reply_motd")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class NetplaySessionDialog : public QDialog, private Ui::NetplaySessionDialog
QString sessionName;
int sessionPort = -1;
int sessionNumber = -1;
bool started = false;

QWebSocket* webSocket;

Expand Down

0 comments on commit 847f832

Please sign in to comment.