diff options
author | Shauren <shauren.trinity@gmail.com> | 2015-03-22 13:47:55 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2015-03-22 13:47:55 +0100 |
commit | cc4d79495f98006f77c68792b946a412f5e86714 (patch) | |
tree | 3dcb68d3ec94b0bfdab80f725680191ff5a105d4 /src | |
parent | 695970df3b9b3bf9d71b5605e22e334dd24cfca8 (diff) |
Core/Misc: Warning fixes
Diffstat (limited to 'src')
32 files changed, 89 insertions, 120 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index b80e861c4df..08025fd1de1 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -497,7 +497,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { if (cost.Power == POWER_HEALTH) { - if (me->GetHealth() <= cost.Amount) + if (me->GetHealth() <= uint32(cost.Amount)) { hasPower = false; break; diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 587e1fca023..6ea09711667 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -550,7 +550,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player if (itemSubClass != 0xffffffff && proto->GetSubClass() != itemSubClass) continue; - if (inventoryType != 0xffffffff && proto->GetInventoryType() != inventoryType) + if (inventoryType != 0xffffffff && proto->GetInventoryType() != InventoryType(inventoryType)) continue; if (quality != 0xffffffff && proto->GetQuality() != quality) diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index e52acc0e2c3..9aab120cc63 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -135,7 +135,7 @@ struct ItemEffectEntry uint32 OrderIndex; // 2 uint32 SpellID; // 3 uint32 Trigger; // 4 - uint32 Charges; // 5 + int32 Charges; // 5 int32 Cooldown; // 6 uint32 Category; // 7 int32 CategoryCooldown; // 8 diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index f5c7b42292e..11c88d4922e 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1724,7 +1724,7 @@ SpellInfo const* Creature::reachWithSpellAttack(Unit* victim) std::vector<SpellInfo::CostData> costs = spellInfo->CalcPowerCost(this, SpellSchoolMask(spellInfo->SchoolMask)); auto m = std::find_if(costs.begin(), costs.end(), [](SpellInfo::CostData const& cost) { return cost.Power == POWER_MANA; }); if (m != costs.end()) - if (m->Amount > (uint32)GetPower(POWER_MANA)) + if (m->Amount > GetPower(POWER_MANA)) continue; float range = spellInfo->GetMaxRange(false); @@ -1772,7 +1772,7 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* victim) std::vector<SpellInfo::CostData> costs = spellInfo->CalcPowerCost(this, SpellSchoolMask(spellInfo->SchoolMask)); auto m = std::find_if(costs.begin(), costs.end(), [](SpellInfo::CostData const& cost) { return cost.Power == POWER_MANA; }); if (m != costs.end()) - if (m->Amount > (uint32)GetPower(POWER_MANA)) + if (m->Amount > GetPower(POWER_MANA)) continue; float range = spellInfo->GetMaxRange(true); diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index f0c4250ff1e..83d2ad1874c 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1626,7 +1626,7 @@ bool Pet::resetTalents() return true; } -void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* onlinePet /*= NULL*/) +void Pet::resetTalentsForAllPetsOf(Player* /*owner*/, Pet* /*onlinePet*/ /*= NULL*/) { /* TODO: 6.x remove pet talents // not need after this call diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e93c176969f..08e8180bb3f 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6130,7 +6130,7 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere // Used in case when access to whole aura is needed // All procs should be handled like this... -bool Unit::HandleAuraProc(Unit* victim, uint32 /*damage*/, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown, bool * handled) +bool Unit::HandleAuraProc(Unit* victim, uint32 /*damage*/, Aura* triggeredByAura, SpellInfo const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown, bool * handled) { SpellInfo const* dummySpell = triggeredByAura->GetSpellInfo(); @@ -16445,7 +16445,7 @@ bool Unit::IsHighestExclusiveAura(Aura const* aura, bool removeOtherAuraApplicat { if (AuraApplication* aurApp = existingAurEff->GetBase()->GetApplicationOfTarget(GetGUID())) { - bool hasMoreThanOneEffect = base->HasMoreThanOneEffectForType(auraType, GetMap()->GetDifficultyID()); + bool hasMoreThanOneEffect = base->HasMoreThanOneEffectForType(auraType); uint32 removedAuras = m_removedAurasCount; RemoveAura(aurApp); if (hasMoreThanOneEffect || m_removedAurasCount > removedAuras + 1) diff --git a/src/server/game/Handlers/BlackMarketHandler.cpp b/src/server/game/Handlers/BlackMarketHandler.cpp index 0520d1e18f3..f2b549c58c3 100644 --- a/src/server/game/Handlers/BlackMarketHandler.cpp +++ b/src/server/game/Handlers/BlackMarketHandler.cpp @@ -37,7 +37,7 @@ void WorldSession::HandleBlackMarketOpen(WorldPackets::BlackMarket::BlackMarketO SendBlackMarketOpenResult(packet.Guid, unit); } -void WorldSession::SendBlackMarketOpenResult(ObjectGuid guid, Creature* auctioneer) +void WorldSession::SendBlackMarketOpenResult(ObjectGuid guid, Creature* /*auctioneer*/) { WorldPackets::BlackMarket::BlackMarketOpenResult packet; packet.Guid = guid; diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index 7a63d38f4fa..34c50cac180 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -1394,7 +1394,7 @@ void WorldSession::HandleAlterAppearance(WorldPacket& recvData) return; } - if (_player->GetStandState() != UNIT_STAND_STATE_SIT_LOW_CHAIR + go->GetGOInfo()->barberChair.chairheight) + if (_player->GetStandState() != UnitStandStateType(UNIT_STAND_STATE_SIT_LOW_CHAIR + go->GetGOInfo()->barberChair.chairheight)) { SendBarberShopResult(BARBER_SHOP_RESULT_NOT_ON_CHAIR); return; diff --git a/src/server/game/Handlers/GuildHandler.cpp b/src/server/game/Handlers/GuildHandler.cpp index 2f5c1602a9f..679f1f08dc9 100644 --- a/src/server/game/Handlers/GuildHandler.cpp +++ b/src/server/game/Handlers/GuildHandler.cpp @@ -390,7 +390,7 @@ void WorldSession::HandleDeclineGuildInvites(WorldPackets::Guild::DeclineGuildIn GetPlayer()->ApplyModFlag(PLAYER_FLAGS, PLAYER_FLAGS_AUTO_DECLINE_GUILD, packet.Allow); } -void WorldSession::HandleRequestGuildRewardsList(WorldPackets::Guild::RequestGuildRewardsList& packet) +void WorldSession::HandleRequestGuildRewardsList(WorldPackets::Guild::RequestGuildRewardsList& /*packet*/) { if (sGuildMgr->GetGuildById(_player->GetGuildId())) { diff --git a/src/server/game/Handlers/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp index bf1e808d5d0..b291ffb0c9e 100644 --- a/src/server/game/Handlers/LFGHandler.cpp +++ b/src/server/game/Handlers/LFGHandler.cpp @@ -72,7 +72,7 @@ void BuildQuestReward(WorldPacket& data, Quest const* quest, Player* player) { if (uint32 itemId = quest->RewardItemId[i]) { - ItemTemplate const* item = sObjectMgr->GetItemTemplate(itemId); + //ItemTemplate const* item = sObjectMgr->GetItemTemplate(itemId); data << uint32(itemId); data << uint32(/*item ? item->DisplayInfoID :*/ 0); data << uint32(quest->RewardItemCount[i]); diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 13b60d571d3..675f68cd90f 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -63,7 +63,7 @@ #include "AchievementPackets.h" #include "WhoPackets.h" -void WorldSession::HandleRepopRequest(WorldPackets::Misc::RepopRequest& packet) +void WorldSession::HandleRepopRequest(WorldPackets::Misc::RepopRequest& /*packet*/) { TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_REPOP_REQUEST Message"); @@ -545,7 +545,7 @@ void WorldSession::HandleBugReportOpcode(WorldPacket& recvData) CharacterDatabase.Execute(stmt); } -void WorldSession::HandleReclaimCorpse(WorldPackets::Misc::ReclaimCorpse& packet) +void WorldSession::HandleReclaimCorpse(WorldPackets::Misc::ReclaimCorpse& /*packet*/) { TC_LOG_DEBUG("network", "WORLD: Received CMSG_RECLAIM_CORPSE"); diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index f40527b66d7..c703e02a95c 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -369,8 +369,6 @@ void WorldSession::HandleMovementOpcodes(WorldPackets::Movement::ClientPlayerMov plrMover->UpdateFallInformationIfNeed(movementInfo, opcode); - AreaTableEntry const* zone = GetAreaEntryByAreaID(plrMover->GetAreaId()); - if (movementInfo.pos.GetPositionZ() < MAX_MAP_DEPTH) { if (!(plrMover->GetBattleground() && plrMover->GetBattleground()->HandlePlayerUnderMap(_player))) diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp index 48e752b5d0b..999b71d69a3 100644 --- a/src/server/game/Handlers/NPCHandler.cpp +++ b/src/server/game/Handlers/NPCHandler.cpp @@ -120,10 +120,8 @@ void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle) // reputation discount float fDiscountMod = _player->GetReputationPriceDiscount(unit); - bool can_learn_primary_prof = GetPlayer()->GetFreePrimaryProfessionPoints() > 0; - packet.Spells.resize(trainer_spells->spellList.size()); - uint32 count = 0; + packet.Spells.reserve(trainer_spells->spellList.size()); for (TrainerSpellMap::const_iterator itr = trainer_spells->spellList.begin(); itr != trainer_spells->spellList.end(); ++itr) { TrainerSpell const* tSpell = &itr->second; @@ -143,12 +141,13 @@ void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle) if (learnedSpellInfo && learnedSpellInfo->IsPrimaryProfessionFirstRank()) primary_prof_first_rank = true; } + if (!valid) continue; TrainerSpellState state = _player->GetTrainerSpellState(tSpell); - WorldPackets::NPC::TrainerListSpell& spell = packet.Spells[count]; + WorldPackets::NPC::TrainerListSpell spell; spell.SpellID = tSpell->SpellID; spell.MoneyCost = floor(tSpell->MoneyCost * fDiscountMod); spell.ReqSkillLine = tSpell->ReqSkillLine; @@ -157,39 +156,34 @@ void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle) spell.Usable = (state == TRAINER_SPELL_GREEN_DISABLED ? TRAINER_SPELL_GREEN : state); uint8 maxReq = 0; - /// @todo Update this when new spell system is ready - /*for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + for (uint8 i = 0; i < MAX_TRAINERSPELL_ABILITY_REQS; ++i) { if (!tSpell->ReqAbility[i]) continue; + if (uint32 prevSpellId = sSpellMgr->GetPrevSpellInChain(tSpell->ReqAbility[i])) { spell.ReqAbility[maxReq] = prevSpellId; ++maxReq; } + if (maxReq == 2) break; + SpellsRequiringSpellMapBounds spellsRequired = sSpellMgr->GetSpellsRequiredForSpellBounds(tSpell->ReqAbility[i]); for (SpellsRequiringSpellMap::const_iterator itr2 = spellsRequired.first; itr2 != spellsRequired.second && maxReq < 3; ++itr2) { spell.ReqAbility[maxReq] = itr2->second; ++maxReq; } + if (maxReq == 2) break; - }*/ - while (maxReq < MAX_TRAINERSPELL_ABILITY_REQS) - { - spell.ReqAbility[maxReq] = 0; - ++maxReq; } - ++count; + packet.Spells.push_back(spell); } - // Shrink to actual data size - packet.Spells.resize(count); - SendPacket(packet.Write()); } diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 280055f8337..c7e98e75dfa 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -33,6 +33,7 @@ #include "SpellHistory.h" #include "SpellInfo.h" #include "Player.h" +#include "SpellPackets.h" void WorldSession::HandleDismissCritter(WorldPacket& recvData) { @@ -751,54 +752,41 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) charmInfo->SetSpellAutocast(spellInfo, state != 0); } -void WorldSession::HandlePetCastSpellOpcode(WorldPackets::Spells::PetCastSpell& castRequest) +void WorldSession::HandlePetCastSpellOpcode(WorldPackets::Spells::PetCastSpell& petCastSpell) { - TC_LOG_DEBUG("network", "WORLD: Received CMSG_PET_CAST_SPELL"); - /* - ObjectGuid guid; - uint8 castCount; - uint32 spellId; - uint8 castFlags; - - recvPacket >> guid >> castCount >> spellId >> castFlags; - - TC_LOG_DEBUG("network", "WORLD: CMSG_PET_CAST_SPELL, %s, castCount: %u, spellId %u, castFlags %u", guid.ToString().c_str(), castCount, spellId, castFlags); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(petCastSpell.Cast.SpellID); + if (!spellInfo) + { + TC_LOG_ERROR("network", "WORLD: unknown PET spell id %i", petCastSpell.Cast.SpellID); + return; + } // This opcode is also sent from charmed and possessed units (players and creatures) if (!_player->GetGuardianPet() && !_player->GetCharm()) return; - Unit* caster = ObjectAccessor::GetUnit(*_player, guid); + Unit* caster = ObjectAccessor::GetUnit(*_player, petCastSpell.PetGUID); if (!caster || (caster != _player->GetGuardianPet() && caster != _player->GetCharm())) { - TC_LOG_ERROR("network", "HandlePetCastSpellOpcode: %s isn't pet of player %s (%s).", guid.ToString().c_str(), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str()); - return; - } - - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); - if (!spellInfo) - { - TC_LOG_ERROR("network", "WORLD: unknown PET spell id %i", spellId); + TC_LOG_ERROR("network", "HandlePetCastSpellOpcode: %s isn't pet of player %s (%s).", petCastSpell.PetGUID.ToString().c_str(), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str()); return; } // do not cast not learned spells - if (!caster->HasSpell(spellId) || spellInfo->IsPassive()) + if (!caster->HasSpell(spellInfo->Id) || spellInfo->IsPassive()) return; - SpellCastTargets targets; - targets.Read(recvPacket, caster); - HandleClientCastFlags(recvPacket, castFlags, targets); + SpellCastTargets targets(caster, petCastSpell.Cast); caster->ClearUnitState(UNIT_STATE_FOLLOW); Spell* spell = new Spell(caster, spellInfo, TRIGGERED_NONE); - spell->m_cast_count = castCount; // probably pending spell cast + spell->m_cast_count = petCastSpell.Cast.CastID; + spell->m_misc.Data = petCastSpell.Cast.Misc; spell->m_targets = targets; SpellCastResult result = spell->CheckPetCast(NULL); - if (result == SPELL_CAST_OK) { if (Creature* creature = caster->ToCreature()) @@ -810,22 +798,22 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPackets::Spells::PetCastSpell& if (pet->getPetType() == SUMMON_PET && (urand(0, 100) < 10)) pet->SendPetTalk(PET_TALK_SPECIAL_SPELL); else - pet->SendPetAIReaction(guid); + pet->SendPetAIReaction(petCastSpell.PetGUID); } } - spell->prepare(&(spell->m_targets)); + spell->prepare(&targets); } else { spell->SendPetCastResult(result); - if (!caster->GetSpellHistory()->HasCooldown(spellId)) - caster->GetSpellHistory()->ResetCooldown(spellId, true); + if (!caster->GetSpellHistory()->HasCooldown(spellInfo->Id)) + caster->GetSpellHistory()->ResetCooldown(spellInfo->Id, true); spell->finish(false); delete spell; - }*/ + } } void WorldSession::SendPetNameInvalid(uint32 error, const std::string& name, DeclinedName *declinedName) @@ -840,15 +828,3 @@ void WorldSession::SendPetNameInvalid(uint32 error, const std::string& name, Dec SendPacket(&data); } - -void WorldSession::HandlePetLearnTalent(WorldPacket& recvData) -{ - /* TODO: 6.x remove pet talents (add pet specializations) - - ObjectGuid guid; - uint32 talentId, requestedRank; - recvData >> guid >> talentId >> requestedRank; - - _player->LearnPetTalent(guid, talentId, requestedRank); - _player->SendTalentsInfoData(true);*/ -} diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 6dd8d95bbf6..97935d5837e 100644 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -241,7 +241,6 @@ void WorldSession::HandlePetitionRenameGuild(WorldPackets::Petition::PetitionRen TC_LOG_DEBUG("network", "Received CMSG_PETITION_RENAME_GUILD"); TC_LOG_DEBUG("network", "Received opcode CMSG_PETITION_RENAME_GUILD"); - uint8 type = 0; Item* item = _player->GetItemByGuid(packet.PetitionGuid); if (!item) return; @@ -292,7 +291,7 @@ void WorldSession::HandleSignPetition(WorldPackets::Petition::SignPetition& pack Field* fields = result->Fetch(); ObjectGuid ownerGuid = ObjectGuid::Create<HighGuid::Player>(fields[0].GetUInt64()); - uint64 signs = fields[1].GetUInt64(); + //uint64 signs = fields[1].GetUInt64(); if (ownerGuid == _player->GetGUID()) return; diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index e9eccb6b634..1cbfd7057b7 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -337,7 +337,7 @@ void WorldSession::HandleCancelAuraOpcode(WorldPackets::Spells::CancelAura& canc if (spellInfo->IsChanneled()) { if (Spell* curSpell = _player->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) - if (curSpell->GetSpellInfo()->Id == cancelAura.SpellID) + if (curSpell->GetSpellInfo()->Id == uint32(cancelAura.SpellID)) _player->InterruptSpell(CURRENT_CHANNELED_SPELL); return; } diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index cd5b79c95c3..da0830734e5 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -334,7 +334,7 @@ bool Quest::IsAllowedInRaid(Difficulty difficulty) const return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_RAID); } -uint32 Quest::CalculateHonorGain(uint8 level) const +uint32 Quest::CalculateHonorGain(uint8 /*level*/) const { uint32 honor = 0; diff --git a/src/server/game/Server/Packets/NPCPackets.h b/src/server/game/Server/Packets/NPCPackets.h index b4c7a377187..849013fb5d8 100644 --- a/src/server/game/Server/Packets/NPCPackets.h +++ b/src/server/game/Server/Packets/NPCPackets.h @@ -59,7 +59,7 @@ namespace WorldPackets int32 QuestLevel = 0; bool Repeatable = false; std::string QuestTitle; - int32 QuestFlags[2]; + int32 QuestFlags[2] = { }; }; class GossipMessage final : public ServerPacket @@ -130,7 +130,7 @@ namespace WorldPackets int32 MoneyCost = 0; int32 ReqSkillLine = 0; int32 ReqSkillRank = 0; - int32 ReqAbility[MAX_TRAINERSPELL_ABILITY_REQS]; + int32 ReqAbility[MAX_TRAINERSPELL_ABILITY_REQS] = { }; uint8 Usable = 0; uint8 ReqLevel = 0; }; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 467e56fb1f1..5d7c18db742 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -638,7 +638,6 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER_OLD(CMSG_PET_BATTLE_SCRIPT_ERROR_NOTIFY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_PET_CANCEL_AURA, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandlePetCancelAuraOpcode ); DEFINE_HANDLER(CMSG_PET_CAST_SPELL, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Spells::PetCastSpell, &WorldSession::HandlePetCastSpellOpcode); - DEFINE_OPCODE_HANDLER_OLD(CMSG_PET_LEARN_TALENT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandlePetLearnTalent ); DEFINE_OPCODE_HANDLER_OLD(CMSG_PET_NAME_CACHE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_PET_NAME_QUERY, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandlePetNameQuery ); DEFINE_OPCODE_HANDLER_OLD(CMSG_PET_RENAME, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandlePetRename ); diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 9a40da19a23..498a2db708d 100644 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -546,7 +546,6 @@ enum OpcodeClient : uint32 CMSG_PET_BATTLE_SCRIPT_ERROR_NOTIFY = 0xBADD, CMSG_PET_CANCEL_AURA = 0xBADD, CMSG_PET_CAST_SPELL = 0xBADD, - CMSG_PET_LEARN_TALENT = 0xBADD, CMSG_PET_NAME_CACHE = 0xBADD, CMSG_PET_NAME_QUERY = 0x0CCB, CMSG_PET_RENAME = 0x1333, diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 61c27ff57d8..e1ad57bbc77 100644 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -1178,8 +1178,7 @@ class WorldSession void HandlePetRename(WorldPacket& recvData); void HandlePetCancelAuraOpcode(WorldPacket& recvPacket); void HandlePetSpellAutocastOpcode(WorldPacket& recvPacket); - void HandlePetCastSpellOpcode(WorldPackets::Spells::PetCastSpell& castRequest); - void HandlePetLearnTalent(WorldPacket& recvPacket); + void HandlePetCastSpellOpcode(WorldPackets::Spells::PetCastSpell& petCastSpell); void HandleSetActionBarToggles(WorldPackets::Character::SetActionBarToggles& packet); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 0af38131740..e85d38ee30c 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1003,11 +1003,11 @@ void Aura::RefreshSpellMods() player->RestoreAllSpellMods(0, this); } -bool Aura::HasMoreThanOneEffectForType(AuraType auraType, uint32 difficulty) const +bool Aura::HasMoreThanOneEffectForType(AuraType auraType) const { uint32 count = 0; for (SpellEffectInfo const* effect : GetSpellEffectInfos()) - if (effect && HasEffect(effect->EffectIndex) && AuraType(effect->ApplyAuraName) == auraType) + if (effect && HasEffect(effect->EffectIndex) && AuraType(effect->ApplyAuraName) == auraType) ++count; return count > 1; diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index 77ef04009b8..acc9de2587d 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -183,7 +183,7 @@ class Aura uint8 GetCasterLevel() const { return m_casterLevel; } - bool HasMoreThanOneEffectForType(AuraType auraType, uint32 difficulty) const; + bool HasMoreThanOneEffectForType(AuraType auraType) const; bool IsArea() const; bool IsPassive() const; bool IsDeathPersistent() const; diff --git a/src/server/game/Support/SupportMgr.cpp b/src/server/game/Support/SupportMgr.cpp index 773dd5d9676..f7a85a91faa 100644 --- a/src/server/game/Support/SupportMgr.cpp +++ b/src/server/game/Support/SupportMgr.cpp @@ -34,26 +34,26 @@ void Ticket::TeleportTo(Player* player) const player->TeleportTo(_mapId, _pos.x, _pos.y, _pos.z, 0.0f, 0); } -std::string Ticket::FormatViewMessageString(ChatHandler& handler, const char* szClosedName, const char* szAssignedToName, const char* szUnassignedName, const char* szDeletedName, const char* szCompletedName) const +std::string Ticket::FormatViewMessageString(ChatHandler& handler, char const* closedName, char const* assignedToName, char const* unassignedName, char const* deletedName, char const* /*completedName*/) const { std::stringstream ss; ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTGUID, _id); ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTNAME, GetPlayer()->GetName().c_str()); - if (szClosedName) - ss << handler.PGetParseString(LANG_COMMAND_TICKETCLOSED, szClosedName); - if (szAssignedToName) - ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, szAssignedToName); - if (szUnassignedName) - ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTUNASSIGNED, szUnassignedName); - if (szDeletedName) - ss << handler.PGetParseString(LANG_COMMAND_TICKETDELETED, szDeletedName); + if (closedName) + ss << handler.PGetParseString(LANG_COMMAND_TICKETCLOSED, closedName); + if (assignedToName) + ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, assignedToName); + if (unassignedName) + ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTUNASSIGNED, unassignedName); + if (deletedName) + ss << handler.PGetParseString(LANG_COMMAND_TICKETDELETED, deletedName); return ss.str(); } GmTicket::GmTicket() : _lastModifiedTime(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED), _viewed(false), _needResponse(false), _needMoreHelp(false) { } GmTicket::GmTicket(Player* player) : Ticket(player), _lastModifiedTime(time(nullptr)), _completed(false), _escalatedStatus(TICKET_UNASSIGNED), -_viewed(false), _needResponse(false), _needMoreHelp(false) +_viewed(false), _needResponse(false), _needMoreHelp(false) { _id = sSupportMgr->GenerateGmTicketId(); } @@ -71,9 +71,9 @@ void GmTicket::SetUnassigned() _assignedTo.Clear(); switch (_escalatedStatus) { - case TICKET_ASSIGNED: _escalatedStatus = TICKET_UNASSIGNED; + case TICKET_ASSIGNED: _escalatedStatus = TICKET_UNASSIGNED; break; - case TICKET_ESCALATED_ASSIGNED: _escalatedStatus = TICKET_IN_ESCALATION_QUEUE; + case TICKET_ESCALATED_ASSIGNED: _escalatedStatus = TICKET_IN_ESCALATION_QUEUE; break; case TICKET_UNASSIGNED: case TICKET_IN_ESCALATION_QUEUE: @@ -246,7 +246,7 @@ void BugTicket::LoadFromDB(Field* fields) _closedBy.SetRawValue(0, uint64(closedBy)); else _closedBy = ObjectGuid::Create<HighGuid::Player>(uint64(closedBy)); - + uint64 assignedTo = fields[++idx].GetUInt64(); if (assignedTo == 0) _assignedTo = ObjectGuid::Empty; @@ -330,7 +330,7 @@ void ComplaintTicket::LoadFromDB(Field* fields) int32 reportLineIndex = fields[++idx].GetInt32(); if (reportLineIndex != -1) _chatLog.ReportLineIndex.Set(reportLineIndex); - + int64 closedBy = fields[++idx].GetInt64(); if (closedBy == 0) _closedBy = ObjectGuid::Empty; @@ -344,7 +344,7 @@ void ComplaintTicket::LoadFromDB(Field* fields) _assignedTo = ObjectGuid::Empty; else _assignedTo = ObjectGuid::Create<HighGuid::Player>(assignedTo); - + _comment = fields[++idx].GetString(); } @@ -373,7 +373,7 @@ void ComplaintTicket::SaveToDB(SQLTransaction& trans) const stmt->setUInt8(++idx, _complaintType); if (_chatLog.ReportLineIndex.HasValue) stmt->setInt32(++idx, _chatLog.ReportLineIndex.Value); - else + else stmt->setInt32(++idx, -1); // empty ReportLineIndex stmt->setInt64(++idx, _closedBy.GetCounter()); stmt->setUInt64(++idx, _assignedTo.GetCounter()); @@ -393,7 +393,7 @@ void ComplaintTicket::SaveToDB(SQLTransaction& trans) const trans->Append(stmt); ++lineIndex; } - + if (!isInTransaction) CharacterDatabase.CommitTransaction(trans); } @@ -517,7 +517,7 @@ std::string SuggestionTicket::FormatViewMessageString(ChatHandler& handler, bool return ss.str(); } -SupportMgr::SupportMgr() : _lastGmTicketId(0), _lastBugId(0), _lastComplaintId(0), _lastSuggestionId(0), _openGmTicketCount(0), +SupportMgr::SupportMgr() : _lastGmTicketId(0), _lastBugId(0), _lastComplaintId(0), _lastSuggestionId(0), _openGmTicketCount(0), _openBugTicketCount(0), _openComplaintTicketCount(0), _openSuggestionTicketCount(0) { } SupportMgr::~SupportMgr() @@ -701,7 +701,7 @@ void SupportMgr::LoadComplaintTickets() uint32 count = 0; PreparedStatement* chatLogStmt; PreparedQueryResult chatLogResult; - do + do { Field* fields = result->Fetch(); ComplaintTicket* complaint = new ComplaintTicket(); diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index 7a34ba55110..d41c9c5d2c2 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -211,7 +211,7 @@ public: return true; } - static bool HandleLearnAllMyPetTalentsCommand(ChatHandler* handler, char const* /*args*/) + static bool HandleLearnAllMyPetTalentsCommand(ChatHandler* /*handler*/, char const* /*args*/) { /* TODO: 6.x remove pet talents Player* player = handler->GetSession()->GetPlayer(); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index cf1bc4fbb0e..8e646629e91 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -2613,7 +2613,7 @@ public: return true; } - static bool HandleAurasCommand(ChatHandler* handler, char const* args) + static bool HandleAurasCommand(ChatHandler* handler, char const* /*args*/) { Unit* target = handler->GetSession()->GetPlayer()->GetSelectedUnit(); diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index c22edf52dd3..e6fa8037d3f 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -418,7 +418,7 @@ public: } //Edit Player TP - static bool HandleModifyTalentCommand (ChatHandler* handler, const char* args) + static bool HandleModifyTalentCommand(ChatHandler* /*handler*/, const char* /*args*/) { /* TODO: 6.x remove this if (!*args) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp index f31a79f46d5..134783ccf07 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp @@ -1128,7 +1128,7 @@ class npc_ominous_cloud : public CreatureScript void UpdateAI(uint32 /*diff*/) override { } - void DoAction(int32 action) override + void DoAction(int32 /*action*/) override { me->GetMotionMaster()->MoveCirclePath(YoggSaronSpawnPos.GetPositionX(), YoggSaronSpawnPos.GetPositionY(), me->GetPositionZ() + 5.0f, me->GetDistance2d(YoggSaronSpawnPos.GetPositionX(), YoggSaronSpawnPos.GetPositionY()), true, 16); } diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 8105f7de5ff..91ef240a1a3 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -548,7 +548,7 @@ class spell_mage_fire_frost_ward : public SpellScriptLoader } } - void Absorb(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount) + void Absorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& /*absorbAmount*/) { /*Unit* target = GetTarget(); if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_FROST_WARDING_R1, EFFECT_0)) diff --git a/src/server/shared/Updater/UpdateFetcher.h b/src/server/shared/Updater/UpdateFetcher.h index f545c232a94..48a94444aa6 100644 --- a/src/server/shared/Updater/UpdateFetcher.h +++ b/src/server/shared/Updater/UpdateFetcher.h @@ -27,7 +27,7 @@ class UpdateFetcher { - using Path = boost::filesystem::path; + typedef boost::filesystem::path Path; public: UpdateFetcher(Path const& updateDirectory, @@ -53,6 +53,9 @@ private: struct AppliedFileEntry { + AppliedFileEntry(std::string const& name_, std::string const& hash_, State state_, uint64 timestamp_) + : name(name_), hash(hash_), state(state_), timestamp(timestamp_) { } + std::string const name; std::string const hash; @@ -79,12 +82,14 @@ private: struct DirectoryEntry { + DirectoryEntry(Path const& path_, State state_) : path(path_), state(state_) { } + Path const path; State const state; }; - using LocaleFileEntry = std::pair<Path, State>; + typedef std::pair<Path, State> LocaleFileEntry; struct PathCompare { @@ -94,11 +99,11 @@ private: } }; - using LocaleFileStorage = std::set<LocaleFileEntry, PathCompare>; - using HashToFileNameStorage = std::unordered_map<std::string, std::string>; - using AppliedFileStorage = std::unordered_map<std::string, AppliedFileEntry>; - using DirectoryStorage = std::vector<UpdateFetcher::DirectoryEntry>; - using SQLUpdate = std::shared_ptr<std::string>; + typedef std::set<LocaleFileEntry, PathCompare> LocaleFileStorage; + typedef std::unordered_map<std::string, std::string> HashToFileNameStorage; + typedef std::unordered_map<std::string, AppliedFileEntry> AppliedFileStorage; + typedef std::vector<UpdateFetcher::DirectoryEntry> DirectoryStorage; + typedef std::shared_ptr<std::string> SQLUpdate; LocaleFileStorage GetFileList() const; void FillFileListRecursively(Path const& path, LocaleFileStorage& storage, State const state, uint32 const depth) const; diff --git a/src/server/shared/Utilities/ServiceWin32.cpp b/src/server/shared/Utilities/ServiceWin32.cpp index c73949fc6a3..3e5e416b1a3 100644 --- a/src/server/shared/Utilities/ServiceWin32.cpp +++ b/src/server/shared/Utilities/ServiceWin32.cpp @@ -255,7 +255,7 @@ bool WinServiceRun() if (!StartServiceCtrlDispatcher(serviceTable)) { - TC_LOG_ERROR("server.worldserver", "StartService Failed. Error [%u]", ::GetLastError()); + TC_LOG_ERROR("server.worldserver", "StartService Failed. Error [%u]", uint32(::GetLastError())); return false; } return true; diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index 50bb8d7646d..a1e8ba74514 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -325,7 +325,7 @@ void ShutdownCLIThread(std::thread* cliThread) errorBuffer = "Unknown error"; TC_LOG_DEBUG("server.worldserver", "Error cancelling I/O of CliThread, error code %u, detail: %s", - errorCode, errorBuffer); + uint32(errorCode), errorBuffer); LocalFree(errorBuffer); // send keyboard input to safely unblock the CLI thread |