public override void Deserialize(IDataReader reader) { questType = reader.ReadSByte(); if (questType < 0) { throw new Exception("Forbidden value on questType = " + questType + ", it doesn't respect the following condition : questType < 0"); } startMapId = reader.ReadInt(); var limit = reader.ReadUShort(); var knownStepsList_ = new Types.TreasureHuntStep[limit]; for (int i = 0; i < limit; i++) { knownStepsList_[i] = Types.ProtocolTypeManager.GetInstance <Types.TreasureHuntStep>(reader.ReadShort()); knownStepsList_[i].Deserialize(reader); } knownStepsList = knownStepsList_; totalStepCount = reader.ReadSByte(); if (totalStepCount < 0) { throw new Exception("Forbidden value on totalStepCount = " + totalStepCount + ", it doesn't respect the following condition : totalStepCount < 0"); } checkPointCurrent = reader.ReadVarInt(); if (checkPointCurrent < 0) { throw new Exception("Forbidden value on checkPointCurrent = " + checkPointCurrent + ", it doesn't respect the following condition : checkPointCurrent < 0"); } checkPointTotal = reader.ReadVarInt(); if (checkPointTotal < 0) { throw new Exception("Forbidden value on checkPointTotal = " + checkPointTotal + ", it doesn't respect the following condition : checkPointTotal < 0"); } availableRetryCount = reader.ReadInt(); limit = reader.ReadUShort(); var flags_ = new Types.TreasureHuntFlag[limit]; for (int i = 0; i < limit; i++) { flags_[i] = new Types.TreasureHuntFlag(); flags_[i].Deserialize(reader); } flags = flags_; }
public override void Deserialize(IDataReader reader) { questType = reader.ReadSbyte(); startMapId = reader.ReadDouble(); var limit = (ushort)reader.ReadUShort(); knownStepsList = new Types.TreasureHuntStep[limit]; for (int i = 0; i < limit; i++) { knownStepsList[i] = ProtocolTypeManager.GetInstance <Types.TreasureHuntStep>(reader.ReadUShort()); knownStepsList[i].Deserialize(reader); } totalStepCount = reader.ReadSbyte(); checkPointCurrent = reader.ReadVarUhInt(); checkPointTotal = reader.ReadVarUhInt(); availableRetryCount = reader.ReadInt(); limit = (ushort)reader.ReadUShort(); flags = new Types.TreasureHuntFlag[limit]; for (int i = 0; i < limit; i++) { flags[i] = new Types.TreasureHuntFlag(); flags[i].Deserialize(reader); } }
public override void Deserialize(BigEndianReader reader) { questType = reader.ReadSByte(); if (questType < 0) throw new Exception("Forbidden value on questType = " + questType + ", it doesn't respect the following condition : questType < 0"); startMapId = reader.ReadInt(); var limit = reader.ReadUShort(); knownStepsList = new Types.TreasureHuntStep[limit]; for (int i = 0; i < limit; i++) { knownStepsList[i] = Types.ProtocolTypeManager.GetInstance<Types.TreasureHuntStep>(reader.ReadShort()); knownStepsList[i].Deserialize(reader); } totalStepCount = reader.ReadSByte(); if (totalStepCount < 0) throw new Exception("Forbidden value on totalStepCount = " + totalStepCount + ", it doesn't respect the following condition : totalStepCount < 0"); checkPointCurrent = reader.ReadVarInt(); if (checkPointCurrent < 0) throw new Exception("Forbidden value on checkPointCurrent = " + checkPointCurrent + ", it doesn't respect the following condition : checkPointCurrent < 0"); checkPointTotal = reader.ReadVarInt(); if (checkPointTotal < 0) throw new Exception("Forbidden value on checkPointTotal = " + checkPointTotal + ", it doesn't respect the following condition : checkPointTotal < 0"); availableRetryCount = reader.ReadInt(); limit = reader.ReadUShort(); flags = new Types.TreasureHuntFlag[limit]; for (int i = 0; i < limit; i++) { flags[i] = new Types.TreasureHuntFlag(); flags[i].Deserialize(reader); } }