mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
small protocol change
This commit is contained in:
parent
40d292c4ac
commit
2e0b16e90b
2 changed files with 9 additions and 12 deletions
|
|
@ -6,20 +6,18 @@ bool ReturnMessage::send(ReturnCode code)
|
|||
ServerSocket *s = qobject_cast<ServerSocket *>(parent());
|
||||
if (!s)
|
||||
return false;
|
||||
bool success = (code == ReturnOk);
|
||||
QString returnCodeString;
|
||||
switch (code) {
|
||||
case ReturnNothing: return true;
|
||||
case ReturnOk: break;
|
||||
case ReturnOk: returnCodeString = "ok"; break;
|
||||
case ReturnLoginNeeded: returnCodeString = "login_needed"; break;
|
||||
case ReturnSyntaxError: returnCodeString = "syntax"; break;
|
||||
case ReturnContextError: returnCodeString = "context"; break;
|
||||
case ReturnPasswordWrong: returnCodeString = "password"; break;
|
||||
}
|
||||
s->msg(QString("resp|%1|%2|%3").arg(msg_id)
|
||||
.arg(success ? "ok" : "err")
|
||||
.arg(returnCodeString));
|
||||
return success;
|
||||
s->msg(QString("resp|%1|%2").arg(msg_id)
|
||||
.arg(returnCodeString));
|
||||
return (code == ReturnOk);
|
||||
}
|
||||
|
||||
bool ReturnMessage::sendList(const QStringList &args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue