Network: AI走完后将着法放到服务器的发送列表中

This commit is contained in:
CalciteM 2019-07-28 10:51:27 +08:00
parent c00287db45
commit 6b8a22e528
3 changed files with 6 additions and 10 deletions

View File

@ -905,6 +905,10 @@ bool GameController::command(const QString &cmd, bool update /* = true */)
QMessageBox::about(NULL, "游戏结果", message);
}
}
// 网络: 将着法放到服务器的发送列表中
this->server->setAction(cmd);
return true;
}

View File

@ -56,14 +56,6 @@ Server::Server(QWidget *parent)
sessionOpened();
}
actions << tr("Move")
<< tr("Place")
<< tr("Capture")
<< tr("Giveup")
<< tr("Hello")
<< tr("Quit")
<< tr("Draw");
auto quitButton = new QPushButton(tr("Quit"));
quitButton->setAutoDefault(false);
connect(quitButton, &QAbstractButton::clicked, this, &QWidget::close);
@ -144,7 +136,7 @@ void Server::sessionOpened()
.arg(ipAddress).arg(tcpServer->serverPort()));
}
void Server::setAction(QString action)
void Server::setAction(const QString &action)
{
this->action = action;
}

View File

@ -37,10 +37,10 @@ class Server : public QDialog
public:
explicit Server(QWidget *parent = nullptr);
void setAction(const QString &action);
private slots:
void sessionOpened();
void setAction(QString action);
void sendAction();
private: