public static DoubleUIntKeyTable <T> CreateDoubleUIntKeyTableFromBinary <T>(MemoryStream stream) where T : IDoubleUIntKeyBinaryTableData, new() { DoubleUIntKeyTable <T> doubleUIntKeyTable = new DoubleUIntKeyTable <T>(); BinaryTableReader binaryTableReader = new BinaryTableReader(stream); while (binaryTableReader.MoveNext()) { uint key = binaryTableReader.ReadUInt32(0u); uint key2 = binaryTableReader.ReadUInt32(0u); T value = new T(); value.LoadFromBinary(binaryTableReader, ref key, ref key2); doubleUIntKeyTable.Add(key, key2, value); } return(doubleUIntKeyTable); }
public static DoubleUIntKeyTable <GrowEquipItemNeedItemData> CreateNeedTableBinary(byte[] bytes) { DoubleUIntKeyTable <GrowEquipItemNeedItemData> doubleUIntKeyTable = new DoubleUIntKeyTable <GrowEquipItemNeedItemData>(); BinaryTableReader binaryTableReader = new BinaryTableReader(bytes); while (binaryTableReader.MoveNext()) { uint key = binaryTableReader.ReadUInt32(0u); uint key2 = binaryTableReader.ReadUInt32(0u); GrowEquipItemNeedItemData growEquipItemNeedItemData = new GrowEquipItemNeedItemData(); growEquipItemNeedItemData.LoadFromBinary(binaryTableReader, ref key, ref key2); doubleUIntKeyTable.Add(key, key2, growEquipItemNeedItemData); } return(doubleUIntKeyTable); }
public void AddTableFromAPI(uint itemId, List <int> questIds) { if (itemToQuestTable == null) { itemToQuestTable = new DoubleUIntKeyTable <ItemToQuestData>(); } itemToQuestTable.Get(itemId)?.Clear(); for (int i = 0; i < questIds.Count; i++) { ItemToQuestData itemToQuestData = new ItemToQuestData(); itemToQuestData.LoadFromAPI(itemId, (uint)questIds[i], (uint)i); itemToQuestTable.Add(itemId, (uint)i, itemToQuestData); } InitDependencyData(); }
public static DoubleUIntKeyTable <AbilityData> CreateTableBinary(byte[] bytes) { DoubleUIntKeyTable <AbilityData> doubleUIntKeyTable = new DoubleUIntKeyTable <AbilityData>(); BinaryTableReader binaryTableReader = new BinaryTableReader(bytes); while (binaryTableReader.MoveNext()) { uint key = binaryTableReader.ReadUInt32(0u); uint key2 = 0u; UIntKeyTable <AbilityData> uIntKeyTable = doubleUIntKeyTable.Get(key); if (uIntKeyTable != null) { key2 = (uint)uIntKeyTable.GetCount(); } AbilityData abilityData = new AbilityData(); abilityData.LoadFromBinary(binaryTableReader, ref key, ref key2); doubleUIntKeyTable.Add(key, key2, abilityData); } return(doubleUIntKeyTable); }
private bool ReceivePromisePacketOverAgainCheck(CoopPacket packet) { if (packet.fromClientId <= 0) { return(false); } List <int> list = recvPromisePacketSequenceNoTable.Get((uint)packet.fromClientId, (uint)packet.packetType); if (list != null && list.Find((int x) => x == packet.sequenceNo) > 0) { Logd("Receive promise packet over again!!. fromId={0}, packet={1}, no={2}", packet.fromClientId, packet.packetType, packet.sequenceNo); return(true); } Logd("Receive promise packet over again add sequenceNo. fromId={0}, packet={1}, no={2}", packet.fromClientId, packet.packetType, packet.sequenceNo); if (list == null) { list = new List <int>(); recvPromisePacketSequenceNoTable.Add((uint)packet.fromClientId, (uint)packet.packetType, list); } list.Add(packet.sequenceNo); return(false); }