Ejemplo n.º 1
0
        public override void WriteProp(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
        {
            base.WriteProp(s, go, f, ms);

            //Get name table entry
            ms.WriteArkClassname((ArkClassName)data, s);
        }
Ejemplo n.º 2
0
        public override void WriteProp(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
        {
            base.WriteProp(s, go, f, ms);

            //Write int
            ms.WriteInt((int)data);
        }
Ejemplo n.º 3
0
        public override void WriteProp(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
        {
            base.WriteProp(s, go, f, ms);

            //Write the UInt64
            ms.WriteULong((ulong)data);
        }
Ejemplo n.º 4
0
        public override void WriteProp(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
        {
            base.WriteProp(s, go, f, ms);

            //Write the byte
            ms.ms.WriteByte((byte)data);
        }
 public override void WriteStruct(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
 {
     ms.WriteFloat(r);
     ms.WriteFloat(g);
     ms.WriteFloat(b);
     ms.WriteFloat(a);
 }
Ejemplo n.º 6
0
        public override void WriteProp(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
        {
            base.WriteProp(s, go, f, ms);

            //Write string
            ms.WriteUEString((string)data);
        }
Ejemplo n.º 7
0
        public override void WriteProp(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
        {
            base.WriteProp(s, go, f, ms);

            //If the length is four, just write the objectID
            //TODO: Track the referenced GameObject so changing the index doesn't break this.
            if (size == 4)
            {
                ms.WriteInt(objectId);
            }
            else if (size >= 8)
            {
                //Write the type
                ms.WriteInt((int)objectRefType);

                //Depending on the type, write it
                if (objectRefType == ObjectPropertyType.TypeID)
                {
                    ms.WriteInt(objectId);
                }
                else if (objectRefType == ObjectPropertyType.TypePath)
                {
                    ms.WriteArkClassname(className, s);
                }
                else
                {
                    throw new Exception("Unknown type of ObjectProperty.");
                }
            }
            else
            {
                throw new Exception($"Unknown ObjectProperty length, {size}. Cannot write.");
            }
        }
Ejemplo n.º 8
0
        public void WriteToDotArkFile(DotArkSerializerInstance ark, IOMemoryStream ms)
        {
            //Get name table index.
            int nameTableIndex = ark.GetNameTableEntry(classname);

            //Write nameTableIndex and the index
            ms.WriteInt(nameTableIndex);
            ms.WriteInt(index);
        }
Ejemplo n.º 9
0
        public override void WriteProp(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
        {
            base.WriteProp(s, go, f, ms);

            //Write the struct type
            ms.WriteArkClassname(structType, s);

            //Write the struct data.
            structData.WriteStruct(s, go, f, ms);
        }
Ejemplo n.º 10
0
        public override void WriteProp(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
        {
            //For now, fake this and pretend this is an empty array
            //TODO: Add ArrayProperty to saveable properties.
            size = 4;

            base.WriteProp(s, go, f, ms);
            ms.WriteArkClassname(arrayType, s);
            ms.WriteInt(0);
        }
Ejemplo n.º 11
0
        /// <summary>
        /// When overwritten, this function will write the prop
        /// </summary>
        /// <param name="s"></param>
        /// <param name="go"></param>
        /// <param name="f"></param>
        /// <param name="ms"></param>
        public virtual void WriteProp(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
        {
            //Write the header data
            ms.WriteArkClassname(name, s);
            ms.WriteArkClassname(type, s);
            ms.WriteInt(size);
            ms.WriteInt(index);

            //Now, the overwritten function will run.
        }
Ejemplo n.º 12
0
        public override void WriteProp(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
        {
            base.WriteProp(s, go, f, ms);

            byte value = 0;

            if ((bool)data)
            {
                value = 1;
            }

            //Write
            ms.WriteByte(value);
        }
Ejemplo n.º 13
0
        public override void WriteStruct(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
        {
            //Write all of the props in the dict
            foreach (var p in props)
            {
                //Write property
                p.Value.WriteProp(s, go, f, ms);
            }

            //Finally, write a None type to stop Ark
            ms.WriteArkClassname(new ArkClassName
            {
                classname = "None",
                index     = 0
            }, s);
        }
Ejemplo n.º 14
0
        public override void WriteProp(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
        {
            base.WriteProp(s, go, f, ms);

            //Convert from Base64 string
            byte[] buf = Convert.FromBase64String((string)data);

            //If this does not match the length, die
            if (size != buf.Length)
            {
                throw new Exception("The size of the TextProperty did not match the real size, in bytes.");
            }

            //Write
            ms.ms.Write(buf, 0, size);
        }
Ejemplo n.º 15
0
        public override void WriteProp(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
        {
            base.WriteProp(s, go, f, ms);

            //Write enum name
            ms.WriteArkClassname(enumName, s);

            //If this is a normal byte, write the byte value. Else, write the classname
            if (isNormalByte)
            {
                ms.ms.WriteByte(byteValue);
            }
            else
            {
                ms.WriteArkClassname(enumValue, s);
            }
        }
 public override void WriteStruct(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
 {
     ms.WriteInt(unk);
     ms.WriteUEString(netId);
 }
Ejemplo n.º 17
0
 public void WriteArkClassname(ArkClassName c, DotArkSerializerInstance i)
 {
     c.WriteToDotArkFile(i, this);
 }
Ejemplo n.º 18
0
 public virtual void WriteStruct(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
 {
     throw new Exception("Unknown sturct type; Cannot write.");
 }