Refactoring of BNetServer

This commit is contained in:
hondacrx
2020-07-12 00:06:43 -04:00
parent 4164384b72
commit 581d077acd
318 changed files with 2046 additions and 4694 deletions
@@ -536,13 +536,13 @@ namespace Game.DataStorage
LocalizedString localized = new LocalizedString();
if (_stringsTable == null)
{
localized[LocaleConstant.enUS] = _data.ReadCString();
localized[Locale.enUS] = _data.ReadCString();
}
else
{
var pos = _recordsOffset + (_data.Position >> 3);
int ofs = GetFieldValue<int>(fieldIndex);
localized[LocaleConstant.enUS] = _stringsTable.LookupByKey(pos + ofs);
localized[Locale.enUS] = _stringsTable.LookupByKey(pos + ofs);
}
f.SetValue(obj, localized);
@@ -732,12 +732,12 @@ namespace Game.DataStorage
public class LocalizedString
{
public bool HasString(LocaleConstant locale = SharedConst.DefaultLocale)
public bool HasString(Locale locale = SharedConst.DefaultLocale)
{
return !string.IsNullOrEmpty(stringStorage[(int)locale]);
}
public string this[LocaleConstant locale]
public string this[Locale locale]
{
get
{
@@ -749,6 +749,6 @@ namespace Game.DataStorage
}
}
StringArray stringStorage = new StringArray((int)LocaleConstant.Total);
StringArray stringStorage = new StringArray((int)Locale.Total);
}
}