Пример #1
0
        public ChallengeThumbnail(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            version = new GBXUInt(s);
            AddChildDeprecated(versionKey, version);

            if (version.Value == 0)
            {
                return;
            }
            //version > 0
            thumbSize = new GBXUInt(s);
            AddChildDeprecated(thumbSizeKey, thumbSize);

            thumbBegin = new GBXFixedLengthString(s, 15);
            AddChildDeprecated(thumbBeginKey, thumbBegin);

            thumb = new Unread(s, (int)thumbSize.Value);
            AddChildDeprecated(thumbKey, thumb);

            thumbEnd = new GBXFixedLengthString(s, 16);
            AddChildDeprecated(thumbEndKey, thumbEnd);

            commentBegin = new GBXFixedLengthString(s, 10);
            AddChildDeprecated(commentBeginKey, commentBegin);

            comment = new GBXString(s);
            AddChildDeprecated(commentKey, comment);

            commentEnd = new GBXFixedLengthString(s, 11);
            AddChildDeprecated(commentEndKey, commentEnd);
        }
        public Challenge03043049(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            //TODO Figure out what this is.
            var unknown = new Unread(s, 36);

            AddChildDeprecated(unknownKey, unknown);
        }
 public Challenge03043051(Stream s, GBXLBSContext c) : base(c, null)
 {
     AlwaysZero = new GBXUInt(s);
     TitlePack  = new GBXLBS(c);
     Version    = new GBXString(s);
     this.LBSContext.SkipVersion();
 }
Пример #4
0
        public Challenge03043017(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            checkPointCount = new GBXUInt(s);
            AddChildDeprecated(checkPointCountKey, checkPointCount);

            checkPointArray = new Array <GBXNat3>(checkPointCount.Value, () => new GBXNat3(s));
            AddChildDeprecated(checkPointArrayKey, checkPointArray);
        }
        public Challenge03043018(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            unknown = new GBXBool(s);
            AddChildDeprecated(unknownKey, unknown);

            numLaps = new GBXUInt(s);
            AddChildDeprecated(numLapsKey, numLaps);
        }
        public Challenge03043014(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            unknown = new GBXUInt(s);
            AddChildDeprecated(unknownKey, unknown);

            passwordXorOld = new GBXString(s);
            AddChildDeprecated(passwordXorOldKey, passwordXorOld);
        }
        public ChallengeParameters0305B008(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            timeLimit = new GBXUInt(s);
            AddChildDeprecated(timeLimitKey, timeLimit);

            authorScore = new GBXUInt(s);
            AddChildDeprecated(authorScoreKey, authorScore);
        }
Пример #8
0
        public Challenge03043025(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            var mapCoordsOrigin = new GBXVec2(s);

            AddChildDeprecated(mapCoordsOriginKey, mapCoordsOrigin);

            var mapCoordsTarget = new GBXVec2(s);

            AddChildDeprecated(mapCoordsTargetKey, mapCoordsTarget);
        }
Пример #9
0
        public static Chunk ReadBodyChunk(Stream s, GBXLBSContext context, GBXNodeRefList list, out string key)
        {
            uint chunkID = s.ReadUInt();

            if (chunkID == facade)
            {
                key = null;
                return(null);
            }

            Chunk newChunk;

            try
            {
                if (IsChunkSkippable(chunkID))
                {
                    Trace.Assert(s.ReadUInt() == skip, "Error reading chunk. ChunkID:" + chunkID.ToString("X"));

                    long chunkEndPos = s.ReadUInt() + s.Position;

                    newChunk = ReadChunk(s, chunkID, new GBXLBSContext(), list, out key);

                    Trace.Assert(s.Position == chunkEndPos, "Error reading chunk. ChunkID:" + chunkID.ToString("X"));
                }
                else
                {
                    newChunk = ReadChunk(s, chunkID, context, list, out key);
                }
            }
            catch (KeyNotFoundException)
            {
                //Chunk not in database, testing if it can be skipped
                uint testSkip = BitConverter.ToUInt32(s.SimplePeek(4), 0);

                if (testSkip == skip) //Chunk can be skipped, chunk info not necessary
                {
                    s.Position += 4;
                    uint length = s.ReadUInt();

                    newChunk = new SkippedChunk(s, (int)length, new GBXLBSContext(), new GBXNodeRefList())
                    {
                        ChunkID     = chunkID,
                        isSkippable = true
                    };
                    key = skippedChunkKey + " " + chunkID.ToString("X");
                }
                else
                {
                    //This exeption will cause the read to end.
                    throw new UnknownChunkException("Chunk could not be read ChunkID: " + chunkID.ToString("X"));
                }
            }

            return(newChunk);
        }
Пример #10
0
        //TODO better names

        public ChallengeParameters0305B00E(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            unknown1 = new GBXString(s);
            AddChildDeprecated("Unknown 1", unknown1);

            unknown2 = new GBXUInt(s);
            AddChildDeprecated("Unknown 2", unknown2);

            unknown3 = new GBXUInt(s);
            AddChildDeprecated("Unknown 3", unknown3);
        }
Пример #11
0
        public Challenge03043011(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            collectorList = list.ReadGBXNodeRef(s, context);
            AddChildDeprecated(collectorListKey, collectorList);

            challengeParameters = list.ReadGBXNodeRef(s, context);
            AddChildDeprecated(challengeParametersKey, challengeParameters);

            kind = new GBXUInt(s);
            AddChildDeprecated(kindKey, kind);
        }
Пример #12
0
        public BlockSkin03059002(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            unknown = new GBXString(s);
            AddChildDeprecated(unknownKey, unknown);

            packDesc = new GBXFileRef(s);
            AddChildDeprecated(packDescKey, packDesc);

            parentPackDesc = new GBXFileRef(s);
            AddChildDeprecated(parentPackDescKey, parentPackDesc);
        }
        //TODO improve names

        public ChallengeParameters0305B005(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            ignored1 = new GBXUInt(s);
            AddChildDeprecated("Ignored 1", ignored1);

            ignored2 = new GBXUInt(s);
            AddChildDeprecated("Ignored 2", ignored2);

            ignored3 = new GBXUInt(s);
            AddChildDeprecated("Ignored 3", ignored3);
        }
Пример #14
0
        public Challenge03043021(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            clipIntro = list.ReadGBXNodeRef(s, context);
            AddChildDeprecated(clipIntroKey, clipIntro);

            clipGroupIngame = list.ReadGBXNodeRef(s, context);
            AddChildDeprecated(clipGroupIngameKey, clipGroupIngame);

            clipGroupEndRace = list.ReadGBXNodeRef(s, context);
            AddChildDeprecated(clipGroupEndRaceKey, clipGroupEndRace);
        }
        public ChallengeParameters0305B001(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            string1 = new GBXString(s);
            AddChildDeprecated("String 1", string1);

            string2 = new GBXString(s);
            AddChildDeprecated("String 2", string2);

            string3 = new GBXString(s);
            AddChildDeprecated("String 3", string3);

            string4 = new GBXString(s);
            AddChildDeprecated("String 4", string4);
        }
Пример #16
0
        private static Chunk ReadChunk(Stream s, uint chunkID, GBXLBSContext context, GBXNodeRefList list, out string key)
        {
            var info = chunkInfos[chunkID];

            key = info.key;
            var newChunk = info.constructor(s, context, list);

            if (newChunk.ChunkID == 0)
            {
                newChunk.ChunkID = chunkID; //ChunkID has not been set manually.
            }
            newChunk.isSkippable = info.skippable;
            return(newChunk);
        }
        public ChallengeParameters0305B004(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            bronzeTime = new GBXUInt(s);
            AddChildDeprecated(bronzeTimeKey, bronzeTime);

            silverTime = new GBXUInt(s);
            AddChildDeprecated(silverTimeKey, silverTime);

            goldTime = new GBXUInt(s);
            AddChildDeprecated(goldTimeKey, goldTime);

            authorTime = new GBXUInt(s);
            AddChildDeprecated(authorTimeKey, authorTime);

            ignored = new GBXUInt(s);
            AddChildDeprecated(ignoredKey, ignored);
        }
        public ChallengeAuthor(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            version = new GBXUInt(s);
            AddChildDeprecated(versionKey, version);

            authorVersion = new GBXUInt(s);
            AddChildDeprecated(authorVersionKey, authorVersion);

            authorLogin = new GBXString(s);
            AddChildDeprecated(authorLoginKey, authorLogin);

            authorNick = new GBXString(s);
            AddChildDeprecated(authorNickKey, authorNick);

            authorZone = new GBXString(s);
            AddChildDeprecated(authorZoneKey, authorZone);

            authorExtraInfo = new GBXString(s);
            AddChildDeprecated(authorExtraInfoKey, authorExtraInfo);
        }
Пример #19
0
        public ChallengeParameters0305B00A(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
        {
            unknown = new GBXUInt(s);
            AddChildDeprecated(unknownKey, unknown);

            bronzeTime = new GBXUInt(s);
            AddChildDeprecated(bronzeTimeKey, bronzeTime);

            silverTime = new GBXUInt(s);
            AddChildDeprecated(silverTimeKey, silverTime);

            goldTime = new GBXUInt(s);
            AddChildDeprecated(goldTimeKey, goldTime);

            authorTime = new GBXUInt(s);
            AddChildDeprecated(authorTimeKey, authorTime);

            timeLimit = new GBXUInt(s);
            AddChildDeprecated(timeLimitKey, timeLimit);

            authorScore = new GBXUInt(s);
            AddChildDeprecated(authorScoreKey, authorScore);
        }
        public GBXNodeRef ReadGBXNodeRef(Stream s, GBXLBSContext context)
        {
            uint index = s.ReadUInt();

            if (index == emptyNode) //Empty NodeRef
            {
                return(new GBXNodeRef(this, null));
            }

            //NodeRef contains node:
            Node node;

            try
            {
                node = _storedNodesRead[(int)index - 1];
            }
            catch (ArgumentOutOfRangeException)
            {
                node = new Node(s, context, this);
                _storedNodesRead.Add(node);
            }

            return(new GBXNodeRef(this, node));
        }
 public ChallengeParameters0305B006(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
 {
     count = new GBXUInt(s);
     Trace.Assert(count.Value == 0, "Unsupported count");
     AddChildDeprecated(countKey, count);
 }
Пример #22
0
 public Challenge0304301C(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
 {
     playMode = new GBXUInt(s);
     AddChildDeprecated(playModeKey, playMode);
 }
Пример #23
0
 public CollectorList0301B000(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
 {
     archiveCount = new GBXUInt(s);
     Trace.Assert(archiveCount.Value == 0, "Unsupported Archive count");
     AddChildDeprecated(archiveCountKey, archiveCount);
 }
 public ChallengeParameters0305B00D(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
 {
     unknown = new GBXUInt(s);
     AddChildDeprecated(unknownKey, unknown);
 }
 public ChallengeVersion(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
 {
     version = new GBXUInt(s);
     AddChildDeprecated(versionKey, version);
 }
 public Challenge03043024(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
 {
     customMusicPackDesc = new GBXFileRef(s);
     AddChildDeprecated(customMusicPackDescKey, customMusicPackDesc);
 }
 public ChallengeCommunity(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
 {
     CommunityXml = new GBXXml <MapCommunityRoot>(s);
 }
Пример #28
0
 protected Chunk(GBXLBSContext context, GBXNodeRefList list)
 {
     _context      = context;
     IsHeaderChunk = false;
 }
Пример #29
0
 public Challenge03043019(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
 {
     modRef = new GBXFileRef(s);
     AddChildDeprecated(modRefKey, modRef);
 }
Пример #30
0
 public Challenge03043026(Stream s, GBXLBSContext context, GBXNodeRefList list) : base(context, list)
 {
     clipGlobal = list.ReadGBXNodeRef(s, context);
     AddChildDeprecated(clipGlobalKey, clipGlobal);
 }