Fixes hotfix loading.
This commit is contained in:
@@ -17,7 +17,7 @@ namespace Game.DataStorage
|
||||
{
|
||||
uint oldMSTime = Time.GetMSTime();
|
||||
|
||||
string db2Path = dataPath + "/dbc";
|
||||
string db2Path = $"{dataPath}/dbc";
|
||||
|
||||
BitSet availableDb2Locales = new((int)Locale.Total);
|
||||
foreach (var dir in Directory.GetDirectories(db2Path))
|
||||
@@ -33,7 +33,13 @@ namespace Game.DataStorage
|
||||
uint loadedFileCount = 0;
|
||||
DB6Storage<T> ReadDB2<T>(string fileName, HotfixStatements preparedStatement, HotfixStatements preparedStatementLocale = 0) where T : new()
|
||||
{
|
||||
return DBReader.Read<T>(availableDb2Locales, $"{db2Path}/{defaultLocale}/", fileName, preparedStatement, preparedStatementLocale, ref loadedFileCount);
|
||||
DB6Storage<T> storage = new();
|
||||
storage.LoadData($"{db2Path}/{defaultLocale}/{fileName}");
|
||||
storage.LoadHotfixData(availableDb2Locales, preparedStatement, preparedStatementLocale);
|
||||
|
||||
Global.DB2Mgr.AddDB2(storage.GetTableHash(), storage);
|
||||
loadedFileCount++;
|
||||
return storage;
|
||||
}
|
||||
|
||||
AchievementStorage = ReadDB2<AchievementRecord>("Achievement.db2", HotfixStatements.SEL_ACHIEVEMENT, HotfixStatements.SEL_ACHIEVEMENT_LOCALE);
|
||||
@@ -420,7 +426,7 @@ namespace Game.DataStorage
|
||||
!MapStorage.ContainsKey(2582) || // last map added in 10.0.5 (47660)
|
||||
!SpellNameStorage.ContainsKey(401848)) // last spell added in 10.0.5 (47660)
|
||||
{
|
||||
Log.outError(LogFilter.Misc, "You have _outdated_ DB2 files. Please extract correct versions from current using client.");
|
||||
Log.outFatal(LogFilter.ServerLoading, "You have _outdated_ DB2 files. Please extract correct versions from current using client.");
|
||||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user