Preparing the use of the report bad avatar function.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user