Exemplo n.º 1
0
            void VerifyHeaderGroupTag(IO.ITagStream ts, Type type_of)
            {
                if (header.GroupTag != headerGroupTag.ID)
                {
                    if (type == FieldType.Struct)
                    {
                        var groups = ts.Engine.VersionToStructCollection();
                        int index  = groups.FindGroupIndex(header.GroupTag);

                        if (index == -1)
                        {
                            failureReason = VersioningFailureReason.GroupTagNotFound;

                            Debug.LogFile.WriteLine("{5} field set signature failed (signature not found) \t@{0:X8} [{1} !{2}] in {3}\t {4}",
                                                    relativeOffset, headerGroupTag.TagToString(), new string(TagGroup.FromUInt(header.GroupTag)),
                                                    type_of, ts.GetExceptionDescription(),
                                                    GetTypeString());
                            throw new Exceptions.InvalidVersion(ts);
                        }
                    }

                    failureReason = VersioningFailureReason.GroupTagMismatch;

                    Debug.LogFile.WriteLine("{5} field set signature failed\t@{0:X8} [{1} !{2}] in {3}\t {4}",
                                            relativeOffset,
                                            headerGroupTag.TagToString(), new string(TagGroup.FromUInt(header.GroupTag)),
                                            type_of, ts.GetExceptionDescription(),
                                            GetTypeString());
                    throw new Exceptions.InvalidVersion(ts);
                }
            }
Exemplo n.º 2
0
 public void Setup(Definition definition, TagGroup tag, short head, short ver)
 {
     def      = definition;
     groupTag = tag;
     header   = head;
     version  = ver;
 }
Exemplo n.º 3
0
            public FieldSetVersioning(BlamVersion engine, FieldType container_type, DefinitionState state)
            {
                failureReason        = VersioningFailureReason.None;
                relativeOffset       = 0;
                expectedCount        = 1;
                needsUpgrading       = false;
                useImplicitUpgrading = false;
                header = new tag_fieldset_header();

                this.type  = container_type;
                this.state = state;

                if (container_type != FieldType.Struct)
                {
                    this.headerGroupTag = Blam.MiscGroups.tbfd;
                }
                else
                {
                    var groups = engine.VersionToStructCollection();
                    var sa     = state.Attribute as StructAttribute;

                    headerGroupTag = groups[sa.GroupIndex];
                }
            }
Exemplo n.º 4
0
 public FieldSetVersioning(BlamVersion engine, FieldType container_type, DefinitionState state, TagGroup group_tag)
     : this(engine, container_type, state)
 {
     this.headerGroupTag = group_tag;
 }
Exemplo n.º 5
0
 public DefinitionFile(TagGroup tag, BlamVersion g)
 {
     engine   = g;
     groupTag = tag;
 }
Exemplo n.º 6
0
 public DefinitionFile(TagGroup tag, GameMan.Namespace g, GameMan.Platform p)
 {
     engine   = GameMan.ToBlamVersion(g, p);
     groupTag = tag;
 }