initial commit for chat channels

This commit is contained in:
Max-Wilhelm Bruker 2009-08-22 19:34:48 +02:00
parent 0d84de2384
commit 947cd1736c
23 changed files with 408 additions and 66 deletions

View file

@ -110,6 +110,8 @@ void Client::readLine()
emit playerIdReceived(id, data[1]);
} else
emit gameEvent(event);
} else if (prefix == "chat") {
emit chatEvent(ChatEventData(line));
} else if (prefix == "resp") {
if (values.size() != 2) {
// XXX
@ -231,6 +233,26 @@ void Client::ping()
cmd("ping");
}
PendingCommand *Client::chatListChannels()
{
return cmd("chat_list_channels");
}
PendingCommand *Client::chatJoinChannel(const QString &name)
{
return cmd(QString("chat_join_channel|%1").arg(name));
}
PendingCommand *Client::chatLeaveChannel(const QString &name)
{
return cmd(QString("chat_leave_channel|%1").arg(name));
}
PendingCommand *Client::chatSay(const QString &channel, const QString &s)
{
return cmd(QString("chat_say|%1|%2").arg(channel).arg(s));
}
PendingCommand *Client::listGames()
{
return cmd("list_games");