Esempio n. 1
0
            public override void Read(CGameCtnMediaClipGroup n, GameBoxReader r, GameBoxWriter unknownW)
            {
                Version = r.ReadInt32();

                var clips = r.ReadArray(i => r.ReadNodeRef<CGameCtnMediaClip>());
                var triggers = r.ReadArray(i =>
                {
                    var coords = r.ReadArray(j => r.ReadInt3());
                    var u01 = r.ReadInt32();
                    var u02 = r.ReadInt32();
                    var u03 = r.ReadInt32();
                    var u04 = r.ReadInt32();

                    return new Trigger()
                    {
                        Coords = coords,
                        U01 = u01,
                        U02 = u02,
                        U03 = u03,
                        U04 = u04
                    };
                });

                n.Clips = clips.Select((clip, index) =>
                    Tuple.Create(clip, triggers[index])
                ).ToList();
            }
Esempio n. 2
0
            public override void Read(CGameCtnMacroBlockInfo n, GameBoxReader r, GameBoxWriter unknownW)
            {
                var version = r.ReadInt32();
                var nodrefs = r.ReadArray(i => r.ReadNodeRef());

                r.ReadArray <int>(2);
            }
Esempio n. 3
0
 public override void Read(CGameCtnBlockInfo n, GameBoxReader r) // WIP
 {
     n.BlockName = r.ReadId();
     r.ReadInt32();
     r.ReadInt32();
     r.ReadInt32();
     r.ReadInt32();
     r.ReadInt32();
     r.ReadInt32();
     r.ReadInt32();
     r.ReadArray(r => r.ReadNodeRef <CGameCtnBlockUnitInfo>());
     r.ReadArray(r => r.ReadNodeRef <CGameCtnBlockUnitInfo>());
     r.ReadInt32();
     r.ReadInt32();
     r.ReadNodeRef <CSceneMobil>();
     r.ReadInt32();
     r.ReadInt32();
     r.ReadNodeRef <CSceneMobil>();
     r.ReadByte();
     r.ReadInt32();
     r.ReadInt32();
 }
Esempio n. 4
0
        public override void Read(CGameCtnMediaClipGroup n, GameBoxReader r)
        {
            n.ClipsVersion = r.ReadInt32();

            var clips = r.ReadArray(r => r.ReadNodeRef <CGameCtnMediaClip>() !);

            var triggers = r.ReadArray(r => new Trigger()
            {
                Coords = r.ReadArray(r => r.ReadInt3())
            });

            n.Clips = clips.Select((clip, index) =>
                                   new ClipTrigger(clip, triggers[index])
                                   ).ToList();
        }
Esempio n. 5
0
        public override void Read(CGameCtnBlockInfoMobil n, GameBoxReader r)
        {
            U01 = r.ReadInt32();
            U02 = r.ReadInt32();

            n.DynaLinks = r.ReadArray(r =>
            {
                var u01      = r.ReadInt32();
                var u02      = r.ReadInt32();
                var u03      = r.ReadInt32();
                var socketID = r.ReadId();
                var model    = r.ReadNodeRef <CGameObjectModel>();

                return(new CGameCtnBlockInfoMobilLink(socketID, model));
            });
        }
Esempio n. 6
0
        public override void Read(CGameCtnBlockInfoMobil n, GameBoxReader r)
        {
            Version = r.ReadInt32();
            r.ReadByte();
            var num = r.ReadInt32();

            if (num == 16777216) // TODO: figure out why
            {
                r.ReadSingle();
                r.ReadSingle();

                r.ReadSingle();
                r.ReadSingle();

                r.ReadSingle();
                r.ReadSingle();
            }

            if (Version >= 20)
            {
                r.ReadInt32();
                r.ReadInt32();
            }

            r.ReadInt32();
            r.ReadInt32();
            r.ReadInt32();
            r.ReadInt32();
            r.ReadInt32();
            r.ReadInt32();
            r.ReadInt32();

            if (Version >= 20)
            {
                r.ReadInt32();
                r.ReadInt32();
                r.ReadInt32(); // 3

                r.ReadInt32();
                r.ReadInt32();
                r.ReadInt32();
                r.ReadInt32();
                r.ReadByte();
                r.ReadVec3();
                n.RoadChunks = r.ReadArray(r => r.ReadNodeRef <CPlugRoadChunk>());
            }
        }
Esempio n. 7
0
            public override void Read(CGameCtnMacroBlockInfo n, GameBoxReader r, GameBoxWriter unknownW)
            {
                var unknown = r.ReadArray(i =>
                {
                    var version = r.ReadInt32();
                    if (r.ReadNodeRef() != null)
                    {
                        throw new NotImplementedException();
                    }

                    if (version == 0)
                    {
                        r.ReadInt32();
                        r.ReadInt32();
                        r.ReadInt32();
                    }

                    r.ReadInt32();

                    return(new object());
                });
            }
Esempio n. 8
0
 public override void Read(CGameCtnReplayRecord n, GameBoxReader r)
 {
     U01          = r.ReadInt32();
     U02          = r.ReadInt32();
     n.recordData = r.ReadNodeRef <CPlugEntRecordData>();
 }
Esempio n. 9
0
 public override void Read(CGameCtnReplayRecord n, GameBoxReader r)
 {
     n.clip = r.ReadNodeRef <CGameCtnMediaClip>();
 }
Esempio n. 10
0
 public override void Read(CGameCtnReplayRecord n, GameBoxReader r)
 {
     n.events = r.ReadNodeRef <CCtnMediaBlockEventTrackMania>();
 }
Esempio n. 11
0
            public override void Read(CGameCtnMacroBlockInfo n, GameBoxReader r, GameBoxWriter unknownW)
            {
                n.Blocks = r.ReadArray(i =>
                {
                    Int3?coord        = null;
                    Direction?dir     = null;
                    Vec3?position     = null;
                    Vec3?pitchYawRoll = null;

                    var ver   = r.ReadInt32();
                    var ident = r.ReadIdent();
                    int flags = 0;

                    if (ver >= 2)
                    {
                        if (ver < 5)
                        {
                        }

                        flags = r.ReadInt32();

                        if (ver >= 4)
                        {
                            if ((flags & (1 << 26)) != 0) // free block
                            {
                                position     = r.ReadVec3();
                                pitchYawRoll = r.ReadVec3();
                            }
                            else
                            {
                                coord = (Int3)r.ReadByte3();
                                dir   = (Direction)r.ReadByte();
                            }
                        }
                    }

                    if (ver >= 3)
                    {
                        if (r.ReadNodeRef() != null)
                        {
                            throw new NotImplementedException();
                        }
                    }

                    if (ver >= 4)
                    {
                        if (r.ReadNodeRef() != null)
                        {
                            throw new NotImplementedException();
                        }
                    }

                    var correctFlags = flags & 15;

                    if ((flags & 0x20000) != 0) // Fixes inner pillars of some blocks
                    {
                        correctFlags |= 0x400000;
                    }

                    if ((flags & 0x10000) != 0) // Fixes ghost blocks
                    {
                        correctFlags |= 0x10000000;
                    }

                    var block = new CGameCtnBlock()
                    {
                        BlockInfo = ident,
                        Coord     = coord.GetValueOrDefault(),
                        Direction = dir.GetValueOrDefault(),
                        Flags     = correctFlags
                    };

                    if ((flags & (1 << 26)) != 0)
                    {
                        block.IsFree = true;
                        block.AbsolutePositionInMap += position.GetValueOrDefault();
                        block.PitchYawRoll          += pitchYawRoll.GetValueOrDefault();
                    }

                    return(block);
                }).Where(x => x != null).ToArray();
            }
Esempio n. 12
0
            public override void Read(CGameCtnMacroBlockInfo n, GameBoxReader r, GameBoxWriter unknownW)
            {
                Version = r.ReadInt32();

                n.AnchoredObjects = r.ReadArray(i =>
                {
                    var v = r.ReadInt32();

                    var itemModel = r.ReadIdent();

                    Vec3 pitchYawRoll  = default;
                    Vec3 pivotPosition = default;
                    float scale        = 1;

                    if (v < 3)
                    {
                        var quarterY = r.ReadByte();

                        if (v != 0)
                        {
                            var additionalDir = r.ReadByte();
                        }
                    }
                    else
                    {
                        pitchYawRoll = r.ReadVec3();
                    }

                    var blockCoord = r.ReadInt3();
                    var lookback   = r.ReadId();
                    var pos        = r.ReadVec3();

                    if (v < 5)
                    {
                        r.ReadInt32();
                    }
                    if (v < 6)
                    {
                        r.ReadInt32();
                    }
                    if (v >= 6)
                    {
                        r.ReadInt16(); // 0
                    }
                    if (v >= 7)
                    {
                        pivotPosition = r.ReadVec3();
                    }
                    if (v >= 8)
                    {
                        r.ReadNodeRef(); // probably waypoint
                    }
                    if (v >= 9)
                    {
                        scale = r.ReadSingle(); // 1
                    }
                    if (v >= 10)
                    {
                        r.ReadArray <int>(3); // 0 1 -1
                    }
                    return(new CGameCtnAnchoredObject()
                    {
                        ItemModel = itemModel,
                        PitchYawRoll = pitchYawRoll,
                        BlockUnitCoord = (Byte3)blockCoord,
                        AbsolutePositionInMap = pos,
                        PivotPosition = pivotPosition,
                        Scale = scale,
                    });
                });

                var num = r.ReadInt32();

                if (num == 1)
                {
                    r.ReadInt32();
                    r.ReadInt32();
                }
            }
Esempio n. 13
0
 public override void Read(CGameCtnAutoTerrain n, GameBoxReader r)
 {
     var offset    = r.ReadInt3();
     var genealogy = r.ReadNodeRef <CGameCtnZoneGenealogy>();
 }
Esempio n. 14
0
 public override void Read(CPlugMaterial n, GameBoxReader r)
 {
     var customMaterial = r.ReadNodeRef <CPlugMaterialCustom>();
 }