room stuff and minor fixes

This commit is contained in:
Max-Wilhelm Bruker 2011-01-03 19:01:49 +01:00
parent 80277ff573
commit 78d81ae65a
19 changed files with 159 additions and 99 deletions

View file

@ -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);
}
}