public void read(Reader reader) { switch (type) { case VariableTypes.UINT8: value_uint8 = reader.ReadByte(); break; case VariableTypes.UINT16: value_uint16 = reader.ReadUInt16(); break; case VariableTypes.UINT32: value_uint32 = reader.ReadUInt32(); break; case VariableTypes.INT8: value_int8 = reader.ReadSByte(); break; case VariableTypes.INT16: value_int16 = reader.ReadInt16(); break; case VariableTypes.INT32: value_int32 = reader.ReadInt32(); break; case VariableTypes.ENUM: value_enum = reader.ReadInt32(); break; case VariableTypes.BOOL: value_bool = reader.readBool32(); break; case VariableTypes.STRING: value_string = reader.readRSDKUTF16String(); break; case VariableTypes.VECTOR2: value_vector2.x = reader.ReadInt32(); value_vector2.y = reader.ReadInt32(); break; case VariableTypes.UNKNOWN: value_unknown = reader.ReadInt32(); break; case VariableTypes.COLOR: value_color = new Color(reader); break; } }
public Replay(Reader reader) { Reader creader = reader.getCompressedStreamRaw(); reader.Close(); // Signature if (creader.ReadUInt32() != signature) { creader.Close(); throw new Exception("Invalid Replay v5 signature"); } gameVer = creader.ReadInt32(); isPacked = creader.readBool32(); bool isNotEmpty = creader.readBool32(); int frameCount = creader.ReadInt32(); startingFrame = creader.ReadInt32(); zoneID = creader.ReadInt32(); act = creader.ReadInt32(); characterID = creader.ReadInt32(); isPlusLayout = creader.readBool32(); oscillation = creader.ReadInt32(); int bufferSize = creader.ReadInt32(); float avgSize = creader.ReadSingle(); unknown = creader.ReadInt32(); frames.Clear(); for (int f = 0; f < frameCount; ++f) { ReplayEntry frame = new ReplayEntry(); frame.unpack(creader, isPacked); frames.Add(frame); } creader.Close(); }