Preparing the use of the report bad avatar function.

This commit is contained in:
lotodore
2010-12-24 12:27:46 +00:00
parent 6de66ec8a2
commit 710affb1e5
6 changed files with 34 additions and 1 deletions
+19
View File
@@ -361,6 +361,25 @@ ClientThread::SendRejectGameInvitation(unsigned gameId, DenyGameInvitationReason
m_ioService->post(boost::bind(&ClientThread::SendSessionPacket, shared_from_this(), packet));
}
void
ClientThread::SendReportAvatar(unsigned reportedPlayerId, const std::string &avatarHash)
{
boost::shared_ptr<NetPacket> packet(new NetPacket(NetPacket::Alloc));
packet->GetMsg()->present = PokerTHMessage_PR_reportAvatarMessage;
ReportAvatarMessage_t *netReport = &packet->GetMsg()->choice.reportAvatarMessage;
netReport->reportedPlayerId = reportedPlayerId;
MD5Buf tmpMD5;
if (tmpMD5.FromString(avatarHash) && !tmpMD5.IsZero())
{
OCTET_STRING_fromBuf(
&netReport->reportedAvatar,
(const char *)tmpMD5.GetData(),
MD5_DATA_SIZE);
m_ioService->post(boost::bind(&ClientThread::SendSessionPacket, shared_from_this(), packet));
}
}
void
ClientThread::StartAsyncRead()
{