mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-22 22:53:55 -07:00
The remote client now runs in an extra thread, fixing issue #29
This commit is contained in:
parent
542fd2c5c8
commit
4e4a7563db
26 changed files with 130 additions and 79 deletions
|
|
@ -15,6 +15,7 @@
|
|||
#include "pending_command.h"
|
||||
#include "pb/room_commands.pb.h"
|
||||
#include "pb/serverinfo_game.pb.h"
|
||||
#include "pb/response.pb.h"
|
||||
|
||||
void DlgCreateGame::sharedCtor()
|
||||
{
|
||||
|
|
@ -177,19 +178,19 @@ void DlgCreateGame::actOK()
|
|||
}
|
||||
|
||||
PendingCommand *pend = room->prepareRoomCommand(cmd);
|
||||
connect(pend, SIGNAL(finished(Response::ResponseCode)), this, SLOT(checkResponse(Response::ResponseCode)));
|
||||
connect(pend, SIGNAL(finished(Response, CommandContainer, QVariant)), this, SLOT(checkResponse(Response)));
|
||||
room->sendRoomCommand(pend);
|
||||
|
||||
okButton->setEnabled(false);
|
||||
cancelButton->setEnabled(false);
|
||||
}
|
||||
|
||||
void DlgCreateGame::checkResponse(Response::ResponseCode response)
|
||||
void DlgCreateGame::checkResponse(const Response &response)
|
||||
{
|
||||
okButton->setEnabled(true);
|
||||
cancelButton->setEnabled(true);
|
||||
|
||||
if (response == Response::RespOk)
|
||||
if (response.response_code() == Response::RespOk)
|
||||
accept();
|
||||
else {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Server error."));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue