Preparing the use of the report bad avatar function.
This commit is contained in:
@@ -206,7 +206,7 @@ void MyAvatarLabel::reportBadAvatar() {
|
|||||||
QMessageBox::Yes | QMessageBox::No);
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
if(ret) {
|
if(ret) {
|
||||||
QFileInfo fi(avatar);
|
QFileInfo fi(avatar);
|
||||||
// tue_irgendwas_in_session(myId, fi.baseName());
|
myW->getSession()->reportBadAvatar(myId, fi.baseName().toStdString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ public:
|
|||||||
void SendShowMyCards();
|
void SendShowMyCards();
|
||||||
void SendInvitePlayerToCurrentGame(unsigned playerId);
|
void SendInvitePlayerToCurrentGame(unsigned playerId);
|
||||||
void SendRejectGameInvitation(unsigned gameId, DenyGameInvitationReason reason);
|
void SendRejectGameInvitation(unsigned gameId, DenyGameInvitationReason reason);
|
||||||
|
void SendReportAvatar(unsigned reportedPlayerId, const std::string &avatarHash);
|
||||||
|
|
||||||
void StartAsyncRead();
|
void StartAsyncRead();
|
||||||
void HandleRead(const boost::system::error_code& ec, size_t bytesRead);
|
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));
|
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
|
void
|
||||||
ClientThread::StartAsyncRead()
|
ClientThread::StartAsyncRead()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -304,6 +304,10 @@ AbstractServerGameStateReceiving::ProcessPacket(boost::shared_ptr<ServerGame> se
|
|||||||
else
|
else
|
||||||
session.sessionData->ResetWantsLobbyMsg();
|
session.sessionData->ResetWantsLobbyMsg();
|
||||||
}
|
}
|
||||||
|
else if (packet->GetMsg()->present == PokerTHMessage_PR_reportAvatarMessage)
|
||||||
|
{
|
||||||
|
ReportAvatarMessage_t *netReport = &packet->GetMsg()->choice.reportAvatarMessage;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Packet processing in subclass.
|
// Packet processing in subclass.
|
||||||
|
|||||||
@@ -457,6 +457,13 @@ void
|
|||||||
myNetClient->SendRejectGameInvitation(gameId, reason);
|
myNetClient->SendRejectGameInvitation(gameId, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Session::reportBadAvatar(unsigned reportedPlayerId, const std::string &avatarHash)
|
||||||
|
{
|
||||||
|
if (!myNetClient)
|
||||||
|
return; // only act if client is running.
|
||||||
|
myNetClient->SendReportAvatar(reportedPlayerId, avatarHash);
|
||||||
|
}
|
||||||
|
|
||||||
void Session::voteKick(bool doKick)
|
void Session::voteKick(bool doKick)
|
||||||
{
|
{
|
||||||
if (!myNetClient)
|
if (!myNetClient)
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ public:
|
|||||||
void acceptGameInvitation(unsigned gameId);
|
void acceptGameInvitation(unsigned gameId);
|
||||||
void rejectGameInvitation(unsigned gameId, DenyGameInvitationReason reason);
|
void rejectGameInvitation(unsigned gameId, DenyGameInvitationReason reason);
|
||||||
|
|
||||||
|
void reportBadAvatar(unsigned reportedPlayerId, const std::string &avatarHash);
|
||||||
|
|
||||||
void resetNetworkTimeout();
|
void resetNetworkTimeout();
|
||||||
|
|
||||||
bool isNetworkClientRunning() const; // TODO hack
|
bool isNetworkClientRunning() const; // TODO hack
|
||||||
|
|||||||
Reference in New Issue
Block a user