Network: AI走完后将着法放到服务器的发送列表中
This commit is contained in:
parent
c00287db45
commit
6b8a22e528
|
@ -905,6 +905,10 @@ bool GameController::command(const QString &cmd, bool update /* = true */)
|
|||
QMessageBox::about(NULL, "游戏结果", message);
|
||||
}
|
||||
}
|
||||
|
||||
// 网络: 将着法放到服务器的发送列表中
|
||||
this->server->setAction(cmd);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue