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
+1
View File
@@ -82,6 +82,7 @@ public:
void SendShowMyCards();
void SendInvitePlayerToCurrentGame(unsigned playerId);
void SendRejectGameInvitation(unsigned gameId, DenyGameInvitationReason reason);
void SendReportAvatar(unsigned reportedPlayerId, const std::string &avatarHash);
void StartAsyncRead();
void HandleRead(const boost::system::error_code& ec, size_t bytesRead);
+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()
{
+4
View File
@@ -304,6 +304,10 @@ AbstractServerGameStateReceiving::ProcessPacket(boost::shared_ptr<ServerGame> se
else
session.sessionData->ResetWantsLobbyMsg();
}
else if (packet->GetMsg()->present == PokerTHMessage_PR_reportAvatarMessage)
{
ReportAvatarMessage_t *netReport = &packet->GetMsg()->choice.reportAvatarMessage;
}
else
{
// Packet processing in subclass.