Ejemplo n.º 1
0
 public BoundsStoreItem(BinaryReader br)
 {
     Name  = new MetaHash(br.ReadUInt32());
     Min   = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
     Max   = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
     Layer = br.ReadUInt32();
 }
Ejemplo n.º 2
0
        public MapDataStoreNode(BinaryReader br)
        {
            Name                = new MetaHash(br.ReadUInt32());
            ParentName          = new MetaHash(br.ReadUInt32());
            ContentFlags        = br.ReadUInt32();
            streamingExtentsMin = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            streamingExtentsMax = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            entitiesExtentsMin  = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            entitiesExtentsMax  = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            Unk1                = br.ReadByte(); //HD flag? (critical, long, strm)
            Unk2                = br.ReadByte(); //lod flag? - primary map files
            Unk3                = br.ReadByte(); //slod flag?
            Unk4                = br.ReadByte();

            if (Unk1 != 0)
            {
            }
            if (Unk2 != 0)
            {
            }
            if (Unk3 != 0)
            {
            }
            if (Unk4 != 0)
            {
            }   //no hits here now..

            if (Unk4 == 0xFE)
            {
                //this seems to never be hit anymore...
                UnkExtra = new MapDataStoreNodeExtra(br);
            }
        }
Ejemplo n.º 3
0
        public void SwapEnd()
        {
            Name = new MetaHash(MetaTypes.SwapBytes(Name.Hash));
            var b = Bounds; b.SwapEnd(); Bounds = b;
            var w = WeatherTypes; w.SwapEnd(); WeatherTypes = w;

            HoursOnOff = MetaTypes.SwapBytes(HoursOnOff);
            Flags      = MetaTypes.SwapBytes(Flags);
        }
Ejemplo n.º 4
0
        public CVehicleModelInfoVariation_418053801(XmlNode node)
        {
            modelName = Xml.GetChildInnerText(node, "modelName");
            XmlNode cnode;

            cnode = node.SelectSingleNode("colors");
            if (cnode != null)
            {
                var items = cnode.SelectNodes("Item");
                if (items.Count > 0)
                {
                    colors = new CVehicleModelInfoVariation_2575850962[items.Count];
                    for (int i = 0; i < items.Count; i++)
                    {
                        colors[i] = new CVehicleModelInfoVariation_2575850962(items[i]);
                    }
                }
            }
            cnode = node.SelectSingleNode("kits");
            if (cnode != null)
            {
                var items = cnode.SelectNodes("Item");
                if (items.Count > 0)
                {
                    kits = new MetaHash[items.Count];
                    for (int i = 0; i < items.Count; i++)
                    {
                        kits[i] = XmlMeta.GetHash(items[i].InnerText);
                    }
                }
            }
            cnode = node.SelectSingleNode("windowsWithExposedEdges");
            if (cnode != null)
            {
                var items = cnode.SelectNodes("Item");
                if (items.Count > 0)
                {
                    windowsWithExposedEdges = new MetaHash[items.Count];
                    for (int i = 0; i < items.Count; i++)
                    {
                        windowsWithExposedEdges[i] = XmlMeta.GetHash(items[i].InnerText);
                    }
                }
            }
            cnode = node.SelectSingleNode("plateProbabilities");
            if (cnode != null)
            {
                plateProbabilities = new PlateProbabilities(cnode);
            }
            lightSettings = (byte)Xml.GetChildIntAttribute(node, "lightSettings", "value");
            sirenSettings = (byte)Xml.GetChildIntAttribute(node, "sirenSettings", "value");
        }
Ejemplo n.º 5
0
 public CacheFileDate(string line)
 {
     string[] parts = line.Split(' ');
     if (parts.Length == 3)
     {
         FileName  = new MetaHash(uint.Parse(parts[0]));
         TimeStamp = DateTime.FromFileTimeUtc(long.Parse(parts[1]));
         FileID    = uint.Parse(parts[2]);
     }
     else
     {
     }   //testing
 }
Ejemplo n.º 6
0
 public static MetaHash[] GetHashArray(PsoFile pso, Array_uint arr)
 {
     uint[] uints = GetUintArrayRaw(pso, arr);
     if (uints == null)
     {
         return(null);
     }
     MetaHash[] hashes = new MetaHash[uints.Length];
     for (int n = 0; n < uints.Length; n++)
     {
         hashes[n].Hash = MetaTypes.SwapBytes(uints[n]);
     }
     return(hashes);
 }
Ejemplo n.º 7
0
        public MapDataStoreNode(BinaryReader br)
        {
            Name                = new MetaHash(br.ReadUInt32());
            ParentName          = new MetaHash(br.ReadUInt32());
            ContentFlags        = br.ReadUInt32();
            streamingExtentsMin = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            streamingExtentsMax = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            entitiesExtentsMin  = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            entitiesExtentsMax  = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            Unk02               = br.ReadByte();
            Unk03               = br.ReadByte();
            Unk04               = br.ReadByte();
            Unk05               = br.ReadByte();

            if (Unk05 == 0xFE)
            {
                UnkExtra = new MapDataStoreNodeExtra(br);
            }
        }
Ejemplo n.º 8
0
 public CInteriorProxy(BinaryReader br)
 {
     Unk01       = br.ReadUInt32();
     Unk02       = br.ReadUInt32();
     Unk03       = br.ReadUInt32();
     Name        = new MetaHash(br.ReadUInt32());
     Parent      = new MetaHash(br.ReadUInt32());
     Position    = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
     Orientation = new Quaternion(br.ReadSingle(), br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
     BBMin       = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
     BBMax       = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
     Unk11       = br.ReadSingle();
     Unk12       = br.ReadUInt32();
     Unk13       = br.ReadSingle();
     Unk14       = br.ReadUInt32();
     Unk15       = br.ReadSingle();
     Unk16       = br.ReadUInt32();
     Unk17       = br.ReadUInt32();
     Unk18       = br.ReadUInt32();
 }
Ejemplo n.º 9
0
 public void SwapEnd()
 {
     Name = new MetaHash(MetaTypes.SwapBytes(Name.Hash));
 }
Ejemplo n.º 10
0
 public void SwapEnd()
 {
     Name = new MetaHash(MetaTypes.SwapBytes(Name.Hash));
     var aabb = AABB; aabb.SwapEnd(); AABB = aabb;
 }
Ejemplo n.º 11
0
 public void SwapEnd()
 {
     Name = new MetaHash(MetaTypes.SwapBytes(Name.Hash));
     var b = Bounds; b.SwapEnd(); Bounds = b;
 }
Ejemplo n.º 12
0
 public void SwapEnd()
 {
     itypName      = new MetaHash(MetaTypes.SwapBytes(itypName.Hash));
     manifestFlags = MetaTypes.SwapBytes(manifestFlags);
     var d = itypDepArray; d.SwapEnd(); itypDepArray = d;
 }
Ejemplo n.º 13
0
 public void SwapEnd()
 {
     imapName     = new MetaHash(MetaTypes.SwapBytes(imapName.Hash));
     itypName     = new MetaHash(MetaTypes.SwapBytes(itypName.Hash));
     packFileName = new MetaHash(MetaTypes.SwapBytes(packFileName.Hash));
 }
Ejemplo n.º 14
0
        public CInteriorProxy(BinaryReader br)
        {
            Unk01       = br.ReadUInt32();
            Unk02       = br.ReadUInt32();
            Unk03       = br.ReadUInt32();
            Name        = new MetaHash(br.ReadUInt32());
            Parent      = new MetaHash(br.ReadUInt32());
            Position    = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            Orientation = new Quaternion(br.ReadSingle(), br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            BBMin       = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            BBMax       = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            Unk11       = br.ReadSingle();
            Unk12       = br.ReadUInt32();
            Unk13       = br.ReadSingle();
            Unk14       = br.ReadUInt32();
            Unk15       = br.ReadSingle();
            Unk16       = br.ReadUInt32();
            Unk17       = br.ReadUInt32();//could be float
            Unk18       = br.ReadUInt32();



            switch (Unk01)
            {
            case 0:     //v_cashdepot
            case 19:    //dt1_02_carpark
            case 20:    //dt1_03_carpark
            case 21:    //dt1_05_carpark
            case 4:     //dt1_rd1_tun
            case 14:    //id1_11_tunnel1_int
            case 24:    //v_firedept
            case 3:     //id2_21_a_tun1
            case 22:    //po1_08_warehouseint1
            case 11:    //sc1_rd_inttun1
            case 10:    //sc1_rd_inttun2b_end
            case 18:    //bt1_04_carpark
            case 16:    //v_hanger
            case 1:     //ap1_03_lisapark_subway
            case 13:    //kt1_03_carpark_int
            case 5:     //sm20_tun1
            case 2:     //vbca_tunnel1
            case 15:    //cs1_12_tunnel01_int
            case 6:     //cs1_14brailway1
            case 9:     //cs2_roadsb_tunnel_01
            case 7:     //cs3_03railtunnel_int1
            case 8:     //cs4_rwayb_tunnelint
            case 12:    //ch1_roadsdint_tun1
            case 100:   //hei_int_mph_carrierhang3
            case 47:    //xm_x17dlc_int_base_ent
                break;

            default:
                break;
            }

            if (Unk02 != 0)
            {
            }

            switch (Unk03)
            {
            case 6:     //v_cashdepot
            case 2:     //dt1_02_carpark
            case 8:     //v_fib01
            case 4:     //v_fib03
            case 0:     //v_fib04
            case 7:     //v_clotheslo
            case 1:     //v_gun
            case 3:     //v_genbank
            case 11:    //v_hospital
            case 5:     //v_shop_247
            case 32:    //v_abattoir
            case 13:    //v_franklins
            case 15:    //v_michael
            case 18:    //v_faceoffice
            case 29:    //v_recycle
            case 9:     //v_stadium
            case 54:    //v_farmhouse
            case 12:    //v_ranch
            case 26:    //hei_gta_milo_bar
            case 17:    //hei_gta_milo_bedrm
            case 14:    //hei_gta_milo_bridge
            case 48:    //apa_mpapa_yacht
                break;

            default:
                break;
            }


            if ((Unk12 == 0) || (Unk12 > 0xFFFFFF))
            {
            }

            switch (Unk14)
            {
            case 1:
            case 0:
            case 580:
            case 355:     //sm_smugdlc_int_01
            case 579:     //xm_x17dlc_int_01
                break;

            default:
                break;
            }
            switch (Unk16)
            {
            case 1:
            case 32758:     //0x7FF6
                break;

            default:
                break;
            }
            switch (Unk17) //could be a float..!
            {
            case 9:
                break;

            case 0x415CBC04:     //13.7959f
            case 0x7B81AC94:
            case 0x40FE3224:     //7.94362f v_gun
            case 0x41515774:     //13.0839f v_gun
            case 0x414E7B34:     //12.9051f bkr_biker_dlc_int_03
            case 0x41389C14:     //11.5381f imp_impexp_int_01
            case 0x4177B664:     //15.482f gr_grdlc_int_01
            case 0xCE0404F4:     //         sm_smugdlc_int_01
                break;

            default:
                //string str = JenkIndex.GetString(Unk17);
                break;
            }
            switch (Unk18)
            {
            case 0:
            case 1:
            case 32758:     //0x7FF6
                break;

            default:
                break;
            }
        }
Ejemplo n.º 15
0
        public void Load(byte[] data, RpfFileEntry entry)
        {
            FileEntry = entry;
            Name      = entry.Name;

            MemoryStream  ms = new MemoryStream(data);
            BinaryReader  br = new BinaryReader(ms);
            StringBuilder sb = new StringBuilder();

            Type = br.ReadUInt32();                     //type/version?

            DataLength = br.ReadUInt32();               //length of data block
            DataBlock  = br.ReadBytes((int)DataLength); //data block... synth infos? script?

            NameTableLength = br.ReadUInt32();          //length of this nametable block
            NameTableCount  = br.ReadUInt32();
            if (NameTableCount > 0)
            {
                uint[] d02 = new uint[NameTableCount]; //string offsets
                for (uint i = 0; i < NameTableCount; i++)
                {
                    d02[i] = br.ReadUInt32();
                }
                NameTableOffsets = d02;
                string[] names = new string[NameTableCount];
                for (uint i = 0; i < NameTableCount; i++)
                {
                    sb.Clear();
                    while (true)
                    {
                        char c = (char)br.ReadByte();
                        if (c != 0)
                        {
                            sb.Append(c);
                        }
                        else
                        {
                            break;
                        }
                    }
                    names[i] = sb.ToString();
                }
                NameTable = names;
            }

            IndexCount = br.ReadUInt32(); //count of index items
            if (IndexCount > 0)
            {
                //checking NameTableLength here doesn't make sense!
                if ((Type == 4) && (NameTableLength == 4)) //audioconfig.dat4.rel
                {
                    IndexStringFlags = br.ReadUInt32();    //what is this?  2524
                    RelIndexString[] indexstrs = new RelIndexString[IndexCount];
                    for (uint i = 0; i < IndexCount; i++)
                    {
                        byte sl = br.ReadByte();
                        sb.Clear();
                        for (int j = 0; j < sl; j++)
                        {
                            char c = (char)br.ReadByte();
                            if (c != 0)
                            {
                                sb.Append(c);
                            }
                        }
                        RelIndexString cunk01 = new RelIndexString();
                        cunk01.Name   = sb.ToString();
                        cunk01.Offset = br.ReadUInt32();
                        cunk01.Length = br.ReadUInt32();
                        indexstrs[i]  = cunk01;
                    }
                    IndexStrings = indexstrs;
                }
                else //for all other .rel files...
                {
                    RelIndexHash[] indexhashes = new RelIndexHash[IndexCount];
                    for (uint i = 0; i < IndexCount; i++)
                    {
                        RelIndexHash unk01 = new RelIndexHash();
                        unk01.Name     = new MetaHash(br.ReadUInt32());
                        unk01.Offset   = br.ReadUInt32();
                        unk01.Length   = br.ReadUInt32();
                        indexhashes[i] = unk01;
                    }
                    IndexHashes = indexhashes;
                }
            }


            Unk05Count = br.ReadUInt32();
            if (Unk05Count != 0)
            {
                uint[]     d05  = new uint[Unk05Count];
                MetaHash[] d05h = new MetaHash[Unk05Count];
                for (uint i = 0; i < Unk05Count; i++)
                {
                    d05[i] = br.ReadUInt32();

                    var pos = ms.Position;
                    ms.Position = d05[i];
                    d05h[i]     = new MetaHash(br.ReadUInt32());
                    ms.Position = pos;
                }
                Unk05Arr    = d05;
                Unk05Hashes = d05h;
            }

            Unk06Count = br.ReadUInt32();
            if (Unk06Count != 0)
            {
                uint[]     d06  = new uint[Unk06Count];
                MetaHash[] d06h = new MetaHash[Unk06Count];
                for (uint i = 0; i < Unk06Count; i++)
                {
                    d06[i] = br.ReadUInt32();

                    var pos = ms.Position;
                    ms.Position = d06[i];
                    d06h[i]     = new MetaHash(br.ReadUInt32());
                    ms.Position = pos;
                }
                Unk06Arr    = d06;
                Unk06Hashes = d06h;
            }

            if (ms.Position != ms.Length)
            {
            }
            //EOF!

            br.Dispose();
            ms.Dispose();


            ParseDataBlock();
        }
Ejemplo n.º 16
0
        public CInteriorProxy(BinaryReader br)
        {
            Unk01       = br.ReadUInt32();
            Unk02       = br.ReadUInt32();
            Unk03       = br.ReadUInt32();
            Name        = new MetaHash(br.ReadUInt32());
            Parent      = new MetaHash(br.ReadUInt32());
            Position    = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            Orientation = new Quaternion(br.ReadSingle(), br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            BBMin       = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            BBMax       = new Vector3(br.ReadSingle(), br.ReadSingle(), br.ReadSingle());
            Unk11       = br.ReadUInt64();
            Unk12       = br.ReadUInt64();
            Unk13       = br.ReadUInt64();
            Unk14       = br.ReadUInt64(); //(unk14-unk13)=~ 5500000


            switch (Unk01)
            {
            case 0:     //v_cashdepot
            case 19:    //dt1_02_carpark
            case 20:    //dt1_03_carpark
            case 21:    //dt1_05_carpark
            case 4:     //dt1_rd1_tun
            case 14:    //id1_11_tunnel1_int
            case 24:    //v_firedept
            case 3:     //id2_21_a_tun1
            case 22:    //po1_08_warehouseint1
            case 11:    //sc1_rd_inttun1
            case 10:    //sc1_rd_inttun2b_end
            case 18:    //bt1_04_carpark
            case 16:    //v_hanger
            case 1:     //ap1_03_lisapark_subway
            case 13:    //kt1_03_carpark_int
            case 5:     //sm20_tun1
            case 2:     //vbca_tunnel1
            case 15:    //cs1_12_tunnel01_int
            case 6:     //cs1_14brailway1
            case 9:     //cs2_roadsb_tunnel_01
            case 7:     //cs3_03railtunnel_int1
            case 8:     //cs4_rwayb_tunnelint
            case 12:    //ch1_roadsdint_tun1
            case 100:   //hei_int_mph_carrierhang3
            case 47:    //xm_x17dlc_int_base_ent
            case 120:
            case 119:
                break;

            default:
                break;
            }

            if (Unk02 != 0)
            {
            }

            switch (Unk03)
            {
            case 6:     //v_cashdepot
            case 2:     //dt1_02_carpark
            case 8:     //v_fib01
            case 4:     //v_fib03
            case 0:     //v_fib04
            case 7:     //v_clotheslo
            case 1:     //v_gun
            case 3:     //v_genbank
            case 11:    //v_hospital
            case 5:     //v_shop_247
            case 32:    //v_abattoir
            case 13:    //v_franklins
            case 15:    //v_michael
            case 18:    //v_faceoffice
            case 29:    //v_recycle
            case 9:     //v_stadium
            case 54:    //v_farmhouse
            case 12:    //v_ranch
            case 26:    //hei_gta_milo_bar
            case 17:    //hei_gta_milo_bedrm
            case 14:    //hei_gta_milo_bridge
            case 48:    //apa_mpapa_yacht
            case 43:
                break;

            default:
                break;
            }

            switch (Unk11)
            {
            case 5390106048:
            case 50578352072311817:
            case 140699061757388:
            case 738537932908210:
            case 65651138218412653:
            case 19678574933270533:
            case 67944777457713148:
            case 42661052301639680:
            case 64551944402634707:
            case 6851324394453320:
            case 5376209604:
            case 7160325822942775:
            case 140695211737544:
            case 5379565000:
            case 12610731652297560:
            case 0:
            case 5836226042334228:
                break;

            default:
                break;
            }
            switch (Unk12)
            {
            case 5394258664:
            case 1788295895209:
            case 2301144275160:
            case 2301144295745:
            case 2301144271926:
            case 2293121037876:
            case 2301144284982:
            case 2301144280511:
            case 2301144292239:
            case 2301144276247:
            case 2297948090320:
            case 2301144281267:
            case 2301144273909:
            case 2301144274429:
            case 2301144278131:
            case 2301144276931:
            case 2301144285912:
            case 2301144279392:
            case 2301144278900:
            case 2301144280746:
            case 2301144276750:
            case 2301144279385:
            case 794564824:
            case 794585409:
            case 3426812900:
            case 3363906997:
            case 2488666884898:
            case 1551090123535:
            case 3581544739:
            case 2697016884:
            case 2697019190:
            case 2697014452:
            case 2697013894:
            case 2697026447:
            case 2697010756:
            case 2697012560:
            case 2697010345:
            case 2697015248:
            case 2697009368:
            case 2697014442:
            case 2697008117:
            case 2697008069:
            case 2697018851:
            case 2697012339:
            case 2697010263:
            case 2697019078:
            case 2697013518:
            case 2697013308:
            case 2697013108:
            case 2079647991056:
            case 2333569996536:
            case 3433367119:
            case 2293344373240:
            case 1527735255327:
            case 1581974815172:
            case 2067312412743:
            case 2240565805648:
                break;

            default:
                break;
            }
            switch (Unk13)
            {
            case 5416947112:
            case 140699301996180:
            case 140699066065044:
            case 5381321844:
            case 5385188756:
            case 5385376164:
            case 140696605328676:
            case 140701349594068:
            case 5387902360:
            case 5380079992:
            case 140695959352556:
            case 140695215813968:
            case 5383741744:
            case 140697989613796:
            case 140701810993260:
            case 140701892506988:
            case 140701188531008:
                break;

            default:
                break;
            }
            switch (Unk14)
            {
            case 9:
            case 140699307584676:
            case 140699071655044:
            case 5386712196:
            case 5390629684:
            case 5390817140:
            case 140696610778260:
            case 140701355067892:
            case 5393331812:
            case 5385368100:
            case 140695964849172:
            case 140695221335892:
            case 5389196308:
            case 140697995052276:
            case 140701816510228:
            case 140701898076100:
            case 140701194017116:
                break;

            default:
                break;
            }
        }