mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
generalized user information
This commit is contained in:
parent
adaa1d5323
commit
f9446f9822
61 changed files with 3710 additions and 175 deletions
|
|
@ -8,12 +8,12 @@ Server_ChatChannel::Server_ChatChannel(const QString &_name, const QString &_des
|
|||
|
||||
void Server_ChatChannel::addClient(Server_ProtocolHandler *client)
|
||||
{
|
||||
sendChatEvent(new Event_ChatJoinChannel(name, client->getPlayerName()));
|
||||
sendChatEvent(new Event_ChatJoinChannel(name, new ServerInfo_User(client->getUserInfo())));
|
||||
append(client);
|
||||
|
||||
QList<ServerInfo_ChatUser *> eventUserList;
|
||||
QList<ServerInfo_User *> eventUserList;
|
||||
for (int i = 0; i < size(); ++i)
|
||||
eventUserList.append(new ServerInfo_ChatUser(at(i)->getPlayerName()));
|
||||
eventUserList.append(new ServerInfo_User(at(i)->getUserInfo()));
|
||||
Event_ChatListPlayers *eventCLP = new Event_ChatListPlayers(name, eventUserList);
|
||||
client->enqueueProtocolItem(eventCLP);
|
||||
|
||||
|
|
@ -25,13 +25,13 @@ void Server_ChatChannel::addClient(Server_ProtocolHandler *client)
|
|||
void Server_ChatChannel::removeClient(Server_ProtocolHandler *client)
|
||||
{
|
||||
removeAt(indexOf(client));
|
||||
sendChatEvent(new Event_ChatLeaveChannel(name, client->getPlayerName()));
|
||||
sendChatEvent(new Event_ChatLeaveChannel(name, client->getUserInfo()->getName()));
|
||||
emit channelInfoChanged();
|
||||
}
|
||||
|
||||
void Server_ChatChannel::say(Server_ProtocolHandler *client, const QString &s)
|
||||
{
|
||||
sendChatEvent(new Event_ChatSay(name, client->getPlayerName(), s));
|
||||
sendChatEvent(new Event_ChatSay(name, client->getUserInfo()->getName(), s));
|
||||
}
|
||||
|
||||
void Server_ChatChannel::sendChatEvent(ChatEvent *event)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue