diff options
Diffstat (limited to 'src/server/game/Handlers')
| -rwxr-xr-x | src/server/game/Handlers/BattleGroundHandler.cpp | 23 | ||||
| -rw-r--r-- | src/server/game/Handlers/CharacterHandler.cpp | 40 | ||||
| -rw-r--r-- | src/server/game/Handlers/ItemHandler.cpp | 2 | ||||
| -rwxr-xr-x | src/server/game/Handlers/LootHandler.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Handlers/MiscHandler.cpp | 4 |
5 files changed, 37 insertions, 36 deletions
diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index a834c7bedc9..9c99bf0a066 100755 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -165,7 +165,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) if (_player->GetBattlegroundQueueIndex(bgQueueTypeIdRandom) < PLAYER_MAX_BATTLEGROUND_QUEUES) { - //player is already in random queue + // player is already in random queue WorldPacket data; sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_IN_RANDOM_BG); _player->GetSession()->SendPacket(&data); @@ -174,7 +174,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) if (_player->InBattlegroundQueue() && bgTypeId == BATTLEGROUND_RB) { - //player is already in queue, can't start random queue + // player is already in queue, can't start random queue WorldPacket data; sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, bg, _player, ERR_IN_NON_RANDOM_BG); _player->GetSession()->SendPacket(&data); @@ -183,7 +183,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) // check if already in queue if (_player->GetBattlegroundQueueIndex(bgQueueTypeId) < PLAYER_MAX_BATTLEGROUND_QUEUES) - //player is already in this queue + // player is already in this queue return; // check if has free queue slots @@ -195,7 +195,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) return; } - BattlegroundQueue& bgQueue = sBattlegroundMgr->m_BattlegroundQueues[bgQueueTypeId]; + BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); GroupQueueInfo* ginfo = bgQueue.AddGroup(_player, NULL, bgTypeId, bracketEntry, 0, false, isPremade, 0, 0); uint32 avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); @@ -206,7 +206,8 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) // send status packet (in queue) sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, _player, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType); SendPacket(&data); - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s", + bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName()); } else { @@ -219,7 +220,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) err = grp->CanJoinBattlegroundQueue(bg, bgQueueTypeId, 0, bg->GetMaxPlayersPerTeam(), false, 0); isPremade = (grp->GetMembersCount() >= bg->GetMinPlayersPerTeam()); - BattlegroundQueue& bgQueue = sBattlegroundMgr->m_BattlegroundQueues[bgQueueTypeId]; + BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); GroupQueueInfo* ginfo = NULL; uint32 avgTime = 0; @@ -274,14 +275,14 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recvD Player* aplr = NULL; Player* hplr = NULL; - if (uint64 guid = bg->GetFlagPickerGUID(BG_TEAM_ALLIANCE)) + if (uint64 guid = bg->GetFlagPickerGUID(TEAM_ALLIANCE)) { aplr = ObjectAccessor::FindPlayer(guid); if (aplr) ++acount; } - if (uint64 guid = bg->GetFlagPickerGUID(BG_TEAM_HORDE)) + if (uint64 guid = bg->GetFlagPickerGUID(TEAM_HORDE)) { hplr = ObjectAccessor::FindPlayer(guid); if (hplr) @@ -439,7 +440,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) //get GroupQueueInfo from BattlegroundQueue BattlegroundTypeId bgTypeId = BattlegroundTypeId(bgTypeId_); BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, type); - BattlegroundQueue& bgQueue = sBattlegroundMgr->m_BattlegroundQueues[bgQueueTypeId]; + BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); //we must use temporary variable, because GroupQueueInfo pointer can be deleted in BattlegroundQueue::RemovePlayer() function GroupQueueInfo ginfo; if (!bgQueue.GetPlayerGroupInfoData(_player->GetGUID(), &ginfo)) @@ -608,7 +609,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recvData*/) } //we are sending update to player about queue - he can be invited there! //get GroupQueueInfo for queue status - BattlegroundQueue& bgQueue = sBattlegroundMgr->m_BattlegroundQueues[bgQueueTypeId]; + BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); GroupQueueInfo ginfo; if (!bgQueue.GetPlayerGroupInfoData(_player->GetGUID(), &ginfo)) continue; @@ -748,7 +749,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recvData) arenaRating = 1; } - BattlegroundQueue &bgQueue = sBattlegroundMgr->m_BattlegroundQueues[bgQueueTypeId]; + BattlegroundQueue &bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId); if (asGroup) { uint32 avgTime = 0; diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index af633544245..e97974af4a1 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1818,7 +1818,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) sWorld->UpdateCharacterNameData(GUID_LOPART(guid), newname, gender, race); - BattlegroundTeamId team = BG_TEAM_ALLIANCE; + TeamId team = TEAM_ALLIANCE; // Search each faction is targeted switch (race) @@ -1829,7 +1829,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) case RACE_UNDEAD_PLAYER: case RACE_TROLL: case RACE_BLOODELF: - team = BG_TEAM_HORDE; + team = TEAM_HORDE; break; default: break; @@ -1846,7 +1846,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) stmt->setUInt32(0, lowGuid); // Faction specific languages - if (team == BG_TEAM_HORDE) + if (team == TEAM_HORDE) stmt->setUInt16(1, 109); else stmt->setUInt16(1, 98); @@ -1911,7 +1911,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) uint32 numFullTaximasks = level / 7; if (numFullTaximasks > 11) numFullTaximasks = 11; - if (team == BG_TEAM_ALLIANCE) + if (team == TEAM_ALLIANCE) { if (playerClass != CLASS_DEATH_KNIGHT) { @@ -1963,7 +1963,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) { Quest *qinfo = iter->second; uint32 requiredRaces = qinfo->GetRequiredRaces(); - if (team == BG_TEAM_ALLIANCE) + if (team == TEAM_ALLIANCE) { if (requiredRaces & RACEMASK_ALLIANCE) { @@ -1971,7 +1971,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) quests << ','; } } - else // if (team == BG_TEAM_HORDE) + else // if (team == TEAM_HORDE) { if (requiredRaces & RACEMASK_HORDE) { @@ -2024,7 +2024,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PLAYER_HOMEBIND); stmt->setUInt32(0, lowGuid); - if (team == BG_TEAM_ALLIANCE) + if (team == TEAM_ALLIANCE) { stmt->setUInt16(1, 0); stmt->setUInt16(2, 1519); @@ -2051,13 +2051,13 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) uint32 achiev_horde = it->second; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT); - stmt->setUInt16(0, uint16(team == BG_TEAM_ALLIANCE ? achiev_alliance : achiev_horde)); + stmt->setUInt16(0, uint16(team == TEAM_ALLIANCE ? achiev_alliance : achiev_horde)); stmt->setUInt32(1, lowGuid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_ACHIEVEMENT); - stmt->setUInt16(0, uint16(team == BG_TEAM_ALLIANCE ? achiev_alliance : achiev_horde)); - stmt->setUInt16(1, uint16(team == BG_TEAM_ALLIANCE ? achiev_horde : achiev_alliance)); + stmt->setUInt16(0, uint16(team == TEAM_ALLIANCE ? achiev_alliance : achiev_horde)); + stmt->setUInt16(1, uint16(team == TEAM_ALLIANCE ? achiev_horde : achiev_alliance)); stmt->setUInt32(2, lowGuid); trans->Append(stmt); } @@ -2069,8 +2069,8 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) uint32 item_horde = it->second; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_INVENTORY_FACTION_CHANGE); - stmt->setUInt32(0, (team == BG_TEAM_ALLIANCE ? item_alliance : item_horde)); - stmt->setUInt32(1, (team == BG_TEAM_ALLIANCE ? item_horde : item_alliance)); + stmt->setUInt32(0, (team == TEAM_ALLIANCE ? item_alliance : item_horde)); + stmt->setUInt32(1, (team == TEAM_ALLIANCE ? item_horde : item_alliance)); stmt->setUInt32(2, guid); trans->Append(stmt); } @@ -2082,13 +2082,13 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) uint32 spell_horde = it->second; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_BY_SPELL); - stmt->setUInt32(0, (team == BG_TEAM_ALLIANCE ? spell_alliance : spell_horde)); + stmt->setUInt32(0, (team == TEAM_ALLIANCE ? spell_alliance : spell_horde)); stmt->setUInt32(1, lowGuid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_SPELL_FACTION_CHANGE); - stmt->setUInt32(0, (team == BG_TEAM_ALLIANCE ? spell_alliance : spell_horde)); - stmt->setUInt32(1, (team == BG_TEAM_ALLIANCE ? spell_horde : spell_alliance)); + stmt->setUInt32(0, (team == TEAM_ALLIANCE ? spell_alliance : spell_horde)); + stmt->setUInt32(1, (team == TEAM_ALLIANCE ? spell_horde : spell_alliance)); stmt->setUInt32(2, lowGuid); trans->Append(stmt); } @@ -2100,13 +2100,13 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) uint32 reputation_horde = it->second; PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_REP_BY_FACTION); - stmt->setUInt32(0, uint16(team == BG_TEAM_ALLIANCE ? reputation_alliance : reputation_horde)); + stmt->setUInt32(0, uint16(team == TEAM_ALLIANCE ? reputation_alliance : reputation_horde)); stmt->setUInt32(1, lowGuid); trans->Append(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_REP_FACTION_CHANGE); - stmt->setUInt16(0, uint16(team == BG_TEAM_ALLIANCE ? reputation_alliance : reputation_horde)); - stmt->setUInt16(1, uint16(team == BG_TEAM_ALLIANCE ? reputation_horde : reputation_alliance)); + stmt->setUInt16(0, uint16(team == TEAM_ALLIANCE ? reputation_alliance : reputation_horde)); + stmt->setUInt16(1, uint16(team == TEAM_ALLIANCE ? reputation_horde : reputation_alliance)); stmt->setUInt32(2, lowGuid); trans->Append(stmt); } @@ -2116,7 +2116,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) { const uint32 ktcount = KNOWN_TITLES_SIZE * 2; uint32 knownTitles[ktcount]; - Tokens tokens(knownTitlesStr, ' ', ktcount); + Tokenizer tokens(knownTitlesStr, ' ', ktcount); if (tokens.size() != ktcount) return; @@ -2132,7 +2132,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData) CharTitlesEntry const* atitleInfo = sCharTitlesStore.LookupEntry(title_alliance); CharTitlesEntry const* htitleInfo = sCharTitlesStore.LookupEntry(title_horde); // new team - if (team == BG_TEAM_ALLIANCE) + if (team == TEAM_ALLIANCE) { uint32 bitIndex = htitleInfo->bit_index; uint32 index = bitIndex / 32; diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index 9f6e66cfc6b..69d9d24db8c 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -777,7 +777,7 @@ void WorldSession::SendListInventory(uint64 vendorGuid) int32 price = vendorItem->IsGoldRequired(itemTemplate) ? uint32(floor(itemTemplate->BuyPrice * discountMod)) : 0; if (int32 priceMod = _player->GetTotalAuraModifier(SPELL_AURA_MOD_VENDOR_ITEMS_PRICES)) - price -= CalculatePctN(price, priceMod); + price -= CalculatePct(price, priceMod); itemsData << uint32(count++ + 1); // client expects counting to start at 1 itemsData << uint32(itemTemplate->MaxDurability); diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index 155d6c73e9c..43242e6a54a 100755 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -183,7 +183,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/) (*i)->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, goldPerPlayer); if (Guild* guild = sGuildMgr->GetGuildById((*i)->GetGuildId())) - if (uint32 guildGold = CalculatePctN(goldPerPlayer, (*i)->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT))) + if (uint32 guildGold = CalculatePct(goldPerPlayer, (*i)->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT))) guild->HandleMemberDepositMoney(this, guildGold, true); WorldPacket data(SMSG_LOOT_MONEY_NOTIFY, 4 + 1); @@ -198,7 +198,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/) player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, loot->gold); if (Guild* guild = sGuildMgr->GetGuildById(player->GetGuildId())) - if (uint32 guildGold = CalculatePctN(loot->gold, player->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT))) + if (uint32 guildGold = CalculatePct(loot->gold, player->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT))) guild->HandleMemberDepositMoney(this, guildGold, true); WorldPacket data(SMSG_LOOT_MONEY_NOTIFY, 4 + 1); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 1108e875be7..2acc8ffcf7b 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -861,8 +861,8 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData) // 2PI = 360°, keep in mind that ingame orientation is counter-clockwise double rotation = 2 * M_PI - atEntry->box_orientation; - double sinVal = sin(rotation); - double cosVal = cos(rotation); + double sinVal = std::sin(rotation); + double cosVal = std::cos(rotation); float playerBoxDistX = player->GetPositionX() - atEntry->x; float playerBoxDistY = player->GetPositionY() - atEntry->y; |
