diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index 193a02ed..24558c81 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -951,11 +951,14 @@ void startWindowImpl::networkMessage(unsigned msgId) switch(msgId) { - case 1: { msgText = tr("The avatar report was accepted by the server. Thank you."); } + case MSG_NET_AVATAR_REPORT_ACCEPTED: + { msgText = tr("The avatar report was accepted by the server. Thank you."); } break; - case 2: { msgText = tr("This avatar was already reported by another player."); } + case MSG_NET_AVATAR_REPORT_DUP: + { msgText = tr("This avatar was already reported by another player."); } break; - case 3: { msgText = tr("An error occurred while reporting the avatar."); } + case MSG_NET_AVATAR_REPORT_REJECTED: + { msgText = tr("An error occurred while reporting the avatar."); } break; default:; break; diff --git a/src/net/common/clientstate.cpp b/src/net/common/clientstate.cpp index 6986ef7d..565e99e9 100644 --- a/src/net/common/clientstate.cpp +++ b/src/net/common/clientstate.cpp @@ -923,6 +923,24 @@ AbstractClientStateReceiving::HandlePacket(boost::shared_ptr clien client->SetUnknownAvatar(requestId); } } + else if (tmpPacket->GetMsg()->present == PokerTHMessage_PR_reportAvatarAckMessage) + { + ReportAvatarAckMessage_t *netReportAck = &tmpPacket->GetMsg()->choice.reportAvatarAckMessage; + unsigned msgCode; + switch (netReportAck->reportResult) + { + case reportResult_avatarReportAccepted: + msgCode = MSG_NET_AVATAR_REPORT_ACCEPTED; + break; + case reportResult_avatarReportDuplicate: + msgCode = MSG_NET_AVATAR_REPORT_DUP; + break; + default: + msgCode = MSG_NET_AVATAR_REPORT_REJECTED; + break; + } + client->GetCallback().SignalNetClientMsgBox(msgCode); + } else if (tmpPacket->GetMsg()->present == PokerTHMessage_PR_statisticsMessage) { StatisticsMessage_t *netStatistics = &tmpPacket->GetMsg()->choice.statisticsMessage; diff --git a/src/net/socket_msg.h b/src/net/socket_msg.h index fd6199c2..04c9d8de 100644 --- a/src/net/socket_msg.h +++ b/src/net/socket_msg.h @@ -152,5 +152,12 @@ #define MSG_NET_GAME_SERVER_CARDS_DELAY MSG_SOCK_LIMIT_CONNECT + 12 #define MSG_NET_GAME_SERVER_END MSG_SOCK_LIMIT_CONNECT + 13 +#define MSG_NET_LIMIT_GAME MSG_NET_GAME_SERVER_END + +// Some messages which are displayed in the GUI +#define MSG_NET_AVATAR_REPORT_ACCEPTED MSG_NET_LIMIT_GAME + 1 +#define MSG_NET_AVATAR_REPORT_DUP MSG_NET_LIMIT_GAME + 2 +#define MSG_NET_AVATAR_REPORT_REJECTED MSG_NET_LIMIT_GAME + 3 + #endif