public HotfixStructureAttribute(DB2Hash hash, ClientVersionBuild addedInVersion, ClientVersionBuild removedInVersion) { if (ClientVersion.InVersion(addedInVersion, removedInVersion)) { Hash = hash; } }
public HotfixStructureAttribute(DB2Hash hash, ClientVersionBuild addedInVersio) { if (ClientVersion.AddedInVersion(addedInVersio)) { Hash = hash; } }
public static void AddHotfixData(int entry, DB2Hash type, bool deleted, uint timeStamp) { HotfixDatas.Add(new HotfixData { RecordID = entry, TableHash = type, Deleted = deleted, Timestamp = timeStamp }); }
public bool ShouldLog(DB2Hash fileHash) { for (var i = 0; i < Hashes.Count; ++i) { var currentElement = Hashes[i]; if (currentElement.FileHash == fileHash.ToString()) { return(currentElement.Enabled); } } return(false); }
private static void HandleHotfixOptionalData(Packet packet, DB2Hash type, int entry, Packet db2File) { var leftSize = db2File.Length - db2File.Position; var backupPosition = db2File.Position; // 28 bytes = size of TactKey optional data if (leftSize % 28 == 0) { var tactKeyCount = leftSize / 28; for (int i = 0; i < tactKeyCount; ++i) { // get hash, we need to verify var hash = db2File.ReadUInt32E <DB2Hash>(); // check if hash is valid hash, we only support TactKey optional data yet if (hash == DB2Hash.TactKey) { // read optional data var optionalData = db2File.ReadBytes(24); packet.AddValue($"(OptionalData) [{i}] Key:", hash); packet.AddValue($"(OptionalData) [{i}] OptionalData:", Utilities.ByteArrayToHexString(optionalData)); HotfixOptionalData hotfixOptionalData = new HotfixOptionalData { // data to link the optional data to correct hotfix TableHash = type, RecordID = entry, Key = hash, Data = new Blob(optionalData) }; Storage.HotfixOptionalDatas.Add(hotfixOptionalData); } else { db2File.SetPosition(backupPosition); db2File.WriteLine($"(Entry: {entry} TableHash: {type}) has incorrect structure OR optional data. PacketLength: {db2File.Length} CurrentPosition: {db2File.Position} "); db2File.AsHex(); } } } else { db2File.WriteLine($"(Entry: {entry} TableHash: {type}) has incorrect structure OR optional data. PacketLength: {db2File.Length} CurrentPosition: {db2File.Position} "); db2File.AsHex(); } }
public bool ShouldLog(DB2Hash fileHash) { for (var i = 0; i < Hashes.Count; ++i) { if (Settings.ParseAllHotfixes == true) { return(true); } var currentElement = Hashes[i]; if (currentElement.FileHash == fileHash.ToString()) { return(currentElement.Enabled); } } return(false); }
public static void AddHotfixData(int entry, DB2Hash type, bool deleted, uint timeStamp) { HotfixDatas.Add(new HotfixData { Deleted = deleted, RecordID = entry, Timestamp = timeStamp }); }
public static HotfixStore <T> GetStore <T>(DB2Hash hash) where T : class, new() => (HotfixStore <T>)GetStore(hash);
public static void RemoveRecord(DB2Hash fileHash, int recordKey) { GetStore(fileHash)?.RemoveRecord(recordKey); OnRecordReceived?.Invoke(fileHash, recordKey, false); }
public static void AddRecord(DB2Hash fileHash, int recordKey, Packet db2File) { GetStore(fileHash)?.AddRecord(recordKey, db2File); OnRecordReceived?.Invoke(fileHash, recordKey, true); }
public static IHotfixStore GetStore(DB2Hash hash) { return(_stores.ContainsKey(hash) ? _stores[hash] : null); }
public HotfixStructureAttribute(DB2Hash hash) { Hash = hash; }