Send a different error if a user is permanently blocked.

This commit is contained in:
lotodore
2010-07-14 15:27:06 +00:00
parent a68a98f739
commit 176dbe1d4f
6 changed files with 37 additions and 21 deletions
+2 -1
View File
@@ -694,7 +694,8 @@ ErrorMessage ::= [APPLICATION 255] SEQUENCE {
errorInvalidState (257),
errorKickedFromServer (258),
errorBannedFromServer (259),
errorSessionTimeout (260)
errorBlockedByServer (260),
errorSessionTimeout (261)
}
}
@@ -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"),
+6
View File
@@ -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;
+17 -16
View File
@@ -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
+5 -3
View File
@@ -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 */
+2 -1
View File
@@ -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 */