aboutsummaryrefslogtreecommitdiff
path: root/src/trinityrealm
diff options
context:
space:
mode:
authorn0n4m3 <none@none>2010-04-11 11:23:32 +0400
committern0n4m3 <none@none>2010-04-11 11:23:32 +0400
commitcdec48b9efab92c0af3bb1b96de0b4e8566f5a35 (patch)
treeb76ddc7ab80476156f77008d786fe344c9375feb /src/trinityrealm
parent7ffc9ef40bd8a832bf14e0202b8da0ec98516725 (diff)
Some fixes for quests/basePoints calculation, realm server.
--HG-- branch : trunk
Diffstat (limited to 'src/trinityrealm')
-rw-r--r--src/trinityrealm/AuthCodes.h37
-rw-r--r--src/trinityrealm/AuthSocket.cpp16
-rw-r--r--src/trinityrealm/AuthSocket.h13
3 files changed, 41 insertions, 25 deletions
diff --git a/src/trinityrealm/AuthCodes.h b/src/trinityrealm/AuthCodes.h
index 3cc373ed6e7..c195b09cfc1 100644
--- a/src/trinityrealm/AuthCodes.h
+++ b/src/trinityrealm/AuthCodes.h
@@ -25,24 +25,27 @@
#ifndef _AUTHCODES_H
#define _AUTHCODES_H
-enum eAuthResults
+enum AuthResult
{
- REALM_AUTH_SUCCESS = 0x00,
- REALM_AUTH_FAILURE = 0x01, ///< Unable to connect
- REALM_AUTH_UNKNOWN1 = 0x02, ///< Unable to connect
- REALM_AUTH_ACCOUNT_BANNED = 0x03, ///< This <game> account has been closed and is no longer available for use. Please go to <site>/banned.html for further information.
- REALM_AUTH_NO_MATCH = 0x04, ///< The information you have entered is not valid. Please check the spelling of the account name and password. If you need help in retrieving a lost or stolen password, see <site> for more information
- REALM_AUTH_UNKNOWN2 = 0x05, ///< The information you have entered is not valid. Please check the spelling of the account name and password. If you need help in retrieving a lost or stolen password, see <site> for more information
- REALM_AUTH_ACCOUNT_IN_USE = 0x06, ///< This account is already logged into <game>. Please check the spelling and try again.
- REALM_AUTH_PREPAID_TIME_LIMIT = 0x07, ///< You have used up your prepaid time for this account. Please purchase more to continue playing
- REALM_AUTH_SERVER_FULL = 0x08, ///< Could not log in to <game> at this time. Please try again later.
- REALM_AUTH_WRONG_BUILD_NUMBER = 0x09, ///< Unable to validate game version. This may be caused by file corruption or interference of another program. Please visit <site> for more information and possible solutions to this issue.
- REALM_AUTH_UPDATE_CLIENT = 0x0a, ///< Downloading
- REALM_AUTH_UNKNOWN3 = 0x0b, ///< Unable to connect
- REALM_AUTH_ACCOUNT_FREEZED = 0x0c, ///< This <game> account has been temporarily suspended. Please go to <site>/banned.html for further information
- REALM_AUTH_UNKNOWN4 = 0x0d, ///< Unable to connect
- REALM_AUTH_UNKNOWN5 = 0x0e, ///< Connected.
- REALM_AUTH_PARENTAL_CONTROL = 0x0f ///< Access to this account has been blocked by parental controls. Your settings may be changed in your account preferences at <site>
+ WOW_SUCCESS = 0x00,
+ WOW_FAIL_UNKNOWN0 = 0x01, ///< ? Unable to connect
+ WOW_FAIL_UNKNOWN1 = 0x02, ///< ? Unable to connect
+ WOW_FAIL_BANNED = 0x03, ///< This <game> account has been closed and is no longer available for use. Please go to <site>/banned.html for further information.
+ WOW_FAIL_UNKNOWN_ACCOUNT = 0x04, ///< The information you have entered is not valid. Please check the spelling of the account name and password. If you need help in retrieving a lost or stolen password, see <site> for more information
+ WOW_FAIL_INCORRECT_PASSWORD = 0x05, ///< The information you have entered is not valid. Please check the spelling of the account name and password. If you need help in retrieving a lost or stolen password, see <site> for more information
+ WOW_FAIL_ALREADY_ONLINE = 0x06, ///< This account is already logged into <game>. Please check the spelling and try again.
+ WOW_FAIL_NO_TIME = 0x07, ///< You have used up your prepaid time for this account. Please purchase more to continue playing
+ WOW_FAIL_DB_BUSY = 0x08, ///< Could not log in to <game> at this time. Please try again later.
+ WOW_FAIL_VERSION_INVALID = 0x09, ///< Unable to validate game version. This may be caused by file corruption or interference of another program. Please visit <site> for more information and possible solutions to this issue.
+ WOW_FAIL_VERSION_UPDATE = 0x0A, ///< Downloading
+ WOW_FAIL_INVALID_SERVER = 0x0B, ///< Unable to connect
+ WOW_FAIL_SUSPENDED = 0x0C, ///< This <game> account has been temporarily suspended. Please go to <site>/banned.html for further information
+ WOW_FAIL_FAIL_NOACCESS = 0x0D, ///< Unable to connect
+ WOW_SUCCESS_SURVEY = 0x0E, ///< Connected.
+ WOW_FAIL_PARENTCONTROL = 0x0F, ///< Access to this account has been blocked by parental controls. Your settings may be changed in your account preferences at <site>
+ WOW_FAIL_LOCKED_ENFORCED = 0x10, ///< You have applied a lock to your account. You can change your locked status by calling your account lock phone number.
+ WOW_FAIL_TRIAL_ENDED = 0x11, ///< Your trial subscription has expired. Please visit <site> to upgrade your account.
+ WOW_FAIL_USE_BATTLENET = 0x12, ///< WOW_FAIL_OTHER This account is now attached to a Battle.net account. Please login with your Battle.net account email address and password.
};
enum LoginResult
diff --git a/src/trinityrealm/AuthSocket.cpp b/src/trinityrealm/AuthSocket.cpp
index ea7a6d6d4c9..caff730e64a 100644
--- a/src/trinityrealm/AuthSocket.cpp
+++ b/src/trinityrealm/AuthSocket.cpp
@@ -371,7 +371,7 @@ bool AuthSocket::_HandleLogonChallenge()
QueryResult_AutoPtr result = loginDatabase.PQuery("SELECT * FROM ip_banned WHERE ip = '%s'",address.c_str());
if (result)
{
- pkt << (uint8)REALM_AUTH_ACCOUNT_BANNED;
+ pkt << (uint8)WOW_FAIL_BANNED;
sLog.outBasic("[AuthChallenge] Banned ip %s tries to login!", address.c_str ());
}
else
@@ -395,7 +395,7 @@ bool AuthSocket::_HandleLogonChallenge()
if (strcmp((*result)[3].GetString(),socket().get_remote_address().c_str()))
{
DEBUG_LOG("[AuthChallenge] Account IP differs");
- pkt << (uint8) REALM_AUTH_ACCOUNT_FREEZED;
+ pkt << (uint8) WOW_FAIL_SUSPENDED;
locked=true;
}
else
@@ -414,12 +414,12 @@ bool AuthSocket::_HandleLogonChallenge()
{
if ((*banresult)[0].GetUInt64() == (*banresult)[1].GetUInt64())
{
- pkt << (uint8) REALM_AUTH_ACCOUNT_BANNED;
+ pkt << (uint8) WOW_FAIL_BANNED;
sLog.outBasic("[AuthChallenge] Banned account %s tries to login!",_login.c_str ());
}
else
{
- pkt << (uint8) REALM_AUTH_ACCOUNT_FREEZED;
+ pkt << (uint8) WOW_FAIL_SUSPENDED;
sLog.outBasic("[AuthChallenge] Temporarily banned account %s tries to login!",_login.c_str ());
}
}
@@ -453,7 +453,7 @@ bool AuthSocket::_HandleLogonChallenge()
unk3.SetRand(16 * 8);
///- Fill the response packet with the result
- pkt << uint8(REALM_AUTH_SUCCESS);
+ pkt << uint8(WOW_SUCCESS);
// B may be calculated < 32B so we force minimal length to 32B
pkt.append(B.AsByteArray(32), 32); // 32 bytes
@@ -481,7 +481,7 @@ bool AuthSocket::_HandleLogonChallenge()
pkt << uint64(0);
}
- if (securityFlags & REALM_AUTH_NO_MATCH) // Security token input
+ if (securityFlags & WOW_FAIL_UNKNOWN_ACCOUNT) // Security token input
pkt << uint8(1);
uint8 secLevel = (*result)[4].GetUInt8();
@@ -497,7 +497,7 @@ bool AuthSocket::_HandleLogonChallenge()
}
else //no account
{
- pkt<< (uint8) REALM_AUTH_NO_MATCH;
+ pkt<< (uint8) WOW_FAIL_UNKNOWN_ACCOUNT;
}
}
@@ -647,7 +647,7 @@ bool AuthSocket::_HandleLogonProof()
}
else
{
- char data[4]= { AUTH_LOGON_PROOF, REALM_AUTH_NO_MATCH, 3, 0};
+ char data[4]= { AUTH_LOGON_PROOF, WOW_FAIL_UNKNOWN_ACCOUNT, 3, 0};
socket().send(data, sizeof(data));
sLog.outBasic("[AuthChallenge] account %s tried to login with wrong password!",_login.c_str ());
diff --git a/src/trinityrealm/AuthSocket.h b/src/trinityrealm/AuthSocket.h
index 13fc9b0080a..5bcbe9cdabd 100644
--- a/src/trinityrealm/AuthSocket.h
+++ b/src/trinityrealm/AuthSocket.h
@@ -30,6 +30,19 @@
#include "RealmSocket.h"
+enum RealmFlags
+{
+ REALM_FLAG_NONE = 0x00,
+ REALM_FLAG_INVALID = 0x01,
+ REALM_FLAG_OFFLINE = 0x02,
+ REALM_FLAG_SPECIFYBUILD = 0x04, // client will show realm version in RealmList screen in form "RealmName (major.minor.revision.build)"
+ REALM_FLAG_UNK1 = 0x08,
+ REALM_FLAG_UNK2 = 0x10,
+ REALM_FLAG_RECOMMENDED = 0x20, // client checks pop == 600f
+ REALM_FLAG_NEW = 0x40, // client checks pop == 200f
+ REALM_FLAG_FULL = 0x80 // client checks pop == 400f
+};
+
/// Handle login commands
class AuthSocket: public RealmSocket::Session
{