From 176dbe1d4fad6097553fbb4c0ebbc84c45f5a0a1 Mon Sep 17 00:00:00 2001 From: lotodore Date: Wed, 14 Jul 2010 15:27:06 +0000 Subject: [PATCH] Send a different error if a user is permanently blocked. --- docs/pokerth.asn1 | 3 +- src/gui/qt/startwindow/startwindowimpl.cpp | 5 ++++ src/net/common/netpacket.cpp | 6 ++++ src/net/socket_msg.h | 33 +++++++++++----------- src/third_party/asn1/ErrorMessage.c | 8 ++++-- src/third_party/asn1/ErrorMessage.h | 3 +- 6 files changed, 37 insertions(+), 21 deletions(-) diff --git a/docs/pokerth.asn1 b/docs/pokerth.asn1 index 85bf87bb..e1dd6140 100644 --- a/docs/pokerth.asn1 +++ b/docs/pokerth.asn1 @@ -694,7 +694,8 @@ ErrorMessage ::= [APPLICATION 255] SEQUENCE { errorInvalidState (257), errorKickedFromServer (258), errorBannedFromServer (259), - errorSessionTimeout (260) + errorBlockedByServer (260), + errorSessionTimeout (261) } } diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index dc65841b..2bd87651 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -761,6 +761,11 @@ void startWindowImpl::networkError(int errorID, int /*osErrorID*/) { tr("You were temporarily banned from the server."), QMessageBox::Close); } break; + case ERR_NET_PLAYER_BLOCKED: + { mySession->terminateNetworkClient(); + QMessageBox::warning(this, tr("Network Error"), + tr("Your account is blocked indefinitely."), + QMessageBox::Close); } case ERR_NET_SESSION_TIMED_OUT: { mySession->terminateNetworkClient(); QMessageBox::warning(this, tr("Network Error"), diff --git a/src/net/common/netpacket.cpp b/src/net/common/netpacket.cpp index 8615d77b..d45ba8dd 100644 --- a/src/net/common/netpacket.cpp +++ b/src/net/common/netpacket.cpp @@ -222,6 +222,9 @@ NetPacket::NetErrorToGameError(long netErrorReason) case errorReason_errorBannedFromServer : retVal = ERR_NET_PLAYER_BANNED; break; + case errorReason_errorBlockedByServer : + retVal = ERR_NET_PLAYER_BLOCKED; + break; case errorReason_errorSessionTimeout : retVal = ERR_NET_SESSION_TIMED_OUT; break; @@ -271,6 +274,9 @@ NetPacket::GameErrorToNetError(int gameErrorReason) case ERR_NET_PLAYER_KICKED : retVal = errorReason_errorKickedFromServer; break; + case ERR_NET_PLAYER_BLOCKED : + retVal = errorReason_errorBlockedByServer; + break; case ERR_NET_PLAYER_BANNED : retVal = errorReason_errorBannedFromServer; break; diff --git a/src/net/socket_msg.h b/src/net/socket_msg.h index 137044c2..ff86fde0 100644 --- a/src/net/socket_msg.h +++ b/src/net/socket_msg.h @@ -71,22 +71,23 @@ #define ERR_NET_PLAYER_NOT_ACTIVE 117 #define ERR_NET_PLAYER_KICKED 118 #define ERR_NET_PLAYER_BANNED 119 -#define ERR_NET_SESSION_TIMED_OUT 120 -#define ERR_NET_INVALID_PLAYER_COUNT 121 -#define ERR_NET_TOO_MANY_MANUAL_BLINDS 122 -#define ERR_NET_INVALID_AVATAR_FILE 123 -#define ERR_NET_AVATAR_TOO_LARGE 124 -#define ERR_NET_BUF_INVALID_SIZE 125 -#define ERR_NET_INVALID_REQUEST_ID 126 -#define ERR_NET_WRONG_AVATAR_SIZE 127 -#define ERR_NET_START_TIMEOUT 128 -#define ERR_NET_GAME_TERMINATION_FAILED 129 -#define ERR_NET_INTERNAL_GAME_ERROR 130 -#define ERR_NET_DEALER_NOT_FOUND 131 -#define ERR_NET_INIT_BLOCKED 132 -#define ERR_NET_GSASL_INIT_FAILED 133 -#define ERR_NET_GSASL_NO_SCRAM 134 -#define ERR_NET_DB_CONNECT_FAILED 135 +#define ERR_NET_PLAYER_BLOCKED 120 +#define ERR_NET_SESSION_TIMED_OUT 121 +#define ERR_NET_INVALID_PLAYER_COUNT 122 +#define ERR_NET_TOO_MANY_MANUAL_BLINDS 123 +#define ERR_NET_INVALID_AVATAR_FILE 124 +#define ERR_NET_AVATAR_TOO_LARGE 125 +#define ERR_NET_BUF_INVALID_SIZE 126 +#define ERR_NET_INVALID_REQUEST_ID 127 +#define ERR_NET_WRONG_AVATAR_SIZE 128 +#define ERR_NET_START_TIMEOUT 129 +#define ERR_NET_GAME_TERMINATION_FAILED 130 +#define ERR_NET_INTERNAL_GAME_ERROR 131 +#define ERR_NET_DEALER_NOT_FOUND 132 +#define ERR_NET_INIT_BLOCKED 133 +#define ERR_NET_GSASL_INIT_FAILED 134 +#define ERR_NET_GSASL_NO_SCRAM 135 +#define ERR_NET_DB_CONNECT_FAILED 136 #define ERR_IRC_INTERNAL 151 #define ERR_IRC_CONNECT_FAILED 152 diff --git a/src/third_party/asn1/ErrorMessage.c b/src/third_party/asn1/ErrorMessage.c index 242bffed..fb006784 100644 --- a/src/third_party/asn1/ErrorMessage.c +++ b/src/third_party/asn1/ErrorMessage.c @@ -96,11 +96,13 @@ static asn_INTEGER_enum_map_t asn_MAP_errorReason_value2enum_2[] = { { 257, 17, "errorInvalidState" }, { 258, 21, "errorKickedFromServer" }, { 259, 21, "errorBannedFromServer" }, - { 260, 19, "errorSessionTimeout" } + { 260, 20, "errorBlockedByServer" }, + { 261, 19, "errorSessionTimeout" } }; static unsigned int asn_MAP_errorReason_enum2value_2[] = { 8, /* errorAvatarTooLarge(8) */ 12, /* errorBannedFromServer(259) */ + 13, /* errorBlockedByServer(260) */ 3, /* errorInitAuthFailure(3) */ 7, /* errorInitBlocked(7) */ 5, /* errorInitInvalidPlayerName(5) */ @@ -112,12 +114,12 @@ static unsigned int asn_MAP_errorReason_enum2value_2[] = { 10, /* errorInvalidState(257) */ 11, /* errorKickedFromServer(258) */ 0, /* errorReserved(0) */ - 13 /* errorSessionTimeout(260) */ + 14 /* errorSessionTimeout(261) */ }; static asn_INTEGER_specifics_t asn_SPC_errorReason_specs_2 = { asn_MAP_errorReason_value2enum_2, /* "tag" => N; sorted by tag */ asn_MAP_errorReason_enum2value_2, /* N => "tag"; sorted by N */ - 14, /* Number of elements in the maps */ + 15, /* Number of elements in the maps */ 0, /* Enumeration is not extensible */ 1, /* Strict enumeration */ 0, /* Native long size */ diff --git a/src/third_party/asn1/ErrorMessage.h b/src/third_party/asn1/ErrorMessage.h index 38d906cd..c5bf2cbe 100644 --- a/src/third_party/asn1/ErrorMessage.h +++ b/src/third_party/asn1/ErrorMessage.h @@ -34,7 +34,8 @@ typedef enum errorReason { errorReason_errorInvalidState = 257, errorReason_errorKickedFromServer = 258, errorReason_errorBannedFromServer = 259, - errorReason_errorSessionTimeout = 260 + errorReason_errorBlockedByServer = 260, + errorReason_errorSessionTimeout = 261 } e_errorReason; /* ErrorMessage */