mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -07:00
initial commit for chat channels
This commit is contained in:
parent
0d84de2384
commit
947cd1736c
23 changed files with 408 additions and 66 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue