New error messages.

This commit is contained in:
lotodore
2008-03-06 21:48:14 +00:00
parent e85eb879bb
commit 4bc902b229
7 changed files with 59 additions and 16 deletions
+21
View File
@@ -114,10 +114,13 @@ using namespace std;
#define NET_ERR_INIT_SERVER_MAINTENANCE 0x0007
#define NET_ERR_AVATAR_TOO_LARGE 0x0010
#define NET_ERR_AVATAR_WRONG_SIZE 0x0011
#define NET_ERR_AVATAR_UPLOAD_BLOCKED 0x0012
#define NET_ERR_JOIN_GAME_UNKNOWN_GAME 0x0020
#define NET_ERR_GENERAL_INVALID_PACKET 0xFF01
#define NET_ERR_GENERAL_INVALID_STATE 0xFF02
#define NET_ERR_GENERAL_PLAYER_KICKED 0xFF03
#define NET_ERR_GENERAL_PLAYER_BANNED 0xFF04
#define NET_ERR_GENERAL_SESSION_TIMED_OUT 0xFF05
#define NET_ERR_OTHER 0xFFFF
// Statistics types
@@ -4663,6 +4666,9 @@ NetPacketError::SetData(const NetPacketError::Data &inData)
case ERR_NET_WRONG_AVATAR_SIZE :
tmpData->errorReason = htons(NET_ERR_AVATAR_WRONG_SIZE);
break;
case ERR_NET_AVATAR_UPLOAD_BLOCKED :
tmpData->errorReason = htons(NET_ERR_AVATAR_UPLOAD_BLOCKED);
break;
case ERR_NET_UNKNOWN_GAME :
tmpData->errorReason = htons(NET_ERR_JOIN_GAME_UNKNOWN_GAME);
break;
@@ -4677,6 +4683,12 @@ NetPacketError::SetData(const NetPacketError::Data &inData)
case ERR_NET_PLAYER_KICKED :
tmpData->errorReason = htons(NET_ERR_GENERAL_PLAYER_KICKED);
break;
case ERR_NET_PLAYER_BANNED :
tmpData->errorReason = htons(NET_ERR_GENERAL_PLAYER_BANNED);
break;
case ERR_NET_SESSION_TIMED_OUT :
tmpData->errorReason = htons(NET_ERR_GENERAL_SESSION_TIMED_OUT);
break;
default :
tmpData->errorReason = htons(NET_ERR_OTHER);
break;
@@ -4718,6 +4730,9 @@ NetPacketError::GetData(NetPacketError::Data &outData) const
case NET_ERR_AVATAR_WRONG_SIZE :
outData.errorCode = ERR_NET_WRONG_AVATAR_SIZE;
break;
case NET_ERR_AVATAR_UPLOAD_BLOCKED :
outData.errorCode = ERR_NET_AVATAR_UPLOAD_BLOCKED;
break;
case NET_ERR_JOIN_GAME_UNKNOWN_GAME :
outData.errorCode = ERR_NET_UNKNOWN_GAME;
break;
@@ -4732,6 +4747,12 @@ NetPacketError::GetData(NetPacketError::Data &outData) const
case NET_ERR_GENERAL_PLAYER_KICKED :
outData.errorCode = ERR_NET_PLAYER_KICKED;
break;
case NET_ERR_GENERAL_PLAYER_BANNED :
outData.errorCode = ERR_NET_PLAYER_BANNED;
break;
case NET_ERR_GENERAL_SESSION_TIMED_OUT :
outData.errorCode = ERR_NET_SESSION_TIMED_OUT;
break;
default :
outData.errorCode = ERR_SOCK_INTERNAL;
break;
+1 -1
View File
@@ -340,7 +340,7 @@ ServerGameStateInit::Process(ServerGameThread &server)
SessionWrapper session = server.GetSessionManager().GetSessionByUniquePlayerId(server.GetAdminPlayerId());
if (session.sessionData.get())
{
server.RemovePlayer(session.playerData->GetUniqueId(), ERR_NET_PLAYER_KICKED); // TODO use proper error code.
server.RemovePlayer(session.playerData->GetUniqueId(), ERR_NET_SESSION_TIMED_OUT);
}
}
return AbstractServerGameStateReceiving::Process(server);
+2 -2
View File
@@ -469,7 +469,7 @@ ServerLobbyThread::HandleNetPacketInit(SessionWrapper session, const NetPacketIn
avatarRecentlyRequested = true;
}
if (avatarRecentlyRequested)
SessionError(session, ERR_NET_INVALID_AVATAR_FILE);
SessionError(session, ERR_NET_AVATAR_UPLOAD_BLOCKED);
else
RequestPlayerAvatar(session);
}
@@ -1014,7 +1014,7 @@ ServerLobbyThread::InternalCheckSessionTimeouts(SessionWrapper session)
}
}
if (closeSession)
RemovePlayer(session.playerData->GetUniqueId(), ERR_NET_PLAYER_KICKED); // TODO new error code
RemovePlayer(session.playerData->GetUniqueId(), ERR_NET_SESSION_TIMED_OUT);
}
void
+14 -11
View File
@@ -60,17 +60,20 @@
#define ERR_NET_NO_CURRENT_PLAYER 116
#define ERR_NET_PLAYER_NOT_ACTIVE 117
#define ERR_NET_PLAYER_KICKED 118
#define ERR_NET_INVALID_PLAYER_COUNT 119
#define ERR_NET_TOO_MANY_MANUAL_BLINDS 120
#define ERR_NET_INVALID_AVATAR_FILE 121
#define ERR_NET_AVATAR_TOO_LARGE 122
#define ERR_NET_BUF_INVALID_SIZE 123
#define ERR_NET_INVALID_REQUEST_ID 124
#define ERR_NET_WRONG_AVATAR_SIZE 125
#define ERR_NET_START_TIMEOUT 126
#define ERR_NET_GAME_TERMINATION_FAILED 127
#define ERR_NET_INTERNAL_GAME_ERROR 128
#define ERR_NET_DEALER_NOT_FOUND 129
#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_AVATAR_UPLOAD_BLOCKED 132
#define ERR_IRC_INTERNAL 151
#define ERR_IRC_CONNECT_FAILED 152