Updated DB2 structs

This commit is contained in:
hondacrx
2018-02-26 13:13:54 -05:00
parent 0a3dfaba37
commit 82dca6de94
61 changed files with 2639 additions and 2517 deletions
@@ -0,0 +1,418 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Framework.IO;
namespace Game.DataStorage
{
public class BitStream : IDisposable
{
private byte currentByte;
private long offset;
private int bit;
private Stream stream;
private Encoding encoding = Encoding.UTF8;
private bool canWrite = true;
public long Length => stream.Length;
public long BitPosition => bit;
public long Offset => offset;
private bool ValidPosition => offset < Length;
public BitStream(int capacity = 0)
{
this.stream = new MemoryStream(capacity);
offset = bit = 0;
canWrite = true;
currentByte = 0;
}
public BitStream(byte[] buffer)
{
this.stream = new MemoryStream(buffer);
offset = bit = 0;
canWrite = false;
currentByte = buffer[0];
}
#region Methods
public void Seek(long offset, int bit)
{
if (offset > Length)
{
this.offset = Length;
}
else
{
if (offset >= 0)
{
this.offset = offset;
}
else
{
offset = 0;
}
}
if (bit >= 8)
{
this.offset += bit / 8;
this.bit = bit % 8;
}
else
{
this.bit = bit;
}
UpdateCurrentByte();
}
public bool AdvanceBit()
{
bit = (bit + 1) % 8;
if (bit == 0)
{
offset++;
if (canWrite)
stream.WriteByte(currentByte);
UpdateCurrentByte();
return true;
}
return false;
}
public byte[] GetStreamData()
{
stream.Position = 0;
MemoryStream s = new MemoryStream();
stream.CopyTo(s);
Seek(offset, bit);
return s.ToArray();
}
public bool ChangeLength(long length)
{
if (stream.CanSeek && stream.CanWrite)
{
stream.SetLength(length);
return true;
}
else
{
return false;
}
}
public void CopyStreamTo(Stream stream)
{
Seek(0, 0);
this.stream.CopyTo(stream);
}
public MemoryStream CloneAsMemoryStream() => new MemoryStream(GetStreamData());
#endregion
#region Bit Read
private void UpdateCurrentByte()
{
stream.Position = offset;
if (canWrite)
{
currentByte = 0;
}
else
{
currentByte = (byte)stream.ReadByte();
stream.Position = offset;
}
}
private Bit ReadBit()
{
if (!ValidPosition)
throw new IOException("Cannot read in an offset bigger than the length of the stream");
byte value = (byte)((currentByte >> (bit)) & 1);
AdvanceBit();
return value;
}
#endregion
public byte[] ReadBytes(long length, bool isBytes = false, long byteLength = 0)
{
if (isBytes)
length *= 8;
byteLength = (byteLength == 0 ? length / 8 : byteLength);
byte[] data = new byte[byteLength];
for (long i = 0; i < length;)
{
byte value = 0;
for (int p = 0; p < 8 && i < length; i++, p++)
value |= (byte)(ReadBit() << p);
data[((i + 7) / 8) - 1] = value;
}
return data;
}
public byte[] ReadBytesPadded(long length)
{
int requiredSize = NextPow2((int)(length + 7) / 8);
byte[] data = ReadBytes(length, false, requiredSize);
return data;
}
public byte ReadByte()
{
return ReadBytes(8)[0];
}
public byte ReadByte(int bits)
{
bits = Math.Min(Math.Max(bits, 0), 8); // clamp values
return ReadBytes(bits)[0];
}
public string ReadString(int length)
{
// UTF8 - revert if encoding gets exposed
return encoding.GetString(ReadBytes(8 * length));
}
public short ReadInt16()
{
short value = BitConverter.ToInt16(ReadBytes(16), 0);
return value;
}
public int ReadInt32()
{
int value = BitConverter.ToInt32(ReadBytes(32), 0);
return value;
}
public long ReadInt64()
{
long value = BitConverter.ToInt64(ReadBytes(64), 0);
return value;
}
public ushort ReadUInt16()
{
ushort value = BitConverter.ToUInt16(ReadBytes(16), 0);
return value;
}
public uint ReadUInt32(int bitWidth = 32)
{
bitWidth = Math.Min(Math.Max(bitWidth, 0), 32); // clamp values
byte[] data = ReadBytes(bitWidth, false, 4);
return BitConverter.ToUInt32(data, 0);
}
public ulong ReadUInt64()
{
ulong value = BitConverter.ToUInt64(ReadBytes(64), 0);
return value;
}
private int NextPow2(int v)
{
v--;
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
v |= v >> 8;
v |= v >> 16;
v++;
return Math.Max(v, 1);
}
public void Dispose()
{
((IDisposable)stream)?.Dispose();
}
internal struct Bit
{
private byte value;
public Bit(int value)
{
this.value = (byte)(value & 1);
}
public static implicit operator Bit(int value) => new Bit(value);
public static implicit operator byte(Bit bit) => bit.value;
}
}
public class BitReader
{
private byte[] m_array;
private int m_readPos;
private int m_readOffset;
public int Position { get => m_readPos; set => m_readPos = value; }
public int Offset { get => m_readOffset; set => m_readOffset = value; }
public byte[] Data { get => m_array; set => m_array = value; }
public BitReader(byte[] data)
{
m_array = data;
}
public BitReader(byte[] data, int offset)
{
m_array = data;
m_readOffset = offset;
}
public uint ReadUInt32(int numBits)
{
uint result = FastStruct<uint>.ArrayToStructure(ref m_array[m_readOffset + (m_readPos >> 3)]) << (32 - numBits - (m_readPos & 7)) >> (32 - numBits);
m_readPos += numBits;
return result;
}
public ulong ReadUInt64(int numBits)
{
ulong result = FastStruct<ulong>.ArrayToStructure(ref m_array[m_readOffset + (m_readPos >> 3)]) << (64 - numBits - (m_readPos & 7)) >> (64 - numBits);
m_readPos += numBits;
return result;
}
public Value32 ReadValue32(int numBits)
{
unsafe
{
ulong result = ReadUInt32(numBits);
return *(Value32*)&result;
}
}
public Value64 ReadValue64(int numBits)
{
unsafe
{
ulong result = ReadUInt64(numBits);
return *(Value64*)&result;
}
}
// this will probably work in C# 7.3 once blittable generic constrain added, or not...
//public unsafe T Read<T>(int numBits) where T : struct
//{
// //fixed (byte* ptr = &m_array[m_readOffset + (m_readPos >> 3)])
// //{
// // T val = *(T*)ptr << (sizeof(T) - numBits - (m_readPos & 7)) >> (sizeof(T) - numBits);
// // m_readPos += numBits;
// // return val;
// //}
// //T result = FastStruct<T>.ArrayToStructure(ref m_array[m_readOffset + (m_readPos >> 3)]) << (32 - numBits - (m_readPos & 7)) >> (32 - numBits);
// //m_readPos += numBits;
// //return result;
//}
}
public struct Value32
{
unsafe fixed byte Value[4];
public T GetValue<T>() where T : struct
{
unsafe
{
fixed (byte* ptr = Value)
return FastStruct<T>.ArrayToStructure(ref ptr[0]);
}
}
public byte[] GetBytes(int bitSize)
{
byte[] data = new byte[NextPow2((int)(bitSize + 7) / 8)];
unsafe
{
fixed (byte* ptr = Value)
{
for (var i = 0; i < data.Length; ++i)
data[i] = ptr[i];
}
}
return data;
}
private int NextPow2(int v)
{
v--;
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
v |= v >> 8;
v |= v >> 16;
v++;
return Math.Max(v, 1);
}
}
public struct Value64
{
unsafe fixed byte Value[8];
public T GetValue<T>() where T : struct
{
unsafe
{
fixed (byte* ptr = Value)
return FastStruct<T>.ArrayToStructure(ref ptr[0]);
}
}
public byte[] GetBytes(int bitSize)
{
byte[] data = new byte[NextPow2((int)(bitSize + 7) / 8)];
unsafe
{
fixed (byte* ptr = Value)
{
for (var i = 0; i < data.Length; ++i)
data[i] = ptr[i];
}
}
return data;
}
private int NextPow2(int v)
{
v--;
v |= v >> 1;
v |= v >> 2;
v |= v >> 4;
v |= v >> 8;
v |= v >> 16;
v++;
return Math.Max(v, 1);
}
}
}
@@ -1,762 +0,0 @@
/*
* Copyright (C) 2012-2018 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Collections;
using Framework.Constants;
using Framework.Database;
using Framework.Dynamic;
using Framework.GameMath;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
namespace Game.DataStorage
{
public class DB6Reader
{
internal static DB6Storage<T> Read<T>(string fileName, DB6Meta meta, HotfixStatements preparedStatement, HotfixStatements preparedStatementLocale = 0) where T : new()
{
DB6Storage<T> storage = new DB6Storage<T>();
if (!File.Exists(CliDB.DataPath + fileName))
{
Log.outError(LogFilter.ServerLoading, "File {0} not found.", fileName);
return storage;
}
//First lets load field Info
var fields = typeof(T).GetFields();
DBClientHelper[] fieldsInfo = new DBClientHelper[fields.Length];
for (var i = 0; i < fields.Length; ++i)
fieldsInfo[i] = new DBClientHelper(fields[i]);
using (var fileReader = new BinaryReader(new MemoryStream(File.ReadAllBytes(CliDB.DataPath + fileName))))
{
_header = ReadHeader(fileReader);
var data = LoadData(fileReader);
int commonDataFieldIndex = 0;
foreach (var pair in data)
{
var dataReader = new DB6BinaryReader(pair.Value);
var obj = new T();
int fieldIndex = 0;
for (var x = 0; x < _header.FieldCount; ++x)
{
int arrayLength = meta.ArraySizes[x];
if (arrayLength > 1)
{
for (var z = 0; z < arrayLength; ++z)
{
var fieldInfo = fieldsInfo[fieldIndex++];
if (fieldInfo.IsArray)
{
//Field is Array
Array array = (Array)fieldInfo.Getter(obj);
for (var y = 0; y < array.Length; ++y)
SetArrayValue(array, y, fieldInfo, dataReader, x);
arrayLength -= array.Length;
}
else
{
//Only Data is Array
if (Type.GetTypeCode(fieldInfo.FieldType) == TypeCode.Object)
{
switch (fieldInfo.FieldType.Name)
{
case "Vector2":
fieldInfo.SetValue(obj, new Vector2(dataReader.ReadSingle(), dataReader.ReadSingle()));
arrayLength -= 2;
break;
case "Vector3":
fieldInfo.SetValue(obj, new Vector3(dataReader.ReadSingle(), dataReader.ReadSingle(), dataReader.ReadSingle()));
arrayLength -= 3;
break;
case "LocalizedString":
LocalizedString locString = new LocalizedString();
locString[Global.WorldMgr.GetDefaultDbcLocale()] = GetString(dataReader, x);
fieldInfo.SetValue(obj, locString);
arrayLength -= 1;
break;
case "FlagArray128":
FlagArray128 flagArray128 = new FlagArray128(dataReader.GetUInt32(_header.GetFieldBytes(x)), dataReader.GetUInt32(_header.GetFieldBytes(x)), dataReader.GetUInt32(_header.GetFieldBytes(x)), dataReader.GetUInt32(_header.GetFieldBytes(x)));
fieldInfo.SetValue(obj, flagArray128);
arrayLength -= 4;
break;
default:
Log.outError(LogFilter.ServerLoading, "Unknown Array Type {0} in DBClient File", fieldInfo.FieldType.Name, nameof(T));
break;
}
}
else
SetValue(obj, fieldInfo, dataReader, x);
}
}
}
else
{
var fieldInfo = fieldsInfo[fieldIndex++];
if (fieldInfo.IsArray)
{
Array array = (Array)fieldInfo.Getter(obj);
for (var y = 0; y < array.Length; ++y)
SetArrayValue(array, y, fieldInfo, dataReader, x + y);
x += array.Length - 1;
}
else
SetValue(obj, fieldInfo, dataReader, x);
}
}
commonDataFieldIndex = fieldIndex;
storage.Add((uint)pair.Key, obj);
}
//Get DB field Index
uint index = 0;
for (uint i = 0; i < _header.FieldCount && i < _header.IndexField; ++i)
index += meta.ArraySizes[i];
ReadCommonData(commonDataFieldIndex, storage, meta, fieldsInfo);
storage.LoadData(index, fieldsInfo, preparedStatement, preparedStatementLocale);
}
Global.DB2Mgr.AddDB2(_header.TableHash, storage);
CliDB.LoadedFileCount++;
return storage;
}
static void ReadCommonData<T>(int fieldIndex, DB6Storage<T> storage, DB6Meta meta, DBClientHelper[] helper) where T : new()
{
for (int x = (int)_header.FieldCount; x < _header.TotalFieldCount; ++x)
{
var fieldInfo = helper[fieldIndex++];
int arrayLength = meta.ArraySizes[x];
foreach (var recordId in _commandData[x])
{
var dataReader = new DB6BinaryReader(recordId.Value);
var record = storage.LookupByKey(recordId.Key);
if (arrayLength > 1)
{
for (var z = 0; z < arrayLength; ++z)
{
if (fieldInfo.IsArray)
{
//Field is Array
Array array = (Array)fieldInfo.Getter(record);
for (var y = 0; y < array.Length; ++y)
SetArrayValue(array, y, fieldInfo, dataReader, x);
arrayLength -= array.Length;
}
else
{
//Only Data is Array
if (Type.GetTypeCode(fieldInfo.FieldType) == TypeCode.Object)
{
Log.outError(LogFilter.Server, "We should not have custom classes in common data");
switch (fieldInfo.FieldType.Name)
{
case "Vector2":
fieldInfo.SetValue(record, new Vector2(dataReader.ReadSingle(), dataReader.ReadSingle()));
arrayLength -= 2;
break;
case "Vector3":
fieldInfo.SetValue(record, new Vector3(dataReader.ReadSingle(), dataReader.ReadSingle(), dataReader.ReadSingle()));
arrayLength -= 3;
break;
case "LocalizedString":
LocalizedString locString = new LocalizedString();
locString[Global.WorldMgr.GetDefaultDbcLocale()] = GetString(dataReader, x);
fieldInfo.SetValue(record, locString);
arrayLength -= 1;
break;
case "FlagArray128":
FlagArray128 flagArray128 = new FlagArray128(dataReader.ReadUInt32(), dataReader.ReadUInt32(), dataReader.ReadUInt32(), dataReader.ReadUInt32());
fieldInfo.SetValue(record, flagArray128);
arrayLength -= 4;
break;
default:
Log.outError(LogFilter.ServerLoading, "Unknown Array Type {0} in DBClient File", fieldInfo.FieldType.Name, nameof(T));
break;
}
}
else
SetValue(record, fieldInfo, dataReader, x);
}
}
}
else
{
if (fieldInfo.IsArray)
{
Array array = (Array)fieldInfo.Getter(record);
for (var y = 0; y < array.Length; ++y)
SetArrayValue(array, y, fieldInfo, dataReader, x + y);
x += array.Length - 1;
}
else
SetValue(record, fieldInfo, dataReader, x);
}
}
}
}
static void SetArrayValue(Array array, int arrayIndex, DBClientHelper helper, DB6BinaryReader reader, int field)
{
switch (Type.GetTypeCode(helper.RealType))
{
case TypeCode.SByte:
helper.SetValue(array, reader.ReadSByte(), arrayIndex);
break;
case TypeCode.Byte:
helper.SetValue(array, reader.ReadByte(), arrayIndex);
break;
case TypeCode.Int16:
helper.SetValue(array, reader.ReadInt16(), arrayIndex);
break;
case TypeCode.UInt16:
helper.SetValue(array, reader.ReadUInt16(), arrayIndex);
break;
case TypeCode.Int32:
helper.SetValue(array, reader.GetInt32(_header.GetFieldBytes(field)), arrayIndex);
break;
case TypeCode.UInt32:
helper.SetValue(array, reader.GetUInt32(_header.GetFieldBytes(field)), arrayIndex);
break;
case TypeCode.Single:
helper.SetValue(array, reader.ReadSingle(), arrayIndex);
break;
case TypeCode.String:
helper.SetValue(array, GetString(reader, field), arrayIndex);
break;
default:
Log.outError(LogFilter.ServerLoading, "Wrong Array Type: {0}", helper.FieldType.Name);
break;
}
}
static void SetValue(object obj, DBClientHelper helper, DB6BinaryReader reader, int field)
{
switch (Type.GetTypeCode(helper.RealType))
{
case TypeCode.SByte:
helper.SetValue(obj, reader.ReadSByte());
break;
case TypeCode.Byte:
helper.SetValue(obj, reader.ReadByte());
break;
case TypeCode.Int16:
helper.SetValue(obj, reader.ReadInt16());
break;
case TypeCode.UInt16:
helper.SetValue(obj, reader.ReadUInt16());
break;
case TypeCode.Int32:
helper.SetValue(obj, reader.GetInt32(_header.GetFieldBytes(field)));
break;
case TypeCode.UInt32:
helper.SetValue(obj, reader.GetUInt32(_header.GetFieldBytes(field)));
break;
case TypeCode.Single:
helper.SetValue(obj, reader.ReadSingle());
break;
case TypeCode.String:
string str = GetString(reader, field);
helper.SetValue(obj, str);
break;
case TypeCode.Object:
switch (helper.FieldType.Name)
{
case "Vector2":
helper.SetValue(obj, new Vector2(reader.ReadSingle(), reader.ReadSingle()));
break;
case "Vector3":
helper.SetValue(obj, new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()));
break;
case "LocalizedString":
LocalizedString locString = new LocalizedString();
locString[Global.WorldMgr.GetDefaultDbcLocale()] = GetString(reader, field);
helper.SetValue(obj, locString);
break;
default:
Log.outError(LogFilter.ServerLoading, "Wrong Array Type: {0}", helper.FieldType.Name);
break;
}
break;
default:
Log.outError(LogFilter.ServerLoading, "Wrong Array Type: {0}", helper.FieldType.Name);
break;
}
}
static string GetString(DB6BinaryReader reader, int field)
{
if (_stringTable != null)
return _stringTable.LookupByKey(reader.GetUInt32(_header.GetFieldBytes(field)));
return reader.ReadCString();
}
static DB6Header ReadHeader(BinaryReader reader)
{
DB6Header header = new DB6Header();
header.Signature = reader.ReadStringFromChars(4);
header.RecordCount = reader.ReadUInt32();
header.FieldCount = reader.ReadUInt32();
header.RecordSize = reader.ReadUInt32();
header.StringTableSize = reader.ReadUInt32(); // also offset for sparse table
header.TableHash = reader.ReadUInt32();
header.LayoutHash = reader.ReadUInt32(); // 21737: changed from build number to layoutHash
header.MinId = reader.ReadInt32();
header.MaxId = reader.ReadInt32();
header.Locale = reader.ReadInt32();
header.CopyTableSize = reader.ReadInt32();
header.Flags = reader.ReadUInt16();
header.IndexField = reader.ReadUInt16();
header.TotalFieldCount = reader.ReadUInt32();
header.CommonDataSize = reader.ReadUInt32();
for (int i = 0; i < header.FieldCount; i++)
{
header.columnMeta.Add(new DB6Header.FieldEntry() { UnusedBits = reader.ReadInt16(), Offset = (short)(reader.ReadInt16() + (header.HasIndexTable() ? 4 : 0)) });
}
if (header.HasIndexTable())
{
header.FieldCount++;
header.columnMeta.Insert(0, new DB6Header.FieldEntry());
}
return header;
}
static Dictionary<int, byte[]> LoadData(BinaryReader reader)
{
Dictionary<int, byte[]> Data = new Dictionary<int, byte[]>();
_stringTable = null;
// headerSize
long recordsOffset = 56 + (_header.HasIndexTable() ? _header.FieldCount - 1 : _header.FieldCount) * 4;
long eof = reader.BaseStream.Length;
long commonDataPos = eof - _header.CommonDataSize;
long copyTablePos = commonDataPos - _header.CopyTableSize;
long indexTablePos = copyTablePos - (_header.HasIndexTable() ? _header.RecordCount * 4 : 0);
long stringTablePos = indexTablePos - (_header.IsSparseTable() ? 0 : _header.StringTableSize);
// Index table
int[] m_indexes = null;
if (_header.HasIndexTable())
{
reader.BaseStream.Position = indexTablePos;
m_indexes = new int[_header.RecordCount];
for (int i = 0; i < _header.RecordCount; i++)
m_indexes[i] = reader.ReadInt32();
}
if (_header.IsSparseTable())
{
// Records table
reader.BaseStream.Position = _header.StringTableSize;
int ofsTableSize = _header.MaxId - _header.MinId + 1;
for (int i = 0; i < ofsTableSize; i++)
{
int offset = reader.ReadInt32();
int length = reader.ReadInt16();
if (offset == 0 || length == 0)
continue;
int id = _header.MinId + i;
long oldPos = reader.BaseStream.Position;
reader.BaseStream.Position = offset;
byte[] recordBytes = reader.ReadBytes(length);
byte[] newRecordBytes = new byte[recordBytes.Length + 4];
Array.Copy(BitConverter.GetBytes(id), newRecordBytes, 4);
Array.Copy(recordBytes, 0, newRecordBytes, 4, recordBytes.Length);
Data.Add(id, newRecordBytes);
reader.BaseStream.Position = oldPos;
}
}
else
{
// Records table
reader.BaseStream.Position = recordsOffset;
for (int i = 0; i < _header.RecordCount; i++)
{
reader.BaseStream.Position = recordsOffset + i * _header.RecordSize;
byte[] recordBytes = reader.ReadBytes((int)_header.RecordSize);
if (_header.HasIndexTable())
{
byte[] newRecordBytes = new byte[_header.RecordSize + 4];
Array.Copy(BitConverter.GetBytes(m_indexes[i]), newRecordBytes, 4);
Array.Copy(recordBytes, 0, newRecordBytes, 4, recordBytes.Length);
Data.Add(m_indexes[i], newRecordBytes);
}
else
{
int numBytes = (32 - _header.columnMeta[_header.IndexField].UnusedBits) >> 3;
int offset = _header.columnMeta[_header.IndexField].Offset;
int id = 0;
for (int j = 0; j < numBytes; j++)
id |= (recordBytes[offset + j] << (j * 8));
Data.Add(id, recordBytes);
}
}
// Strings table
reader.BaseStream.Position = stringTablePos;
_stringTable = new Dictionary<int, string>();
while (reader.BaseStream.Position != stringTablePos + _header.StringTableSize)
{
int index = (int)(reader.BaseStream.Position - stringTablePos);
_stringTable[index] = reader.ReadCString();
}
}
// Copy index table
if (copyTablePos != reader.BaseStream.Length && _header.CopyTableSize != 0)
{
reader.BaseStream.Position = copyTablePos;
while (reader.BaseStream.Position != reader.BaseStream.Length)
{
int id = reader.ReadInt32();
int idcopy = reader.ReadInt32();
byte[] copyRow = Data[idcopy];
byte[] newRow = new byte[copyRow.Length];
Array.Copy(copyRow, newRow, newRow.Length);
Array.Copy(BitConverter.GetBytes(id), newRow, 4);
Data.Add(id, newRow);
}
}
if (_header.CommonDataSize != 0)
{
reader.BaseStream.Position = commonDataPos;
int fieldsCount = reader.ReadInt32();
_commandData = new Dictionary<int, byte[]>[fieldsCount];
for (int i = 0; i < fieldsCount; i++)
{
int count = reader.ReadInt32();
byte type = reader.ReadByte();
_commandData[i] = new Dictionary<int, byte[]>();
for (int j = 0; j < count; j++)
{
int id = reader.ReadInt32();
switch (type)
{
case 1: // 2 bytes
_commandData[i].Add(id, reader.ReadBytes(2));
reader.BaseStream.Position += 2;
break;
case 2: // 1 bytes
_commandData[i].Add(id, reader.ReadBytes(1));
reader.BaseStream.Position += 3;
break;
case 3: // 4 bytes
case 4:
_commandData[i].Add(id, reader.ReadBytes(4));
break;
default:
throw new Exception("Invalid data type " + type);
}
}
}
}
return Data;
}
static DB6Header _header;
static Dictionary<int, string> _stringTable;
static Dictionary<int, byte[]>[] _commandData;
}
public class GameTableReader
{
internal static GameTable<T> Read<T>(string fileName) where T : new()
{
GameTable<T> storage = new GameTable<T>();
if (!File.Exists(CliDB.DataPath + fileName))
{
Log.outError(LogFilter.ServerLoading, "File {0} not found.", fileName);
return storage;
}
using (var reader = new StreamReader(CliDB.DataPath + fileName))
{
string headers = reader.ReadLine();
if (headers.IsEmpty())
{
Log.outError(LogFilter.ServerLoading, "GameTable file {0} is empty.", fileName);
return storage;
}
var columnDefs = new StringArray(headers, '\t');
List<T> data = new List<T>();
data.Add(new T()); // row id 0, unused
string line;
while (!(line = reader.ReadLine()).IsEmpty())
{
var values = new StringArray(line, '\t');
if (values.Length == 0)
break;
var obj = new T();
var fields = obj.GetType().GetFields();
for (int fieldIndex = 0, valueIndex = 1; fieldIndex < fields.Length && valueIndex < values.Length; ++fieldIndex, ++valueIndex)
{
var field = fields[fieldIndex];
if (field.FieldType.IsArray)
{
Array array = (Array)field.GetValue(obj);
for (var i = 0; i < array.Length; ++i)
array.SetValue(float.Parse(values[valueIndex++]), i);
}
else
fields[fieldIndex].SetValue(obj, float.Parse(values[valueIndex]));
}
data.Add(obj);
}
storage.SetData(data);
}
CliDB.LoadedFileCount++;
return storage;
}
}
public struct DBClientHelper
{
public DBClientHelper(FieldInfo fieldInfo)
{
IsArray = false;
FieldType = RealType = fieldInfo.FieldType;
if (fieldInfo.FieldType.IsArray)
{
FieldType = RealType = fieldInfo.FieldType.GetElementType();
IsArray = true;
}
IsEnum = FieldType.IsEnum;
if (IsEnum)
{
IsEnum = FieldType.IsEnum;
RealType = FieldType.GetEnumUnderlyingType();
}
Setter = fieldInfo.CompileSetter();
Getter = fieldInfo.CompileGetter();
}
public void SetValue(Array array, object value, int arrayIndex)
{
if (!IsEnum)
array.SetValue(Convert.ChangeType(value, FieldType), arrayIndex % array.Length);
else
array.SetValue(Enum.ToObject(FieldType, value), arrayIndex % array.Length);
}
public void SetValue(object obj, object value)
{
if (!IsEnum)
Setter(obj, Convert.ChangeType(value, FieldType));
else
Setter(obj, Enum.ToObject(FieldType, value));
}
public Type FieldType;
public Type RealType;
public bool IsArray;
bool IsEnum;
Action<object, object> Setter;
public Func<object, object> Getter;
}
class DB6Header
{
public bool IsValidDB6File()
{
return Signature == "WDB6";
}
public bool IsSparseTable()
{
return Convert.ToBoolean(Flags & 0x1);
}
public bool HasIndexTable()
{
return Convert.ToBoolean(Flags & 0x4);
}
public int GetFieldBytes(int field)
{
if (columnMeta.Count <= field)
return 4;
return 4 - columnMeta[field].UnusedBits / 8;
}
public string Signature;
public uint RecordCount;
public uint FieldCount;
public uint RecordSize;
public uint StringTableSize;
public uint TableHash;
public uint LayoutHash;
public int MinId;
public int MaxId;
public int Locale;
public int CopyTableSize;
public uint Flags;
public int IndexField;
public uint TotalFieldCount;
public uint CommonDataSize;
public List<FieldEntry> columnMeta = new List<FieldEntry>();
public struct FieldEntry
{
public short UnusedBits;
public short Offset;
}
}
class DB6BinaryReader : BinaryReader
{
public DB6BinaryReader(byte[] data) : base(new MemoryStream(data)) { }
public int GetInt32(int fieldBytes)
{
switch (fieldBytes)
{
case 1:
return ReadSByte();
case 2:
return ReadInt16();
case 3:
byte[] bytes = ReadBytes(fieldBytes);
return bytes[0] | (bytes[1] << 8) | (bytes[2] << 16);
default:
return ReadInt32();
}
}
public uint GetUInt32(int fieldBytes)
{
switch (fieldBytes)
{
case 1:
return ReadByte();
case 2:
return ReadUInt16();
case 3:
byte[] bytes = ReadBytes(fieldBytes);
return bytes[0] | ((uint)bytes[1] << 8) | ((uint)bytes[2] << 16);
default:
return ReadUInt32();
}
}
public float GetSingle(int fieldBytes)
{
switch (fieldBytes)
{
case 1:
return ReadByte();
case 2:
return ReadUInt16();
case 3:
byte[] bytes = ReadBytes(fieldBytes);
return bytes[0] | ((uint)bytes[1] << 8) | ((uint)bytes[2] << 16);
default:
return ReadSingle();
}
}
}
public class LocalizedString
{
public bool HasString(LocaleConstant locale = SharedConst.DefaultLocale)
{
return !string.IsNullOrEmpty(stringStorage[(int)locale]);
}
public string this[LocaleConstant locale]
{
get
{
return stringStorage[(int)locale] ?? "";
}
set
{
stringStorage[(int)locale] = value;
}
}
StringArray stringStorage = new StringArray((int)LocaleConstant.Total);
}
}
@@ -1,643 +0,0 @@
/*
* Copyright (C) 2012-2018 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Game.DataStorage
{
public struct DB6Meta
{
public DB6Meta(int indexField, byte[] arraySizes)
{
IndexField = indexField;
ArraySizes = arraySizes;
}
int IndexField;
public byte[] ArraySizes;
}
public struct DB6Metas
{
public static DB6Meta AchievementMeta = new DB6Meta(12, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta AchievementCategoryMeta = new DB6Meta(3, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta AdventureJournalMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1 });
public static DB6Meta AdventureMapPOIMeta = new DB6Meta(-1, new byte[] { 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta AnimKitMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta AnimKitBoneSetMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta AnimKitBoneSetAliasMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta AnimKitConfigMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta AnimKitConfigBoneSetMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta AnimKitPriorityMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta AnimKitReplacementMeta = new DB6Meta(4, new byte[] { 1, 1, 1, 1 });
public static DB6Meta AnimKitSegmentMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta AnimReplacementMeta = new DB6Meta(4, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta AnimReplacementSetMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta AnimationDataMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta AreaGroupMemberMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta AreaPOIMeta = new DB6Meta(-1, new byte[] { 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta AreaPOIStateMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta AreaTableMeta = new DB6Meta(-1, new byte[] { 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta AreaTriggerMeta = new DB6Meta(14, new byte[] { 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta AreaTriggerActionSetMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta AreaTriggerBoxMeta = new DB6Meta(-1, new byte[] { 1, 3 });
public static DB6Meta AreaTriggerCylinderMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta AreaTriggerSphereMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta ArmorLocationMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta ArtifactMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ArtifactAppearanceMeta = new DB6Meta(11, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ArtifactAppearanceSetMeta = new DB6Meta(8, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ArtifactCategoryMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ArtifactPowerMeta = new DB6Meta(5, new byte[] { 2, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ArtifactPowerLinkMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ArtifactPowerPickerMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta ArtifactPowerRankMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta ArtifactQuestXPMeta = new DB6Meta(-1, new byte[] { 1, 10 });
public static DB6Meta ArtifactTierMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta ArtifactUnlockMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta AuctionHouseMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta BankBagSlotPricesMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta BannedAddonsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta BarberShopStyleMeta = new DB6Meta(7, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta BattlePetAbilityMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta BattlePetAbilityEffectMeta = new DB6Meta(6, new byte[] { 1, 1, 1, 1, 6, 1, 1 });
public static DB6Meta BattlePetAbilityStateMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta BattlePetAbilityTurnMeta = new DB6Meta(5, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta BattlePetBreedQualityMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta BattlePetBreedStateMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta BattlePetEffectPropertiesMeta = new DB6Meta(-1, new byte[] { 1, 6, 1, 6 });
public static DB6Meta BattlePetNPCTeamMemberMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta BattlePetSpeciesMeta = new DB6Meta(8, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta BattlePetSpeciesStateMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta BattlePetSpeciesXAbilityMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta BattlePetStateMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta BattlePetVisualMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta BattlemasterListMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta BeamEffectMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta BoneWindModifierModelMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta BoneWindModifiersMeta = new DB6Meta(-1, new byte[] { 1, 3, 1 });
public static DB6Meta BountyMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta BountySetMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta BroadcastTextMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 3, 3, 1, 1, 1, 2, 1 });
public static DB6Meta CameraEffectMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta CameraEffectEntryMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CameraModeMeta = new DB6Meta(-1, new byte[] { 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CameraShakesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CastableRaidBuffsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta CelestialBodyMeta = new DB6Meta(14, new byte[] { 1, 1, 2, 1, 1, 2, 2, 2, 1, 2, 1, 3, 1, 1, 1 });
public static DB6Meta Cfg_CategoriesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta Cfg_ConfigsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta Cfg_RegionsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta CharBaseInfoMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta CharBaseSectionMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta CharComponentTextureLayoutsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta CharComponentTextureSectionsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CharHairGeosetsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CharSectionsMeta = new DB6Meta(-1, new byte[] { 1, 3, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CharShipmentMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CharShipmentContainerMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CharStartOutfitMeta = new DB6Meta(-1, new byte[] { 1, 24, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CharTitlesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta CharacterFaceBoneSetMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta CharacterFacialHairStylesMeta = new DB6Meta(-1, new byte[] { 1, 5, 1, 1, 1 });
public static DB6Meta CharacterLoadoutMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta CharacterLoadoutItemMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ChatChannelsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta ChatProfanityMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ChrClassRaceSexMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ChrClassTitleMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ChrClassUIDisplayMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ChrClassVillainMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ChrClassesMeta = new DB6Meta(18, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ChrClassesXPowerTypesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ChrRacesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3 });
public static DB6Meta ChrSpecializationMeta = new DB6Meta(9, new byte[] { 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ChrUpgradeBucketMeta = new DB6Meta(2, new byte[] { 1, 1, 1 });
public static DB6Meta ChrUpgradeBucketSpellMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ChrUpgradeTierMeta = new DB6Meta(3, new byte[] { 1, 1, 1, 1 });
public static DB6Meta CinematicCameraMeta = new DB6Meta(-1, new byte[] { 1, 1, 3, 1, 1 });
public static DB6Meta CinematicSequencesMeta = new DB6Meta(-1, new byte[] { 1, 1, 8 });
public static DB6Meta CloakDampeningMeta = new DB6Meta(-1, new byte[] { 1, 5, 5, 2, 2, 1, 1, 1 });
public static DB6Meta CombatConditionMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 1 });
public static DB6Meta CommentatorStartLocationMeta = new DB6Meta(-1, new byte[] { 1, 3, 1 });
public static DB6Meta CommentatorTrackedCooldownMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta ComponentModelFileDataMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta ComponentTextureFileDataMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ConfigurationWarningMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ContributionMeta = new DB6Meta(0, new byte[] { 1, 1, 1, 1, 4, 1 });
public static DB6Meta ConversationLineMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CreatureMeta = new DB6Meta(-1, new byte[] { 1, 3, 1, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CreatureDifficultyMeta = new DB6Meta(-1, new byte[] { 1, 1, 7, 1, 1, 1, 1 });
public static DB6Meta CreatureDispXUiCameraMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta CreatureDisplayInfoMeta = new DB6Meta(0, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CreatureDisplayInfoCondMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 });
public static DB6Meta CreatureDisplayInfoEvtMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta CreatureDisplayInfoExtraMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1 });
public static DB6Meta CreatureDisplayInfoTrnMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta CreatureFamilyMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 2, 1, 1, 1, 1 });
public static DB6Meta CreatureImmunitiesMeta = new DB6Meta(-1, new byte[] { 1, 2, 1, 1, 1, 1, 1, 1, 8, 16 });
public static DB6Meta CreatureModelDataMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CreatureMovementInfoMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta CreatureSoundDataMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CreatureTypeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta CreatureXContributionMeta = new DB6Meta(0, new byte[] { 1, 1, 1 });
public static DB6Meta CriteriaMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CriteriaTreeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CriteriaTreeXEffectMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta CurrencyCategoryMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta CurrencyTypesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta CurveMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta CurvePointMeta = new DB6Meta(-1, new byte[] { 1, 2, 1, 1 });
public static DB6Meta DeathThudLookupsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta DecalPropertiesMeta = new DB6Meta(0, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta DeclinedWordMeta = new DB6Meta(1, new byte[] { 1, 1 });
public static DB6Meta DeclinedWordCasesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta DestructibleModelDataMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta DeviceBlacklistMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta DeviceDefaultSettingsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta DifficultyMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta DissolveEffectMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta DriverBlacklistMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta DungeonEncounterMeta = new DB6Meta(6, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta DungeonMapMeta = new DB6Meta(7, new byte[] { 2, 2, 1, 1, 1, 1, 1 });
public static DB6Meta DungeonMapChunkMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta DurabilityCostsMeta = new DB6Meta(-1, new byte[] { 1, 21, 8 });
public static DB6Meta DurabilityQualityMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta EdgeGlowEffectMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta EmotesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta EmotesTextMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta EmotesTextDataMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta EmotesTextSoundMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta EnvironmentalDamageMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ExhaustionMeta = new DB6Meta(7, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta FactionMeta = new DB6Meta(0, new byte[] { 1, 4, 4, 2, 1, 1, 4, 1, 4, 4, 1, 1, 2, 1, 1, 1 });
public static DB6Meta FactionGroupMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta FactionTemplateMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 4, 4, 1, 1, 1 });
public static DB6Meta FootprintTexturesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta FootstepTerrainLookupMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta FriendshipRepReactionMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta FriendshipReputationMeta = new DB6Meta(3, new byte[] { 1, 1, 1, 1 });
public static DB6Meta FullScreenEffectMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GMSurveyAnswersMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta GMSurveyCurrentSurveyMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta GMSurveyQuestionsMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta GMSurveySurveysMeta = new DB6Meta(-1, new byte[] { 1, 15 });
public static DB6Meta GameObjectArtKitMeta = new DB6Meta(-1, new byte[] { 1, 3, 1 });
public static DB6Meta GameObjectDiffAnimMapMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta GameObjectDisplayInfoMeta = new DB6Meta(-1, new byte[] { 1, 1, 6, 1, 1, 1 });
public static DB6Meta GameObjectDisplayInfoXSoundKitMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta GameObjectsMeta = new DB6Meta(11, new byte[] { 3, 4, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GameTipsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta GarrAbilityMeta = new DB6Meta(7, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrAbilityCategoryMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta GarrAbilityEffectMeta = new DB6Meta(11, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrBuildingMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrBuildingDoodadSetMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrBuildingPlotInstMeta = new DB6Meta(4, new byte[] { 2, 1, 1, 1, 1 });
public static DB6Meta GarrClassSpecMeta = new DB6Meta(7, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrClassSpecPlayerCondMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrEncounterMeta = new DB6Meta(5, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrEncounterSetXEncounterMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta GarrEncounterXMechanicMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta GarrFollItemSetMemberMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta GarrFollSupportSpellMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta GarrFollowerMeta = new DB6Meta(31, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrFollowerLevelXPMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta GarrFollowerQualityMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrFollowerSetXFollowerMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta GarrFollowerTypeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrFollowerUICreatureMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrFollowerXAbilityMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta GarrItemLevelUpgradeDataMeta = new DB6Meta(0, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta GarrMechanicMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta GarrMechanicSetXMechanicMeta = new DB6Meta(1, new byte[] { 1, 1, 1 });
public static DB6Meta GarrMechanicTypeMeta = new DB6Meta(4, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta GarrMissionMeta = new DB6Meta(19, new byte[] { 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrMissionTextureMeta = new DB6Meta(-1, new byte[] { 1, 2, 1 });
public static DB6Meta GarrMissionTypeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta GarrMissionXEncounterMeta = new DB6Meta(1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta GarrMissionXFollowerMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta GarrMssnBonusAbilityMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrPlotMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 2 });
public static DB6Meta GarrPlotBuildingMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta GarrPlotInstanceMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta GarrPlotUICategoryMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta GarrSiteLevelMeta = new DB6Meta(-1, new byte[] { 1, 2, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrSiteLevelPlotInstMeta = new DB6Meta(-1, new byte[] { 1, 2, 1, 1, 1 });
public static DB6Meta GarrSpecializationMeta = new DB6Meta(-1, new byte[] { 1, 1, 2, 1, 1, 1, 1, 1 });
public static DB6Meta GarrStringMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta GarrTalentMeta = new DB6Meta(7, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrTalentTreeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrTypeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 2 });
public static DB6Meta GarrUiAnimClassInfoMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GarrUiAnimRaceInfoMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GemPropertiesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta GlobalStringsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta GlyphBindableSpellMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta GlyphExclusiveCategoryMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta GlyphPropertiesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta GlyphRequiredSpecMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta GroundEffectDoodadMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta GroundEffectTextureMeta = new DB6Meta(-1, new byte[] { 1, 4, 4, 1, 1 });
public static DB6Meta GroupFinderActivityMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta GroupFinderActivityGrpMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta GroupFinderCategoryMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta GuildColorBackgroundMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta GuildColorBorderMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta GuildColorEmblemMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta GuildPerkSpellsMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta HeirloomMeta = new DB6Meta(9, new byte[] { 1, 1, 1, 1, 1, 3, 3, 1, 1, 1 });
public static DB6Meta HelmetAnimScalingMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta HelmetGeosetVisDataMeta = new DB6Meta(-1, new byte[] { 1, 9 });
public static DB6Meta HighlightColorMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta HolidayDescriptionsMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta HolidayNamesMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta HolidaysMeta = new DB6Meta(-1, new byte[] { 1, 16, 10, 1, 1, 10, 1, 1, 1, 1, 1, 3 });
public static DB6Meta HotfixMeta = new DB6Meta(0, new byte[] { 1, 1, 1 });
public static DB6Meta ImportPriceArmorMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta ImportPriceQualityMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta ImportPriceShieldMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta ImportPriceWeaponMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta InvasionClientDataMeta = new DB6Meta(2, new byte[] { 1, 2, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ItemMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ItemAppearanceMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta ItemAppearanceXUiCameraMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ItemArmorQualityMeta = new DB6Meta(-1, new byte[] { 1, 7, 1 });
public static DB6Meta ItemArmorShieldMeta = new DB6Meta(-1, new byte[] { 1, 7, 1 });
public static DB6Meta ItemArmorTotalMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta ItemBagFamilyMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta ItemBonusMeta = new DB6Meta(-1, new byte[] { 1, 2, 1, 1, 1 });
public static DB6Meta ItemBonusListLevelDeltaMeta = new DB6Meta(1, new byte[] { 1, 1 });
public static DB6Meta ItemBonusTreeNodeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta ItemChildEquipmentMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ItemClassMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta ItemContextPickerEntryMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ItemCurrencyCostMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta ItemDamageAmmoMeta = new DB6Meta(-1, new byte[] { 1, 7, 1 });
public static DB6Meta ItemDamageOneHandMeta = new DB6Meta(-1, new byte[] { 1, 7, 1 });
public static DB6Meta ItemDamageOneHandCasterMeta = new DB6Meta(-1, new byte[] { 1, 7, 1 });
public static DB6Meta ItemDamageTwoHandMeta = new DB6Meta(-1, new byte[] { 1, 7, 1 });
public static DB6Meta ItemDamageTwoHandCasterMeta = new DB6Meta(-1, new byte[] { 1, 7, 1 });
public static DB6Meta ItemDisenchantLootMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ItemDisplayInfoMeta = new DB6Meta(-1, new byte[] { 1, 2, 2, 4, 4, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ItemDisplayInfoMaterialResMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ItemDisplayXUiCameraMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ItemEffectMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ItemExtendedCostMeta = new DB6Meta(-1, new byte[] { 1, 5, 5, 5, 1, 5, 1, 1, 1, 1, 1 });
public static DB6Meta ItemGroupSoundsMeta = new DB6Meta(-1, new byte[] { 1, 4 });
public static DB6Meta ItemLevelSelectorMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ItemLevelSelectorQualityMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ItemLevelSelectorQualitySetMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ItemLimitCategoryMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ItemLimitCategoryConditionMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ItemModifiedAppearanceMeta = new DB6Meta(5, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta ItemModifiedAppearanceExtraMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta ItemNameDescriptionMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ItemPetFoodMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta ItemPriceBaseMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ItemRandomPropertiesMeta = new DB6Meta(-1, new byte[] { 1, 1, 5 });
public static DB6Meta ItemRandomSuffixMeta = new DB6Meta(-1, new byte[] { 1, 1, 5, 5 });
public static DB6Meta ItemRangedDisplayInfoMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta ItemSearchNameMeta = new DB6Meta(0, new byte[] { 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ItemSetMeta = new DB6Meta(-1, new byte[] { 1, 1, 17, 1, 1, 1 });
public static DB6Meta ItemSetSpellMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta ItemSparseMeta = new DB6Meta(-1, new byte[] { 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1 });
public static DB6Meta ItemSpecMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ItemSpecOverrideMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ItemSubClassMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ItemSubClassMaskMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ItemUpgradeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta ItemVisualsMeta = new DB6Meta(-1, new byte[] { 1, 5 });
public static DB6Meta ItemXBonusTreeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta JournalEncounterMeta = new DB6Meta(-1, new byte[] { 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta JournalEncounterCreatureMeta = new DB6Meta(6, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta JournalEncounterItemMeta = new DB6Meta(5, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta JournalEncounterSectionMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta JournalEncounterXDifficultyMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta JournalEncounterXMapLocMeta = new DB6Meta(-1, new byte[] { 1, 2, 1, 1, 1, 1, 1 });
public static DB6Meta JournalInstanceMeta = new DB6Meta(10, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta JournalItemXDifficultyMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta JournalSectionXDifficultyMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta JournalTierMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta JournalTierXInstanceMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta KeychainMeta = new DB6Meta(-1, new byte[] { 1, 32 });
public static DB6Meta KeystoneAffixMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta LanguageWordsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta LanguagesMeta = new DB6Meta(1, new byte[] { 1, 1 });
public static DB6Meta LfgDungeonExpansionMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta LfgDungeonGroupMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta LFGDungeonsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta LfgDungeonsGroupingMapMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta LfgRoleRequirementMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta LightMeta = new DB6Meta(-1, new byte[] { 1, 3, 1, 1, 1, 8 });
public static DB6Meta LightDataMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta LightParamsMeta = new DB6Meta(10, new byte[] { 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1 });
public static DB6Meta LightSkyboxMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta LiquidMaterialMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta LiquidObjectMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta LiquidTypeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 6, 2, 18, 4, 1, 1, 1, 1, 1, 1, 6, 1 });
public static DB6Meta LoadingScreenTaxiSplinesMeta = new DB6Meta(-1, new byte[] { 1, 10, 10, 1, 1, 1 });
public static DB6Meta LoadingScreensMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta LocaleMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta LocationMeta = new DB6Meta(-1, new byte[] { 1, 3, 3 });
public static DB6Meta LockMeta = new DB6Meta(-1, new byte[] { 1, 8, 8, 8, 8 });
public static DB6Meta LockTypeMeta = new DB6Meta(4, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta LookAtControllerMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta MailTemplateMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta ManagedWorldStateMeta = new DB6Meta(9, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ManagedWorldStateBuffMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta ManagedWorldStateInputMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ManifestInterfaceActionIconMeta = new DB6Meta(0, new byte[] { 1 });
public static DB6Meta ManifestInterfaceDataMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ManifestInterfaceItemIconMeta = new DB6Meta(0, new byte[] { 1 });
public static DB6Meta ManifestInterfaceTOCDataMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta ManifestMP3Meta = new DB6Meta(0, new byte[] { 1 });
public static DB6Meta MapMeta = new DB6Meta(-1, new byte[] { 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta MapCelestialBodyMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta MapChallengeModeMeta = new DB6Meta(0, new byte[] { 1, 1, 1, 3, 1 });
public static DB6Meta MapDifficultyMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta MapDifficultyXConditionMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta MapLoadingScreenMeta = new DB6Meta(-1, new byte[] { 1, 2, 2, 1, 1, 1 });
public static DB6Meta MarketingPromotionsXLocaleMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta MaterialMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta MinorTalentMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta MissileTargetingMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2 });
public static DB6Meta ModelAnimCloakDampeningMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ModelFileDataMeta = new DB6Meta(1, new byte[] { 1, 1, 1 });
public static DB6Meta ModelRibbonQualityMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ModifierTreeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta MountMeta = new DB6Meta(8, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta MountCapabilityMeta = new DB6Meta(6, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta MountTypeXCapabilityMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta MountXDisplayMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta MovieMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta MovieFileDataMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta MovieVariationMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta NPCModelItemSlotDisplayInfoMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta NPCSoundsMeta = new DB6Meta(-1, new byte[] { 1, 4 });
public static DB6Meta NameGenMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta NamesProfanityMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta NamesReservedMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta NamesReservedLocaleMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ObjectEffectMeta = new DB6Meta(-1, new byte[] { 1, 3, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ObjectEffectGroupMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta ObjectEffectModifierMeta = new DB6Meta(-1, new byte[] { 1, 4, 1, 1, 1 });
public static DB6Meta ObjectEffectPackageMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta ObjectEffectPackageElemMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta OutlineEffectMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta OverrideSpellDataMeta = new DB6Meta(-1, new byte[] { 1, 10, 1, 1 });
public static DB6Meta PageTextMaterialMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta PaperDollItemFrameMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ParagonReputationMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ParticleColorMeta = new DB6Meta(-1, new byte[] { 1, 3, 3, 3 });
public static DB6Meta PathMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta PathNodeMeta = new DB6Meta(0, new byte[] { 1, 1, 1, 1 });
public static DB6Meta PathNodePropertyMeta = new DB6Meta(3, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta PathPropertyMeta = new DB6Meta(3, new byte[] { 1, 1, 1, 1 });
public static DB6Meta PhaseMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta PhaseShiftZoneSoundsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta PhaseXPhaseGroupMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta PlayerConditionMeta = new DB6Meta(0, new byte[] { 1, 1, 2, 4, 1, 4, 4, 4, 4, 4, 4, 2, 4, 4, 1, 3, 4, 4, 4, 4, 1, 3, 4, 4, 4, 4, 4, 6, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta PositionerMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta PositionerStateMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta PositionerStateEntryMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta PowerDisplayMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta PowerTypeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta PrestigeLevelInfoMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta PvpBracketTypesMeta = new DB6Meta(-1, new byte[] { 1, 1, 4 });
public static DB6Meta PvpDifficultyMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta PvpItemMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta PvpRewardMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta PvpScalingEffectMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta PvpScalingEffectTypeMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta PvpTalentMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta PvpTalentUnlockMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta QuestFactionRewardMeta = new DB6Meta(-1, new byte[] { 1, 10 });
public static DB6Meta QuestFeedbackEffectMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta QuestInfoMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta QuestLineMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta QuestLineXQuestMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta QuestMoneyRewardMeta = new DB6Meta(-1, new byte[] { 1, 10 });
public static DB6Meta QuestObjectiveMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta QuestPOIBlobMeta = new DB6Meta(0, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta QuestPOIPointMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta QuestPOIPointCliTaskMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta QuestPackageItemMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta QuestSortMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta QuestV2Meta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta QuestV2CliTaskMeta = new DB6Meta(20, new byte[] { 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta QuestXGroupActivityMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta QuestXPMeta = new DB6Meta(-1, new byte[] { 1, 10 });
public static DB6Meta RandPropPointsMeta = new DB6Meta(-1, new byte[] { 1, 5, 5, 5 });
public static DB6Meta RelicSlotTierRequirementMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta RelicTalentMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta ResearchBranchMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ResearchFieldMeta = new DB6Meta(2, new byte[] { 1, 1, 1 });
public static DB6Meta ResearchProjectMeta = new DB6Meta(7, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ResearchSiteMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta ResistancesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta RewardPackMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta RewardPackXCurrencyTypeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta RewardPackXItemMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta RibbonQualityMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta RulesetItemUpgradeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ScalingStatDistributionMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ScenarioMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta ScenarioEventEntryMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta ScenarioStepMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SceneScriptMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta SceneScriptPackageMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta SceneScriptPackageMemberMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta ScheduledIntervalMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta ScheduledWorldStateMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ScheduledWorldStateGroupMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta ScheduledWorldStateXUniqCatMeta = new DB6Meta(0, new byte[] { 1, 1, 1 });
public static DB6Meta ScreenEffectMeta = new DB6Meta(-1, new byte[] { 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ScreenLocationMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta SeamlessSiteMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta ServerMessagesMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta ShadowyEffectMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SkillLineMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SkillLineAbilityMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SkillRaceClassInfoMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SoundAmbienceMeta = new DB6Meta(-1, new byte[] { 1, 1, 2, 1, 1 });
public static DB6Meta SoundAmbienceFlavorMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta SoundBusMeta = new DB6Meta(7, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SoundBusOverrideMeta = new DB6Meta(0, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SoundEmitterPillPointsMeta = new DB6Meta(-1, new byte[] { 1, 3, 1 });
public static DB6Meta SoundEmittersMeta = new DB6Meta(9, new byte[] { 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SoundEnvelopeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SoundFilterMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta SoundFilterElemMeta = new DB6Meta(-1, new byte[] { 1, 9, 1, 1 });
public static DB6Meta SoundKitMeta = new DB6Meta(0, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SoundKitAdvancedMeta = new DB6Meta(0, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SoundKitChildMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta SoundKitEntryMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta SoundKitFallbackMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta SoundKitNameMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta SoundOverrideMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta SoundProviderPreferencesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SourceInfoMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta SpamMessagesMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta SpecializationSpellsMeta = new DB6Meta(5, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellMeta = new DB6Meta(5, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellActionBarPrefMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta SpellActivationOverlayMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 4, 1, 1, 1 });
public static DB6Meta SpellAuraOptionsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellAuraRestrictionsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellAuraVisXChrSpecMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta SpellAuraVisibilityMeta = new DB6Meta(3, new byte[] { 1, 1, 1, 1 });
public static DB6Meta SpellCastTimesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta SpellCastingRequirementsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellCategoriesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellCategoryMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellChainEffectsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3 });
public static DB6Meta SpellClassOptionsMeta = new DB6Meta(-1, new byte[] { 1, 1, 4, 1, 1 });
public static DB6Meta SpellCooldownsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellDescriptionVariablesMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta SpellDispelTypeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta SpellDurationMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta SpellEffectMeta = new DB6Meta(1, new byte[] { 4, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellEffectEmissionMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta SpellEffectGroupSizeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta SpellEffectScalingMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta SpellEquippedItemsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta SpellFlyoutMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellFlyoutItemMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta SpellFocusObjectMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta SpellInterruptsMeta = new DB6Meta(-1, new byte[] { 1, 1, 2, 2, 1, 1 });
public static DB6Meta SpellItemEnchantmentMeta = new DB6Meta(-1, new byte[] { 1, 3, 1, 3, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellItemEnchantmentConditionMeta = new DB6Meta(-1, new byte[] { 1, 5, 5, 5, 5, 5, 5 });
public static DB6Meta SpellKeyboundOverrideMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta SpellLabelMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta SpellLearnSpellMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta SpellLevelsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellMechanicMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta SpellMiscMeta = new DB6Meta(-1, new byte[] { 1, 14, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellMiscDifficultyMeta = new DB6Meta(2, new byte[] { 1, 1, 1 });
public static DB6Meta SpellMissileMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellMissileMotionMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta SpellPowerMeta = new DB6Meta(8, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellPowerDifficultyMeta = new DB6Meta(2, new byte[] { 1, 1, 1 });
public static DB6Meta SpellProceduralEffectMeta = new DB6Meta(2, new byte[] { 4, 1, 1 });
public static DB6Meta SpellProcsPerMinuteMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta SpellProcsPerMinuteModMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta SpellRadiusMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta SpellRangeMeta = new DB6Meta(-1, new byte[] { 1, 2, 2, 1, 1, 1 });
public static DB6Meta SpellReagentsMeta = new DB6Meta(-1, new byte[] { 1, 1, 8, 8 });
public static DB6Meta SpellReagentsCurrencyMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta SpellScalingMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellShapeshiftMeta = new DB6Meta(-1, new byte[] { 1, 1, 2, 2, 1 });
public static DB6Meta SpellShapeshiftFormMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 8 });
public static DB6Meta SpellSpecialUnitEffectMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta SpellTargetRestrictionsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellTotemsMeta = new DB6Meta(-1, new byte[] { 1, 1, 2, 2 });
public static DB6Meta SpellVisualMeta = new DB6Meta(4, new byte[] { 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellVisualAnimMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta SpellVisualColorEffectMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellVisualEffectNameMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellVisualEventMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellVisualKitMeta = new DB6Meta(0, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellVisualKitAreaModelMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellVisualKitEffectMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta SpellVisualKitModelAttachMeta = new DB6Meta(6, new byte[] { 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellVisualMissileMeta = new DB6Meta(13, new byte[] { 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta SpellXSpellVisualMeta = new DB6Meta(2, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta StartupFilesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta Startup_StringsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta StationeryMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 2 });
public static DB6Meta SummonPropertiesMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta TactKeyMeta = new DB6Meta(-1, new byte[] { 1, 16 });
public static DB6Meta TactKeyLookupMeta = new DB6Meta(-1, new byte[] { 1, 8 });
public static DB6Meta TalentMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 2, 1 });
public static DB6Meta TaxiNodesMeta = new DB6Meta(-1, new byte[] { 1, 3, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1 });
public static DB6Meta TaxiPathMeta = new DB6Meta(2, new byte[] { 1, 1, 1, 1 });
public static DB6Meta TaxiPathNodeMeta = new DB6Meta(8, new byte[] { 3, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta TerrainMaterialMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta TerrainTypeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta TerrainTypeSoundsMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta TextureBlendSetMeta = new DB6Meta(-1, new byte[] { 1, 3, 3, 3, 3, 3, 4, 1, 1, 1, 1 });
public static DB6Meta TextureFileDataMeta = new DB6Meta(2, new byte[] { 1, 1 });
public static DB6Meta TotemCategoryMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ToyMeta = new DB6Meta(4, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta TradeSkillCategoryMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta TradeSkillItemMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta TransformMatrixMeta = new DB6Meta(-1, new byte[] { 1, 3, 1, 1, 1, 1 });
public static DB6Meta TransmogHolidayMeta = new DB6Meta(0, new byte[] { 1, 1 });
public static DB6Meta TransmogSetMeta = new DB6Meta(4, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta TransmogSetGroupMeta = new DB6Meta(1, new byte[] { 1, 1 });
public static DB6Meta TransmogSetItemMeta = new DB6Meta(0, new byte[] { 1, 1, 1, 1 });
public static DB6Meta TransportAnimationMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 3, 1 });
public static DB6Meta TransportPhysicsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta TransportRotationMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 4 });
public static DB6Meta TrophyMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta UIExpansionDisplayInfoMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta UIExpansionDisplayInfoIconMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta UiCamFbackTransmogChrRaceMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta UiCamFbackTransmogWeaponMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta UiCameraMeta = new DB6Meta(-1, new byte[] { 1, 1, 3, 3, 3, 1, 1, 1, 1, 1 });
public static DB6Meta UiCameraTypeMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta UiMapPOIMeta = new DB6Meta(6, new byte[] { 1, 3, 1, 1, 1, 1, 1 });
public static DB6Meta UiModelSceneMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta UiModelSceneActorMeta = new DB6Meta(7, new byte[] { 1, 3, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta UiModelSceneActorDisplayMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta UiModelSceneCameraMeta = new DB6Meta(14, new byte[] { 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta UiTextureAtlasMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta UiTextureAtlasMemberMeta = new DB6Meta(0, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta UiTextureKitMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta UnitBloodMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta UnitBloodLevelsMeta = new DB6Meta(-1, new byte[] { 1, 3 });
public static DB6Meta UnitConditionMeta = new DB6Meta(-1, new byte[] { 1, 8, 1, 8, 8 });
public static DB6Meta UnitPowerBarMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta UnitTestMeta = new DB6Meta(2, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta VehicleMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 1, 3, 1, 1, 1 });
public static DB6Meta VehicleSeatMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta VehicleUIIndSeatMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta VehicleUIIndicatorMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta VideoHardwareMeta = new DB6Meta(14, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta VignetteMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta VirtualAttachmentMeta = new DB6Meta(-1, new byte[] { 1, 1, 1});
public static DB6Meta VirtualAttachmentCustomizationMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta VocalUISoundsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 2 });
public static DB6Meta WbAccessControlListMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1 });
public static DB6Meta WbCertWhitelistMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta WeaponImpactSoundsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 11, 11, 11, 11 });
public static DB6Meta WeaponSwingSounds2Meta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta WeaponTrailMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 3, 3, 3, 3, 3 });
public static DB6Meta WeaponTrailModelDefMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta WeaponTrailParamMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta WeatherMeta = new DB6Meta(-1, new byte[] { 1, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta WindSettingsMeta = new DB6Meta(-1, new byte[] { 1, 1, 3, 1, 1, 3, 1, 3, 1, 1, 1 });
public static DB6Meta WMOAreaTableMeta = new DB6Meta(13, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta WMOMinimapTextureMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1});
public static DB6Meta WorldBossLockoutMeta = new DB6Meta(-1, new byte[] { 1, 1, 1 });
public static DB6Meta WorldChunkSoundsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta WorldEffectMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta WorldElapsedTimerMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta WorldMapAreaMeta = new DB6Meta(15, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta WorldMapContinentMeta = new DB6Meta(-1, new byte[] { 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta WorldMapOverlayMeta = new DB6Meta(0, new byte[] { 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta WorldMapTransformsMeta = new DB6Meta(-1, new byte[] { 1, 6, 2, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta WorldSafeLocsMeta = new DB6Meta(-1, new byte[] { 1, 3, 1, 1, 1 });
public static DB6Meta WorldStateExpressionMeta = new DB6Meta(-1, new byte[] { 1, 1 });
public static DB6Meta WorldStateUIMeta = new DB6Meta(14, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1 });
public static DB6Meta WorldStateZoneSoundsMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta World_PVP_AreaMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1, 1, 1, 1 });
public static DB6Meta ZoneIntroMusicTableMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1, 1 });
public static DB6Meta ZoneLightMeta = new DB6Meta(-1, new byte[] { 1, 1, 1, 1 });
public static DB6Meta ZoneLightPointMeta = new DB6Meta(-1, new byte[] { 1, 2, 1, 1 });
public static DB6Meta ZoneMusicMeta = new DB6Meta(-1, new byte[] { 1, 1, 2, 2, 2 });
}
}
@@ -37,14 +37,14 @@ namespace Game.DataStorage
[Serializable]
public class DB6Storage<T> : Dictionary<uint, T>, IDB2Storage where T : new()
{
public void LoadData(uint indexField, DBClientHelper[] helpers, HotfixStatements preparedStatement, HotfixStatements preparedStatementLocale)
public void LoadData(int indexField, DB6FieldInfo[] helpers, HotfixStatements preparedStatement, HotfixStatements preparedStatementLocale)
{
SQLResult result = DB.Hotfix.Query(DB.Hotfix.GetPreparedStatement(preparedStatement));
if (!result.IsEmpty())
{
do
{
var idValue = result.Read<uint>((int)indexField);
var idValue = result.Read<uint>(indexField == -1 ? 0 : indexField);
var obj = new T();
int index = 0;
@@ -56,7 +56,7 @@ namespace Game.DataStorage
Array array = (Array)helper.Getter(obj);
for (var i = 0; i < array.Length; ++i)
{
switch (Type.GetTypeCode(helper.RealType))
switch (Type.GetTypeCode(helper.FieldType))
{
case TypeCode.SByte:
helper.SetValue(array, result.Read<sbyte>(index++), i);
@@ -116,7 +116,7 @@ namespace Game.DataStorage
}
else
{
switch (Type.GetTypeCode(helper.RealType))
switch (Type.GetTypeCode(helper.FieldType))
{
case TypeCode.SByte:
helper.SetValue(obj, result.Read<sbyte>(index++));
@@ -0,0 +1,800 @@
using Framework.Collections;
using Framework.Constants;
using Framework.Database;
using Framework.Dynamic;
using Framework.GameMath;
using Framework.IO;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Linq;
namespace Game.DataStorage
{
class DBReader
{
public static DB6Storage<T> Read<T>(string fileName, HotfixStatements preparedStatement, HotfixStatements preparedStatementLocale = 0) where T : new()
{
ClearData();
DB6Storage<T> storage = new DB6Storage<T>();
if (!File.Exists(CliDB.DataPath + fileName))
{
Log.outError(LogFilter.ServerLoading, "File {0} not found.", fileName);
return storage;
}
//First lets load field Info
var fields = typeof(T).GetFields();
DB6FieldInfo[] fieldsInfo = new DB6FieldInfo[fields.Length];
for (var i = 0; i < fields.Length; ++i)
fieldsInfo[i] = new DB6FieldInfo(fields[i]);
using (var fileReader = new BinaryReader(new MemoryStream(File.ReadAllBytes(CliDB.DataPath + fileName))))
{
ReadHeader(fileReader);
var records = ReadData(fileReader);
foreach (var pair in records)
{
using (MemoryStream ms = new MemoryStream(pair.Value))
using (BinaryReader dataReader = new BinaryReader(ms, System.Text.Encoding.UTF8))
{
var obj = new T();
int objectFieldIndex = 0;
//First check if index is in data
if (Header.HasIndexTable())
fieldsInfo[objectFieldIndex++].SetValue(obj, (uint)pair.Key);
for (var dataFieldIndex = 0; dataFieldIndex < Header.FieldCount; ++dataFieldIndex)
{
int arrayLength = ColumnMeta[dataFieldIndex].ArraySize;
if (arrayLength > 1)
{
for (var arrayIndex = 0; arrayIndex < arrayLength; ++arrayIndex)
{
var fieldInfo = fieldsInfo[objectFieldIndex++];
if (fieldInfo.IsArray)
{
Array array = (Array)fieldInfo.Getter(obj);
SetArrayValue(obj, array.Length, fieldInfo, dataReader);
arrayLength -= array.Length;
}
else
{
//Only Data is Array
if (Type.GetTypeCode(fieldInfo.FieldType) == TypeCode.Object)
{
switch (fieldInfo.FieldType.Name)
{
case "Vector2":
fieldInfo.SetValue(obj, dataReader.Read<Vector2>());
arrayLength -= 2;
break;
case "Vector3":
fieldInfo.SetValue(obj, dataReader.Read<Vector3>());
arrayLength -= 3;
break;
case "LocalizedString":
LocalizedString locString = new LocalizedString();
locString[Global.WorldMgr.GetDefaultDbcLocale()] = GetString(dataReader);
fieldInfo.SetValue(obj, locString);
arrayLength -= 1;
break;
case "FlagArray128":
fieldInfo.SetValue(obj, new FlagArray128(dataReader.ReadUInt32(), dataReader.ReadUInt32(), dataReader.ReadUInt32(), dataReader.ReadUInt32()));
arrayLength -= 4;
break;
default:
Log.outError(LogFilter.ServerLoading, "Unknown Array Type {0} in DBClient File", fieldInfo.FieldType.Name, nameof(T));
break;
}
}
else
SetValue(obj, fieldInfo, dataReader);
}
dataReader.BaseStream.Position += GetPadding(fieldInfo.FieldType, dataFieldIndex);
}
}
else
{
var fieldInfo = fieldsInfo[objectFieldIndex++];
if (fieldInfo.IsArray)
{
Array array = (Array)fieldInfo.Getter(obj);
SetArrayValue(obj, array.Length, fieldInfo, dataReader);
dataFieldIndex += array.Length - 1;
}
else
SetValue(obj, fieldInfo, dataReader);
dataReader.BaseStream.Position += GetPadding(fieldInfo.FieldType, dataFieldIndex);
}
}
//Check if there is parent ids and fill them
if (objectFieldIndex < fieldsInfo.Length && Header.LookupColumnCount > 0)
fieldsInfo[objectFieldIndex].SetValue(obj, dataReader.ReadUInt32());
storage.Add((uint)pair.Key, obj);
}
}
storage.LoadData(Header.IdIndex, fieldsInfo, preparedStatement, preparedStatementLocale);
}
Global.DB2Mgr.AddDB2(Header.TableHash, storage);
CliDB.LoadedFileCount++;
return storage;
}
static void ClearData()
{
Header = null;
StringTable = null;
FieldStructure = null;
ColumnMeta = null;
RelationShipData = null;
}
static void ReadHeader(BinaryReader reader)
{
Header = new DB6Header();
Header.Signature = reader.ReadStringFromChars(4);
Header.RecordCount = reader.ReadUInt32();
Header.FieldCount = reader.ReadUInt32();
Header.RecordSize = reader.ReadUInt32();
Header.StringTableSize = reader.ReadUInt32(); // also offset for sparse table
Header.TableHash = reader.ReadUInt32();
Header.LayoutHash = reader.ReadUInt32();
Header.MinId = reader.ReadInt32();
Header.MaxId = reader.ReadInt32();
Header.Locale = reader.ReadInt32();
Header.CopyTableSize = reader.ReadInt32();
Header.Flags = (HeaderFlags)reader.ReadUInt16();
Header.IdIndex = reader.ReadUInt16();
Header.TotalFieldCount = reader.ReadUInt32();
Header.BitpackedDataOffset = reader.ReadUInt32();
Header.LookupColumnCount = reader.ReadUInt32();
Header.OffsetTableOffset = reader.ReadUInt32();
Header.IdListSize = reader.ReadUInt32();
Header.ColumnMetaSize = reader.ReadUInt32();
Header.CommonDataSize = reader.ReadUInt32();
Header.PalletDataSize = reader.ReadUInt32();
Header.RelationshipDataSize = reader.ReadUInt32();
//Gather field structures
FieldStructure = new List<FieldStructureEntry>();
for (int i = 0; i < Header.FieldCount; i++)
{
var field = new FieldStructureEntry(reader.ReadInt16(), reader.ReadUInt16());
FieldStructure.Add(field);
}
}
static Dictionary<int, byte[]> ReadData(BinaryReader reader)
{
Dictionary<int, byte[]> CopyTable = new Dictionary<int, byte[]>();
List<Tuple<int, short>> offsetmap = new List<Tuple<int, short>>();
Dictionary<int, OffsetDuplicate> firstindex = new Dictionary<int, OffsetDuplicate>();
Dictionary<int, int> OffsetDuplicates = new Dictionary<int, int>();
Dictionary<int, List<int>> Copies = new Dictionary<int, List<int>>();
byte[] recordData;
if (Header.HasOffsetTable())
recordData = reader.ReadBytes((int)(Header.OffsetTableOffset - 84 - 4 * Header.FieldCount));
else
{
recordData = reader.ReadBytes((int)(Header.RecordCount * Header.RecordSize));
Array.Resize(ref recordData, recordData.Length + 8);
}
if (Header.StringTableSize != 0)
{
// string data
StringTable = new Dictionary<int, string>();
for (int i = 0; i < Header.StringTableSize;)
{
long oldPos = reader.BaseStream.Position;
StringTable[i] = reader.ReadCString();
i += (int)(reader.BaseStream.Position - oldPos);
}
}
int[] m_indexes = null;
// OffsetTable
if (Header.HasOffsetTable() && Header.OffsetTableOffset > 0)
{
reader.BaseStream.Position = Header.OffsetTableOffset;
for (int i = 0; i < (Header.MaxId - Header.MinId + 1); i++)
{
int offset = reader.ReadInt32();
short length = reader.ReadInt16();
if (offset == 0 || length == 0)
continue;
// special case, may contain duplicates in the offset map that we don't want
if (Header.CopyTableSize == 0)
{
if (!firstindex.ContainsKey(offset))
firstindex.Add(offset, new OffsetDuplicate(offsetmap.Count, firstindex.Count));
else
OffsetDuplicates.Add(Header.MinId + i, firstindex[offset].VisibleIndex);
}
offsetmap.Add(new Tuple<int, short>(offset, length));
}
}
// IndexTable
if (Header.HasIndexTable())
{
m_indexes = new int[Header.RecordCount];
for (int i = 0; i < Header.RecordCount; i++)
m_indexes[i] = reader.ReadInt32();
}
// Copytable
if (Header.CopyTableSize > 0)
{
long end = reader.BaseStream.Position + Header.CopyTableSize;
while (reader.BaseStream.Position < end)
{
int id = reader.ReadInt32();
int idcopy = reader.ReadInt32();
if (!Copies.ContainsKey(idcopy))
Copies.Add(idcopy, new List<int>());
Copies[idcopy].Add(id);
}
CliDB.Size += (uint)(Copies.Count * Header.RecordSize);
}
// ColumnMeta
ColumnMeta = new List<ColumnStructureEntry>();
if (Header.ColumnMetaSize != 0)
{
for (int i = 0; i < Header.FieldCount; i++)
{
var column = new ColumnStructureEntry()
{
RecordOffset = reader.ReadUInt16(),
Size = reader.ReadUInt16(),
AdditionalDataSize = reader.ReadUInt32(), // size of pallet / sparse values
CompressionType = (DB2ColumnCompression)reader.ReadUInt32(),
BitOffset = reader.ReadInt32(),
BitWidth = reader.ReadInt32(),
Cardinality = reader.ReadInt32()
};
// preload arraysizes
if (column.CompressionType == DB2ColumnCompression.None)
column.ArraySize = Math.Max(column.Size / FieldStructure[i].BitCount, 1);
else if (column.CompressionType == DB2ColumnCompression.PalletArray)
column.ArraySize = Math.Max(column.Cardinality, 1);
ColumnMeta.Add(column);
}
}
// Pallet values
for (int i = 0; i < ColumnMeta.Count; i++)
{
if (ColumnMeta[i].CompressionType == DB2ColumnCompression.Pallet || ColumnMeta[i].CompressionType == DB2ColumnCompression.PalletArray)
{
int elements = (int)ColumnMeta[i].AdditionalDataSize / 4;
int cardinality = Math.Max(ColumnMeta[i].Cardinality, 1);
ColumnMeta[i].PalletValues = new List<byte[]>();
for (int j = 0; j < elements / cardinality; j++)
ColumnMeta[i].PalletValues.Add(reader.ReadBytes(cardinality * 4));
}
}
// Sparse values
for (int i = 0; i < ColumnMeta.Count; i++)
{
if (ColumnMeta[i].CompressionType == DB2ColumnCompression.CommonData)
{
ColumnMeta[i].SparseValues = new Dictionary<int, byte[]>();
for (int j = 0; j < ColumnMeta[i].AdditionalDataSize / 8; j++)
ColumnMeta[i].SparseValues[reader.ReadInt32()] = reader.ReadBytes(4);
}
}
// Relationships
if (Header.RelationshipDataSize > 0)
{
RelationShipData = new RelationShipData()
{
Records = reader.ReadUInt32(),
MinId = reader.ReadUInt32(),
MaxId = reader.ReadUInt32(),
Entries = new Dictionary<uint, byte[]>()
};
for (int i = 0; i < RelationShipData.Records; i++)
{
byte[] foreignKey = reader.ReadBytes(4);
uint index = reader.ReadUInt32();
// has duplicates just like the copy table does... why?
if (!RelationShipData.Entries.ContainsKey(index))
RelationShipData.Entries.Add(index, foreignKey);
}
}
// Record Data
for (int i = 0; i < Header.RecordCount; i++)
{
int id = 0;
if (Header.HasOffsetTable() && Header.HasIndexTable())
{
id = m_indexes[CopyTable.Count];
var map = offsetmap[i];
if (Header.CopyTableSize == 0 && firstindex[map.Item1].HiddenIndex != i) // ignore duplicates
continue;
reader.BaseStream.Position = map.Item1;
byte[] data = reader.ReadBytes(map.Item2);
IEnumerable<byte> recordbytes = data;
// append relationship id
if (RelationShipData != null)
{
// seen cases of missing indicies
if (RelationShipData.Entries.TryGetValue((uint)i, out byte[] foreignData))
recordbytes = recordbytes.Concat(foreignData);
else
recordbytes = recordbytes.Concat(new byte[4]);
}
CopyTable.Add(id, recordbytes.ToArray());
if (Copies.ContainsKey(id))
{
foreach (int copy in Copies[id])
CopyTable.Add(copy, data.ToArray());
}
}
else
{
BitReader bitReader = new BitReader(recordData);
bitReader.Offset = i * (int)Header.RecordSize;
List<byte> data = new List<byte>();
if (Header.HasIndexTable())
id = m_indexes[i];
for (int f = 0; f < Header.FieldCount; f++)
{
int bitWidth = ColumnMeta[f].BitWidth;
switch (ColumnMeta[f].CompressionType)
{
case DB2ColumnCompression.None:
int bitSize = FieldStructure[f].BitCount;
if (!Header.HasIndexTable() && f == Header.IdIndex)
{
id = (int)bitReader.ReadUInt32(bitSize);// always read Ids as ints
data.AddRange(BitConverter.GetBytes(id));
}
else
{
for (int x = 0; x < ColumnMeta[f].ArraySize; x++)
data.AddRange(bitReader.ReadValue64(bitSize).GetBytes(bitSize));
}
break;
case DB2ColumnCompression.Immediate:
if (!Header.HasIndexTable() && f == Header.IdIndex)
{
id = (int)bitReader.ReadUInt32(bitWidth);// always read Ids as ints
data.AddRange(BitConverter.GetBytes(id));
continue;
}
else
{
data.AddRange(bitReader.ReadValue64(bitWidth).GetBytes(bitWidth));
}
break;
case DB2ColumnCompression.CommonData:
if (ColumnMeta[f].SparseValues.TryGetValue(id, out byte[] valBytes))
data.AddRange(valBytes);
else
data.AddRange(BitConverter.GetBytes(ColumnMeta[f].BitOffset));
break;
case DB2ColumnCompression.Pallet:
case DB2ColumnCompression.PalletArray:
uint palletIndex = bitReader.ReadUInt32(bitWidth);
data.AddRange(ColumnMeta[f].PalletValues[(int)palletIndex]);
break;
default:
throw new Exception($"Unknown compression {ColumnMeta[f].CompressionType}");
}
}
// append relationship id
if (RelationShipData != null)
{
// seen cases of missing indicies
if (RelationShipData.Entries.TryGetValue((uint)i, out byte[] foreignData))
data.AddRange(foreignData);
else
data.AddRange(new byte[4]);
}
CopyTable.Add(id, data.ToArray());
if (Copies.ContainsKey(id))
{
foreach (int copy in Copies[id])
{
byte[] newrecord = CopyTable[id].ToArray();
CopyTable.Add(copy, newrecord);
}
}
}
}
return CopyTable;
}
static Dictionary<Type, int> bytecounts = new Dictionary<Type, int>()
{
{ typeof(byte), 1 },
{ typeof(short), 2 },
{ typeof(ushort), 2 },
};
static int GetPadding(Type type, int fieldIndex)
{
if (!bytecounts.ContainsKey(type))
return 0;
if (ColumnMeta[fieldIndex].CompressionType < DB2ColumnCompression.CommonData)
return 0;
return 4 - bytecounts[type];
}
static FieldStructureEntry[] GetBits()
{
List<FieldStructureEntry> bits = new List<FieldStructureEntry>();
for (int i = 0; i < ColumnMeta.Count; i++)
{
short bitcount = (short)(FieldStructure[i].BitCount == 64 ? FieldStructure[i].BitCount : 0); // force bitcounts
bits.Add(new FieldStructureEntry(bitcount, 0));
}
return bits.ToArray();
}
static void SetArrayValue(object obj, int arraySize, DB6FieldInfo fieldInfo, BinaryReader reader)
{
switch (Type.GetTypeCode(fieldInfo.FieldType))
{
case TypeCode.SByte:
fieldInfo.SetValue(obj, reader.ReadArray<sbyte>(arraySize));
break;
case TypeCode.Byte:
fieldInfo.SetValue(obj, reader.ReadArray<byte>(arraySize));
break;
case TypeCode.Int16:
fieldInfo.SetValue(obj, reader.ReadArray<short>(arraySize));
break;
case TypeCode.UInt16:
fieldInfo.SetValue(obj, reader.ReadArray<ushort>(arraySize));
break;
case TypeCode.Int32:
fieldInfo.SetValue(obj, reader.ReadArray<int>(arraySize));
break;
case TypeCode.UInt32:
fieldInfo.SetValue(obj, reader.ReadArray<uint>(arraySize));
break;
case TypeCode.Int64:
fieldInfo.SetValue(obj, reader.ReadArray<long>(arraySize));
break;
case TypeCode.UInt64:
fieldInfo.SetValue(obj, reader.ReadArray<ulong>(arraySize));
break;
case TypeCode.Single:
fieldInfo.SetValue(obj, reader.ReadArray<float>(arraySize));
break;
case TypeCode.String:
string[] str = new string[arraySize];
for (var i = 0; i < arraySize; ++i)
str[i] = GetString(reader);
fieldInfo.SetValue(obj, str);
break;
default:
Log.outError(LogFilter.ServerLoading, "Wrong Array Type: {0}", fieldInfo.FieldType.Name);
break;
}
}
static void SetValue(object obj, DB6FieldInfo fieldInfo, BinaryReader reader)
{
switch (Type.GetTypeCode(fieldInfo.FieldType))
{
case TypeCode.SByte:
fieldInfo.SetValue(obj, reader.ReadSByte());
break;
case TypeCode.Byte:
fieldInfo.SetValue(obj, reader.ReadByte());
break;
case TypeCode.Int16:
fieldInfo.SetValue(obj, reader.ReadInt16());
break;
case TypeCode.UInt16:
fieldInfo.SetValue(obj, reader.ReadUInt16());
break;
case TypeCode.Int32:
fieldInfo.SetValue(obj, reader.ReadInt32());
break;
case TypeCode.UInt32:
fieldInfo.SetValue(obj, reader.ReadUInt32());
break;
case TypeCode.Int64:
fieldInfo.SetValue(obj, reader.ReadInt64());
break;
case TypeCode.UInt64:
fieldInfo.SetValue(obj, reader.ReadUInt64());
break;
case TypeCode.Single:
fieldInfo.SetValue(obj, reader.ReadSingle());
break;
case TypeCode.String:
string str = GetString(reader);
fieldInfo.SetValue(obj, str);
break;
case TypeCode.Object:
switch (fieldInfo.FieldType.Name)
{
case "Vector2":
fieldInfo.SetValue(obj, reader.Read<Vector2>());
break;
case "Vector3":
fieldInfo.SetValue(obj, reader.Read<Vector3>());
break;
case "LocalizedString":
LocalizedString locString = new LocalizedString();
locString[Global.WorldMgr.GetDefaultDbcLocale()] = GetString(reader);
fieldInfo.SetValue(obj, locString);
break;
default:
Log.outError(LogFilter.ServerLoading, "Wrong Array Type: {0}", fieldInfo.FieldType.Name);
break;
}
break;
default:
Log.outError(LogFilter.ServerLoading, "Wrong Array Type: {0}", fieldInfo.FieldType.Name);
break;
}
}
static string GetString(BinaryReader reader)
{
if (StringTable != null)
return StringTable.LookupByKey(reader.ReadUInt32());
return reader.ReadCString();
}
static DB6Header Header;
static Dictionary<int, string> StringTable;
static List<FieldStructureEntry> FieldStructure;
static List<ColumnStructureEntry> ColumnMeta;
static RelationShipData RelationShipData;
}
public struct DB6FieldInfo
{
public DB6FieldInfo(FieldInfo fieldInfo)
{
IsArray = false;
FieldType = fieldInfo.FieldType;
if (fieldInfo.FieldType.IsArray)
{
FieldType = fieldInfo.FieldType.GetElementType();
IsArray = true;
}
Setter = fieldInfo.CompileSetter();
Getter = fieldInfo.CompileGetter();
}
public void SetValue(Array array, object value, int arrayIndex)
{
array.SetValue(value, arrayIndex % array.Length);
}
public void SetValue(object obj, object value)
{
Setter(obj, value);
}
public Type FieldType;
public bool IsArray;
Action<object, object> Setter;
public Func<object, object> Getter;
}
public class DB6Header
{
public bool HasIndexTable()
{
return Convert.ToBoolean(Flags & HeaderFlags.IndexMap);
}
public bool HasOffsetTable()
{
return Convert.ToBoolean(Flags & HeaderFlags.OffsetMap);
}
public string Signature;
public uint RecordCount;
public uint FieldCount;
public uint RecordSize;
public uint StringTableSize;
public uint TableHash;
public uint LayoutHash;
public int MinId;
public int MaxId;
public int Locale;
public int CopyTableSize;
public HeaderFlags Flags;
public int IdIndex;
public uint TotalFieldCount;
public uint BitpackedDataOffset;
public uint LookupColumnCount;
public uint OffsetTableOffset;
public uint IdListSize;
public uint ColumnMetaSize;
public uint CommonDataSize;
public uint PalletDataSize;
public uint RelationshipDataSize;
}
public class FieldStructureEntry
{
public short Bits;
public ushort Offset;
public int Length = 1;
public int ByteCount
{
get
{
int value = (32 - Bits) >> 3;
return (value < 0 ? Math.Abs(value) + 4 : value);
}
}
public int BitCount
{
get
{
int bitSize = 32 - Bits;
if (bitSize < 0)
bitSize = (bitSize * -1) + 32;
return bitSize;
}
}
public FieldStructureEntry(short bits, ushort offset)
{
this.Bits = bits;
this.Offset = offset;
}
public void SetLength(FieldStructureEntry nextField)
{
this.Length = Math.Max(1, (int)Math.Floor((nextField.Offset - this.Offset) / (double)this.ByteCount));
}
}
public class ColumnStructureEntry
{
public ushort RecordOffset { get; set; }
public ushort Size { get; set; }
public uint AdditionalDataSize { get; set; }
public DB2ColumnCompression CompressionType { get; set; }
public int BitOffset { get; set; } // used as common data column for Sparse
public int BitWidth { get; set; }
public int Cardinality { get; set; } // flags for Immediate, &1: Signed
public List<byte[]> PalletValues { get; set; }
public Dictionary<int, byte[]> SparseValues { get; set; }
public int ArraySize { get; set; } = 1;
}
public class RelationShipData
{
public uint Records;
public uint MinId;
public uint MaxId;
public Dictionary<uint, byte[]> Entries; // index, id
}
struct OffsetDuplicate
{
public int HiddenIndex { get; set; }
public int VisibleIndex { get; set; }
public OffsetDuplicate(int hidden, int visible)
{
this.HiddenIndex = hidden;
this.VisibleIndex = visible;
}
}
public class LocalizedString
{
public bool HasString(LocaleConstant locale = SharedConst.DefaultLocale)
{
return !string.IsNullOrEmpty(stringStorage[(int)locale]);
}
public string this[LocaleConstant locale]
{
get
{
return stringStorage[(int)locale] ?? "";
}
set
{
stringStorage[(int)locale] = value;
}
}
StringArray stringStorage = new StringArray((int)LocaleConstant.Total);
}
public enum DB2ColumnCompression : uint
{
None,
Immediate,
CommonData,
Pallet,
PalletArray
}
[Flags]
public enum HeaderFlags : short
{
None = 0x0,
OffsetMap = 0x1,
SecondIndex = 0x2,
IndexMap = 0x4,
Unknown = 0x8,
Compressed = 0x10,
}
}
@@ -15,10 +15,71 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Framework.Collections;
using System;
using System.Collections.Generic;
using System.IO;
namespace Game.DataStorage
{
public class GameTableReader
{
internal static GameTable<T> Read<T>(string fileName) where T : new()
{
GameTable<T> storage = new GameTable<T>();
if (!File.Exists(CliDB.DataPath + fileName))
{
Log.outError(LogFilter.ServerLoading, "File {0} not found.", fileName);
return storage;
}
using (var reader = new StreamReader(CliDB.DataPath + fileName))
{
string headers = reader.ReadLine();
if (headers.IsEmpty())
{
Log.outError(LogFilter.ServerLoading, "GameTable file {0} is empty.", fileName);
return storage;
}
var columnDefs = new StringArray(headers, '\t');
List<T> data = new List<T>();
data.Add(new T()); // row id 0, unused
string line;
while (!(line = reader.ReadLine()).IsEmpty())
{
var values = new StringArray(line, '\t');
if (values.Length == 0)
break;
var obj = new T();
var fields = obj.GetType().GetFields();
for (int fieldIndex = 0, valueIndex = 1; fieldIndex < fields.Length && valueIndex < values.Length; ++fieldIndex, ++valueIndex)
{
var field = fields[fieldIndex];
if (field.FieldType.IsArray)
{
Array array = (Array)field.GetValue(obj);
for (var i = 0; i < array.Length; ++i)
array.SetValue(float.Parse(values[valueIndex++]), i);
}
else
fields[fieldIndex].SetValue(obj, float.Parse(values[valueIndex]));
}
data.Add(obj);
}
storage.SetData(data);
}
CliDB.LoadedFileCount++;
return storage;
}
}
public class GameTable<T> where T : new()
{
public T GetRow(uint row)