mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 09:04:53 -07:00
room stuff and minor fixes
This commit is contained in:
parent
80277ff573
commit
78d81ae65a
19 changed files with 159 additions and 99 deletions
|
|
@ -42,12 +42,17 @@ void RemoteClient::slotConnected()
|
|||
setStatus(StatusAwaitingWelcome);
|
||||
}
|
||||
|
||||
void RemoteClient::loginResponse(ResponseCode response)
|
||||
void RemoteClient::loginResponse(ProtocolResponse *response)
|
||||
{
|
||||
if (response == RespOk)
|
||||
Response_Login *resp = qobject_cast<Response_Login *>(response);
|
||||
if (!resp)
|
||||
disconnectFromServer();
|
||||
|
||||
if (resp->getResponseCode() == RespOk) {
|
||||
setStatus(StatusLoggedIn);
|
||||
else {
|
||||
emit serverError(response);
|
||||
emit userInfoChanged(resp->getUserInfo());
|
||||
} else {
|
||||
emit serverError(resp->getResponseCode());
|
||||
setStatus(StatusDisconnecting);
|
||||
}
|
||||
}
|
||||
|
|
@ -78,7 +83,7 @@ void RemoteClient::readData()
|
|||
|
||||
setStatus(StatusLoggingIn);
|
||||
Command_Login *cmdLogin = new Command_Login(userName, password);
|
||||
connect(cmdLogin, SIGNAL(finished(ResponseCode)), this, SLOT(loginResponse(ResponseCode)));
|
||||
connect(cmdLogin, SIGNAL(finished(ProtocolResponse *)), this, SLOT(loginResponse(ProtocolResponse *)));
|
||||
sendCommand(cmdLogin);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue