diff options
author | n0n4m3 <none@none> | 2010-04-11 11:23:32 +0400 |
---|---|---|
committer | n0n4m3 <none@none> | 2010-04-11 11:23:32 +0400 |
commit | cdec48b9efab92c0af3bb1b96de0b4e8566f5a35 (patch) | |
tree | b76ddc7ab80476156f77008d786fe344c9375feb /src | |
parent | 7ffc9ef40bd8a832bf14e0202b8da0ec98516725 (diff) |
Some fixes for quests/basePoints calculation, realm server.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/GossipDef.cpp | 6 | ||||
-rw-r--r-- | src/game/Unit.cpp | 22 | ||||
-rw-r--r-- | src/game/World.h | 26 | ||||
-rw-r--r-- | src/trinityrealm/AuthCodes.h | 37 | ||||
-rw-r--r-- | src/trinityrealm/AuthSocket.cpp | 16 | ||||
-rw-r--r-- | src/trinityrealm/AuthSocket.h | 13 |
6 files changed, 81 insertions, 39 deletions
diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp index d5de4f4c80e..8b41f457edc 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -167,7 +167,7 @@ void PlayerMenu::SendGossipMenu(uint32 TitleTextId, uint64 objectGUID) data << uint32(questID); data << uint32(qItem.m_qIcon); data << uint32(pSession->GetPlayer()->GetQuestLevel(pQuest)); - data << uint32(0); // 3.3.3 + data << uint32(pQuest->GetFlags()); // 3.3.3 quest flags data << uint8(0); // 3.3.3 changes icon: blue question or yellow exclamation std::string Title = pQuest->GetTitle(); @@ -411,8 +411,8 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title data << uint32(questID); data << uint32(qmi.m_qIcon); data << uint32(pSession->GetPlayer()->GetQuestLevel(pQuest)); - data << uint32(0); - data << uint8(0); + data << uint32(pQuest->GetFlags()); // 3.3.3 quest flags + data << uint8(0); // 3.3.3 changes icon: blue question or yellow exclamation data << title; } pSession->SendPacket(&data); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 043dc8cc179..c2c139fcc78 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -12243,18 +12243,22 @@ int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_inde int32 basePoints = int32(effBasePoints + level * basePointsPerLevel); int32 randomPoints = int32(spellProto->EffectDieSides[effect_index]); - int32 value = basePoints; - - if (randomPoints != 0) + switch(randomPoints) { - // range can have positive and negative values, so order its for irand - int32 randvalue = (0 > randomPoints) - ? irand(randomPoints, 0) - : irand(0, randomPoints); + case 0: break; // not used + case 1: basePoints += 1; break; // range 1..1 + default: + // range can have positive (1..rand) and negative (rand..1) values, so order its for irand + int32 randvalue = (randomPoints >= 1) + ? irand(1, randomPoints) + : irand(randomPoints, 1); - basePoints += randvalue; + basePoints += randvalue; + break; } - + + int32 value = basePoints; + // random damage //if (comboDamage != 0 && unitPlayer /*&& target && (target->GetGUID() == unitPlayer->GetComboTarget())*/) if (m_movedPlayer) diff --git a/src/game/World.h b/src/game/World.h index b1188ba688f..20394ee11f4 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -343,7 +343,21 @@ enum Rates MAX_RATES }; -/// Type of server +/// Can be used in SMSG_AUTH_RESPONSE packet +enum BillingPlanFlags +{ + SESSION_NONE = 0x00, + SESSION_UNUSED = 0x01, + SESSION_RECURRING_BILL = 0x02, + SESSION_FREE_TRIAL = 0x04, + SESSION_IGR = 0x08, + SESSION_USAGE = 0x10, + SESSION_TIME_MIXTURE = 0x20, + SESSION_RESTRICTED = 0x40, + SESSION_ENABLE_CAIS = 0x80, +}; + +/// Type of server, this is values from second column of Cfg_Configs.dbc enum RealmType { REALM_TYPE_NORMAL = 0, @@ -386,7 +400,15 @@ enum RealmZone REALM_ZONE_TEST_SERVER = 26, // any language REALM_ZONE_TOURNAMENT_27 = 27, // basic-Latin at create, any at login REALM_ZONE_QA_SERVER = 28, // any language - REALM_ZONE_CN9 = 29 // basic-Latin at create, any at login + REALM_ZONE_CN9 = 29, // basic-Latin at create, any at login + REALM_ZONE_TEST_SERVER_2 = 30, // any language + REALM_ZONE_CN10 = 31, // basic-Latin at create, any at login + REALM_ZONE_CTC = 32, + REALM_ZONE_CNC = 33, + REALM_ZONE_CN1_4 = 34, // basic-Latin at create, any at login + REALM_ZONE_CN2_6_9 = 35, // basic-Latin at create, any at login + REALM_ZONE_CN3_7 = 36, // basic-Latin at create, any at login + REALM_ZONE_CN5_8 = 37 // basic-Latin at create, any at login }; // DB scripting commands 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 { |