Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
 }
Пример #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);
        }
Пример #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.");
            }
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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.
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
 }
Пример #17
0
 public void WriteArkClassname(ArkClassName c, DotArkSerializerInstance i)
 {
     c.WriteToDotArkFile(i, this);
 }
Пример #18
0
 public virtual void WriteStruct(DotArkSerializerInstance s, DotArkGameObject go, DotArkFile f, IOMemoryStream ms)
 {
     throw new Exception("Unknown sturct type; Cannot write.");
 }