diff options
Diffstat (limited to 'src')
38 files changed, 295 insertions, 295 deletions
diff --git a/src/game/ArenaTeam.cpp b/src/game/ArenaTeam.cpp index 7d9130f26ee..0a7648030af 100644 --- a/src/game/ArenaTeam.cpp +++ b/src/game/ArenaTeam.cpp @@ -312,7 +312,7 @@ void ArenaTeam::Disband(WorldSession *session) // event if (session) { - // probably only 1 string required... + // probably only 1 string required... BroadcastEvent(ERR_ARENA_TEAM_DISBANDED_S, 0, 2, session->GetPlayerName(), GetName(), ""); } @@ -487,36 +487,36 @@ void ArenaTeam::BroadcastPacket(WorldPacket *packet) } } -void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, uint64 guid, uint8 strCount, std::string str1, std::string str2, std::string str3) -{ - WorldPacket data(SMSG_ARENA_TEAM_EVENT, 1+1+1); - data << uint8(event); - data << uint8(strCount); - switch (strCount) - { - case 0: - break; - case 1: - data << str1; - break; - case 2: - data << str1 << str2; - break; - case 3: - data << str1 << str2 << str3; - break; - default: - sLog.outError("Unhandled strCount %u in ArenaTeam::BroadcastEvent", strCount); - return; +void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, uint64 guid, uint8 strCount, std::string str1, std::string str2, std::string str3) +{ + WorldPacket data(SMSG_ARENA_TEAM_EVENT, 1+1+1); + data << uint8(event); + data << uint8(strCount); + switch (strCount) + { + case 0: + break; + case 1: + data << str1; + break; + case 2: + data << str1 << str2; + break; + case 3: + data << str1 << str2 << str3; + break; + default: + sLog.outError("Unhandled strCount %u in ArenaTeam::BroadcastEvent", strCount); + return; } - if (guid) - data << uint64(guid); - - BroadcastPacket(&data); - - sLog.outDebug("WORLD: Sent SMSG_ARENA_TEAM_EVENT"); -} + if (guid) + data << uint64(guid); + + BroadcastPacket(&data); + + sLog.outDebug("WORLD: Sent SMSG_ARENA_TEAM_EVENT"); +} uint8 ArenaTeam::GetSlotByType(uint32 type) { @@ -697,7 +697,7 @@ void ArenaTeam::MemberWon(Player * plr, uint32 againstRating) itr->wins_season += 1; itr->wins_week += 1; // update unit fields - plr->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_GAMES_WEEK, itr->games_week); + plr->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_GAMES_WEEK, itr->games_week); plr->SetArenaTeamInfoField(GetSlot(), ARENA_TEAM_GAMES_SEASON, itr->games_season); return; } diff --git a/src/game/ArenaTeam.h b/src/game/ArenaTeam.h index 1bfbe2d214e..e6f85cf8d9e 100644 --- a/src/game/ArenaTeam.h +++ b/src/game/ArenaTeam.h @@ -44,11 +44,11 @@ enum ArenaTeamCommandErrors ERR_ARENA_TEAM_PLAYER_NOT_IN_TEAM_SS = 0x0A, ERR_ARENA_TEAM_PLAYER_NOT_FOUND_S = 0x0B, ERR_ARENA_TEAM_NOT_ALLIED = 0x0C, - ERR_ARENA_TEAM_IGNORING_YOU_S = 0x13, - ERR_ARENA_TEAM_TARGET_TOO_LOW_S = 0x15, - ERR_ARENA_TEAM_TARGET_TOO_HIGH_S = 0x16, - ERR_ARENA_TEAM_TOO_MANY_MEMBERS_S = 0x17, - ERR_ARENA_TEAM_NOT_FOUND = 0x1B, + ERR_ARENA_TEAM_IGNORING_YOU_S = 0x13, + ERR_ARENA_TEAM_TARGET_TOO_LOW_S = 0x15, + ERR_ARENA_TEAM_TARGET_TOO_HIGH_S = 0x16, + ERR_ARENA_TEAM_TOO_MANY_MEMBERS_S = 0x17, + ERR_ARENA_TEAM_NOT_FOUND = 0x1B, ERR_ARENA_TEAMS_LOCKED = 0x1E }; diff --git a/src/game/AuctionHouseHandler.cpp b/src/game/AuctionHouseHandler.cpp index 586319a2e74..efa4184b393 100644 --- a/src/game/AuctionHouseHandler.cpp +++ b/src/game/AuctionHouseHandler.cpp @@ -68,8 +68,8 @@ void WorldSession::SendAuctionHello(uint64 guid, Creature* unit) return; WorldPacket data(MSG_AUCTION_HELLO, 12); - data << uint64(guid); - data << uint32(ahEntry->houseId); + data << uint64(guid); + data << uint32(ahEntry->houseId); data << uint8(1); // 3.3.3: 1 - AH enabled, 0 - AH disabled SendPacket(&data); } diff --git a/src/game/BattleGroundHandler.cpp b/src/game/BattleGroundHandler.cpp index 47c08137b06..89032da1483 100644 --- a/src/game/BattleGroundHandler.cpp +++ b/src/game/BattleGroundHandler.cpp @@ -152,15 +152,15 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) BattleGroundQueue& bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId]; if (joinAsGroup /* && _player->GetGroup()*/) { - GroupQueueInfo * ginfo; + GroupQueueInfo * ginfo; uint32 avgTime; if(err > 0) { sLog.outDebug("Battleground: the following players are joining as group:"); ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, 0, false, isPremade, 0); - avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); - } + avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); + } for (GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) { @@ -168,15 +168,15 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) if (!member) continue; // this should never happen WorldPacket data; - - if(err <= 0) - { - sBattleGroundMgr.BuildGroupJoinedBattlegroundPacket(&data, err); - member->GetSession()->SendPacket(&data); - continue; + + if(err <= 0) + { + sBattleGroundMgr.BuildGroupJoinedBattlegroundPacket(&data, err); + member->GetSession()->SendPacket(&data); + continue; } - - // add to queue + + // add to queue uint32 queueSlot = member->AddBattleGroundQueueId(bgQueueTypeId); // send status packet (in queue) @@ -664,7 +664,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) if (!grp) return; if (grp->GetLeaderGUID() != _player->GetGUID()) - return; + return; err = grp->CanJoinBattleGroundQueue(bg, bgQueueTypeId, arenatype, arenatype, (bool)isRated, arenaslot); } @@ -704,11 +704,11 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) BattleGroundQueue &bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId]; if (asGroup) { - uint32 avgTime; - - if(err > 0) - { - sLog.outDebug("Battleground: arena join as group start"); + uint32 avgTime; + + if(err > 0) + { + sLog.outDebug("Battleground: arena join as group start"); if (isRated) { sLog.outDebug("Battleground: arena team id %u, leader %s queued with rating %u for type %u",_player->GetArenaTeamId(arenaslot),_player->GetName(),arenaRating,arenatype); @@ -717,8 +717,8 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) else bg->SetRated(false); - GroupQueueInfo * ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, ateamId); - avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); + GroupQueueInfo * ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, arenatype, isRated, false, arenaRating, ateamId); + avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); } for (GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) @@ -728,7 +728,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) continue; WorldPacket data; - + if (err <= 0) { sBattleGroundMgr.BuildGroupJoinedBattlegroundPacket(&data, err); @@ -737,7 +737,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) } // add to queue - uint32 queueSlot = member->AddBattleGroundQueueId(bgQueueTypeId); + uint32 queueSlot = member->AddBattleGroundQueueId(bgQueueTypeId); // send status packet (in queue) sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype); diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index c676cc7a451..2a104ce7966 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -1844,25 +1844,25 @@ void BattleGroundMgr::BuildBattleGroundListPacket(WorldPacket *data, const uint6 *data << uint8(fromWhere); // from where you joined *data << uint32(bgTypeId); // battleground id *data << uint8(0); // unk - *data << uint8(0); // unk - + *data << uint8(0); // unk + // Rewards - *data << uint8(0); // 3.3.3 hasWin - *data << uint32(0); // 3.3.3 winHonor - *data << uint32(0); // 3.3.3 winArena + *data << uint8(0); // 3.3.3 hasWin + *data << uint32(0); // 3.3.3 winHonor + *data << uint32(0); // 3.3.3 winArena *data << uint32(0); // 3.3.3 lossHonor - - uint8 isRandom = 0; - *data << uint8(isRandom); // 3.3.3 isRandom - if (isRandom) - { - // Rewards (random) - *data << uint8(0); // 3.3.3 hasWin_Random - *data << uint32(0); // 3.3.3 winHonor_Random + + uint8 isRandom = 0; + *data << uint8(isRandom); // 3.3.3 isRandom + if (isRandom) + { + // Rewards (random) + *data << uint8(0); // 3.3.3 hasWin_Random + *data << uint32(0); // 3.3.3 winHonor_Random *data << uint32(0); // 3.3.3 winArena_Random *data << uint32(0); // 3.3.3 lossHonor_Random } - + if (bgTypeId == BATTLEGROUND_AA) // arena { *data << uint32(0); // unk (count?) diff --git a/src/game/BattleGroundSA.cpp b/src/game/BattleGroundSA.cpp index 7a4386f0f16..8eb1b72f3e4 100644 --- a/src/game/BattleGroundSA.cpp +++ b/src/game/BattleGroundSA.cpp @@ -549,7 +549,7 @@ WorldSafeLocsEntry const* BattleGroundSA::GetClosestGraveYard(Player* player) dist = sqrt((ret->x - x)*(ret->x - x) + (ret->y - y)*(ret->y - y)+(ret->z - z)*(ret->z - z)); if (dist < nearest) { - closest = ret; + closest = ret; nearest = dist; } } diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp index ca17e1868f4..88e2b5473a5 100644 --- a/src/game/ChatHandler.cpp +++ b/src/game/ChatHandler.cpp @@ -734,23 +734,23 @@ void WorldSession::SendPlayerNotFoundNotice(std::string name) data << name; SendPacket(&data); } - -void WorldSession::SendPlayerAmbiguousNotice(std::string name) + +void WorldSession::SendPlayerAmbiguousNotice(std::string name) { WorldPacket data(SMSG_CHAT_PLAYER_AMBIGUOUS, name.size()+1); data << name; - SendPacket(&data); -} - -void WorldSession::SendWrongFactionNotice() -{ - WorldPacket data(SMSG_CHAT_WRONG_FACTION, 0); - SendPacket(&data); -} - -void WorldSession::SendChatRestrictedNotice(ChatRestrictionType restriction) -{ + SendPacket(&data); +} + +void WorldSession::SendWrongFactionNotice() +{ + WorldPacket data(SMSG_CHAT_WRONG_FACTION, 0); + SendPacket(&data); +} + +void WorldSession::SendChatRestrictedNotice(ChatRestrictionType restriction) +{ WorldPacket data(SMSG_CHAT_RESTRICTED, 1); data << uint8(restriction); - SendPacket(&data); + SendPacket(&data); } diff --git a/src/game/DBCEnums.h b/src/game/DBCEnums.h index ba38e63fb5d..346aa886c44 100644 --- a/src/game/DBCEnums.h +++ b/src/game/DBCEnums.h @@ -209,11 +209,11 @@ enum AchievementCriteriaTypes // 0..115 => 116 criteria types total ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS = 115, ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS = 119, - // 120 - // 121 - // 122 - // 123 - // 0..123 => 124 criteria types total + // 120 + // 121 + // 122 + // 123 + // 0..123 => 124 criteria types total ACHIEVEMENT_CRITERIA_TYPE_TOTAL = 124, }; diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index f6f25267db6..629edff2455 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -403,7 +403,7 @@ void LoadDBCStores(const std::string& dataPath) { SpellDifficultyEntry const *spellDiff = sSpellDifficultyStore.LookupEntry(i); if (!spellDiff) - continue; + continue; for(int x = 0; x < MAX_DIFFICULTY; ++x) { if(spellDiff->SpellID[x] <= 0 || !sSpellStore.LookupEntry(spellDiff->SpellID[x])) @@ -556,10 +556,10 @@ void LoadDBCStores(const std::string& dataPath) // Check loaded DBC files proper version if (!sAreaStore.LookupEntry(3617) || // last area (areaflag) added in 3.3.3a !sCharTitlesStore.LookupEntry(177) || // last char title added in 3.3.3a - !sGemPropertiesStore.LookupEntry(1629) || // last added spell in 3.3.3a - !sItemStore.LookupEntry(54860) || // last gem property added in 3.3.3a + !sGemPropertiesStore.LookupEntry(1629) || // last added spell in 3.3.3a + !sItemStore.LookupEntry(54860) || // last gem property added in 3.3.3a !sItemExtendedCostStore.LookupEntry(2997) || // last item extended cost added in 3.3.3a - !sMapStore.LookupEntry(724) || // last map added in 3.3.3a + !sMapStore.LookupEntry(724) || // last map added in 3.3.3a !sSpellStore.LookupEntry(76567) ) // last client known item added in 3.3.3a { sLog.outError("\nYou have _outdated_ DBC files. Please extract correct versions from current using client."); diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 574bef4601c..09389bc7ff5 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -596,12 +596,12 @@ struct BattlemasterListEntry uint32 id; // 0 int32 mapid[8]; // 1-8 mapid uint32 type; // 9 (3 - BG, 4 - arena) - //uint32 canJoinAsGroup; // 10 (0 or 1) - char* name[16]; // 11-26 - //uint32 nameFlags // 27 string flag, unused - uint32 maxGroupSize; // 28 maxGroupSize, used for checking if queue as group - //uint32 HolidayWorldStateId; // 29 new 3.1 - //uint32 MinLevel; // 30 + //uint32 canJoinAsGroup; // 10 (0 or 1) + char* name[16]; // 11-26 + //uint32 nameFlags // 27 string flag, unused + uint32 maxGroupSize; // 28 maxGroupSize, used for checking if queue as group + //uint32 HolidayWorldStateId; // 29 new 3.1 + //uint32 MinLevel; // 30 //uint32 SomeLevel; // 31, may be max level }; diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp index 8b41f457edc..20a1bc7e279 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -167,15 +167,15 @@ void PlayerMenu::SendGossipMenu(uint32 TitleTextId, uint64 objectGUID) data << uint32(questID); data << uint32(qItem.m_qIcon); data << uint32(pSession->GetPlayer()->GetQuestLevel(pQuest)); - data << uint32(pQuest->GetFlags()); // 3.3.3 quest flags - data << uint8(0); // 3.3.3 changes icon: blue question or yellow exclamation + 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(); int loc_idx = pSession->GetSessionDbLocaleIndex(); if (loc_idx >= 0) if (QuestLocale const *ql = objmgr.GetQuestLocale(questID)) if (ql->Title.size() > loc_idx && !ql->Title[loc_idx].empty()) - Title = ql->Title[loc_idx]; + Title = ql->Title[loc_idx]; data << Title; // max 0x200 } @@ -192,8 +192,8 @@ void PlayerMenu::CloseGossip() void PlayerMenu::SendPointOfInterest(float X, float Y, uint32 Icon, uint32 Flags, uint32 Data, char const * locName) { WorldPacket data(SMSG_GOSSIP_POI, (4+4+4+4+4+10)); // guess size - data << uint32(Flags); - data << float(X); + data << uint32(Flags); + data << float(X); data << float(Y); data << uint32(Icon); data << uint32(Data); @@ -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(pQuest->GetFlags()); // 3.3.3 quest flags - data << uint8(0); // 3.3.3 changes icon: blue question or yellow exclamation + 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); @@ -707,8 +707,8 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID, data << Title; data << OfferRewardText; - data << uint8(EnableNext ? 1 : 0); // Auto Finish - data << uint32(pQuest->GetFlags()); // 3.3.3 questFlags + data << uint8(EnableNext ? 1 : 0); // Auto Finish + data << uint32(pQuest->GetFlags()); // 3.3.3 questFlags data << uint32(pQuest->GetSuggestedPlayers()); // SuggestedGroupNum uint32 EmoteCount = 0; diff --git a/src/game/Group.cpp b/src/game/Group.cpp index d5daaca4e90..5087a200da6 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -1485,19 +1485,19 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed) } } -GroupJoinBattlegroundResult Group::CanJoinBattleGroundQueue(BattleGround const* bgOrTemplate, BattleGroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot) +GroupJoinBattlegroundResult Group::CanJoinBattleGroundQueue(BattleGround const* bgOrTemplate, BattleGroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot) { BattlemasterListEntry const* bgEntry = sBattlemasterListStore.LookupEntry(bgOrTemplate->GetTypeID()); - if (!bgEntry) - return ERR_GROUP_JOIN_BATTLEGROUND_FAIL; // shouldn't happen + if (!bgEntry) + return ERR_GROUP_JOIN_BATTLEGROUND_FAIL; // shouldn't happen // check for min / max count uint32 memberscount = GetMembersCount(); - - // only check for MinPlayerCount since MinPlayerCount == MaxPlayerCount for arenas... - if (bgOrTemplate->isArena() && memberscount != MinPlayerCount) - return ERR_ARENA_TEAM_PARTY_SIZE; - + + // only check for MinPlayerCount since MinPlayerCount == MaxPlayerCount for arenas... + if (bgOrTemplate->isArena() && memberscount != MinPlayerCount) + return ERR_ARENA_TEAM_PARTY_SIZE; + if (memberscount > bgEntry->maxGroupSize) // no MinPlayerCount for battlegrounds return ERR_BATTLEGROUND_NONE; // ERR_GROUP_JOIN_BATTLEGROUND_TOO_MANY handled on client side diff --git a/src/game/GroupHandler.cpp b/src/game/GroupHandler.cpp index f5ab9b28696..3b85872dbfe 100644 --- a/src/game/GroupHandler.cpp +++ b/src/game/GroupHandler.cpp @@ -52,7 +52,7 @@ void WorldSession::SendPartyResult(PartyOperation operation, const std::string& data << (uint32)operation; data << member; data << (uint32)res; - data << uint32(0); // LFD cooldown related (used with ERR_PARTY_LFG_BOOT_COOLDOWN_S and ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S) + data << uint32(0); // LFD cooldown related (used with ERR_PARTY_LFG_BOOT_COOLDOWN_S and ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S) SendPacket(&data); } @@ -167,12 +167,12 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data) // ok, we do it WorldPacket data(SMSG_GROUP_INVITE, 10); // guess size - data << uint8(1); // invited/already in group flag - data << GetPlayer()->GetName(); // max len 48 - data << uint32(0); // unk - data << uint8(0); // count - //for(int i = 0; i < count; ++i) - // data << uint32(0); + data << uint8(1); // invited/already in group flag + data << GetPlayer()->GetName(); // max len 48 + data << uint32(0); // unk + data << uint8(0); // count + //for(int i = 0; i < count; ++i) + // data << uint32(0); data << uint32(0); // unk player->GetSession()->SendPacket(&data); diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index 17f4ac34107..6ade13551de 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -854,11 +854,11 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) BankBagSlotPricesEntry const* slotEntry = sBankBagSlotPricesStore.LookupEntry(slot); - WorldPacket data(SMSG_BUY_BANK_SLOT_RESULT, 4); + WorldPacket data(SMSG_BUY_BANK_SLOT_RESULT, 4); if (!slotEntry) { - data << uint32(ERR_BANKSLOT_FAILED_TOO_MANY); + data << uint32(ERR_BANKSLOT_FAILED_TOO_MANY); SendPacket(&data); return; } @@ -867,7 +867,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) if (_player->GetMoney() < price) { - data << uint32(ERR_BANKSLOT_INSUFFICIENT_FUNDS); + data << uint32(ERR_BANKSLOT_INSUFFICIENT_FUNDS); SendPacket(&data); return; } @@ -876,7 +876,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) _player->ModifyMoney(-int32(price)); data << uint32(ERR_BANKSLOT_OK); - SendPacket(&data); + SendPacket(&data); _player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT); } diff --git a/src/game/Mail.cpp b/src/game/Mail.cpp index a552664d162..0942e3a306f 100644 --- a/src/game/Mail.cpp +++ b/src/game/Mail.cpp @@ -596,7 +596,7 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data) data << uint32((*itr)->checked); // flags data << float(((*itr)->expire_time-time(NULL))/DAY); // Time data << uint32((*itr)->mailTemplateId); // mail template (MailTemplate.dbc) - data << (*itr)->subject; // Subject string - once 00, when mail type = 3, max 256 + data << (*itr)->subject; // Subject string - once 00, when mail type = 3, max 256 data << (*itr)->body; // message? max 8000 data << uint8(item_count); // client limit is 0x10 @@ -646,22 +646,22 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data) ///this function is called when client needs mail message body, or when player clicks on item which has ITEM_FIELD_ITEM_TEXT_ID > 0 void WorldSession::HandleItemTextQuery(WorldPacket & recv_data) { - uint64 itemGuid; + uint64 itemGuid; recv_data >> itemGuid; sLog.outDebug("CMSG_ITEM_TEXT_QUERY item guid: %u", GUID_LOPART(itemGuid)); - WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, (4+10)); // guess size - - if (Item *item = _player->GetItemByGuid(itemGuid)) - { - data << uint8(0); // has text - data << uint64(itemGuid); // item guid - data << objmgr.GetItemText(item->GetGUIDLow()); // max 8000 + WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, (4+10)); // guess size + + if (Item *item = _player->GetItemByGuid(itemGuid)) + { + data << uint8(0); // has text + data << uint64(itemGuid); // item guid + data << objmgr.GetItemText(item->GetGUIDLow()); // max 8000 } - else + else { - data << uint8(1); // no text + data << uint8(1); // no text } SendPacket(&data); } @@ -687,11 +687,11 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data) return; } - Item *bodyItem = new Item; // This is not bag and then can be used new Item. + Item *bodyItem = new Item; // This is not bag and then can be used new Item. if (!bodyItem->Create(objmgr.GenerateLowGuid(HIGHGUID_ITEM), MAIL_BODY_ITEM_TEMPLATE, pl)) - { + { delete bodyItem; - return; + return; } // in mail template case we need create new item text @@ -706,10 +706,10 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data) objmgr.CreateItemText(bodyItem->GetGUIDLow(), mailTemplateEntry->content[GetSessionDbcLocale()]); } - else + else objmgr.CreateItemText(bodyItem->GetGUIDLow(), m->body); - bodyItem->SetUInt32Value(ITEM_FIELD_CREATOR, m->sender); + bodyItem->SetUInt32Value(ITEM_FIELD_CREATOR, m->sender); bodyItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAGS_WRAPPER | ITEM_FLAGS_REFUNDABLE_2 | ITEM_FLAGS_UNK1); sLog.outDetail("HandleMailCreateTextItem mailid=%u",mailId); @@ -960,11 +960,11 @@ void MailDraft::SendMailTo(MailReceiver const& receiver, MailSender const& sende CharacterDatabase.BeginTransaction(); CharacterDatabase.escape_string(safe_subject); - std::string safe_body = GetBody(); - CharacterDatabase.BeginTransaction(); - CharacterDatabase.escape_string(safe_body); + std::string safe_body = GetBody(); + CharacterDatabase.BeginTransaction(); + CharacterDatabase.escape_string(safe_body); - CharacterDatabase.PExecute("INSERT INTO mail (id,messageType,stationery,mailTemplateId,sender,receiver,subject,body,has_items,expire_time,deliver_time,money,cod,checked) " + CharacterDatabase.PExecute("INSERT INTO mail (id,messageType,stationery,mailTemplateId,sender,receiver,subject,body,has_items,expire_time,deliver_time,money,cod,checked) " "VALUES ('%u', '%u', '%u', '%u', '%u', '%u', '%s', '%s', '%u', '" UI64FMTD "','" UI64FMTD "', '%u', '%u', '%d')", mailId, sender.GetMailMessageType(), sender.GetStationery(), GetMailTemplateId(), sender.GetSenderId(), receiver.GetPlayerGUIDLow(), safe_subject.c_str(), safe_body.c_str(),(m_items.empty() ? 0 : 1), (uint64)expire_time, (uint64)deliver_time, m_money, m_COD, checked); diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 5864da2e914..7682fe24797 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -217,7 +217,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) uint32 gmLevelInWhoList = sWorld.getConfig(CONFIG_GM_LEVEL_IN_WHO_LIST); WorldPacket data(SMSG_WHO, 50); // guess size - data << uint32(clientcount); // clientcount place holder, listed count + data << uint32(clientcount); // clientcount place holder, listed count data << uint32(clientcount); // clientcount place holder, online count ObjectAccessor::Guard guard(*HashMapHolder<Player>::GetLock()); @@ -328,8 +328,8 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) break; } - uint32 count = m.size(); - data.put( 0, clientcount ); // insert right count, listed count + uint32 count = m.size(); + data.put( 0, clientcount ); // insert right count, listed count data.put( 4, count > 50 ? count : clientcount ); // insert right count, online count SendPacket(&data); @@ -756,8 +756,8 @@ void WorldSession::HandleResurrectResponseOpcode(WorldPacket & recv_data) recv_data >> guid; recv_data >> status; - if (GetPlayer()->isAlive()) - return; + if (GetPlayer()->isAlive()) + return; if (status == 0) { @@ -1445,19 +1445,19 @@ void WorldSession::HandleTimeSyncResp(WorldPacket & recv_data) { sLog.outDebug("CMSG_TIME_SYNC_RESP"); - uint32 counter, clientTicks; + uint32 counter, clientTicks; recv_data >> counter >> clientTicks; - if (counter != _player->m_timeSyncCounter - 1) + if (counter != _player->m_timeSyncCounter - 1) sLog.outDebug("Wrong time sync counter from player %s (cheater?)", _player->GetName()); - sLog.outDebug("Time sync received: counter %u, client ticks %u, time since last sync %u", counter, clientTicks, clientTicks - _player->m_timeSyncClient); - - uint32 ourTicks = clientTicks + (getMSTime() - _player->m_timeSyncServer); - - // diff should be small + sLog.outDebug("Time sync received: counter %u, client ticks %u, time since last sync %u", counter, clientTicks, clientTicks - _player->m_timeSyncClient); + + uint32 ourTicks = clientTicks + (getMSTime() - _player->m_timeSyncServer); + + // diff should be small sLog.outDebug("Our ticks: %u, diff %u, latency %u", ourTicks, ourTicks - clientTicks, GetLatency()); - + _player->m_timeSyncClient = clientTicks; } diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index 77dd820d847..c578d0f83e6 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -629,7 +629,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data) if (Vehicle *vehicle = vehUnit->GetVehicleKit()) if (vehicle->HasEmptySeat(seatId)) GetPlayer()->EnterVehicle(vehicle, seatId); - } + } break; default: break; diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index daf97dfa2f7..d35e31e9b29 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -6059,9 +6059,9 @@ uint32 ObjectMgr::GenerateMailID() void ObjectMgr::CreateItemText(uint32 guid, std::string text) { - // insert new item text to container - mItemTexts[ guid ] = text; - + // insert new item text to container + mItemTexts[ guid ] = text; + // save new item text CharacterDatabase.escape_string(text); diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index e5391ed74ef..1994ca593ae 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -719,7 +719,7 @@ class ObjectMgr uint32 GenerateMailID(); uint32 GeneratePetNumber(); - void CreateItemText(uint32 guid, std::string text); + void CreateItemText(uint32 guid, std::string text); void AddItemText(uint32 guid, std::string text) { mItemTexts[guid] = text; } std::string GetItemText(uint32 id) { diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index 4b9bf6f8390..583d39932fb 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -1322,27 +1322,27 @@ enum Opcodes UMSG_UNKNOWN_1283 = 0x503, UMSG_UNKNOWN_1284 = 0x504, UMSG_UNKNOWN_1285 = 0x505, - SMSG_UNKNOWN_1286 = 0x506, // ERR_CORPSE_IS_NOT_IN_INSTANCE = 0x1A8, - UMSG_UNKNOWN_1287 = 0x507, // not found - CMSG_UNKNOWN_1288 = 0x508, // lua: SetAllowLowLevelRaid - CMSG_UNKNOWN_1289 = 0x509, // lua: SetAllowLowLevelRaid - SMSG_CAMERA_SHAKE = 0x50A, // uint32 SpellEffectCameraShakes.dbc index, uint32 - SMSG_UNKNOWN_1291 = 0x50B, // some item update packet? - UMSG_UNKNOWN_1292 = 0x50C, // not found - UMSG_UNKNOWN_1293 = 0x50D, // not found - disconnect - CMSG_UNKNOWN_1294 = 0x50E, // something with networking + SMSG_UNKNOWN_1286 = 0x506, // ERR_CORPSE_IS_NOT_IN_INSTANCE = 0x1A8, + UMSG_UNKNOWN_1287 = 0x507, // not found + CMSG_UNKNOWN_1288 = 0x508, // lua: SetAllowLowLevelRaid + CMSG_UNKNOWN_1289 = 0x509, // lua: SetAllowLowLevelRaid + SMSG_CAMERA_SHAKE = 0x50A, // uint32 SpellEffectCameraShakes.dbc index, uint32 + SMSG_UNKNOWN_1291 = 0x50B, // some item update packet? + UMSG_UNKNOWN_1292 = 0x50C, // not found + UMSG_UNKNOWN_1293 = 0x50D, // not found - disconnect + CMSG_UNKNOWN_1294 = 0x50E, // something with networking UMSG_UNKNOWN_1295 = 0x50F, // not found - disconnect CMSG_UNKNOWN_1296 = 0x510, // something with networking - UMSG_UNKNOWN_1297 = 0x511, // not found - crash - CMSG_UNKNOWN_1298 = 0x512, // something with networking - UMSG_UNKNOWN_1299 = 0x513, // not found - SMSG_UNKNOWN_1300 = 0x514, // SMSG + UMSG_UNKNOWN_1297 = 0x511, // not found - crash + CMSG_UNKNOWN_1298 = 0x512, // something with networking + UMSG_UNKNOWN_1299 = 0x513, // not found + SMSG_UNKNOWN_1300 = 0x514, // SMSG SMSG_UNKNOWN_1301 = 0x515, // event 0x204 (opens dungeon finder, probably for outdoor bosses) - SMSG_UNKNOWN_1302 = 0x516, // something with player movement (move event 58?) + SMSG_UNKNOWN_1302 = 0x516, // something with player movement (move event 58?) CMSG_UNKNOWN_1303 = 0x517, // something with player movement (move event 58?) - SMSG_UNKNOWN_1304 = 0x518, // something with player movement (move event 58?), speed packet + SMSG_UNKNOWN_1304 = 0x518, // something with player movement (move event 58?), speed packet UMSG_UNKNOWN_1305 = 0x519, // not found - UMSG_UNKNOWN_1306 = 0x51A, // not found + UMSG_UNKNOWN_1306 = 0x51A, // not found NUM_MSG_TYPES = 0x51B }; diff --git a/src/game/PetitionsHandler.cpp b/src/game/PetitionsHandler.cpp index 000a8d16b41..7f578c22656 100644 --- a/src/game/PetitionsHandler.cpp +++ b/src/game/PetitionsHandler.cpp @@ -268,9 +268,9 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data) sLog.outDebug("CMSG_PETITION_SHOW_SIGNATURES petition entry: '%u'", petitionguid_low); WorldPacket data(SMSG_PETITION_SHOW_SIGNATURES, (8+8+4+1+signs*12)); - data << uint64(petitionguid); // petition guid - data << uint64(_player->GetGUID()); // owner guid - data << uint32(petitionguid_low); // guild guid (in mangos always same as GUID_LOPART(petitionguid) + data << uint64(petitionguid); // petition guid + data << uint64(_player->GetGUID()); // owner guid + data << uint32(petitionguid_low); // guild guid (in mangos always same as GUID_LOPART(petitionguid) data << uint8(signs); // sign's count for (uint8 i = 1; i <= signs; ++i) @@ -668,8 +668,8 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) WorldPacket data(SMSG_PETITION_SHOW_SIGNATURES, (8+8+4+signs+signs*12)); data << uint64(petitionguid); // petition guid - data << uint64(_player->GetGUID()); // owner guid - data << uint32(GUID_LOPART(petitionguid)); // guild guid (in mangos always same as GUID_LOPART(petition guid) + data << uint64(_player->GetGUID()); // owner guid + data << uint32(GUID_LOPART(petitionguid)); // guild guid (in mangos always same as GUID_LOPART(petition guid) data << uint8(signs); // sign's count for (uint8 i = 1; i <= signs; ++i) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 31e5f84d3e7..f6eb52fcb19 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1608,17 +1608,17 @@ bool Player::BuildEnumData(QueryResult_AutoPtr result, WorldPacket * p_data) *p_data << uint8(proto->InventoryType); *p_data << uint32(enchant ? enchant->aura_id : 0); } - - *p_data << uint32(0); // bag 1 display id + + *p_data << uint32(0); // bag 1 display id *p_data << uint8(0); // bag 1 inventory type - *p_data << uint32(0); // enchant? - *p_data << uint32(0); // bag 2 display id + *p_data << uint32(0); // enchant? + *p_data << uint32(0); // bag 2 display id *p_data << uint8(0); // bag 2 inventory type - *p_data << uint32(0); // enchant? - *p_data << uint32(0); // bag 3 display id - *p_data << uint8(0); // bag 3 inventory type - *p_data << uint32(0); // enchant? - *p_data << uint32(0); // bag 4 display id + *p_data << uint32(0); // enchant? + *p_data << uint32(0); // bag 3 display id + *p_data << uint8(0); // bag 3 inventory type + *p_data << uint32(0); // enchant? + *p_data << uint32(0); // bag 4 display id *p_data << uint8(0); // bag 4 inventory type *p_data << uint32(0); // enchant? @@ -5817,15 +5817,15 @@ bool Player::HasSkill(uint32 skill) const return (itr != mSkillStatus.end() && itr->second.uState != SKILL_DELETED); } -uint16 Player::GetSkillStep(uint16 skill) const -{ - if (!skill) - return 0; +uint16 Player::GetSkillStep(uint16 skill) const +{ + if (!skill) + return 0; SkillStatusMap::const_iterator itr = mSkillStatus.find(skill); if (itr == mSkillStatus.end() || itr->second.uState == SKILL_DELETED) return 0; - + return PAIR32_HIPART(GetUInt32Value(PLAYER_SKILL_INDEX(itr->second.pos))); } @@ -6358,7 +6358,7 @@ void Player::RewardReputation(Quest const *pQuest) } else { - uint32 row = ((pQuest->RewRepValueId[i] < 0) ? 1 : 0) + 1; + uint32 row = ((pQuest->RewRepValueId[i] < 0) ? 1 : 0) + 1; uint32 field = abs(pQuest->RewRepValueId[i]); if (const QuestFactionRewEntry *pRow = sQuestFactionRewardStore.LookupEntry(row)) @@ -14288,10 +14288,10 @@ bool Player::SatisfyQuestLog(bool msg) if (FindQuestSlot(0) < MAX_QUEST_LOG_SIZE) return true; - if (msg) + if (msg) { WorldPacket data(SMSG_QUESTLOG_FULL, 0); - GetSession()->SendPacket(&data); + GetSession()->SendPacket(&data); sLog.outDebug("WORLD: Sent SMSG_QUESTLOG_FULL"); } return false; @@ -15441,9 +15441,9 @@ void Player::_LoadArenaTeamInfo(QueryResult_AutoPtr result) SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_ID, arenateamid); SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_TYPE, aTeam->GetType()); SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_MEMBER, (aTeam->GetCaptain() == GetGUID()) ? 0 : 1); - SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_GAMES_WEEK, played_week); + SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_GAMES_WEEK, played_week); SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_GAMES_SEASON, played_season); - SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_WINS_SEASON, wons_season); + SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_WINS_SEASON, wons_season); SetArenaTeamInfoField(arenaSlot, ARENA_TEAM_PERSONAL_RATING, personal_rating); }while (result->NextRow()); @@ -15537,16 +15537,16 @@ float Player::GetFloatValueFromArray(Tokens const& data, uint16 index) void Player::_LoadIntoDataField(const char* data, uint32 startOffset, uint32 count) { - if (!data) - return; - + if (!data) + return; + Tokens tokens = StrSplit(data, " "); if (tokens.size() != count) return; Tokens::iterator iter; - uint32 index; + uint32 index; for (iter = tokens.begin(), index = 0; index < count; ++iter, ++index) { m_uint32Values[startOffset + index] = atol((*iter).c_str()); @@ -15631,7 +15631,7 @@ bool Player::LoadFromDB(uint32 guid, SqlQueryHolder *holder) SetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES, fields[47].GetUInt64()); SetUInt32Value(PLAYER_AMMO_ID, fields[63].GetUInt32()); - + InitDisplayIds(); // cleanup inventory related item value fields (its will be filled correctly in _LoadInventory) @@ -16017,7 +16017,7 @@ bool Player::LoadFromDB(uint32 guid, SqlQueryHolder *holder) float bubble1 = 0.125f; float bubble = fields[23].GetUInt32() > 0 ? bubble1*sWorld.getRate(RATE_REST_OFFLINE_IN_TAVERN_OR_CITY) - : bubble0*sWorld.getRate(RATE_REST_OFFLINE_IN_WILDERNESS); + : bubble0*sWorld.getRate(RATE_REST_OFFLINE_IN_WILDERNESS); SetRestBonus(GetRestBonus()+ time_diff*((float)GetUInt32Value(PLAYER_NEXT_LEVEL_XP)/72000)*bubble); } @@ -16638,11 +16638,11 @@ void Player::_LoadMail() m->sender = fields[2].GetUInt32(); m->receiver = fields[3].GetUInt32(); m->subject = fields[4].GetCppString(); - m->body = fields[5].GetCppString(); + m->body = fields[5].GetCppString(); bool has_items = fields[6].GetBool(); - m->expire_time = (time_t)fields[7].GetUInt64(); + m->expire_time = (time_t)fields[7].GetUInt64(); m->deliver_time = (time_t)fields[8].GetUInt64(); - m->money = fields[9].GetUInt32(); + m->money = fields[9].GetUInt32(); m->COD = fields[10].GetUInt32(); m->checked = fields[11].GetUInt32(); m->stationery = fields[12].GetUInt8(); @@ -17409,16 +17409,16 @@ void Player::SaveToDB() ss << ", "; ss << uint32(m_specsCount); ss << ", "; - ss << uint32(m_activeSpec) << ", '"; + ss << uint32(m_activeSpec) << ", '"; for (uint32 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i) - { + { ss << GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + i) << " "; } ss << "', '"; for (uint32 i = 0; i < EQUIPMENT_SLOT_END * 2; ++i ) { - ss << GetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + i) << " "; + ss << GetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + i) << " "; } ss << "',"; @@ -23367,7 +23367,7 @@ void Player::ResetTimeSync() { m_timeSyncCounter = 0; m_timeSyncTimer = 0; - m_timeSyncClient = 0; + m_timeSyncClient = 0; m_timeSyncServer = getMSTime(); } @@ -23377,8 +23377,8 @@ void Player::SendTimeSync() data << uint32(m_timeSyncCounter++); GetSession()->SendPacket(&data); - // Schedule next sync in 10 sec - m_timeSyncTimer = 10000; + // Schedule next sync in 10 sec + m_timeSyncTimer = 10000; m_timeSyncServer = getMSTime(); } diff --git a/src/game/Player.h b/src/game/Player.h index 36e6807f3b4..244a50c58ca 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -57,7 +57,7 @@ class OutdoorPvP; typedef std::deque<Mail*> PlayerMails; #define PLAYER_MAX_SKILLS 127 -#define PLAYER_MAX_DAILY_QUESTS 25 +#define PLAYER_MAX_DAILY_QUESTS 25 #define PLAYER_EXPLORED_ZONES_SIZE 128 // Note: SPELLMOD_* values is aura types in fact @@ -79,13 +79,13 @@ enum PlayerUnderwaterState UNDERWATER_EXIST_TIMERS = 0x10 }; -enum BuyBankSlotResult -{ - ERR_BANKSLOT_FAILED_TOO_MANY = 0, - ERR_BANKSLOT_INSUFFICIENT_FUNDS = 1, - ERR_BANKSLOT_NOTBANKER = 2, - ERR_BANKSLOT_OK = 3 -}; +enum BuyBankSlotResult +{ + ERR_BANKSLOT_FAILED_TOO_MANY = 0, + ERR_BANKSLOT_INSUFFICIENT_FUNDS = 1, + ERR_BANKSLOT_NOTBANKER = 2, + ERR_BANKSLOT_OK = 3 +}; enum PlayerSpellState { @@ -500,7 +500,7 @@ enum PlayerFlags #define PLAYER_TITLE_HAND_OF_ADAL UI64LIT(0x0000008000000000) // 39 #define PLAYER_TITLE_VENGEFUL_GLADIATOR UI64LIT(0x0000010000000000) // 40 -#define KNOWN_TITLES_SIZE 3 +#define KNOWN_TITLES_SIZE 3 #define MAX_TITLE_INDEX (KNOWN_TITLES_SIZE*64) // 3 uint64 fields // used in PLAYER_FIELD_BYTES values @@ -1723,7 +1723,7 @@ class Player : public Unit, public GridObject<Player> SetArenaTeamInfoField(slot, ARENA_TEAM_ID, ArenaTeamId); SetArenaTeamInfoField(slot, ARENA_TEAM_TYPE, type); } - void SetArenaTeamInfoField(uint8 slot, ArenaTeamInfoType type, uint32 value) + void SetArenaTeamInfoField(uint8 slot, ArenaTeamInfoType type, uint32 value) { SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + type, value); } @@ -2628,8 +2628,8 @@ class Player : public Unit, public GridObject<Player> uint32 m_ChampioningFaction; uint32 m_timeSyncCounter; - uint32 m_timeSyncTimer; - uint32 m_timeSyncClient; + uint32 m_timeSyncTimer; + uint32 m_timeSyncClient; uint32 m_timeSyncServer; }; diff --git a/src/game/QuestDef.h b/src/game/QuestDef.h index c72b823a124..7ceb12bd025 100644 --- a/src/game/QuestDef.h +++ b/src/game/QuestDef.h @@ -240,7 +240,7 @@ class Quest bool IsAutoComplete() const { return QuestMethod ? false : true; } uint32 GetFlags() const { return QuestFlags; } bool IsDaily() const { return QuestFlags & QUEST_FLAGS_DAILY; } - bool IsWeekly() const { return QuestFlags & QUEST_FLAGS_WEEKLY; } + bool IsWeekly() const { return QuestFlags & QUEST_FLAGS_WEEKLY; } bool IsAutoAccept() const { return QuestFlags & QUEST_FLAGS_AUTO_ACCEPT; } // multiple values diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 16d4e90a5fb..22077649b6d 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -2661,14 +2661,14 @@ enum ResponseCodes CHAR_LOGIN_LOCKED_BY_BILLING = 0x55, CHAR_LOGIN_LOCKED_BY_MOBILE_AH = 0x56, - CHAR_NAME_SUCCESS = 0x57, + CHAR_NAME_SUCCESS = 0x57, CHAR_NAME_FAILURE = 0x58, CHAR_NAME_NO_NAME = 0x59, CHAR_NAME_TOO_SHORT = 0x5A, CHAR_NAME_TOO_LONG = 0x5B, - CHAR_NAME_INVALID_CHARACTER = 0x5C, - CHAR_NAME_MIXED_LANGUAGES = 0x5D, - CHAR_NAME_PROFANE = 0x5E, + CHAR_NAME_INVALID_CHARACTER = 0x5C, + CHAR_NAME_MIXED_LANGUAGES = 0x5D, + CHAR_NAME_PROFANE = 0x5E, CHAR_NAME_RESERVED = 0x5F, CHAR_NAME_INVALID_APOSTROPHE = 0x60, CHAR_NAME_MULTIPLE_APOSTROPHES = 0x61, diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 4543128e54f..6c64163ac0d 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -228,8 +228,8 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectNULL, //160 SPELL_EFFECT_160 unused &Spell::EffectSpecCount, //161 SPELL_EFFECT_TALENT_SPEC_COUNT second talent spec (learn/revert) &Spell::EffectActivateSpec, //162 SPELL_EFFECT_TALENT_SPEC_SELECT activate primary/secondary spec - &Spell::EffectNULL, //163 - &Spell::EffectNULL, //164 cancel's some aura... + &Spell::EffectNULL, //163 + &Spell::EffectNULL, //164 cancel's some aura... }; void Spell::EffectNULL(uint32 /*i*/) diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index cd796636be5..79d629d6ea6 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -290,8 +290,8 @@ inline bool IsExplicitDiscoverySpell(SpellEntry const *spellInfo) inline bool IsLootCraftingSpell(SpellEntry const *spellInfo) { return (spellInfo->Effect[0] == SPELL_EFFECT_CREATE_RANDOM_ITEM || - // different random cards from Inscription (121==Virtuoso Inking Set category) r without explicit item - (spellInfo->Effect[0] == SPELL_EFFECT_CREATE_ITEM_2 && + // different random cards from Inscription (121==Virtuoso Inking Set category) r without explicit item + (spellInfo->Effect[0] == SPELL_EFFECT_CREATE_ITEM_2 && (spellInfo->TotemCategory[0] != 0 || spellInfo->EffectItemType[0]==0))); } @@ -792,8 +792,8 @@ typedef std::pair<SpellsRequiringSpellMap::const_iterator,SpellsRequiringSpellMa // Spell learning properties (accessed using SpellMgr functions) struct SpellLearnSkillNode { - uint16 skill; - uint16 step; + uint16 skill; + uint16 step; uint16 value; // 0 - max skill value for player level uint16 maxvalue; // 0 - max skill value for player level }; @@ -1056,7 +1056,7 @@ class SpellMgr if (!newSpell) { sLog.outDebug("GetSpellForDifficultyFromSpell: spell %u not found in spell, this should never happen.", newSpell->Id);//alerady checked at startup - return spell; + return spell; } sLog.outDebug("GetSpellForDifficultyFromSpell: spellid for spell %u in mode %u is %u ", spell->Id, mode, newSpell->Id); return newSpell; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 2605f760faf..4c541c7e9df 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -1702,7 +1702,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff bool existExpired = false; TriggeredSpellInfoVct triggeredSpells; - // Incanter's Absorption, for converting to spell power + // Incanter's Absorption, for converting to spell power int32 incanterAbsorption = 0; // absorb without mana cost @@ -1955,7 +1955,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff RemainingDamage -= currentAbsorb; // Fire Ward or Frost Ward or Ice Barrier (or Mana Shield) - // for Incanter's Absorption converting to spell power + // for Incanter's Absorption converting to spell power if (spellProto->SpellFamilyName == SPELLFAMILY_MAGE && spellProto->SpellFamilyFlags[2] & 0x000008) incanterAbsorption += currentAbsorb; @@ -2025,7 +2025,7 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff } // Mana Shield (or Fire Ward or Frost Ward or Ice Barrier) - // for Incanter's Absorption converting to spell power + // for Incanter's Absorption converting to spell power if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_MAGE && (*i)->GetSpellProto()->SpellFamilyFlags[2] & 0x000008) incanterAbsorption += currentAbsorb; @@ -12257,7 +12257,7 @@ int32 Unit::CalculateSpellDamage(Unit const* target, SpellEntry const* spellProt switch(randomPoints) { - case 0: // not used + case 0: // 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 @@ -12265,9 +12265,9 @@ int32 Unit::CalculateSpellDamage(Unit const* target, SpellEntry const* spellProt ? irand(1, randomPoints) : irand(randomPoints, 1); - basePoints += randvalue; + basePoints += randvalue; break; - } + } int32 value = basePoints; diff --git a/src/game/UnitAI.cpp b/src/game/UnitAI.cpp index 7ff4a74b522..c04a698048b 100644 --- a/src/game/UnitAI.cpp +++ b/src/game/UnitAI.cpp @@ -91,7 +91,7 @@ struct DefaultTargetSelector : public std::unary_function<Unit *, bool> int32 m_aura; // pUnit: the reference unit - // dist: if 0: ignored, if > 0: maximum distance to the reference unit, if < 0: minimum distance to the reference unit + // dist: if 0: ignored, if > 0: maximum distance to the reference unit, if < 0: minimum distance to the reference unit // playerOnly: self explaining // aura: if 0: ignored, if > 0: the target shall have the aura, if < 0, the target shall NOT have the aura DefaultTargetSelector(const Unit *pUnit, float dist, bool playerOnly, int32 aura) : me(pUnit), m_dist(dist), m_playerOnly(playerOnly), m_aura(aura) {} @@ -205,7 +205,7 @@ void UnitAI::DoCastToAllHostilePlayers(uint32 spellid, bool triggered) } void UnitAI::DoCast(uint32 spellId) -{ +{ Unit *target = NULL; //sLog.outError("aggre %u %u", spellId, (uint32)AISpellInfo[spellId].target); switch(AISpellInfo[spellId].target) diff --git a/src/game/World.h b/src/game/World.h index 20394ee11f4..958ab584488 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -343,19 +343,19 @@ enum Rates MAX_RATES }; -/// Can be used in SMSG_AUTH_RESPONSE packet -enum BillingPlanFlags -{ +/// 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_IGR = 0x08, SESSION_USAGE = 0x10, SESSION_TIME_MIXTURE = 0x20, - SESSION_RESTRICTED = 0x40, - SESSION_ENABLE_CAIS = 0x80, -}; + SESSION_RESTRICTED = 0x40, + SESSION_ENABLE_CAIS = 0x80, +}; /// Type of server, this is values from second column of Cfg_Configs.dbc enum RealmType @@ -402,12 +402,12 @@ enum RealmZone REALM_ZONE_QA_SERVER = 28, // any language 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_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_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 }; diff --git a/src/scripts/northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp b/src/scripts/northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp index f9764885404..48d53481795 100644 --- a/src/scripts/northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp +++ b/src/scripts/northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp @@ -18,7 +18,7 @@ #include "forge_of_souls.h" /* - * TODO: + * TODO: * - Fix Soul Storm spell and remove work around. */ @@ -73,7 +73,7 @@ struct boss_bronjahmAI : public ScriptedAI ScriptedInstance* pInstance; EventMap events; - + CombatPhases phase; void Reset() @@ -133,7 +133,7 @@ struct boss_bronjahmAI : public ScriptedAI //Return since we have no target if (!UpdateVictim()) return; - + events.Update(diff); if (m_creature->hasUnitState(UNIT_STAT_CASTING)) @@ -238,7 +238,7 @@ void AddSC_boss_bronjahm() newscript->Name = "boss_bronjahm"; newscript->GetAI = &GetAI_boss_bronjahm; newscript->RegisterSelf(); - + newscript = new Script; newscript->Name = "mob_corrupted_soul_fragment"; newscript->GetAI = &GetAI_mob_corrupted_soul_fragment; diff --git a/src/scripts/northrend/frozen_halls/forge_of_souls/boss_devourer_of_souls.cpp b/src/scripts/northrend/frozen_halls/forge_of_souls/boss_devourer_of_souls.cpp index 90ece77724a..7fa564771c8 100644 --- a/src/scripts/northrend/frozen_halls/forge_of_souls/boss_devourer_of_souls.cpp +++ b/src/scripts/northrend/frozen_halls/forge_of_souls/boss_devourer_of_souls.cpp @@ -18,7 +18,7 @@ #include "forge_of_souls.h" /* - * TODO: + * TODO: * - Fix model id during unleash soul -> seems DB issue 36503 is missing (likewise 36504 is also missing). * - Fix outro npc movement */ @@ -86,11 +86,11 @@ enum eEnum DISPLAY_DESIRE = 30150, }; -struct +struct { uint32 entry[2]; Position movePosition; -} outroPositions[] = +} outroPositions[] = { { NPC_CHAMPION_1_ALLIANCE, NPC_CHAMPION_1_HORDE, { 5590.47, 2427.79, 705.935, 0.802851 } }, { NPC_CHAMPION_1_ALLIANCE, NPC_CHAMPION_1_HORDE, { 5593.59, 2428.34, 705.935, 0.977384 } }, @@ -126,7 +126,7 @@ struct boss_devourer_of_soulsAI : public ScriptedAI } bool bThreeFaceAchievement; - + ScriptedInstance* pInstance; EventMap events; @@ -144,10 +144,10 @@ struct boss_devourer_of_soulsAI : public ScriptedAI m_creature->SetReactState(REACT_AGGRESSIVE); events.Reset(); - + bThreeFaceAchievement = true; uiMirroredSoulTarget = 0; - + if (pInstance) pInstance->SetData(DATA_DEVOURER_EVENT, NOT_STARTED); } @@ -175,7 +175,7 @@ struct boss_devourer_of_soulsAI : public ScriptedAI if (Aura *pAura = pPlayer->GetAura(SPELL_MIRRORED_SOUL)) { int32 mirrorDamage = (uiDamage * 45)/100; - m_creature->CastCustomSpell(pPlayer, 69034, &mirrorDamage, 0, 0, true); + m_creature->CastCustomSpell(pPlayer, 69034, &mirrorDamage, 0, 0, true); // m_creature->DealDamage(pPlayer, (uiDamage * 45)/100, 0, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_SHADOW); } else @@ -288,7 +288,7 @@ struct boss_devourer_of_soulsAI : public ScriptedAI m_creature->SetOrientation(m_creature->GetAngle(pTarget)); DoCast(m_creature, SPELL_WAILING_SOULS_BEAM); } - + beamAngle = m_creature->GetOrientation(); beamAngleDiff = PI/30.0f; // PI/2 in 15 sec = PI/30 per tick @@ -313,7 +313,7 @@ struct boss_devourer_of_soulsAI : public ScriptedAI beamAngle += beamAngleDiff; m_creature->SetOrientation(beamAngle); m_creature->StopMoving(); - + DoCast(m_creature, SPELL_WAILING_SOULS); if (--wailingSoulTick) diff --git a/src/scripts/northrend/frozen_halls/forge_of_souls/forge_of_souls.cpp b/src/scripts/northrend/frozen_halls/forge_of_souls/forge_of_souls.cpp index d54ac8ee39b..efc2a043e22 100644 --- a/src/scripts/northrend/frozen_halls/forge_of_souls/forge_of_souls.cpp +++ b/src/scripts/northrend/frozen_halls/forge_of_souls/forge_of_souls.cpp @@ -27,7 +27,7 @@ enum Spells SPELL_VEIL_OF_SHADOWS = 69633, SPELL_WAIL_OF_SOULS = 69148, H_SPELL_WAIL_OF_SOULS = 70210, - + //Soulguard Watchman SPELL_SHROUD_OF_RUNES = 69056, SPELL_UNHOLY_RAGE = 69053, @@ -43,7 +43,7 @@ enum Spells SPELL_RAISE_DEAD = 69562, SPELL_SHIELD_OF_BONES = 69069, H_SPELL_SHIELD_OF_BONES = 70207, - + //Soulguard Animator // Raise dead 69562 SPELL_SHADOW_BOLT = 69068, @@ -155,7 +155,7 @@ struct npc_sylvanas_fosAI: public ScriptedAI } ScriptedInstance* pInstance; - + EventMap events; Phase phase; @@ -167,7 +167,7 @@ struct npc_sylvanas_fosAI: public ScriptedAI void DoAction(const int32 actionId) { - switch(actionId) + switch(actionId) { case ACTION_INTRO: { @@ -251,7 +251,7 @@ struct npc_jaina_fosAI: public ScriptedAI } ScriptedInstance* pInstance; - + EventMap events; Phase phase; @@ -263,7 +263,7 @@ struct npc_jaina_fosAI: public ScriptedAI void DoAction(const int32 actionId) { - switch(actionId) + switch(actionId) { case ACTION_INTRO: { diff --git a/src/scripts/northrend/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp b/src/scripts/northrend/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp index 814380db4fd..908f2857b89 100644 --- a/src/scripts/northrend/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp +++ b/src/scripts/northrend/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp @@ -40,7 +40,7 @@ struct instance_forge_of_souls : public ScriptedInstance uiDevourer = 0; uiTeamInInstance = 0; - + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) uiEncounter[i] = NOT_STARTED; } diff --git a/src/shared/Auth/BigNumber.cpp b/src/shared/Auth/BigNumber.cpp index c4811d2b95f..64e9ef21ccc 100644 --- a/src/shared/Auth/BigNumber.cpp +++ b/src/shared/Auth/BigNumber.cpp @@ -183,7 +183,7 @@ uint8 *BigNumber::AsByteArray(int minSize, bool reverse) BN_bn2bin(_bn, (unsigned char *)_array); - if (reverse) + if (reverse) std::reverse(_array, _array + length); return _array; diff --git a/src/shared/Auth/Hmac.cpp b/src/shared/Auth/Hmac.cpp index 07fbd4821fb..a30f1b2d1e2 100644 --- a/src/shared/Auth/Hmac.cpp +++ b/src/shared/Auth/Hmac.cpp @@ -42,9 +42,9 @@ void HmacHash::UpdateData(const uint8 *data, int length) HMAC_Update(&m_ctx, data, length); } -void HmacHash::UpdateData(const std::string &str) -{ - UpdateData((uint8 const*)str.c_str(), str.length()); +void HmacHash::UpdateData(const std::string &str) +{ + UpdateData((uint8 const*)str.c_str(), str.length()); } void HmacHash::Finalize() diff --git a/src/shared/Auth/SARC4.h b/src/shared/Auth/SARC4.h index 768856c7fe7..2e408627fc8 100644 --- a/src/shared/Auth/SARC4.h +++ b/src/shared/Auth/SARC4.h @@ -25,7 +25,7 @@ class SARC4 { public: - SARC4(uint8 len); + SARC4(uint8 len); SARC4(uint8 *seed, uint8 len); ~SARC4(); void Init(uint8 *seed); diff --git a/src/trinityrealm/AuthSocket.h b/src/trinityrealm/AuthSocket.h index 5bcbe9cdabd..bfd0fa4fdca 100644 --- a/src/trinityrealm/AuthSocket.h +++ b/src/trinityrealm/AuthSocket.h @@ -30,18 +30,18 @@ #include "RealmSocket.h" -enum RealmFlags -{ +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_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 |