Core/Instances: Delete InstanceSaveMgr and replace most of its uses with new InstanceLockMgr

Port From (https://github.com/TrinityCore/TrinityCore/commit/9b924522d0549dd67b10e2cbdfc20297dd21e182)
This commit is contained in:
hondacrx
2022-10-04 10:57:04 -04:00
parent 793cf91a24
commit 66c7047a29
27 changed files with 186 additions and 1545 deletions
@@ -879,28 +879,6 @@ namespace Game.Chat
return true;
}
if (difficulty == 0)
{
handler.SendSysMessage($"Resetting all difficulties for '{mEntry.MapName[handler.GetSessionDbcLocale()]}'.");
foreach (var diff in CliDB.DifficultyStorage.Values)
{
if (Global.DB2Mgr.GetMapDifficultyData(mapId, (Difficulty)diff.Id) != null)
{
handler.SendSysMessage($"Resetting difficulty {diff.Id} for '{mEntry.MapName[handler.GetSessionDbcLocale()]}'.");
Global.InstanceSaveMgr.ForceGlobalReset(mapId, (Difficulty)diff.Id);
}
}
}
else if (mEntry.IsNonRaidDungeon() && difficulty == (int)Difficulty.Normal)
{
handler.SendSysMessage($"'{mEntry.MapName[handler.GetSessionDbcLocale()]}' does not have any permanent saves for difficulty {(Difficulty)difficulty}.");
}
else
{
handler.SendSysMessage($"Resetting difficulty {(Difficulty)difficulty} for '{mEntry.MapName[handler.GetSessionDbcLocale()]}'.");
Global.InstanceSaveMgr.ForceGlobalReset(mapId, (Difficulty)difficulty);
}
return true;
}