diff --git a/Source/BNetServer/BNetServer.csproj b/Source/BNetServer/BNetServer.csproj index 5eb6a9878..8bf1aa458 100644 --- a/Source/BNetServer/BNetServer.csproj +++ b/Source/BNetServer/BNetServer.csproj @@ -5,6 +5,7 @@ netcoreapp3.1 BNetServer.Server Red.ico + 8.0 diff --git a/Source/Framework/Dynamic/OptionalType.cs b/Source/Framework/Dynamic/OptionalType.cs index b992d28c9..86cc784fe 100644 --- a/Source/Framework/Dynamic/OptionalType.cs +++ b/Source/Framework/Dynamic/OptionalType.cs @@ -28,7 +28,7 @@ namespace Framework.Dynamic set { _hasValue = value; - Value = _hasValue ? new T() : default(T); + Value = _hasValue ? new T() : default; } } @@ -41,7 +41,7 @@ namespace Framework.Dynamic public void Clear() { _hasValue = false; - Value = default(T); + Value = default; } public static explicit operator T(Optional value) diff --git a/Source/Framework/Framework.csproj b/Source/Framework/Framework.csproj index 9196d5217..e492faf6c 100644 --- a/Source/Framework/Framework.csproj +++ b/Source/Framework/Framework.csproj @@ -4,6 +4,7 @@ netstandard2.1 x64 true + 8.0 diff --git a/Source/Framework/GameMath/Plane.cs b/Source/Framework/GameMath/Plane.cs index 2a0b5f0ac..1411afd74 100644 --- a/Source/Framework/GameMath/Plane.cs +++ b/Source/Framework/GameMath/Plane.cs @@ -253,7 +253,7 @@ namespace Framework.GameMath /// A string representation of this object. public override string ToString() { - return $"Plane[n={_normal.ToString()}, c={_const.ToString()}]"; + return $"Plane[n={_normal}, c={_const}]"; } #endregion } diff --git a/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs b/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs index f1c939a05..ecb16a65d 100644 --- a/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs +++ b/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs @@ -464,7 +464,7 @@ namespace Game.AI me.RemoveUnitFlag(UnitFlags.ImmuneToNpc); } - Log.outDebug(LogFilter.Scripts, $"EscortAI started. ActiveAttacker = {m_bIsActiveAttacker}, Run = {m_bIsRunning}, PlayerGUID = {m_uiPlayerGUID.ToString()}"); + Log.outDebug(LogFilter.Scripts, $"EscortAI started. ActiveAttacker = {m_bIsActiveAttacker}, Run = {m_bIsRunning}, PlayerGUID = {m_uiPlayerGUID}"); CurrentWPIndex = 0; diff --git a/Source/Game/AI/SmartScripts/SmartScript.cs b/Source/Game/AI/SmartScripts/SmartScript.cs index 54735e625..36dae3d09 100644 --- a/Source/Game/AI/SmartScripts/SmartScript.cs +++ b/Source/Game/AI/SmartScripts/SmartScript.cs @@ -1054,7 +1054,7 @@ namespace Game.AI if (IsCreature(obj)) { me.SetInCombatWithZone(); - Log.outDebug(LogFilter.ScriptsAi, $"SmartScript.ProcessAction: SMART_ACTION_SET_IN_COMBAT_WITH_ZONE: Creature: {me.GetGUID().ToString()}, Target: {obj.GetGUID().ToString()}"); + Log.outDebug(LogFilter.ScriptsAi, $"SmartScript.ProcessAction: SMART_ACTION_SET_IN_COMBAT_WITH_ZONE: Creature: {me.GetGUID()}, Target: {obj.GetGUID()}"); } } @@ -1076,7 +1076,7 @@ namespace Game.AI var builder = new BroadcastTextBuilder(me, ChatMsg.Emote, (uint)BroadcastTextIds.CallForHelp, me.GetGender()); Global.CreatureTextMgr.SendChatPacket(me, builder, ChatMsg.MonsterEmote); } - Log.outDebug(LogFilter.ScriptsAi, $"SmartScript.ProcessAction: SMART_ACTION_CALL_FOR_HELP: Creature: {me.GetGUID().ToString()}, Target: {obj.GetGUID().ToString()}"); + Log.outDebug(LogFilter.ScriptsAi, $"SmartScript.ProcessAction: SMART_ACTION_CALL_FOR_HELP: Creature: {me.GetGUID()}, Target: {obj.GetGUID()}"); } } break; @@ -2652,7 +2652,7 @@ namespace Game.AI { obj.ToUnit().SendPlaySpellVisualKit(e.Action.spellVisualKit.spellVisualKitId, e.Action.spellVisualKit.kitType, e.Action.spellVisualKit.duration); - Log.outDebug(LogFilter.ScriptsAi, $"SmartScript.ProcessAction:: SMART_ACTION_PLAY_SPELL_VISUAL_KIT: target: {obj.GetName()} ({obj.GetGUID().ToString()}), SpellVisualKit: {e.Action.spellVisualKit.spellVisualKitId}"); + Log.outDebug(LogFilter.ScriptsAi, $"SmartScript.ProcessAction:: SMART_ACTION_PLAY_SPELL_VISUAL_KIT: target: {obj.GetName()} ({obj.GetGUID()}), SpellVisualKit: {e.Action.spellVisualKit.spellVisualKitId}"); } } break; diff --git a/Source/Game/Achievements/AchievementManager.cs b/Source/Game/Achievements/AchievementManager.cs index f66993ac1..0614bfba8 100644 --- a/Source/Game/Achievements/AchievementManager.cs +++ b/Source/Game/Achievements/AchievementManager.cs @@ -660,7 +660,7 @@ namespace Game.Achievements public override string GetOwnerInfo() { - return $"{_owner.GetGUID().ToString()} {_owner.GetName()}"; + return $"{_owner.GetGUID()} {_owner.GetName()}"; } Player _owner; diff --git a/Source/Game/Achievements/CriteriaHandler.cs b/Source/Game/Achievements/CriteriaHandler.cs index 5ed50a6bd..90c4a40fc 100644 --- a/Source/Game/Achievements/CriteriaHandler.cs +++ b/Source/Game/Achievements/CriteriaHandler.cs @@ -2210,8 +2210,8 @@ namespace Game.Achievements return false; case CriteriaAdditionalCondition.ItemModifiedAppearance: // 200 { - var hasAppearance = referencePlayer.GetSession().GetCollectionMgr().HasItemAppearance(reqValue); - if (!hasAppearance.PermAppearance || hasAppearance.TempAppearance) + var (PermAppearance, TempAppearance) = referencePlayer.GetSession().GetCollectionMgr().HasItemAppearance(reqValue); + if (!PermAppearance || TempAppearance) return false; break; } diff --git a/Source/Game/AuctionHouse/AuctionManager.cs b/Source/Game/AuctionHouse/AuctionManager.cs index de584e162..a0464210e 100644 --- a/Source/Game/AuctionHouse/AuctionManager.cs +++ b/Source/Game/AuctionHouse/AuctionManager.cs @@ -135,17 +135,17 @@ namespace Game public string BuildAuctionWonMailBody(ObjectGuid guid, ulong bid, ulong buyout) { - return $"{guid.ToString()}:{bid}:{buyout}:0"; + return $"{guid}:{bid}:{buyout}:0"; } public string BuildAuctionSoldMailBody(ObjectGuid guid, ulong bid, ulong buyout, uint deposit, ulong consignment) { - return $"{guid.ToString()}:{bid}:{buyout}:{deposit}:{consignment}:0"; + return $"{guid}:{bid}:{buyout}:{deposit}:{consignment}:0"; } public string BuildAuctionInvoiceMailBody(ObjectGuid guid, ulong bid, ulong buyout, uint deposit, ulong consignment, uint moneyDelay, uint eta) { - return $"{guid.ToString()}:{bid}:{buyout}:{deposit}:{consignment}:{moneyDelay}:{eta}:0"; + return $"{guid}:{bid}:{buyout}:{deposit}:{consignment}:{moneyDelay}:{eta}:0"; } public void LoadAuctions() @@ -383,7 +383,7 @@ namespace Game else { // Expire any auctions that we couldn't get a deposit for - Log.outWarn(LogFilter.Auctionhouse, $"Player {playerGUID.ToString()} was offline, unable to retrieve deposit!"); + Log.outWarn(LogFilter.Auctionhouse, $"Player {playerGUID} was offline, unable to retrieve deposit!"); SQLTransaction trans = new SQLTransaction(); foreach (PendingAuctionInfo pendingAuction in pair.Value.Auctions) @@ -1350,13 +1350,13 @@ namespace Game public void SendAuctionWon(AuctionPosting auction, Player bidder, SQLTransaction trans) { - uint bidderAccId = 0; + uint bidderAccId; if (!bidder) bidder = Global.ObjAccessor.FindConnectedPlayer(auction.Bidder); // try lookup bidder when called from .Update // data for gm.log string bidderName = ""; - bool logGmTrade = false; + bool logGmTrade; if (bidder) { @@ -1528,7 +1528,6 @@ namespace Game AuctionHouseRecord _auctionHouse; SortedList _itemsByAuctionId = new SortedList(); // ordered for replicate - Dictionary _soldItemsById = new Dictionary(); SortedDictionary _buckets = new SortedDictionary();// ordered for search by itemid only Dictionary _commodityQuotes = new Dictionary(); @@ -1628,7 +1627,7 @@ namespace Game } // all (not optional<>) - auctionItem.DurationLeft = (int)Math.Max((EndTime - GameTime.GetGameTimeSystemPoint()).ToMilliseconds(), 0l); + auctionItem.DurationLeft = (int)Math.Max((EndTime - GameTime.GetGameTimeSystemPoint()).ToMilliseconds(), 0L); auctionItem.DeleteReason = 0; // SMSG_AUCTION_LIST_ITEMS_RESULT (only if owned) diff --git a/Source/Game/Chat/Commands/CharacterCommands.cs b/Source/Game/Chat/Commands/CharacterCommands.cs index 0a90609fa..20d16e715 100644 --- a/Source/Game/Chat/Commands/CharacterCommands.cs +++ b/Source/Game/Chat/Commands/CharacterCommands.cs @@ -327,7 +327,7 @@ namespace Game.Chat handler.SendSysMessage(CypherStrings.ChangeAccountSuccess, targetName, accountName); - string logString = $"changed ownership of player {targetName} ({targetGuid.ToString()}) from account {oldAccountId} to account {newAccountId}"; + string logString = $"changed ownership of player {targetName} ({targetGuid}) from account {oldAccountId} to account {newAccountId}"; WorldSession session = handler.GetSession(); if (session != null) { diff --git a/Source/Game/Chat/Commands/ReloadCommand.cs b/Source/Game/Chat/Commands/ReloadCommand.cs index b1d4dea74..9d947bf0e 100644 --- a/Source/Game/Chat/Commands/ReloadCommand.cs +++ b/Source/Game/Chat/Commands/ReloadCommand.cs @@ -211,7 +211,7 @@ namespace Game.Chat if (args.Empty()) return false; - uint entry = 0; + uint entry; while ((entry = args.NextUInt32()) != 0) { PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.SEL_CREATURE_TEMPLATE); diff --git a/Source/Game/DataStorage/DB2Manager.cs b/Source/Game/DataStorage/DB2Manager.cs index dcf5813dc..634809d2f 100644 --- a/Source/Game/DataStorage/DB2Manager.cs +++ b/Source/Game/DataStorage/DB2Manager.cs @@ -1722,8 +1722,7 @@ namespace Game.DataStorage public List GetSpellPowers(uint spellId, Difficulty difficulty = Difficulty.None) { - bool notUsed; - return GetSpellPowers(spellId, difficulty, out notUsed); + return GetSpellPowers(spellId, difficulty, out _); } public List GetSpellPowers(uint spellId, Difficulty difficulty, out bool hasDifficultyPowers) diff --git a/Source/Game/DungeonFinding/LFGManager.cs b/Source/Game/DungeonFinding/LFGManager.cs index 689a68286..34b7b03d5 100644 --- a/Source/Game/DungeonFinding/LFGManager.cs +++ b/Source/Game/DungeonFinding/LFGManager.cs @@ -1285,13 +1285,13 @@ namespace Game.DungeonFinding uint gDungeonId = GetDungeon(gguid); if (gDungeonId != dungeonId) { - Log.outDebug(LogFilter.Lfg, $"Group {gguid.ToString()} finished dungeon {dungeonId} but queued for {gDungeonId}. Ignoring"); + Log.outDebug(LogFilter.Lfg, $"Group {gguid} finished dungeon {dungeonId} but queued for {gDungeonId}. Ignoring"); return; } if (GetState(gguid) == LfgState.FinishedDungeon) // Shouldn't happen. Do not reward multiple times { - Log.outDebug(LogFilter.Lfg, $"Group {gguid.ToString()} already rewarded"); + Log.outDebug(LogFilter.Lfg, $"Group {gguid} already rewarded"); return; } @@ -1302,7 +1302,7 @@ namespace Game.DungeonFinding { if (GetState(guid) == LfgState.FinishedDungeon) { - Log.outDebug(LogFilter.Lfg, $"Group: {gguid.ToString()}, Player: {guid.ToString()} already rewarded"); + Log.outDebug(LogFilter.Lfg, $"Group: {gguid}, Player: {guid} already rewarded"); continue; } @@ -1318,14 +1318,14 @@ namespace Game.DungeonFinding if (dungeon == null || (dungeon.type != LfgType.RandomDungeon && !dungeon.seasonal)) { - Log.outDebug(LogFilter.Lfg, $"Group: {gguid.ToString()}, Player: {guid.ToString()} dungeon {rDungeonId} is not random or seasonal"); + Log.outDebug(LogFilter.Lfg, $"Group: {gguid}, Player: {guid} dungeon {rDungeonId} is not random or seasonal"); continue; } Player player = Global.ObjAccessor.FindPlayer(guid); if (!player || player.GetMap() != currMap) { - Log.outDebug(LogFilter.Lfg, $"Group: {gguid.ToString()}, Player: {guid.ToString()} not found in world"); + Log.outDebug(LogFilter.Lfg, $"Group: {gguid}, Player: {guid} not found in world"); continue; } @@ -1334,7 +1334,7 @@ namespace Game.DungeonFinding if (player.GetMapId() != mapId) { - Log.outDebug(LogFilter.Lfg, $"Group: {gguid.ToString()}, Player: {guid.ToString()} is in map {player.GetMapId()} and should be in {mapId} to get reward"); + Log.outDebug(LogFilter.Lfg, $"Group: {gguid}, Player: {guid} is in map {player.GetMapId()} and should be in {mapId} to get reward"); continue; } @@ -1366,7 +1366,7 @@ namespace Game.DungeonFinding // Give rewards string doneString = done ? "" : "not"; - Log.outDebug(LogFilter.Lfg, $"Group: {gguid.ToString()}, Player: {guid.ToString()} done dungeon {GetDungeon(gguid)}, {doneString} previously done."); + Log.outDebug(LogFilter.Lfg, $"Group: {gguid}, Player: {guid} done dungeon {GetDungeon(gguid)}, {doneString} previously done."); LfgPlayerRewardData data = new LfgPlayerRewardData(dungeon.Entry(), GetDungeon(gguid, false), done, quest); player.GetSession().SendLfgPlayerReward(data); } diff --git a/Source/Game/Entities/GameObject/GameObject.cs b/Source/Game/Entities/GameObject/GameObject.cs index 0c6ec2040..b5af97324 100644 --- a/Source/Game/Entities/GameObject/GameObject.cs +++ b/Source/Game/Entities/GameObject/GameObject.cs @@ -1429,7 +1429,7 @@ namespace Game.Entities var guid = ChairListSlots.LookupByKey(nearest_slot); if (!guid.IsEmpty()) { - guid = player.GetGUID(); //this slot in now used by player + ChairListSlots[nearest_slot] = player.GetGUID(); //this slot in now used by player player.TeleportTo(GetMapId(), x_lowest, y_lowest, GetPositionZ(), GetOrientation(), (TeleportToOptions.NotLeaveTransport | TeleportToOptions.NotLeaveCombat | TeleportToOptions.NotUnSummonPet)); player.SetStandState(UnitStandStateType.SitLowChair + (byte)info.Chair.chairheight); return; diff --git a/Source/Game/Entities/Item/Item.cs b/Source/Game/Entities/Item/Item.cs index 0775df9c2..8806a9296 100644 --- a/Source/Game/Entities/Item/Item.cs +++ b/Source/Game/Entities/Item/Item.cs @@ -1601,7 +1601,7 @@ namespace Game.Entities return 0; float qualityFactor = qualityPrice.Data; - float baseFactor = 0.0f; + float baseFactor; var inventoryType = proto.GetInventoryType(); @@ -2308,11 +2308,6 @@ namespace Game.Entities break; case ItemEnchantmentType.ArtifactPowerBonusRankByID: { - var indexItr = m_artifactPowerIdToIndex.LookupByKey(enchant.EffectArg[i]); - ushort index; - if (indexItr != 0) - index = indexItr; - ushort artifactPowerIndex = m_artifactPowerIdToIndex.LookupByKey(enchant.EffectArg[i]); if (artifactPowerIndex != 0) { @@ -2933,7 +2928,7 @@ namespace Game.Entities break; case ItemBonusType.Stat: { - uint statIndex = 0; + uint statIndex; for (statIndex = 0; statIndex < ItemConst.MaxStats; ++statIndex) if (ItemStatType[statIndex] == values[0] || ItemStatType[statIndex] == -1) break; diff --git a/Source/Game/Entities/Pet.cs b/Source/Game/Entities/Pet.cs index 61441cb47..89a129603 100644 --- a/Source/Game/Entities/Pet.cs +++ b/Source/Game/Entities/Pet.cs @@ -99,7 +99,7 @@ namespace Game.Entities ulong ownerid = owner.GetGUID().GetCounter(); - PreparedStatement stmt = null; + PreparedStatement stmt; if (petnumber != 0) { diff --git a/Source/Game/Entities/Player/CollectionManager.cs b/Source/Game/Entities/Player/CollectionManager.cs index 44e4122b2..a12438405 100644 --- a/Source/Game/Entities/Player/CollectionManager.cs +++ b/Source/Game/Entities/Player/CollectionManager.cs @@ -109,7 +109,7 @@ namespace Game.Entities public void SaveAccountToys(SQLTransaction trans) { - PreparedStatement stmt = null; + PreparedStatement stmt; foreach (var pair in _toys) { stmt = DB.Login.GetPreparedStatement(LoginStatements.REP_ACCOUNT_TOYS); diff --git a/Source/Game/Entities/Player/Player.DB.cs b/Source/Game/Entities/Player/Player.DB.cs index 640d614d8..75720b01d 100644 --- a/Source/Game/Entities/Player/Player.DB.cs +++ b/Source/Game/Entities/Player/Player.DB.cs @@ -217,7 +217,7 @@ namespace Game.Entities item = Bag.NewItemOrBag(proto); if (item.LoadFromDB(itemGuid, GetGUID(), fields, itemEntry)) { - PreparedStatement stmt = null; + PreparedStatement stmt; // Do not allow to have item limited to another map/zone in alive state if (IsAlive() && item.IsLimitedToAnotherMapOrZone(GetMapId(), zoneId)) @@ -349,7 +349,7 @@ namespace Game.Entities { if (mSkillStatus.Count >= SkillConst.MaxPlayerSkills) // client limit { - Log.outError(LogFilter.Player, $"Player::_LoadSkills: Player '{GetName()}' ({GetGUID().ToString()}) has more than {SkillConst.MaxPlayerSkills} skills."); + Log.outError(LogFilter.Player, $"Player::_LoadSkills: Player '{GetName()}' ({GetGUID()}) has more than {SkillConst.MaxPlayerSkills} skills."); break; } @@ -1235,7 +1235,7 @@ namespace Game.Entities ItemTemplate proto = Global.ObjectMgr.GetItemTemplate(itemEntry); if (proto == null) { - Log.outError(LogFilter.Player, $"Player {(player != null ? player.GetName() : "")} ({playerGuid.ToString()}) has unknown item in mailed items (GUID: {itemGuid} template: {itemEntry}) in mail ({mailId}), deleted."); + Log.outError(LogFilter.Player, $"Player {(player != null ? player.GetName() : "")} ({playerGuid}) has unknown item in mailed items (GUID: {itemGuid} template: {itemEntry}) in mail ({mailId}), deleted."); SQLTransaction trans = new SQLTransaction(); @@ -1657,7 +1657,7 @@ namespace Game.Entities } void _SaveSpells(SQLTransaction trans) { - PreparedStatement stmt = null; + PreparedStatement stmt; foreach (var spell in m_spells.ToList()) { @@ -1767,7 +1767,7 @@ namespace Game.Entities } void _SaveCurrency(SQLTransaction trans) { - PreparedStatement stmt = null; + PreparedStatement stmt; foreach (var pair in _currencyStorage) { CurrencyTypesRecord entry = CliDB.CurrencyTypesStorage.LookupByKey(pair.Key); @@ -2180,7 +2180,7 @@ namespace Game.Entities foreach (var pair in _equipmentSets) { EquipmentSetInfo eqSet = pair.Value; - PreparedStatement stmt = null; + PreparedStatement stmt; byte j = 0; switch (eqSet.state) { @@ -2271,7 +2271,7 @@ namespace Game.Entities } void _SaveVoidStorage(SQLTransaction trans) { - PreparedStatement stmt = null; + PreparedStatement stmt; for (byte i = 0; i < SharedConst.VoidStorageMaxSlot; ++i) { if (_voidStorageItems[i] == null) // unused item @@ -2307,7 +2307,7 @@ namespace Game.Entities } void _SaveCUFProfiles(SQLTransaction trans) { - PreparedStatement stmt = null; + PreparedStatement stmt; ulong lowGuid = GetGUID().GetCounter(); for (byte i = 0; i < PlayerConst.MaxCUFProfiles; ++i) @@ -3144,7 +3144,7 @@ namespace Game.Entities stmt.AddValue(0, GetGUID().GetCounter()); characterTransaction.Append(stmt); - float finiteAlways(float f) { return !float.IsInfinity(f) ? f : 0.0f; }; + static float finiteAlways(float f) { return !float.IsInfinity(f) ? f : 0.0f; }; if (create) { diff --git a/Source/Game/Entities/Player/Player.Talents.cs b/Source/Game/Entities/Player/Player.Talents.cs index bafe4b12f..54c3deeff 100644 --- a/Source/Game/Entities/Player/Player.Talents.cs +++ b/Source/Game/Entities/Player/Player.Talents.cs @@ -593,14 +593,14 @@ namespace Game.Entities PvpTalentRecord talentInfo = CliDB.PvpTalentStorage.LookupByKey(pvpTalents[slot]); if (talentInfo == null) { - Log.outError(LogFilter.Player, $"Player.SendTalentsInfoData: Player '{GetName()}' ({GetGUID().ToString()}) has unknown pvp talent id: {pvpTalents[slot]}"); + Log.outError(LogFilter.Player, $"Player.SendTalentsInfoData: Player '{GetName()}' ({GetGUID()}) has unknown pvp talent id: {pvpTalents[slot]}"); continue; } SpellInfo spellEntry = Global.SpellMgr.GetSpellInfo(talentInfo.SpellID); if (spellEntry == null) { - Log.outError(LogFilter.Player, $"Player.SendTalentsInfoData: Player '{GetName()}' ({GetGUID().ToString()}) has unknown pvp talent spell: {talentInfo.SpellID}"); + Log.outError(LogFilter.Player, $"Player.SendTalentsInfoData: Player '{GetName()}' ({GetGUID()}) has unknown pvp talent spell: {talentInfo.SpellID}"); continue; } diff --git a/Source/Game/Game.csproj b/Source/Game/Game.csproj index 61028b248..e51725593 100644 --- a/Source/Game/Game.csproj +++ b/Source/Game/Game.csproj @@ -4,7 +4,7 @@ netstandard2.1 x64 true - 7.3 + 8.0 diff --git a/Source/Game/Globals/ObjectManager.cs b/Source/Game/Globals/ObjectManager.cs index fff450972..d38956e42 100644 --- a/Source/Game/Globals/ObjectManager.cs +++ b/Source/Game/Globals/ObjectManager.cs @@ -841,7 +841,7 @@ namespace Game WorldLocation loc = new WorldLocation(result.Read(1), result.Read(2), result.Read(3), result.Read(4), result.Read(5)); if (!GridDefines.IsValidMapCoord(loc)) { - Log.outError(LogFilter.Sql, $"World location (ID: {id}) has a invalid position MapID: {loc.GetMapId()} {loc.ToString()}, skipped"); + Log.outError(LogFilter.Sql, $"World location (ID: {id}) has a invalid position MapID: {loc.GetMapId()} {loc}, skipped"); continue; } @@ -3452,10 +3452,8 @@ namespace Game if (WorldConfig.GetBoolValue(WorldCfg.CalculateCreatureZoneAreaData)) { - uint zoneId = 0; - uint areaId = 0; PhasingHandler.InitDbVisibleMapId(phaseShift, data.terrainSwapMap); - Global.MapMgr.GetZoneAndAreaId(phaseShift, out zoneId, out areaId, data.mapid, data.posX, data.posY, data.posZ); + Global.MapMgr.GetZoneAndAreaId(phaseShift, out uint zoneId, out uint areaId, data.mapid, data.posX, data.posY, data.posZ); PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_ZONE_AREA_DATA); stmt.AddValue(0, zoneId); @@ -4164,10 +4162,8 @@ namespace Game if (WorldConfig.GetBoolValue(WorldCfg.CalculateGameobjectZoneAreaData)) { - uint zoneId = 0; - uint areaId = 0; PhasingHandler.InitDbVisibleMapId(phaseShift, data.terrainSwapMap); - Global.MapMgr.GetZoneAndAreaId(phaseShift, out zoneId, out areaId, data.mapid, data.posX, data.posY, data.posZ); + Global.MapMgr.GetZoneAndAreaId(phaseShift, out uint zoneId, out uint areaId, data.mapid, data.posX, data.posY, data.posZ); PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_GAMEOBJECT_ZONE_AREA_DATA); stmt.AddValue(0, zoneId); @@ -9518,7 +9514,7 @@ namespace Game TaxiNodesRecord node = CliDB.TaxiNodesStorage.LookupByKey(id); if (node != null) { - uint mount_entry = 0; + uint mount_entry; if (team == Team.Alliance) mount_entry = node.MountCreatureID[1]; else diff --git a/Source/Game/Handlers/AuctionHandler.cs b/Source/Game/Handlers/AuctionHandler.cs index 548192e30..cbb210f17 100644 --- a/Source/Game/Handlers/AuctionHandler.cs +++ b/Source/Game/Handlers/AuctionHandler.cs @@ -41,7 +41,7 @@ namespace Game Creature creature = GetPlayer().GetNPCIfCanInteractWith(browseQuery.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None); if (creature == null) { - Log.outError(LogFilter.Network, $"WORLD: HandleAuctionListItems - {browseQuery.Auctioneer.ToString()} not found or you can't interact with him."); + Log.outError(LogFilter.Network, $"WORLD: HandleAuctionListItems - {browseQuery.Auctioneer} not found or you can't interact with him."); return; } @@ -51,7 +51,7 @@ namespace Game AuctionHouseObject auctionHouse = Global.AuctionHouseMgr.GetAuctionsMap(creature.GetFaction()); - Log.outDebug(LogFilter.Auctionhouse, $"Auctionhouse search ({browseQuery.Auctioneer.ToString()}), searchedname: {browseQuery.Name}, levelmin: {browseQuery.MinLevel}, levelmax: {browseQuery.MaxLevel}, filters: {browseQuery.Filters}"); + Log.outDebug(LogFilter.Auctionhouse, $"Auctionhouse search ({browseQuery.Auctioneer}), searchedname: {browseQuery.Name}, levelmin: {browseQuery.MinLevel}, levelmax: {browseQuery.MaxLevel}, filters: {browseQuery.Filters}"); Optional classFilters = new Optional(); @@ -97,7 +97,7 @@ namespace Game Creature creature = GetPlayer().GetNPCIfCanInteractWith(cancelCommoditiesPurchase.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None); if (creature == null) { - Log.outError(LogFilter.Network, $"WORLD: HandleAuctionListItems - {cancelCommoditiesPurchase.Auctioneer.ToString()} not found or you can't interact with him."); + Log.outError(LogFilter.Network, $"WORLD: HandleAuctionListItems - {cancelCommoditiesPurchase.Auctioneer} not found or you can't interact with him."); return; } @@ -119,7 +119,7 @@ namespace Game Creature creature = GetPlayer().GetNPCIfCanInteractWith(confirmCommoditiesPurchase.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None); if (creature == null) { - Log.outError(LogFilter.Network, $"WORLD: HandleAuctionListItems - {confirmCommoditiesPurchase.Auctioneer.ToString()} not found or you can't interact with him."); + Log.outError(LogFilter.Network, $"WORLD: HandleAuctionListItems - {confirmCommoditiesPurchase.Auctioneer} not found or you can't interact with him."); return; } @@ -154,7 +154,7 @@ namespace Game Creature unit = GetPlayer().GetNPCIfCanInteractWith(hello.Guid, NPCFlags.Auctioneer, NPCFlags2.None); if (!unit) { - Log.outDebug(LogFilter.Network, $"WORLD: HandleAuctionHelloOpcode - {hello.Guid.ToString()} not found or you can't interact with him."); + Log.outDebug(LogFilter.Network, $"WORLD: HandleAuctionHelloOpcode - {hello.Guid} not found or you can't interact with him."); return; } @@ -175,7 +175,7 @@ namespace Game Creature creature = GetPlayer().GetNPCIfCanInteractWith(listBidderItems.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None); if (!creature) { - Log.outDebug(LogFilter.Network, $"WORLD: HandleAuctionListBidderItems - {listBidderItems.Auctioneer.ToString()} not found or you can't interact with him."); + Log.outDebug(LogFilter.Network, $"WORLD: HandleAuctionListBidderItems - {listBidderItems.Auctioneer} not found or you can't interact with him."); return; } @@ -203,7 +203,7 @@ namespace Game Creature creature = GetPlayer().GetNPCIfCanInteractWith(listBucketsByBucketKeys.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None); if (creature == null) { - Log.outError(LogFilter.Network, $"WORLD: HandleAuctionListItems - {listBucketsByBucketKeys.Auctioneer.ToString()} not found or you can't interact with him."); + Log.outError(LogFilter.Network, $"WORLD: HandleAuctionListItems - {listBucketsByBucketKeys.Auctioneer} not found or you can't interact with him."); return; } @@ -234,7 +234,7 @@ namespace Game Creature creature = GetPlayer().GetNPCIfCanInteractWith(listItemsByBucketKey.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None); if (creature == null) { - Log.outError(LogFilter.Network, $"WORLD: HandleAuctionListItemsByBucketKey - {listItemsByBucketKey.Auctioneer.ToString()} not found or you can't interact with him."); + Log.outError(LogFilter.Network, $"WORLD: HandleAuctionListItemsByBucketKey - {listItemsByBucketKey.Auctioneer} not found or you can't interact with him."); return; } @@ -266,7 +266,7 @@ namespace Game Creature creature = GetPlayer().GetNPCIfCanInteractWith(listItemsByItemID.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None); if (creature == null) { - Log.outError(LogFilter.Network, $"WORLD: HandleAuctionListItemsByItemID - {listItemsByItemID.Auctioneer.ToString()} not found or you can't interact with him."); + Log.outError(LogFilter.Network, $"WORLD: HandleAuctionListItemsByItemID - {listItemsByItemID.Auctioneer} not found or you can't interact with him."); return; } @@ -298,7 +298,7 @@ namespace Game Creature creature = GetPlayer().GetNPCIfCanInteractWith(listOwnerItems.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None); if (!creature) { - Log.outDebug(LogFilter.Network, $"WORLD: HandleAuctionListOwnerItems - {listOwnerItems.Auctioneer.ToString()} not found or you can't interact with him."); + Log.outDebug(LogFilter.Network, $"WORLD: HandleAuctionListOwnerItems - {listOwnerItems.Auctioneer} not found or you can't interact with him."); return; } @@ -325,7 +325,7 @@ namespace Game Creature creature = GetPlayer().GetNPCIfCanInteractWith(placeBid.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None); if (!creature) { - Log.outDebug(LogFilter.Network, $"WORLD: HandleAuctionPlaceBid - {placeBid.Auctioneer.ToString()} not found or you can't interact with him."); + Log.outDebug(LogFilter.Network, $"WORLD: HandleAuctionPlaceBid - {placeBid.Auctioneer} not found or you can't interact with him."); return; } @@ -455,7 +455,7 @@ namespace Game Creature creature = GetPlayer().GetNPCIfCanInteractWith(removeItem.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None); if (!creature) { - Log.outDebug(LogFilter.Network, $"WORLD: HandleAuctionRemoveItem - {removeItem.Auctioneer.ToString()} not found or you can't interact with him."); + Log.outDebug(LogFilter.Network, $"WORLD: HandleAuctionRemoveItem - {removeItem.Auctioneer} not found or you can't interact with him."); return; } @@ -489,7 +489,7 @@ namespace Game { SendAuctionCommandResult(0, AuctionCommand.Cancel, AuctionResult.DatabaseError, throttle.DelayUntilNext); //this code isn't possible ... maybe there should be assert - Log.outError(LogFilter.Network, $"CHEATER: {player.GetGUID().ToString()} tried to cancel auction (id: {removeItem.AuctionID}) of another player or auction is null"); + Log.outError(LogFilter.Network, $"CHEATER: {player.GetGUID()} tried to cancel auction (id: {removeItem.AuctionID}) of another player or auction is null"); return; } @@ -517,7 +517,7 @@ namespace Game Creature creature = GetPlayer().GetNPCIfCanInteractWith(replicateItems.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None); if (!creature) { - Log.outError(LogFilter.Network, $"WORLD: HandleReplicateItems - {replicateItems.Auctioneer.ToString()} not found or you can't interact with him."); + Log.outError(LogFilter.Network, $"WORLD: HandleReplicateItems - {replicateItems.Auctioneer} not found or you can't interact with him."); return; } @@ -546,7 +546,7 @@ namespace Game if (sellCommodity.UnitPrice == 0 || sellCommodity.UnitPrice > PlayerConst.MaxMoneyAmount) { - Log.outError(LogFilter.Network, $"WORLD: HandleAuctionSellItem - Player {_player.GetName()} ({_player.GetGUID().ToString()}) attempted to sell item with invalid price."); + Log.outError(LogFilter.Network, $"WORLD: HandleAuctionSellItem - Player {_player.GetName()} ({_player.GetGUID()}) attempted to sell item with invalid price."); SendAuctionCommandResult(0, AuctionCommand.SellItem, AuctionResult.DatabaseError, throttle.DelayUntilNext); return; } @@ -561,7 +561,7 @@ namespace Game Creature creature = GetPlayer().GetNPCIfCanInteractWith(sellCommodity.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None); if (creature == null) { - Log.outError(LogFilter.Network, $"WORLD: HandleAuctionListItems - {sellCommodity.Auctioneer.ToString()} not found or you can't interact with him."); + Log.outError(LogFilter.Network, $"WORLD: HandleAuctionListItems - {sellCommodity.Auctioneer} not found or you can't interact with him."); return; } @@ -569,7 +569,7 @@ namespace Game AuctionHouseRecord auctionHouseEntry = Global.AuctionHouseMgr.GetAuctionHouseEntry(creature.GetFaction(), ref houseId); if (auctionHouseEntry == null) { - Log.outError(LogFilter.Network, $"WORLD: HandleAuctionSellItem - Unit ({sellCommodity.Auctioneer.ToString()}) has wrong faction."); + Log.outError(LogFilter.Network, $"WORLD: HandleAuctionSellItem - Unit ({sellCommodity.Auctioneer}) has wrong faction."); return; } @@ -771,7 +771,7 @@ namespace Game if (sellItem.MinBid > PlayerConst.MaxMoneyAmount || sellItem.BuyoutPrice > PlayerConst.MaxMoneyAmount) { - Log.outError(LogFilter.Network, $"WORLD: HandleAuctionSellItem - Player {_player.GetName()} ({_player.GetGUID().ToString()}) attempted to sell item with higher price than max gold amount."); + Log.outError(LogFilter.Network, $"WORLD: HandleAuctionSellItem - Player {_player.GetName()} ({_player.GetGUID()}) attempted to sell item with higher price than max gold amount."); SendAuctionCommandResult(0, AuctionCommand.SellItem, AuctionResult.Inventory, throttle.DelayUntilNext, InventoryResult.TooMuchGold); return; } @@ -862,8 +862,8 @@ namespace Game auction.Items.Add(item); - Log.outInfo(LogFilter.Network, $"CMSG_AuctionAction.SellItem: {_player.GetGUID().ToString()} {_player.GetName()} is selling item {item.GetGUID().ToString()} {item.GetTemplate().GetName()} " + - $"to auctioneer {creature.GetGUID().ToString()} with count {item.GetCount()} with initial bid {sellItem.MinBid} with buyout {sellItem.BuyoutPrice} and with time {auctionTime.TotalSeconds} " + + Log.outInfo(LogFilter.Network, $"CMSG_AuctionAction.SellItem: {_player.GetGUID()} {_player.GetName()} is selling item {item.GetGUID()} {item.GetTemplate().GetName()} " + + $"to auctioneer {creature.GetGUID()} with count {item.GetCount()} with initial bid {sellItem.MinBid} with buyout {sellItem.BuyoutPrice} and with time {auctionTime.TotalSeconds} " + $"(in sec) in auctionhouse {auctionHouse.GetAuctionHouseId()}"); // Add to pending auctions, or fail with insufficient funds error diff --git a/Source/Game/Handlers/BattleGroundHandler.cs b/Source/Game/Handlers/BattleGroundHandler.cs index 85b6094a8..3312dce7c 100644 --- a/Source/Game/Handlers/BattleGroundHandler.cs +++ b/Source/Game/Handlers/BattleGroundHandler.cs @@ -60,7 +60,7 @@ namespace Game if (battlemasterJoin.QueueIDs.Empty()) { - Log.outError(LogFilter.Network, $"Battleground: no bgtype received. possible cheater? {_player.GetGUID().ToString()}"); + Log.outError(LogFilter.Network, $"Battleground: no bgtype received. possible cheater? {_player.GetGUID()}"); return; } diff --git a/Source/Game/Handlers/CharacterHandler.cs b/Source/Game/Handlers/CharacterHandler.cs index 84f74e533..710813822 100644 --- a/Source/Game/Handlers/CharacterHandler.cs +++ b/Source/Game/Handlers/CharacterHandler.cs @@ -1399,7 +1399,7 @@ namespace Game if (!CliDB.ItemModifiedAppearanceStorage.ContainsKey(saveEquipmentSet.Set.Appearances[i])) return; - (bool hasAppearance, bool isTemporary) = GetCollectionMgr().HasItemAppearance((uint)saveEquipmentSet.Set.Appearances[i]); + (bool hasAppearance, _) = GetCollectionMgr().HasItemAppearance((uint)saveEquipmentSet.Set.Appearances[i]); if (!hasAppearance) return; } diff --git a/Source/Game/Handlers/ItemHandler.cs b/Source/Game/Handlers/ItemHandler.cs index e191bf6bc..bbba4f9b3 100644 --- a/Source/Game/Handlers/ItemHandler.cs +++ b/Source/Game/Handlers/ItemHandler.cs @@ -1097,7 +1097,7 @@ namespace Game Item item = _player.GetItemByGuid(removeNewItem.ItemGuid); if (!item) { - Log.outDebug(LogFilter.Network, $"WorldSession.HandleRemoveNewItem: Item ({removeNewItem.ItemGuid.ToString()}) not found for {GetPlayerInfo()}!"); + Log.outDebug(LogFilter.Network, $"WorldSession.HandleRemoveNewItem: Item ({removeNewItem.ItemGuid}) not found for {GetPlayerInfo()}!"); return; } diff --git a/Source/Game/Handlers/MailHandler.cs b/Source/Game/Handlers/MailHandler.cs index 386cb6609..c3ad1b583 100644 --- a/Source/Game/Handlers/MailHandler.cs +++ b/Source/Game/Handlers/MailHandler.cs @@ -144,7 +144,7 @@ namespace Game byte mailsCount = 0; //do not allow to send to one player more than 100 mails byte receiverLevel = 0; uint receiverAccountId = 0; - uint receiverBnetAccountId = 0; + uint receiverBnetAccountId; if (receiver) { diff --git a/Source/Game/Handlers/MovementHandler.cs b/Source/Game/Handlers/MovementHandler.cs index 43897563e..87b1389c9 100644 --- a/Source/Game/Handlers/MovementHandler.cs +++ b/Source/Game/Handlers/MovementHandler.cs @@ -630,7 +630,7 @@ namespace Game // prevent tampered movement data if (moveApplyMovementForceAck.Ack.Status.Guid != mover.GetGUID()) { - Log.outError(LogFilter.Network, $"HandleMoveApplyMovementForceAck: guid error, expected {mover.GetGUID().ToString()}, got {moveApplyMovementForceAck.Ack.Status.Guid.ToString()}"); + Log.outError(LogFilter.Network, $"HandleMoveApplyMovementForceAck: guid error, expected {mover.GetGUID()}, got {moveApplyMovementForceAck.Ack.Status.Guid}"); return; } @@ -652,7 +652,7 @@ namespace Game // prevent tampered movement data if (moveRemoveMovementForceAck.Ack.Status.Guid != mover.GetGUID()) { - Log.outError(LogFilter.Network, $"HandleMoveRemoveMovementForceAck: guid error, expected {mover.GetGUID().ToString()}, got {moveRemoveMovementForceAck.Ack.Status.Guid.ToString()}"); + Log.outError(LogFilter.Network, $"HandleMoveRemoveMovementForceAck: guid error, expected {mover.GetGUID()}, got {moveRemoveMovementForceAck.Ack.Status.Guid}"); return; } diff --git a/Source/Game/Handlers/NPCHandler.cs b/Source/Game/Handlers/NPCHandler.cs index ca75f1459..7e59efc48 100644 --- a/Source/Game/Handlers/NPCHandler.cs +++ b/Source/Game/Handlers/NPCHandler.cs @@ -59,7 +59,7 @@ namespace Game Creature npc = GetPlayer().GetNPCIfCanInteractWith(packet.Unit, NPCFlags.Trainer, NPCFlags2.None); if (!npc) { - Log.outDebug(LogFilter.Network, $"WorldSession.SendTrainerList - {packet.Unit.ToString()} not found or you can not interact with him."); + Log.outDebug(LogFilter.Network, $"WorldSession.SendTrainerList - {packet.Unit} not found or you can not interact with him."); return; } @@ -79,7 +79,7 @@ namespace Game Trainer trainer = Global.ObjectMgr.GetTrainer(trainerId); if (trainer == null) { - Log.outDebug(LogFilter.Network, $"WORLD: SendTrainerList - trainer spells not found for trainer {npc.GetGUID().ToString()} id {trainerId}"); + Log.outDebug(LogFilter.Network, $"WORLD: SendTrainerList - trainer spells not found for trainer {npc.GetGUID()} id {trainerId}"); return; } @@ -95,7 +95,7 @@ namespace Game Creature npc = _player.GetNPCIfCanInteractWith(packet.TrainerGUID, NPCFlags.Trainer, NPCFlags2.None); if (npc == null) { - Log.outDebug(LogFilter.Network, $"WORLD: HandleTrainerBuySpell - {packet.TrainerGUID.ToString()} not found or you can not interact with him."); + Log.outDebug(LogFilter.Network, $"WORLD: HandleTrainerBuySpell - {packet.TrainerGUID} not found or you can not interact with him."); return; } diff --git a/Source/Game/Handlers/SpellHandler.cs b/Source/Game/Handlers/SpellHandler.cs index 9b06097b1..7134a05c6 100644 --- a/Source/Game/Handlers/SpellHandler.cs +++ b/Source/Game/Handlers/SpellHandler.cs @@ -209,7 +209,7 @@ namespace Game if (result.IsEmpty()) { - Log.outError(LogFilter.Network, $"Wrapped item {item.GetGUID().ToString()} don't have record in character_gifts table and will deleted"); + Log.outError(LogFilter.Network, $"Wrapped item {item.GetGUID()} don't have record in character_gifts table and will deleted"); GetPlayer().DestroyItem(item.GetBagSlot(), item.GetSlot(), true); return; } diff --git a/Source/Game/Loot/Loot.cs b/Source/Game/Loot/Loot.cs index 0618329a9..19a42d305 100644 --- a/Source/Game/Loot/Loot.cs +++ b/Source/Game/Loot/Loot.cs @@ -469,8 +469,7 @@ namespace Game.Loots public LootItem LootItemInSlot(uint lootSlot, Player player) { - NotNormalLootItem qitem, ffaitem, conditem; - return LootItemInSlot(lootSlot, player, out qitem, out ffaitem, out conditem); + return LootItemInSlot(lootSlot, player, out _, out _, out _); } public LootItem LootItemInSlot(uint lootSlot, Player player, out NotNormalLootItem qitem, out NotNormalLootItem ffaitem, out NotNormalLootItem conditem) { diff --git a/Source/Game/Movement/MoveSplineInit.cs b/Source/Game/Movement/MoveSplineInit.cs index 0b69b7319..e79c28dc6 100644 --- a/Source/Game/Movement/MoveSplineInit.cs +++ b/Source/Game/Movement/MoveSplineInit.cs @@ -328,7 +328,6 @@ namespace Game.Movement if (transport != null) { float unused = 0.0f; // need reference - transport.CalculatePassengerOffset(ref x, ref y, ref z, ref unused); } } diff --git a/Source/Game/Network/WorldSocket.cs b/Source/Game/Network/WorldSocket.cs index 5fcc03b0a..38fa62dfe 100644 --- a/Source/Game/Network/WorldSocket.cs +++ b/Source/Game/Network/WorldSocket.cs @@ -156,14 +156,14 @@ namespace Game.Network if (!_worldCrypt.Decrypt(ref data, header.Tag)) { - Log.outError(LogFilter.Network, $"WorldSocket.ReadHandler(): client {GetRemoteIpAddress().ToString()} failed to decrypt packet (size: {header.Size})"); + Log.outError(LogFilter.Network, $"WorldSocket.ReadHandler(): client {GetRemoteIpAddress()} failed to decrypt packet (size: {header.Size})"); return; } WorldPacket worldPacket = new WorldPacket(data); if (worldPacket.GetOpcode() >= (int)ClientOpcodes.Max) { - Log.outError(LogFilter.Network, $"WorldSocket.ReadHandler(): client {GetRemoteIpAddress().ToString()} sent wrong opcode (opcode: {worldPacket.GetOpcode()})"); + Log.outError(LogFilter.Network, $"WorldSocket.ReadHandler(): client {GetRemoteIpAddress()} sent wrong opcode (opcode: {worldPacket.GetOpcode()})"); return; } @@ -395,7 +395,7 @@ namespace Game.Network if (buildInfo == null) { SendAuthResponseError(BattlenetRpcErrorCode.BadVersion); - Log.outError(LogFilter.Network, $"WorldSocket.HandleAuthSessionCallback: Missing auth seed for realm build {Global.WorldMgr.GetRealm().Build} ({GetRemoteIpAddress().ToString()})."); + Log.outError(LogFilter.Network, $"WorldSocket.HandleAuthSessionCallback: Missing auth seed for realm build {Global.WorldMgr.GetRealm().Build} ({GetRemoteIpAddress()})."); CloseSocket(); return; } diff --git a/Source/Game/Quest/QuestObjectiveCriteriaManager.cs b/Source/Game/Quest/QuestObjectiveCriteriaManager.cs index 9b6d3e7bc..25c68699d 100644 --- a/Source/Game/Quest/QuestObjectiveCriteriaManager.cs +++ b/Source/Game/Quest/QuestObjectiveCriteriaManager.cs @@ -312,7 +312,7 @@ namespace Game public override string GetOwnerInfo() { - return $"{_owner.GetGUID().ToString()} {_owner.GetName()}"; + return $"{_owner.GetGUID()} {_owner.GetName()}"; } public override List GetCriteriaByType(CriteriaTypes type) diff --git a/Source/Game/Server/WorldConfig.cs b/Source/Game/Server/WorldConfig.cs index b5bc0e32e..22c3d6614 100644 --- a/Source/Game/Server/WorldConfig.cs +++ b/Source/Game/Server/WorldConfig.cs @@ -40,7 +40,7 @@ namespace Game Values[WorldCfg.EnableSinfoLogin] = GetDefaultValue("Server.LoginInfo", 0); // Read all rates from the config file - void SetRegenRate(WorldCfg rate, string configKey) + static void SetRegenRate(WorldCfg rate, string configKey) { Values[rate] = GetDefaultValue(configKey, 1.0f); if ((float) Values[rate] < 0.0f) diff --git a/Source/Game/Server/WorldManager.cs b/Source/Game/Server/WorldManager.cs index 37f1b3d20..6069edf95 100644 --- a/Source/Game/Server/WorldManager.cs +++ b/Source/Game/Server/WorldManager.cs @@ -1444,7 +1444,7 @@ namespace Game return BanReturn.Exists; SQLResult resultAccounts; - PreparedStatement stmt = null; + PreparedStatement stmt; // Update the database with ban information switch (mode) @@ -1522,7 +1522,7 @@ namespace Game /// Remove a ban from an account or IP address public bool RemoveBanAccount(BanMode mode, string nameOrIP) { - PreparedStatement stmt = null; + PreparedStatement stmt; if (mode == BanMode.IP) { stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_IP_NOT_BANNED); diff --git a/Source/Game/Spells/SpellManager.cs b/Source/Game/Spells/SpellManager.cs index ec6d21727..b2bfe728e 100644 --- a/Source/Game/Spells/SpellManager.cs +++ b/Source/Game/Spells/SpellManager.cs @@ -1972,7 +1972,6 @@ namespace Game.Entities Dictionary loadData = new Dictionary(); Dictionary battlePetSpeciesByCreature = new Dictionary(); - Dictionary battlePetSpeciesBySpellId = new Dictionary(); foreach (var battlePetSpecies in CliDB.BattlePetSpeciesStorage.Values) if (battlePetSpecies.CreatureID != 0) battlePetSpeciesByCreature[battlePetSpecies.CreatureID] = battlePetSpecies; diff --git a/Source/Scripts/Scripts.csproj b/Source/Scripts/Scripts.csproj index 818fc7602..7cf909d6b 100644 --- a/Source/Scripts/Scripts.csproj +++ b/Source/Scripts/Scripts.csproj @@ -2,6 +2,7 @@ netstandard2.1 x64 + 8.0 diff --git a/Source/WorldServer/WorldServer.csproj b/Source/WorldServer/WorldServer.csproj index 42c98386e..88c15ae51 100644 --- a/Source/WorldServer/WorldServer.csproj +++ b/Source/WorldServer/WorldServer.csproj @@ -5,6 +5,7 @@ netcoreapp3.1 Blue.ico WorldServer.Server + 8.0