Fix loading into world.

This commit is contained in:
hondacrx
2021-04-13 01:23:54 -04:00
parent b0e28e1478
commit 99350e6dc6
22 changed files with 78 additions and 171 deletions
@@ -34,16 +34,20 @@ namespace Game.DataStorage
void WriteRecord(uint id, Locale locale, ByteBuffer buffer); void WriteRecord(uint id, Locale locale, ByteBuffer buffer);
void EraseRecord(uint id); void EraseRecord(uint id);
string GetName();
} }
[Serializable] [Serializable]
public class DB6Storage<T> : Dictionary<uint, T>, IDB2Storage where T : new() public class DB6Storage<T> : Dictionary<uint, T>, IDB2Storage where T : new()
{ {
WDCHeader _header; WDCHeader _header;
string _tableName;
public void LoadData(WDCHeader header, BitSet availableDb2Locales, HotfixStatements preparedStatement, HotfixStatements preparedStatementLocale) public void LoadData(WDCHeader header, BitSet availableDb2Locales, HotfixStatements preparedStatement, HotfixStatements preparedStatementLocale)
{ {
_header = header; _header = header;
_tableName = typeof(T).Name;
SQLResult result = DB.Hotfix.Query(DB.Hotfix.GetPreparedStatement(preparedStatement)); SQLResult result = DB.Hotfix.Query(DB.Hotfix.GetPreparedStatement(preparedStatement));
if (!result.IsEmpty()) if (!result.IsEmpty())
@@ -384,5 +388,10 @@ namespace Game.DataStorage
} }
public uint GetTableHash() { return _header.TableHash; } public uint GetTableHash() { return _header.TableHash; }
public string GetName()
{
return _tableName;
}
} }
} }
+4 -80
View File
@@ -54,8 +54,6 @@ namespace Game.DataStorage
foreach (var areaGroupMember in CliDB.AreaGroupMemberStorage.Values) foreach (var areaGroupMember in CliDB.AreaGroupMemberStorage.Values)
_areaGroupMembers.Add(areaGroupMember.AreaGroupID, areaGroupMember.AreaID); _areaGroupMembers.Add(areaGroupMember.AreaGroupID, areaGroupMember.AreaID);
CliDB.AreaGroupMemberStorage.Clear();
foreach (ArtifactPowerRecord artifactPower in CliDB.ArtifactPowerStorage.Values) foreach (ArtifactPowerRecord artifactPower in CliDB.ArtifactPowerStorage.Values)
_artifactPowers.Add(artifactPower.ArtifactID, artifactPower); _artifactPowers.Add(artifactPower.ArtifactID, artifactPower);
@@ -65,23 +63,15 @@ namespace Game.DataStorage
_artifactPowerLinks.Add(artifactPowerLink.PowerB, artifactPowerLink.PowerA); _artifactPowerLinks.Add(artifactPowerLink.PowerB, artifactPowerLink.PowerA);
} }
CliDB.ArtifactPowerLinkStorage.Clear();
foreach (ArtifactPowerRankRecord artifactPowerRank in CliDB.ArtifactPowerRankStorage.Values) foreach (ArtifactPowerRankRecord artifactPowerRank in CliDB.ArtifactPowerRankStorage.Values)
_artifactPowerRanks[Tuple.Create(artifactPowerRank.ArtifactPowerID, artifactPowerRank.RankIndex)] = artifactPowerRank; _artifactPowerRanks[Tuple.Create(artifactPowerRank.ArtifactPowerID, artifactPowerRank.RankIndex)] = artifactPowerRank;
CliDB.ArtifactPowerRankStorage.Clear();
foreach (AzeriteEmpoweredItemRecord azeriteEmpoweredItem in CliDB.AzeriteEmpoweredItemStorage.Values) foreach (AzeriteEmpoweredItemRecord azeriteEmpoweredItem in CliDB.AzeriteEmpoweredItemStorage.Values)
_azeriteEmpoweredItems[azeriteEmpoweredItem.ItemID] = azeriteEmpoweredItem; _azeriteEmpoweredItems[azeriteEmpoweredItem.ItemID] = azeriteEmpoweredItem;
CliDB.AzeriteEmpoweredItemStorage.Clear();
foreach (AzeriteEssencePowerRecord azeriteEssencePower in CliDB.AzeriteEssencePowerStorage.Values) foreach (AzeriteEssencePowerRecord azeriteEssencePower in CliDB.AzeriteEssencePowerStorage.Values)
_azeriteEssencePowersByIdAndRank[((uint)azeriteEssencePower.AzeriteEssenceID, (uint)azeriteEssencePower.Tier)] = azeriteEssencePower; _azeriteEssencePowersByIdAndRank[((uint)azeriteEssencePower.AzeriteEssenceID, (uint)azeriteEssencePower.Tier)] = azeriteEssencePower;
CliDB.AzeriteEssencePowerStorage.Clear();
foreach (AzeriteItemMilestonePowerRecord azeriteItemMilestonePower in CliDB.AzeriteItemMilestonePowerStorage.Values) foreach (AzeriteItemMilestonePowerRecord azeriteItemMilestonePower in CliDB.AzeriteItemMilestonePowerStorage.Values)
_azeriteItemMilestonePowers.Add(azeriteItemMilestonePower); _azeriteItemMilestonePowers.Add(azeriteItemMilestonePower);
@@ -103,8 +93,6 @@ namespace Game.DataStorage
if (CliDB.AzeritePowerStorage.ContainsKey(azeritePowerSetMember.AzeritePowerID)) if (CliDB.AzeritePowerStorage.ContainsKey(azeritePowerSetMember.AzeritePowerID))
_azeritePowers.Add(azeritePowerSetMember.AzeritePowerSetID, azeritePowerSetMember); _azeritePowers.Add(azeritePowerSetMember.AzeritePowerSetID, azeritePowerSetMember);
CliDB.AzeritePowerSetMemberStorage.Clear();
foreach (AzeriteTierUnlockRecord azeriteTierUnlock in CliDB.AzeriteTierUnlockStorage.Values) foreach (AzeriteTierUnlockRecord azeriteTierUnlock in CliDB.AzeriteTierUnlockStorage.Values)
{ {
var key = (azeriteTierUnlock.AzeriteTierUnlockSetID, (ItemContext)azeriteTierUnlock.ItemCreationContext); var key = (azeriteTierUnlock.AzeriteTierUnlockSetID, (ItemContext)azeriteTierUnlock.ItemCreationContext);
@@ -143,8 +131,6 @@ namespace Game.DataStorage
foreach (var chrClasses in CliDB.ChrClassesXPowerTypesStorage.Values) foreach (var chrClasses in CliDB.ChrClassesXPowerTypesStorage.Values)
powers.Add(chrClasses); powers.Add(chrClasses);
CliDB.ChrClassesXPowerTypesStorage.Clear();
powers.Sort(new ChrClassesXPowerTypesRecordComparer()); powers.Sort(new ChrClassesXPowerTypesRecordComparer());
foreach (var power in powers) foreach (var power in powers)
{ {
@@ -264,21 +250,15 @@ namespace Game.DataStorage
_curvePoints.Add(curvePoint.CurveID, curvePoint); _curvePoints.Add(curvePoint.CurveID, curvePoint);
} }
CliDB.CurvePointStorage.Clear();
foreach (var key in _curvePoints.Keys.ToList()) foreach (var key in _curvePoints.Keys.ToList())
_curvePoints[key] = _curvePoints[key].OrderBy(point => point.OrderIndex).ToList(); _curvePoints[key] = _curvePoints[key].OrderBy(point => point.OrderIndex).ToList();
foreach (EmotesTextSoundRecord emoteTextSound in CliDB.EmotesTextSoundStorage.Values) foreach (EmotesTextSoundRecord emoteTextSound in CliDB.EmotesTextSoundStorage.Values)
_emoteTextSounds[Tuple.Create((uint)emoteTextSound.EmotesTextId, emoteTextSound.RaceId, emoteTextSound.SexId, emoteTextSound.ClassId)] = emoteTextSound; _emoteTextSounds[Tuple.Create(emoteTextSound.EmotesTextId, emoteTextSound.RaceId, emoteTextSound.SexId, emoteTextSound.ClassId)] = emoteTextSound;
CliDB.EmotesTextSoundStorage.Clear();
foreach (ExpectedStatRecord expectedStat in CliDB.ExpectedStatStorage.Values) foreach (ExpectedStatRecord expectedStat in CliDB.ExpectedStatStorage.Values)
_expectedStatsByLevel[Tuple.Create(expectedStat.Lvl, expectedStat.ExpansionID)] = expectedStat; _expectedStatsByLevel[Tuple.Create(expectedStat.Lvl, expectedStat.ExpansionID)] = expectedStat;
CliDB.ExpectedStatStorage.Clear();
foreach (FactionRecord faction in CliDB.FactionStorage.Values) foreach (FactionRecord faction in CliDB.FactionStorage.Values)
if (faction.ParentFactionID != 0) if (faction.ParentFactionID != 0)
_factionTeams.Add(faction.ParentFactionID, faction.Id); _factionTeams.Add(faction.ParentFactionID, faction.Id);
@@ -296,41 +276,27 @@ namespace Game.DataStorage
foreach (HeirloomRecord heirloom in CliDB.HeirloomStorage.Values) foreach (HeirloomRecord heirloom in CliDB.HeirloomStorage.Values)
_heirlooms[heirloom.ItemID] = heirloom; _heirlooms[heirloom.ItemID] = heirloom;
CliDB.HeirloomStorage.Clear();
foreach (GlyphBindableSpellRecord glyphBindableSpell in CliDB.GlyphBindableSpellStorage.Values) foreach (GlyphBindableSpellRecord glyphBindableSpell in CliDB.GlyphBindableSpellStorage.Values)
_glyphBindableSpells.Add((uint)glyphBindableSpell.GlyphPropertiesID, (uint)glyphBindableSpell.SpellID); _glyphBindableSpells.Add(glyphBindableSpell.GlyphPropertiesID, (uint)glyphBindableSpell.SpellID);
CliDB.GlyphBindableSpellStorage.Clear();
foreach (GlyphRequiredSpecRecord glyphRequiredSpec in CliDB.GlyphRequiredSpecStorage.Values) foreach (GlyphRequiredSpecRecord glyphRequiredSpec in CliDB.GlyphRequiredSpecStorage.Values)
_glyphRequiredSpecs.Add(glyphRequiredSpec.GlyphPropertiesID, glyphRequiredSpec.ChrSpecializationID); _glyphRequiredSpecs.Add(glyphRequiredSpec.GlyphPropertiesID, glyphRequiredSpec.ChrSpecializationID);
CliDB.GlyphRequiredSpecStorage.Clear();
foreach (var bonus in CliDB.ItemBonusStorage.Values) foreach (var bonus in CliDB.ItemBonusStorage.Values)
_itemBonusLists.Add(bonus.ParentItemBonusListID, bonus); _itemBonusLists.Add(bonus.ParentItemBonusListID, bonus);
CliDB.ItemBonusStorage.Clear();
foreach (ItemBonusListLevelDeltaRecord itemBonusListLevelDelta in CliDB.ItemBonusListLevelDeltaStorage.Values) foreach (ItemBonusListLevelDeltaRecord itemBonusListLevelDelta in CliDB.ItemBonusListLevelDeltaStorage.Values)
_itemLevelDeltaToBonusListContainer[itemBonusListLevelDelta.ItemLevelDelta] = itemBonusListLevelDelta.Id; _itemLevelDeltaToBonusListContainer[itemBonusListLevelDelta.ItemLevelDelta] = itemBonusListLevelDelta.Id;
CliDB.ItemBonusListLevelDeltaStorage.Clear();
foreach (var bonusTreeNode in CliDB.ItemBonusTreeNodeStorage.Values) foreach (var bonusTreeNode in CliDB.ItemBonusTreeNodeStorage.Values)
_itemBonusTrees.Add(bonusTreeNode.ParentItemBonusTreeID, bonusTreeNode); _itemBonusTrees.Add(bonusTreeNode.ParentItemBonusTreeID, bonusTreeNode);
CliDB.ItemBonusTreeNodeStorage.Clear();
foreach (ItemChildEquipmentRecord itemChildEquipment in CliDB.ItemChildEquipmentStorage.Values) foreach (ItemChildEquipmentRecord itemChildEquipment in CliDB.ItemChildEquipmentStorage.Values)
{ {
//ASSERT(_itemChildEquipment.find(itemChildEquipment.ParentItemID) == _itemChildEquipment.end(), "Item must have max 1 child item."); //ASSERT(_itemChildEquipment.find(itemChildEquipment.ParentItemID) == _itemChildEquipment.end(), "Item must have max 1 child item.");
_itemChildEquipment[itemChildEquipment.ParentItemID] = itemChildEquipment; _itemChildEquipment[itemChildEquipment.ParentItemID] = itemChildEquipment;
} }
CliDB.ItemChildEquipmentStorage.Clear();
foreach (ItemClassRecord itemClass in CliDB.ItemClassStorage.Values) foreach (ItemClassRecord itemClass in CliDB.ItemClassStorage.Values)
{ {
//ASSERT(itemClass.ClassID < _itemClassByOldEnum.size()); //ASSERT(itemClass.ClassID < _itemClassByOldEnum.size());
@@ -338,20 +304,14 @@ namespace Game.DataStorage
_itemClassByOldEnum[itemClass.ClassID] = itemClass; _itemClassByOldEnum[itemClass.ClassID] = itemClass;
} }
CliDB.ItemClassStorage.Clear();
foreach (ItemCurrencyCostRecord itemCurrencyCost in CliDB.ItemCurrencyCostStorage.Values) foreach (ItemCurrencyCostRecord itemCurrencyCost in CliDB.ItemCurrencyCostStorage.Values)
_itemsWithCurrencyCost.Add(itemCurrencyCost.ItemID); _itemsWithCurrencyCost.Add(itemCurrencyCost.ItemID);
CliDB.ItemCurrencyCostStorage.Clear();
foreach (ItemLimitCategoryConditionRecord condition in CliDB.ItemLimitCategoryConditionStorage.Values) foreach (ItemLimitCategoryConditionRecord condition in CliDB.ItemLimitCategoryConditionStorage.Values)
_itemCategoryConditions.Add(condition.ParentItemLimitCategoryID, condition); _itemCategoryConditions.Add(condition.ParentItemLimitCategoryID, condition);
foreach (ItemLevelSelectorQualityRecord itemLevelSelectorQuality in CliDB.ItemLevelSelectorQualityStorage.Values) foreach (ItemLevelSelectorQualityRecord itemLevelSelectorQuality in CliDB.ItemLevelSelectorQualityStorage.Values)
_itemLevelQualitySelectorQualities.Add((uint)itemLevelSelectorQuality.ParentILSQualitySetID, itemLevelSelectorQuality); _itemLevelQualitySelectorQualities.Add(itemLevelSelectorQuality.ParentILSQualitySetID, itemLevelSelectorQuality);
CliDB.ItemLevelSelectorQualityStorage.Clear();
foreach (var appearanceMod in CliDB.ItemModifiedAppearanceStorage.Values) foreach (var appearanceMod in CliDB.ItemModifiedAppearanceStorage.Values)
{ {
@@ -362,18 +322,12 @@ namespace Game.DataStorage
foreach (ItemSetSpellRecord itemSetSpell in CliDB.ItemSetSpellStorage.Values) foreach (ItemSetSpellRecord itemSetSpell in CliDB.ItemSetSpellStorage.Values)
_itemSetSpells.Add(itemSetSpell.ItemSetID, itemSetSpell); _itemSetSpells.Add(itemSetSpell.ItemSetID, itemSetSpell);
CliDB.ItemSetSpellStorage.Clear();
foreach (var itemSpecOverride in CliDB.ItemSpecOverrideStorage.Values) foreach (var itemSpecOverride in CliDB.ItemSpecOverrideStorage.Values)
_itemSpecOverrides.Add(itemSpecOverride.ItemID, itemSpecOverride); _itemSpecOverrides.Add(itemSpecOverride.ItemID, itemSpecOverride);
CliDB.ItemSpecOverrideStorage.Clear();
foreach (var itemBonusTreeAssignment in CliDB.ItemXBonusTreeStorage.Values) foreach (var itemBonusTreeAssignment in CliDB.ItemXBonusTreeStorage.Values)
_itemToBonusTree.Add(itemBonusTreeAssignment.ItemID, itemBonusTreeAssignment.ItemBonusTreeID); _itemToBonusTree.Add(itemBonusTreeAssignment.ItemID, itemBonusTreeAssignment.ItemBonusTreeID);
CliDB.ItemXBonusTreeStorage.Clear();
foreach (var pair in _azeriteEmpoweredItems) foreach (var pair in _azeriteEmpoweredItems)
LoadAzeriteEmpoweredItemUnlockMappings(azeriteUnlockMappings, pair.Key); LoadAzeriteEmpoweredItemUnlockMappings(azeriteUnlockMappings, pair.Key);
@@ -386,8 +340,6 @@ namespace Game.DataStorage
} }
_mapDifficulties[0][0] = _mapDifficulties[1][0]; // map 0 is missing from MapDifficulty.dbc so we cheat a bit _mapDifficulties[0][0] = _mapDifficulties[1][0]; // map 0 is missing from MapDifficulty.dbc so we cheat a bit
CliDB.MapDifficultyStorage.Clear();
List<MapDifficultyXConditionRecord> mapDifficultyConditions = new(); List<MapDifficultyXConditionRecord> mapDifficultyConditions = new();
foreach (var mapDifficultyCondition in CliDB.MapDifficultyXConditionStorage.Values) foreach (var mapDifficultyCondition in CliDB.MapDifficultyXConditionStorage.Values)
mapDifficultyConditions.Add(mapDifficultyCondition); mapDifficultyConditions.Add(mapDifficultyCondition);
@@ -407,16 +359,12 @@ namespace Game.DataStorage
foreach (MountTypeXCapabilityRecord mountTypeCapability in CliDB.MountTypeXCapabilityStorage.Values) foreach (MountTypeXCapabilityRecord mountTypeCapability in CliDB.MountTypeXCapabilityStorage.Values)
_mountCapabilitiesByType.Add(mountTypeCapability.MountTypeID, mountTypeCapability); _mountCapabilitiesByType.Add(mountTypeCapability.MountTypeID, mountTypeCapability);
CliDB.MountTypeXCapabilityStorage.Clear();
foreach (var key in _mountCapabilitiesByType.Keys) foreach (var key in _mountCapabilitiesByType.Keys)
_mountCapabilitiesByType[key].Sort(new MountTypeXCapabilityRecordComparer()); _mountCapabilitiesByType[key].Sort(new MountTypeXCapabilityRecordComparer());
foreach (MountXDisplayRecord mountDisplay in CliDB.MountXDisplayStorage.Values) foreach (MountXDisplayRecord mountDisplay in CliDB.MountXDisplayStorage.Values)
_mountDisplays.Add(mountDisplay.MountID, mountDisplay); _mountDisplays.Add(mountDisplay.MountID, mountDisplay);
CliDB.MountXDisplayStorage.Clear();
foreach (var entry in CliDB.NameGenStorage.Values) foreach (var entry in CliDB.NameGenStorage.Values)
{ {
if (!_nameGenData.ContainsKey(entry.RaceID)) if (!_nameGenData.ContainsKey(entry.RaceID))
@@ -429,8 +377,6 @@ namespace Game.DataStorage
_nameGenData[entry.RaceID][entry.Sex].Add(entry); _nameGenData[entry.RaceID][entry.Sex].Add(entry);
} }
CliDB.NameGenStorage.Clear();
foreach (var namesProfanity in CliDB.NamesProfanityStorage.Values) foreach (var namesProfanity in CliDB.NamesProfanityStorage.Values)
{ {
Cypher.Assert(namesProfanity.Language < (int)Locale.Total || namesProfanity.Language == -1); Cypher.Assert(namesProfanity.Language < (int)Locale.Total || namesProfanity.Language == -1);
@@ -446,13 +392,9 @@ namespace Game.DataStorage
} }
} }
CliDB.NamesProfanityStorage.Clear();
foreach (var namesReserved in CliDB.NamesReservedStorage.Values) foreach (var namesReserved in CliDB.NamesReservedStorage.Values)
_nameValidators[(int)Locale.Total].Add(namesReserved.Name); _nameValidators[(int)Locale.Total].Add(namesReserved.Name);
CliDB.NamesReservedStorage.Clear();
foreach (var namesReserved in CliDB.NamesReservedLocaleStorage.Values) foreach (var namesReserved in CliDB.NamesReservedLocaleStorage.Values)
{ {
Cypher.Assert(!Convert.ToBoolean(namesReserved.LocaleMask & ~((1 << (int)Locale.Total) - 1))); Cypher.Assert(!Convert.ToBoolean(namesReserved.LocaleMask & ~((1 << (int)Locale.Total) - 1)));
@@ -465,7 +407,6 @@ namespace Game.DataStorage
_nameValidators[i].Add(namesReserved.Name); _nameValidators[i].Add(namesReserved.Name);
} }
} }
CliDB.NamesReservedLocaleStorage.Clear();
foreach (var group in CliDB.PhaseXPhaseGroupStorage.Values) foreach (var group in CliDB.PhaseXPhaseGroupStorage.Values)
{ {
@@ -473,7 +414,6 @@ namespace Game.DataStorage
if (phase != null) if (phase != null)
_phasesByGroup.Add(group.PhaseGroupID, phase.Id); _phasesByGroup.Add(group.PhaseGroupID, phase.Id);
} }
CliDB.PhaseXPhaseGroupStorage.Clear();
foreach (PowerTypeRecord powerType in CliDB.PowerTypeStorage.Values) foreach (PowerTypeRecord powerType in CliDB.PowerTypeStorage.Values)
{ {
@@ -509,18 +449,12 @@ namespace Game.DataStorage
_questPackages[questPackageItem.PackageID].Item2.Add(questPackageItem); _questPackages[questPackageItem.PackageID].Item2.Add(questPackageItem);
} }
CliDB.QuestPackageItemStorage.Clear();
foreach (RewardPackXCurrencyTypeRecord rewardPackXCurrencyType in CliDB.RewardPackXCurrencyTypeStorage.Values) foreach (RewardPackXCurrencyTypeRecord rewardPackXCurrencyType in CliDB.RewardPackXCurrencyTypeStorage.Values)
_rewardPackCurrencyTypes.Add(rewardPackXCurrencyType.RewardPackID, rewardPackXCurrencyType); _rewardPackCurrencyTypes.Add(rewardPackXCurrencyType.RewardPackID, rewardPackXCurrencyType);
CliDB.RewardPackXCurrencyTypeStorage.Clear();
foreach (RewardPackXItemRecord rewardPackXItem in CliDB.RewardPackXItemStorage.Values) foreach (RewardPackXItemRecord rewardPackXItem in CliDB.RewardPackXItemStorage.Values)
_rewardPackItems.Add(rewardPackXItem.RewardPackID, rewardPackXItem); _rewardPackItems.Add(rewardPackXItem.RewardPackID, rewardPackXItem);
CliDB.RewardPackXItemStorage.Clear();
foreach (SkillLineRecord skill in CliDB.SkillLineStorage.Values) foreach (SkillLineRecord skill in CliDB.SkillLineStorage.Values)
{ {
if (skill.ParentSkillLineID != 0) if (skill.ParentSkillLineID != 0)
@@ -539,8 +473,6 @@ namespace Game.DataStorage
foreach (var specSpells in CliDB.SpecializationSpellsStorage.Values) foreach (var specSpells in CliDB.SpecializationSpellsStorage.Values)
_specializationSpellsBySpec.Add(specSpells.SpecID, specSpells); _specializationSpellsBySpec.Add(specSpells.SpecID, specSpells);
CliDB.SpecializationSpellsStorage.Clear();
foreach (SpecSetMemberRecord specSetMember in CliDB.SpecSetMemberStorage.Values) foreach (SpecSetMemberRecord specSetMember in CliDB.SpecSetMemberStorage.Values)
_specsBySpecSet.Add(Tuple.Create((int)specSetMember.SpecSetID, (uint)specSetMember.ChrSpecializationID)); _specsBySpecSet.Add(Tuple.Create((int)specSetMember.SpecSetID, (uint)specSetMember.ChrSpecializationID));
@@ -550,8 +482,6 @@ namespace Game.DataStorage
foreach (SpellProcsPerMinuteModRecord ppmMod in CliDB.SpellProcsPerMinuteModStorage.Values) foreach (SpellProcsPerMinuteModRecord ppmMod in CliDB.SpellProcsPerMinuteModStorage.Values)
_spellProcsPerMinuteMods.Add(ppmMod.SpellProcsPerMinuteID, ppmMod); _spellProcsPerMinuteMods.Add(ppmMod.SpellProcsPerMinuteID, ppmMod);
CliDB.SpellProcsPerMinuteModStorage.Clear();
for (var i = 0; i < (int)Class.Max; ++i) for (var i = 0; i < (int)Class.Max; ++i)
{ {
_talentsByPosition[i] = new List<TalentRecord>[PlayerConst.MaxTalentTiers][]; _talentsByPosition[i] = new List<TalentRecord>[PlayerConst.MaxTalentTiers][];
@@ -575,8 +505,6 @@ namespace Game.DataStorage
foreach (ToyRecord toy in CliDB.ToyStorage.Values) foreach (ToyRecord toy in CliDB.ToyStorage.Values)
_toys.Add(toy.ItemID); _toys.Add(toy.ItemID);
CliDB.ToyStorage.Clear();
foreach (TransmogSetItemRecord transmogSetItem in CliDB.TransmogSetItemStorage.Values) foreach (TransmogSetItemRecord transmogSetItem in CliDB.TransmogSetItemStorage.Values)
{ {
TransmogSetRecord set = CliDB.TransmogSetStorage.LookupByKey(transmogSetItem.TransmogSetID); TransmogSetRecord set = CliDB.TransmogSetStorage.LookupByKey(transmogSetItem.TransmogSetID);
@@ -587,8 +515,6 @@ namespace Game.DataStorage
_transmogSetItemsByTransmogSet.Add(transmogSetItem.TransmogSetID, transmogSetItem); _transmogSetItemsByTransmogSet.Add(transmogSetItem.TransmogSetID, transmogSetItem);
} }
CliDB.TransmogSetItemStorage.Clear();
for (var i = 0; i < (int)UiMapSystem.Max; ++i) for (var i = 0; i < (int)UiMapSystem.Max; ++i)
{ {
_uiMapAssignmentByMap[i] = new MultiMap<int, UiMapAssignmentRecord>(); _uiMapAssignmentByMap[i] = new MultiMap<int, UiMapAssignmentRecord>();
@@ -696,8 +622,6 @@ namespace Game.DataStorage
foreach (WMOAreaTableRecord entry in CliDB.WMOAreaTableStorage.Values) foreach (WMOAreaTableRecord entry in CliDB.WMOAreaTableStorage.Values)
_wmoAreaTableLookup[Tuple.Create((short)entry.WmoID, (sbyte)entry.NameSetID, entry.WmoGroupID)] = entry; _wmoAreaTableLookup[Tuple.Create((short)entry.WmoID, (sbyte)entry.NameSetID, entry.WmoGroupID)] = entry;
CliDB.WMOAreaTableStorage.Clear();
} }
public IDB2Storage GetStorage(uint type) public IDB2Storage GetStorage(uint type)
@@ -776,7 +700,7 @@ namespace Game.DataStorage
var storeItr = _storage.LookupByKey(tableHash); var storeItr = _storage.LookupByKey(tableHash);
if (storeItr != null) if (storeItr != null)
{ {
Log.outError(LogFilter.Sql, $"Table hash 0x{tableHash:X} points to a loaded DB2 store {storeItr.GetType().Name}, fill related table instead of hotfix_blob"); Log.outError(LogFilter.Sql, $"Table hash 0x{tableHash:X} points to a loaded DB2 store {storeItr.GetName()}, fill related table instead of hotfix_blob");
continue; continue;
} }
@@ -3037,7 +3037,7 @@ namespace Game.Entities
data.WriteUInt32(Field_14); data.WriteUInt32(Field_14);
data.WriteUInt32(Field_18); data.WriteUInt32(Field_18);
data.WriteUInt32(PvpTierID); data.WriteUInt32(PvpTierID);
data.WriteBit(Field_20); data.WriteBit((bool)Field_20);
data.FlushBits(); data.FlushBits();
} }
+1 -1
View File
@@ -408,7 +408,7 @@ namespace Game
var rewards = Global.GuildMgr.GetGuildRewards(); var rewards = Global.GuildMgr.GetGuildRewards();
GuildRewardList rewardList = new(); GuildRewardList rewardList = new();
rewardList.Version = (uint)Time.UnixTime; rewardList.Version = Time.UnixTime;
for (int i = 0; i < rewards.Count; i++) for (int i = 0; i < rewards.Count; i++)
{ {
+1 -1
View File
@@ -28,7 +28,7 @@ namespace Game
void HandleServerTimeOffsetRequest(ServerTimeOffsetRequest packet) void HandleServerTimeOffsetRequest(ServerTimeOffsetRequest packet)
{ {
ServerTimeOffset response = new(); ServerTimeOffset response = new();
response.Time = (uint)Time.UnixTime; response.Time = Time.UnixTime;
SendPacket(response); SendPacket(response);
} }
@@ -75,7 +75,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt32(Flags); _worldPacket.WriteUInt32(Flags);
_worldPacket.WritePackedTime(CurrentTime); _worldPacket.WritePackedTime(CurrentTime);
_worldPacket.WriteUInt32(ElapsedTime); _worldPacket.WriteUInt32(ElapsedTime);
_worldPacket.WriteUInt32(CreationTime); _worldPacket.WriteInt64(CreationTime);
_worldPacket.WriteBit(RafAcceptanceID.HasValue); _worldPacket.WriteBit(RafAcceptanceID.HasValue);
_worldPacket.FlushBits(); _worldPacket.FlushBits();
@@ -89,7 +89,7 @@ namespace Game.Networking.Packets
public uint Flags; public uint Flags;
public long CurrentTime; public long CurrentTime;
public uint ElapsedTime; public uint ElapsedTime;
public uint CreationTime; public long CreationTime;
public Optional<ulong> RafAcceptanceID; public Optional<ulong> RafAcceptanceID;
} }
@@ -186,8 +186,8 @@ namespace Game.Networking.Packets
foreach (GuildCriteriaProgress progress in Progress) foreach (GuildCriteriaProgress progress in Progress)
{ {
_worldPacket.WriteUInt32(progress.CriteriaID); _worldPacket.WriteUInt32(progress.CriteriaID);
_worldPacket.WriteUInt32(progress.DateCreated); _worldPacket.WriteInt64(progress.DateCreated);
_worldPacket.WriteUInt32(progress.DateStarted); _worldPacket.WriteInt64(progress.DateStarted);
_worldPacket.WritePackedTime(progress.DateUpdated); _worldPacket.WritePackedTime(progress.DateUpdated);
_worldPacket.WriteUInt32(0); // this is a hack. this is a packed time written as int64 (progress.DateUpdated) _worldPacket.WriteUInt32(0); // this is a hack. this is a packed time written as int64 (progress.DateUpdated)
_worldPacket.WriteUInt64(progress.Quantity); _worldPacket.WriteUInt64(progress.Quantity);
@@ -356,8 +356,8 @@ namespace Game.Networking.Packets
public struct GuildCriteriaProgress public struct GuildCriteriaProgress
{ {
public uint CriteriaID; public uint CriteriaID;
public uint DateCreated; public long DateCreated;
public uint DateStarted; public long DateStarted;
public long DateUpdated; public long DateUpdated;
public ulong Quantity; public ulong Quantity;
public ObjectGuid PlayerGUID; public ObjectGuid PlayerGUID;
@@ -130,7 +130,7 @@ namespace Game.Networking.Packets
_worldPacket.WriteInt32(SuccessInfo.Value.AvailableClasses.Count); _worldPacket.WriteInt32(SuccessInfo.Value.AvailableClasses.Count);
_worldPacket.WriteInt32(SuccessInfo.Value.Templates.Count); _worldPacket.WriteInt32(SuccessInfo.Value.Templates.Count);
_worldPacket.WriteUInt32(SuccessInfo.Value.CurrencyID); _worldPacket.WriteUInt32(SuccessInfo.Value.CurrencyID);
_worldPacket.WriteUInt32(SuccessInfo.Value.Time); _worldPacket.WriteInt64(SuccessInfo.Value.Time);
foreach (var raceClassAvailability in SuccessInfo.Value.AvailableClasses) foreach (var raceClassAvailability in SuccessInfo.Value.AvailableClasses)
{ {
@@ -211,7 +211,7 @@ namespace Game.Networking.Packets
public uint VirtualRealmAddress; // a special identifier made from the Index, BattleGroup and Region. @todo implement public uint VirtualRealmAddress; // a special identifier made from the Index, BattleGroup and Region. @todo implement
public uint TimeSecondsUntilPCKick; // @todo research public uint TimeSecondsUntilPCKick; // @todo research
public uint CurrencyID; // this is probably used for the ingame shop. @todo implement public uint CurrencyID; // this is probably used for the ingame shop. @todo implement
public uint Time; public long Time;
public GameTime GameTimeInfo; public GameTime GameTimeInfo;
@@ -468,7 +468,7 @@ namespace Game.Networking.Packets
{ {
_worldPacket.WriteUInt32(MapID); _worldPacket.WriteUInt32(MapID);
_worldPacket.WriteUInt8((byte)State); _worldPacket.WriteUInt8((byte)State);
_worldPacket.WriteInt32((int)StartTime); _worldPacket.WriteInt64(StartTime);
_worldPacket.WriteInt32(Duration); _worldPacket.WriteInt32(Duration);
_worldPacket.WriteUInt8(ArenaFaction); _worldPacket.WriteUInt8(ArenaFaction);
_worldPacket.WriteUInt32(BattlemasterListID); _worldPacket.WriteUInt32(BattlemasterListID);
@@ -55,11 +55,11 @@ namespace Game.Networking.Packets
public override void Read() public override void Read()
{ {
Guid = _worldPacket.ReadPackedGuid(); Guid = _worldPacket.ReadPackedGuid();
LastUpdateID = _worldPacket.ReadUInt32(); LastUpdateID = _worldPacket.ReadInt64();
} }
public ObjectGuid Guid; public ObjectGuid Guid;
public uint LastUpdateID; public long LastUpdateID;
} }
public class BlackMarketRequestItemsResult : ServerPacket public class BlackMarketRequestItemsResult : ServerPacket
@@ -68,14 +68,14 @@ namespace Game.Networking.Packets
public override void Write() public override void Write()
{ {
_worldPacket.WriteInt32(LastUpdateID); _worldPacket.WriteInt64(LastUpdateID);
_worldPacket.WriteInt32(Items.Count); _worldPacket.WriteInt32(Items.Count);
foreach (BlackMarketItem item in Items) foreach (BlackMarketItem item in Items)
item.Write(_worldPacket); item.Write(_worldPacket);
} }
public int LastUpdateID; public long LastUpdateID;
public List<BlackMarketItem> Items = new(); public List<BlackMarketItem> Items = new();
} }
@@ -188,7 +188,7 @@ namespace Game.Networking.Packets
foreach (var visualItem in VisualItems) foreach (var visualItem in VisualItems)
visualItem.Write(data); visualItem.Write(data);
data.WriteUInt32((uint)LastPlayedTime); data.WriteInt64(LastPlayedTime);
data.WriteUInt16(SpecID); data.WriteUInt16(SpecID);
data.WriteUInt32(Unknown703); data.WriteUInt32(Unknown703);
data.WriteUInt32(LastLoginVersion); data.WriteUInt32(LastLoginVersion);
@@ -29,14 +29,14 @@ namespace Game.Networking.Packets
public override void Write() public override void Write()
{ {
_worldPacket.WritePackedGuid(PlayerGuid); _worldPacket.WritePackedGuid(PlayerGuid);
_worldPacket.WriteUInt32(ServerTime); _worldPacket.WriteInt64(ServerTime);
foreach (var accounttime in AccountTimes) foreach (var accounttime in AccountTimes)
_worldPacket.WriteUInt32(accounttime); _worldPacket.WriteInt64(accounttime);
} }
public ObjectGuid PlayerGuid; public ObjectGuid PlayerGuid;
public uint ServerTime = 0; public long ServerTime;
public Array<uint> AccountTimes = new((int)AccountDataTypes.Max); public Array<long> AccountTimes = new((int)AccountDataTypes.Max);
} }
public class ClientCacheVersion : ServerPacket public class ClientCacheVersion : ServerPacket
@@ -72,7 +72,7 @@ namespace Game.Networking.Packets
public override void Write() public override void Write()
{ {
_worldPacket.WritePackedGuid(Player); _worldPacket.WritePackedGuid(Player);
_worldPacket.WriteUInt32(Time); _worldPacket.WriteInt64(Time);
_worldPacket.WriteUInt32(Size); _worldPacket.WriteUInt32(Size);
_worldPacket.WriteBits(DataType, 3); _worldPacket.WriteBits(DataType, 3);
@@ -87,8 +87,8 @@ namespace Game.Networking.Packets
} }
public ObjectGuid Player; public ObjectGuid Player;
public uint Time = 0; // UnixTime public long Time; // UnixTime
public uint Size = 0; // decompressed size public uint Size; // decompressed size
public AccountDataTypes DataType = 0; public AccountDataTypes DataType = 0;
public ByteBuffer CompressedData; public ByteBuffer CompressedData;
} }
@@ -100,7 +100,7 @@ namespace Game.Networking.Packets
public override void Read() public override void Read()
{ {
PlayerGuid = _worldPacket.ReadPackedGuid(); PlayerGuid = _worldPacket.ReadPackedGuid();
Time = _worldPacket.ReadUInt32(); Time = _worldPacket.ReadInt64();
Size = _worldPacket.ReadUInt32(); Size = _worldPacket.ReadUInt32();
DataType = (AccountDataTypes)_worldPacket.ReadBits<uint>(3); DataType = (AccountDataTypes)_worldPacket.ReadBits<uint>(3);
@@ -112,7 +112,7 @@ namespace Game.Networking.Packets
} }
public ObjectGuid PlayerGuid; public ObjectGuid PlayerGuid;
public uint Time; // UnixTime public long Time; // UnixTime
public uint Size; // decompressed size public uint Size; // decompressed size
public AccountDataTypes DataType = 0; public AccountDataTypes DataType = 0;
public ByteBuffer CompressedData; public ByteBuffer CompressedData;
@@ -338,9 +338,9 @@ namespace Game.Networking.Packets
{ {
data.WriteUInt32(GarrPlotInstanceID); data.WriteUInt32(GarrPlotInstanceID);
data.WriteUInt32(GarrBuildingID); data.WriteUInt32(GarrBuildingID);
data.WriteUInt32((uint)TimeBuilt); data.WriteInt64(TimeBuilt);
data.WriteUInt32(CurrentGarSpecID); data.WriteUInt32(CurrentGarSpecID);
data.WriteUInt32((uint)TimeSpecCooldown); data.WriteInt64(TimeSpecCooldown);
data.WriteBit(Active); data.WriteBit(Active);
data.FlushBits(); data.FlushBits();
} }
@@ -371,8 +371,8 @@ namespace Game.Networking.Packets
data.WriteUInt32(ZoneSupportSpellID); data.WriteUInt32(ZoneSupportSpellID);
data.WriteUInt32(FollowerStatus); data.WriteUInt32(FollowerStatus);
data.WriteInt32(Health); data.WriteInt32(Health);
data .WriteInt8(BoardIndex); data.WriteInt8(BoardIndex);
data .WriteInt32(HealingTimestamp); data.WriteInt64(HealingTimestamp);
AbilityID.ForEach(ability => data.WriteUInt32(ability.Id)); AbilityID.ForEach(ability => data.WriteUInt32(ability.Id));
@@ -395,7 +395,7 @@ namespace Game.Networking.Packets
public uint ZoneSupportSpellID; public uint ZoneSupportSpellID;
public uint FollowerStatus; public uint FollowerStatus;
public int Health; public int Health;
public int HealingTimestamp; public long HealingTimestamp;
public sbyte BoardIndex; public sbyte BoardIndex;
public string CustomName = ""; public string CustomName = "";
} }
@@ -405,9 +405,9 @@ namespace Game.Networking.Packets
public void Write(WorldPacket data) public void Write(WorldPacket data)
{ {
data.WriteUInt64(DbID); data.WriteUInt64(DbID);
data.WriteUInt32((uint)OfferTime); data.WriteInt64(OfferTime);
data.WriteUInt32(OfferDuration); data.WriteUInt32(OfferDuration);
data.WriteUInt32((uint)StartTime); data.WriteInt64(StartTime);
data.WriteUInt32(TravelDuration); data.WriteUInt32(TravelDuration);
data.WriteUInt32(MissionDuration); data.WriteUInt32(MissionDuration);
data.WriteUInt32(MissionRecID); data.WriteUInt32(MissionRecID);
@@ -462,7 +462,7 @@ namespace Game.Networking.Packets
{ {
public void Write(WorldPacket data) public void Write(WorldPacket data)
{ {
data.WriteUInt32((uint)StartTime); data.WriteInt64(StartTime);
data.WriteUInt32(GarrMssnBonusAbilityID); data.WriteUInt32(GarrMssnBonusAbilityID);
} }
@@ -488,7 +488,7 @@ namespace Game.Networking.Packets
{ {
data.WriteInt32(GarrTalentID); data.WriteInt32(GarrTalentID);
data.WriteInt32(Rank); data.WriteInt32(Rank);
data.WriteUInt32((uint)ResearchStartTime); data.WriteInt64(ResearchStartTime);
data.WriteInt32(Flags); data.WriteInt32(Flags);
data.WriteBit(Socket.HasValue); data.WriteBit(Socket.HasValue);
data.FlushBits(); data.FlushBits();
@@ -152,10 +152,10 @@ namespace Game.Networking.Packets
public override void Read() public override void Read()
{ {
LastUpdate = _worldPacket.ReadUInt32(); LastUpdate = _worldPacket.ReadInt64();
} }
public uint LastUpdate; public long LastUpdate;
} }
class LFGuildRecruits : ServerPacket class LFGuildRecruits : ServerPacket
@@ -165,7 +165,7 @@ namespace Game.Networking.Packets
public override void Write() public override void Write()
{ {
_worldPacket.WriteInt32(Recruits.Count); _worldPacket.WriteInt32(Recruits.Count);
_worldPacket.WriteUInt32((uint)UpdateTime); _worldPacket.WriteInt64(UpdateTime);
foreach (LFGuildRecruitData recruit in Recruits) foreach (LFGuildRecruitData recruit in Recruits)
recruit.Write(_worldPacket); recruit.Write(_worldPacket);
} }
@@ -879,10 +879,10 @@ namespace Game.Networking.Packets
public override void Read() public override void Read()
{ {
CurrentVersion = _worldPacket.ReadUInt32(); CurrentVersion = _worldPacket.ReadInt64();
} }
public uint CurrentVersion; public long CurrentVersion;
} }
public class GuildRewardList : ServerPacket public class GuildRewardList : ServerPacket
@@ -894,7 +894,7 @@ namespace Game.Networking.Packets
public override void Write() public override void Write()
{ {
_worldPacket.WriteUInt32(Version); _worldPacket.WriteInt64(Version);
_worldPacket.WriteInt32(RewardItems.Count); _worldPacket.WriteInt32(RewardItems.Count);
foreach (var item in RewardItems) foreach (var item in RewardItems)
@@ -902,7 +902,7 @@ namespace Game.Networking.Packets
} }
public List<GuildRewardItem> RewardItems; public List<GuildRewardItem> RewardItems;
public uint Version; public long Version;
} }
public class GuildBankActivate : ClientPacket public class GuildBankActivate : ClientPacket
@@ -87,10 +87,10 @@ namespace Game.Networking.Packets
public override void Write() public override void Write()
{ {
_worldPacket.WriteUInt32(VirtualRealmAddress); _worldPacket.WriteUInt32(VirtualRealmAddress);
_worldPacket.WriteInt32(Hotfixes.Count); _worldPacket.WriteInt32(Hotfixes.Keys.Count);
foreach (var pair in Hotfixes) foreach (var key in Hotfixes.Keys)
_worldPacket.WriteInt32(pair.Key); _worldPacket.WriteInt32(key);
} }
public uint VirtualRealmAddress; public uint VirtualRealmAddress;
+3 -3
View File
@@ -758,7 +758,7 @@ namespace Game.Networking.Packets
RequesterGuid = data.ReadPackedGuid(); RequesterGuid = data.ReadPackedGuid();
Id = data.ReadUInt32(); Id = data.ReadUInt32();
Type = (RideType)data.ReadUInt32(); Type = (RideType)data.ReadUInt32();
Time = data.ReadInt32(); Time = data.ReadInt64();
} }
public void Write(WorldPacket data) public void Write(WorldPacket data)
@@ -766,13 +766,13 @@ namespace Game.Networking.Packets
data.WritePackedGuid(RequesterGuid); data.WritePackedGuid(RequesterGuid);
data.WriteUInt32(Id); data.WriteUInt32(Id);
data.WriteUInt32((uint)Type); data.WriteUInt32((uint)Type);
data.WriteInt32(Time); data.WriteInt64(Time);
} }
public ObjectGuid RequesterGuid; public ObjectGuid RequesterGuid;
public uint Id; public uint Id;
public RideType Type; public RideType Type;
public int Time; public long Time;
} }
public enum RideType public enum RideType
@@ -316,10 +316,10 @@ namespace Game.Networking.Packets
public override void Write() public override void Write()
{ {
_worldPacket.WriteUInt32(Time); _worldPacket.WriteInt64(Time);
} }
public uint Time; public long Time;
} }
public class TutorialFlags : ServerPacket public class TutorialFlags : ServerPacket
@@ -390,7 +390,7 @@ namespace Game.Networking.Packets
public override void Write() public override void Write()
{ {
_worldPacket.WriteUInt32((uint)CurrentTime); _worldPacket.WriteInt64(CurrentTime);
} }
public long CurrentTime; public long CurrentTime;
@@ -503,7 +503,7 @@ namespace Game.Networking.Packets
for (byte i = 0; i < SharedConst.MaxDeclinedNameCases; ++i) for (byte i = 0; i < SharedConst.MaxDeclinedNameCases; ++i)
_worldPacket.WriteString(DeclinedNames.name[i]); _worldPacket.WriteString(DeclinedNames.name[i]);
_worldPacket.WriteUInt32(Timestamp); _worldPacket.WriteInt64(Timestamp);
_worldPacket.WriteString(Name); _worldPacket.WriteString(Name);
} }
@@ -515,7 +515,7 @@ namespace Game.Networking.Packets
public bool HasDeclined; public bool HasDeclined;
public DeclinedName DeclinedNames = new(); public DeclinedName DeclinedNames = new();
public uint Timestamp; public long Timestamp;
public string Name = ""; public string Name = "";
} }
@@ -817,7 +817,7 @@ namespace Game.Networking.Packets
foreach (WorldQuestUpdateInfo worldQuestUpdate in WorldQuestUpdates) foreach (WorldQuestUpdateInfo worldQuestUpdate in WorldQuestUpdates)
{ {
_worldPacket.WriteInt32(worldQuestUpdate.LastUpdate); _worldPacket.WriteInt64(worldQuestUpdate.LastUpdate);
_worldPacket.WriteUInt32(worldQuestUpdate.QuestID); _worldPacket.WriteUInt32(worldQuestUpdate.QuestID);
_worldPacket.WriteUInt32(worldQuestUpdate.Timer); _worldPacket.WriteUInt32(worldQuestUpdate.Timer);
_worldPacket.WriteInt32(worldQuestUpdate.VariableID); _worldPacket.WriteInt32(worldQuestUpdate.VariableID);
@@ -1183,7 +1183,7 @@ namespace Game.Networking.Packets
struct WorldQuestUpdateInfo struct WorldQuestUpdateInfo
{ {
public WorldQuestUpdateInfo(int lastUpdate, uint questID, uint timer, int variableID, int value) public WorldQuestUpdateInfo(long lastUpdate, uint questID, uint timer, int variableID, int value)
{ {
LastUpdate = lastUpdate; LastUpdate = lastUpdate;
QuestID = questID; QuestID = questID;
@@ -1192,7 +1192,7 @@ namespace Game.Networking.Packets
Value = value; Value = value;
} }
public int LastUpdate; public long LastUpdate;
public uint QuestID; public uint QuestID;
public uint Timer; public uint Timer;
// WorldState // WorldState
@@ -61,7 +61,7 @@ namespace Game.Networking.Packets
foreach (var c in Cases) foreach (var c in Cases)
{ {
_worldPacket.WriteInt32(c.CaseID); _worldPacket.WriteInt32(c.CaseID);
_worldPacket.WriteUInt32(c.CaseOpened); _worldPacket.WriteInt64(c.CaseOpened);
_worldPacket.WriteInt32(c.CaseStatus); _worldPacket.WriteInt32(c.CaseStatus);
_worldPacket.WriteUInt16(c.CfgRealmID); _worldPacket.WriteUInt16(c.CfgRealmID);
_worldPacket.WriteUInt64(c.CharacterID); _worldPacket.WriteUInt64(c.CharacterID);
@@ -80,7 +80,7 @@ namespace Game.Networking.Packets
public struct GMTicketCase public struct GMTicketCase
{ {
public int CaseID; public int CaseID;
public uint CaseOpened; public long CaseOpened;
public int CaseStatus; public int CaseStatus;
public ushort CfgRealmID; public ushort CfgRealmID;
public ulong CharacterID; public ulong CharacterID;
@@ -215,18 +215,18 @@ namespace Game.Networking.Packets
public struct SupportTicketChatLine public struct SupportTicketChatLine
{ {
public uint Timestamp; public long Timestamp;
public string Text; public string Text;
public SupportTicketChatLine(WorldPacket data) public SupportTicketChatLine(WorldPacket data)
{ {
Timestamp = data.ReadUInt32(); Timestamp = data.ReadInt64();
Text = data.ReadString(data.ReadBits<uint>(12)); Text = data.ReadString(data.ReadBits<uint>(12));
} }
public SupportTicketChatLine(long timestamp, string text) public SupportTicketChatLine(long timestamp, string text)
{ {
Timestamp = (uint)timestamp; Timestamp = timestamp;
Text = text; Text = text;
} }
@@ -260,7 +260,7 @@ namespace Game.Networking.Packets
{ {
public void Read(WorldPacket data) public void Read(WorldPacket data)
{ {
Timestamp = data.ReadInt32(); Timestamp = data.ReadInt64();
AuthorGUID = data.ReadPackedGuid(); AuthorGUID = data.ReadPackedGuid();
bool hasClubID = data.HasBit(); bool hasClubID = data.HasBit();
@@ -305,7 +305,7 @@ namespace Game.Networking.Packets
public byte field_6; public byte field_6;
} }
public int Timestamp; public long Timestamp;
public ObjectGuid AuthorGUID; public ObjectGuid AuthorGUID;
public Optional<ulong> ClubID; public Optional<ulong> ClubID;
public Optional<ObjectGuid> ChannelGUID; public Optional<ObjectGuid> ChannelGUID;
@@ -45,7 +45,7 @@ namespace Game.Networking.Packets
foreach (AuctionableTokenInfo auctionableTokenAuctionable in AuctionableTokenAuctionableList) foreach (AuctionableTokenInfo auctionableTokenAuctionable in AuctionableTokenAuctionableList)
{ {
_worldPacket.WriteUInt64(auctionableTokenAuctionable.UnkInt1); _worldPacket.WriteUInt64(auctionableTokenAuctionable.UnkInt1);
_worldPacket.WriteUInt32(auctionableTokenAuctionable.UnkInt2); _worldPacket.WriteInt64(auctionableTokenAuctionable.UnkInt2);
_worldPacket.WriteUInt64(auctionableTokenAuctionable.BuyoutPrice); _worldPacket.WriteUInt64(auctionableTokenAuctionable.BuyoutPrice);
_worldPacket.WriteUInt32(auctionableTokenAuctionable.Owner); _worldPacket.WriteUInt32(auctionableTokenAuctionable.Owner);
_worldPacket.WriteUInt32(auctionableTokenAuctionable.DurationLeft); _worldPacket.WriteUInt32(auctionableTokenAuctionable.DurationLeft);
@@ -59,7 +59,7 @@ namespace Game.Networking.Packets
struct AuctionableTokenInfo struct AuctionableTokenInfo
{ {
public ulong UnkInt1; public ulong UnkInt1;
public uint UnkInt2; public long UnkInt2;
public uint Owner; public uint Owner;
public ulong BuyoutPrice; public ulong BuyoutPrice;
public uint DurationLeft; public uint DurationLeft;
-26
View File
@@ -2193,43 +2193,27 @@ namespace Game.Entities
foreach (SpellAuraOptionsRecord auraOptions in CliDB.SpellAuraOptionsStorage.Values) foreach (SpellAuraOptionsRecord auraOptions in CliDB.SpellAuraOptionsStorage.Values)
GetLoadHelper(auraOptions.SpellID, auraOptions.DifficultyID).AuraOptions = auraOptions; GetLoadHelper(auraOptions.SpellID, auraOptions.DifficultyID).AuraOptions = auraOptions;
CliDB.SpellAuraOptionsStorage.Clear();
foreach (SpellAuraRestrictionsRecord auraRestrictions in CliDB.SpellAuraRestrictionsStorage.Values) foreach (SpellAuraRestrictionsRecord auraRestrictions in CliDB.SpellAuraRestrictionsStorage.Values)
GetLoadHelper(auraRestrictions.SpellID, auraRestrictions.DifficultyID).AuraRestrictions = auraRestrictions; GetLoadHelper(auraRestrictions.SpellID, auraRestrictions.DifficultyID).AuraRestrictions = auraRestrictions;
CliDB.SpellAuraRestrictionsStorage.Clear();
foreach (SpellCastingRequirementsRecord castingRequirements in CliDB.SpellCastingRequirementsStorage.Values) foreach (SpellCastingRequirementsRecord castingRequirements in CliDB.SpellCastingRequirementsStorage.Values)
GetLoadHelper(castingRequirements.SpellID, 0).CastingRequirements = castingRequirements; GetLoadHelper(castingRequirements.SpellID, 0).CastingRequirements = castingRequirements;
CliDB.SpellCastingRequirementsStorage.Clear();
foreach (SpellCategoriesRecord categories in CliDB.SpellCategoriesStorage.Values) foreach (SpellCategoriesRecord categories in CliDB.SpellCategoriesStorage.Values)
GetLoadHelper(categories.SpellID, categories.DifficultyID).Categories = categories; GetLoadHelper(categories.SpellID, categories.DifficultyID).Categories = categories;
CliDB.SpellCategoriesStorage.Clear();
foreach (SpellClassOptionsRecord classOptions in CliDB.SpellClassOptionsStorage.Values) foreach (SpellClassOptionsRecord classOptions in CliDB.SpellClassOptionsStorage.Values)
GetLoadHelper(classOptions.SpellID, 0).ClassOptions = classOptions; GetLoadHelper(classOptions.SpellID, 0).ClassOptions = classOptions;
CliDB.SpellClassOptionsStorage.Clear();
foreach (SpellCooldownsRecord cooldowns in CliDB.SpellCooldownsStorage.Values) foreach (SpellCooldownsRecord cooldowns in CliDB.SpellCooldownsStorage.Values)
GetLoadHelper(cooldowns.SpellID, cooldowns.DifficultyID).Cooldowns = cooldowns; GetLoadHelper(cooldowns.SpellID, cooldowns.DifficultyID).Cooldowns = cooldowns;
CliDB.SpellCooldownsStorage.Clear();
foreach (SpellEquippedItemsRecord equippedItems in CliDB.SpellEquippedItemsStorage.Values) foreach (SpellEquippedItemsRecord equippedItems in CliDB.SpellEquippedItemsStorage.Values)
GetLoadHelper(equippedItems.SpellID, 0).EquippedItems = equippedItems; GetLoadHelper(equippedItems.SpellID, 0).EquippedItems = equippedItems;
CliDB.SpellEquippedItemsStorage.Clear();
foreach (SpellInterruptsRecord interrupts in CliDB.SpellInterruptsStorage.Values) foreach (SpellInterruptsRecord interrupts in CliDB.SpellInterruptsStorage.Values)
GetLoadHelper(interrupts.SpellID, interrupts.DifficultyID).Interrupts = interrupts; GetLoadHelper(interrupts.SpellID, interrupts.DifficultyID).Interrupts = interrupts;
CliDB.SpellInterruptsStorage.Clear();
foreach (SpellLevelsRecord levels in CliDB.SpellLevelsStorage.Values) foreach (SpellLevelsRecord levels in CliDB.SpellLevelsStorage.Values)
GetLoadHelper(levels.SpellID, levels.DifficultyID).Levels = levels; GetLoadHelper(levels.SpellID, levels.DifficultyID).Levels = levels;
@@ -2255,28 +2239,18 @@ namespace Game.Entities
foreach (SpellReagentsRecord reagents in CliDB.SpellReagentsStorage.Values) foreach (SpellReagentsRecord reagents in CliDB.SpellReagentsStorage.Values)
GetLoadHelper(reagents.SpellID, 0).Reagents = reagents; GetLoadHelper(reagents.SpellID, 0).Reagents = reagents;
CliDB.SpellReagentsStorage.Clear();
foreach (SpellScalingRecord scaling in CliDB.SpellScalingStorage.Values) foreach (SpellScalingRecord scaling in CliDB.SpellScalingStorage.Values)
GetLoadHelper(scaling.SpellID, 0).Scaling = scaling; GetLoadHelper(scaling.SpellID, 0).Scaling = scaling;
CliDB.SpellScalingStorage.Clear();
foreach (SpellShapeshiftRecord shapeshift in CliDB.SpellShapeshiftStorage.Values) foreach (SpellShapeshiftRecord shapeshift in CliDB.SpellShapeshiftStorage.Values)
GetLoadHelper(shapeshift.SpellID, 0).Shapeshift = shapeshift; GetLoadHelper(shapeshift.SpellID, 0).Shapeshift = shapeshift;
CliDB.SpellShapeshiftStorage.Clear();
foreach (SpellTargetRestrictionsRecord targetRestrictions in CliDB.SpellTargetRestrictionsStorage.Values) foreach (SpellTargetRestrictionsRecord targetRestrictions in CliDB.SpellTargetRestrictionsStorage.Values)
GetLoadHelper(targetRestrictions.SpellID, targetRestrictions.DifficultyID).TargetRestrictions = targetRestrictions; GetLoadHelper(targetRestrictions.SpellID, targetRestrictions.DifficultyID).TargetRestrictions = targetRestrictions;
CliDB.SpellTargetRestrictionsStorage.Clear();
foreach (SpellTotemsRecord totems in CliDB.SpellTotemsStorage.Values) foreach (SpellTotemsRecord totems in CliDB.SpellTotemsStorage.Values)
GetLoadHelper(totems.SpellID, 0).Totems = totems; GetLoadHelper(totems.SpellID, 0).Totems = totems;
CliDB.SpellTotemsStorage.Clear();
foreach (var visual in CliDB.SpellXSpellVisualStorage.Values) foreach (var visual in CliDB.SpellXSpellVisualStorage.Values)
{ {
var visuals = GetLoadHelper(visual.SpellID, visual.DifficultyID).Visuals; var visuals = GetLoadHelper(visual.SpellID, visual.DifficultyID).Visuals;