Adding code for private chat messages (server side). These messages are not allowed within a game. Adding config option to disable brute force protection.

This commit is contained in:
lotodore
2010-11-07 08:24:31 +00:00
parent 6b179cd8ca
commit 0cb1d75ce3
7 changed files with 106 additions and 41 deletions
+19
View File
@@ -209,6 +209,25 @@ ClientThread::SendLobbyChatMessage(const std::string &msg)
m_ioService->post(boost::bind(&ClientThread::SendSessionPacket, shared_from_this(), packet));
}
void
ClientThread::SendPrivateChatMessage(unsigned targetPlayerId, const std::string &msg)
{
// Warning: This function is called in the context of the GUI thread.
// Create a network packet containing the chat message.
boost::shared_ptr<NetPacket> packet(new NetPacket(NetPacket::Alloc));
packet->GetMsg()->present = PokerTHMessage_PR_chatRequestMessage;
ChatRequestMessage_t *netChat = &packet->GetMsg()->choice.chatRequestMessage;
OCTET_STRING_fromBuf(&netChat->chatText,
msg.c_str(),
msg.length());
netChat->chatRequestType.present = chatRequestType_PR_chatRequestTypePrivate;
netChat->chatRequestType.choice.chatRequestTypePrivate.targetPlayerId = targetPlayerId;
// Just dump the packet.
m_ioService->post(boost::bind(&ClientThread::SendSessionPacket, shared_from_this(), packet));
}
void
ClientThread::SendJoinFirstGame(const std::string &password)
{