Exemplo n.º 1
0
 public Definitions(NhaamaProcess process)
 {
     Time           = new Pointer(process, 0x1A8D3C0);
     Weather        = new Pointer(process, 0x1A62448);
     LocalContentId = new Pointer(process, 0x1B58B60);
     TerritoryType  = new Pointer(process, 0x1CB2E70, 0x12);
 }
Exemplo n.º 2
0
        public Game(Process process, bool loadRemote = true, string definitionFilePath = null)
        {
            Type    = process.MainModule.ModuleName.Contains("ffxiv_dx11") ? GameType.Dx11 : GameType.Dx9;
            Process = process.GetNhaamaProcess();

            var gameDirectory = new DirectoryInfo(process.MainModule.FileName);

            Version = File.ReadAllText(Path.Combine(gameDirectory.Parent.FullName, "ffxivgame.ver"));

            if (loadRemote)
            {
                Definitions = Definitions.Get(Process, Version, Type);
            }
            else if (definitionFilePath != null)
            {
                var definitionJson = File.ReadAllText(definitionFilePath);
                var serializer     = Process.GetSerializer();
                Definitions = serializer.DeserializeObject <Definitions>(definitionJson);
            }
            else
            {
                Definitions = new Definitions(Process);
            }

            ActorTable = new ActorTableCollection(this);
        }
Exemplo n.º 3
0
        public Game(Process process, bool loadRemote = true)
        {
            Type    = process.MainModule.ModuleName.Contains("ffxiv_dx11") ? GameType.Dx11 : GameType.Dx9;
            Process = process.GetNhaamaProcess();

            var gameDirectory = new DirectoryInfo(process.MainModule.FileName);

            Version = File.ReadAllText(Path.Combine(gameDirectory.Parent.FullName, "ffxivgame.ver"));

            Definitions = loadRemote ? Definitions.Get(Process, Version, Type) : new Definitions(Process);

            ActorTable = new ActorTableCollection(this);
        }
Exemplo n.º 4
0
        public static Definitions Get(NhaamaProcess p, string version, Game.GameType gameType)
        {
            using (WebClient client = new WebClient())
            {
                var uri = new Uri(DefinitionStoreUrl, $"{gameType.ToString().ToLower()}/{version}.json");

                try
                {
                    var definitionJson         = client.DownloadString(uri);
                    var serializer             = p.GetSerializer();
                    var deserializedDefinition = serializer.DeserializeObject <Definitions>(definitionJson);

                    return(deserializedDefinition);
                }
                catch (WebException exc)
                {
                    throw new Exception("Could not get definitions for version: " + uri, exc);
                }
            }
        }
Exemplo n.º 5
0
        public Definitions(NhaamaProcess process)
        {
            TerritoryType = new Pointer(process, 0x1AE5A88, 0x5A8);
            Time          = new Pointer(process, 0x1A8D3C0);
            Weather       = new Pointer(process, 0x1A62448);

            Pointers = new Dictionary <string, Pointer>();
            Pointers.Add("EquippedGear", new Pointer(process, 28116856, 96, 8));

            DefinedOffsets = new Dictionary <string, int>();
            DefinedOffsets.Add("EquipmentData_ContentID", 0);
            DefinedOffsets.Add("EquipmentData_IsHQ", 12);
            DefinedOffsets.Add("EquipmentData_MateriaIDs", 24);
            DefinedOffsets.Add("EquipmentData_MateriaRanks", 34);
            DefinedOffsets.Add("EquipmentData_DyeID", 39);
            DefinedOffsets.Add("EquipmentData_GlamourID", 40);

            StructureSizes = new Dictionary <string, int>();
            StructureSizes.Add("EquipmentData", 56);
            StructureSizes.Add("CharacterName", 0x44);
        }
Exemplo n.º 6
0
        public static string GetJson(NhaamaProcess process)
        {
            var serializer = process.GetSerializer();

            return(serializer.SerializeObject(new Definitions(process), Newtonsoft.Json.Formatting.Indented));
        }
 public ProcessModulePropertyConverter(NhaamaProcess process)
 {
     _process = process;
 }
Exemplo n.º 8
0
 public PointerPropertyConverter(NhaamaProcess process)
 {
     _process = process;
 }
Exemplo n.º 9
0
 public NhaamaSerializer(NhaamaProcess process)
 {
     _converters.Add(new ProcessModulePropertyConverter(process));
     _converters.Add(new PointerPropertyConverter(process));
 }
Exemplo n.º 10
0
 public Definitions(NhaamaProcess process)
 {
     TerritoryType = new Pointer(process, 0x1AE5A88, 0x5A8);
     Time          = new Pointer(process, 0x1A8D3C0);
     Weather       = new Pointer(process, 0x1A62448);
 }