final (?) spectator code, small bugfix

This commit is contained in:
Max-Wilhelm Bruker 2009-09-24 20:12:44 +02:00
parent fa16d86283
commit a543c9b90c
22 changed files with 453 additions and 190 deletions

View file

@ -22,14 +22,15 @@ bool ReturnMessage::send(ReturnCode code)
return (code == ReturnOk);
}
bool ReturnMessage::sendList(const QStringList &args)
bool ReturnMessage::sendList(const QStringList &args, const QString &prefix)
{
ServerSocket *s = qobject_cast<ServerSocket *>(parent());
if (!s)
return false;
QString arg1 = prefix.isEmpty() ? cmd : prefix;
for (int i = 0; i < args.size(); i++)
s->msg(QString("%1|%2|%3").arg(cmd)
s->msg(QString("%1|%2|%3").arg(arg1)
.arg(msg_id)
.arg(args[i]));
return true;