Implementing private messages in lobby chat, ticket #12. Some cosmetic improvements are still missing.

This commit is contained in:
lotodore
2011-02-11 23:02:29 +00:00
parent 02518c67b2
commit c4b8e567ed
25 changed files with 220 additions and 27 deletions
+5
View File
@@ -715,6 +715,11 @@ AbstractClientStateReceiving::HandlePacket(boost::shared_ptr<ClientThread> clien
PlayerInfo info;
if (client->GetCachedPlayerInfo(playerId, info))
client->GetCallback().SignalNetClientLobbyChatMsg(info.playerName, STL_STRING_FROM_OCTET_STRING(netMessage->chatText));
} else if (netMessage->chatType.present == chatType_PR_chatTypePrivate) {
unsigned playerId = netMessage->chatType.choice.chatTypeLobby.playerId;
PlayerInfo info;
if (client->GetCachedPlayerInfo(playerId, info))
client->GetCallback().SignalNetClientPrivateChatMsg(info.playerName, STL_STRING_FROM_OCTET_STRING(netMessage->chatText));
}
} else if (tmpPacket->GetMsg()->present == PokerTHMessage_PR_dialogMessage) {
// Message box - display it in the GUI.
+3 -3
View File
@@ -1396,9 +1396,9 @@ ServerLobbyThread::HandleNetPacketChatRequest(SessionWrapper session, const Chat
boost::shared_ptr<NetPacket> packet(new NetPacket(NetPacket::Alloc));
packet->GetMsg()->present = PokerTHMessage_PR_chatMessage;
ChatMessage_t *netChat = &packet->GetMsg()->choice.chatMessage;
netChat->chatType.present = chatType_PR_chatTypeLobby;
ChatTypeLobby_t *netLobbyChat = &netChat->chatType.choice.chatTypeLobby;
netLobbyChat->playerId = session.playerData->GetUniqueId();
netChat->chatType.present = chatType_PR_chatTypePrivate;
ChatTypePrivate_t *netPrivateChat = &netChat->chatType.choice.chatTypePrivate;
netPrivateChat->playerId = session.playerData->GetUniqueId();
OCTET_STRING_fromBuf(
&netChat->chatText,
(char *)chatRequest.chatText.buf,