/// <summary> /// Initializes a new instance of the <see cref="ClientState"/> class. /// Set up client state access. /// </summary> /// <param name="dalamud">Dalamud instance.</param> /// <param name="startInfo">StartInfo of the current Dalamud launch.</param> /// <param name="scanner">Sig scanner.</param> internal ClientState(Dalamud dalamud, DalamudStartInfo startInfo, SigScanner scanner) { this.dalamud = dalamud; this.address = new ClientStateAddressResolver(); this.address.Setup(scanner); Log.Verbose("===== C L I E N T S T A T E ====="); this.ClientLanguage = startInfo.Language; this.Actors = new ActorTable(dalamud, this.address); this.Fates = new FateTable(dalamud, this.address); this.PartyList = new PartyList(dalamud, this.address); this.JobGauges = new JobGauges(this.address); this.KeyState = new KeyState(this.address, scanner.Module.BaseAddress); this.GamepadState = new GamepadState(this.address); this.Condition = new Condition(this.address); this.Targets = new Targets(dalamud, this.address); Log.Verbose($"SetupTerritoryType address 0x{this.address.SetupTerritoryType.ToInt64():X}"); this.setupTerritoryTypeHook = new Hook <SetupTerritoryTypeDelegate>(this.address.SetupTerritoryType, this.SetupTerritoryTypeDetour); dalamud.Framework.OnUpdateEvent += this.FrameworkOnOnUpdateEvent; dalamud.NetworkHandlers.CfPop += this.NetworkHandlersOnCfPop; }
/// <summary> /// Set up client state access. /// </summary> /// <param name="dalamud">Dalamud instance</param> /// /// <param name="startInfo">StartInfo of the current Dalamud launch</param> /// <param name="scanner">Sig scanner</param> public ClientState(Dalamud dalamud, DalamudStartInfo startInfo, SigScanner scanner) { this.dalamud = dalamud; Address = new ClientStateAddressResolver(); Address.Setup(scanner); Log.Verbose("===== C L I E N T S T A T E ====="); this.ClientLanguage = startInfo.Language; this.Actors = new ActorTable(dalamud, Address); this.PartyList = new PartyList(dalamud, Address); this.JobGauges = new JobGauges(Address); this.KeyState = new KeyState(Address, scanner.Module.BaseAddress); this.Condition = new Condition(Address); this.Targets = new Targets(dalamud, Address); Log.Verbose("SetupTerritoryType address {SetupTerritoryType}", Address.SetupTerritoryType); this.setupTerritoryTypeHook = new Hook <SetupTerritoryTypeDelegate>(Address.SetupTerritoryType, new SetupTerritoryTypeDelegate(SetupTerritoryTypeDetour), this); dalamud.Framework.OnUpdateEvent += FrameworkOnOnUpdateEvent; dalamud.NetworkHandlers.CfPop += NetworkHandlersOnCfPop; }
/// <summary> /// Initializes a new instance of the <see cref="GamepadState" /> class. /// </summary> /// <param name="resolver">Resolver knowing the pointer to the GamepadPoll function.</param> public GamepadState(ClientStateAddressResolver resolver) { #if DEBUG Log.Verbose("GamepadPoll address {GamepadPoll}", resolver.GamepadPoll); #endif this.gamepadPoll = new Hook <ControllerPoll>( resolver.GamepadPoll, (ControllerPoll)this.GamepadPollDetour); }
/// <summary> /// Set up client state access. /// </summary> /// <param name="dalamud">Dalamud instance</param> /// /// <param name="startInfo">StartInfo of the current Dalamud launch</param> /// <param name="scanner">Sig scanner</param> /// <param name="targetModule">Game process module</param> public ClientState(Dalamud dalamud, DalamudStartInfo startInfo, SigScanner scanner, ProcessModule targetModule) { Address = new ClientStateAddressResolver(); Address.Setup(scanner); Log.Verbose("===== C L I E N T S T A T E ====="); this.ClientLanguage = startInfo.Language; this.Actors = new ActorTable(Address); this.JobGauges = new JobGauges(Address); dalamud.Framework.OnUpdateEvent += FrameworkOnOnUpdateEvent; }
/// <summary> /// Initializes a new instance of the <see cref="ClientState"/> class. /// Set up client state access. /// </summary> internal ClientState() { this.address = new ClientStateAddressResolver(); this.address.Setup(); Log.Verbose("===== C L I E N T S T A T E ====="); this.ClientLanguage = Service <DalamudStartInfo> .Get().Language; Service <ObjectTable> .Set(this.address); Service <FateTable> .Set(this.address); Service <PartyList> .Set(this.address); Service <BuddyList> .Set(this.address); Service <JobGauges> .Set(this.address); Service <KeyState> .Set(this.address); Service <GamepadState> .Set(this.address); Service <Condition> .Set(this.address); Service <TargetManager> .Set(this.address); Service <AetheryteList> .Set(this.address); Log.Verbose($"SetupTerritoryType address 0x{this.address.SetupTerritoryType.ToInt64():X}"); this.setupTerritoryTypeHook = new Hook <SetupTerritoryTypeDelegate>(this.address.SetupTerritoryType, this.SetupTerritoryTypeDetour); var framework = Service <Framework> .Get(); framework.Update += this.FrameworkOnOnUpdateEvent; var networkHandlers = Service <NetworkHandlers> .Get(); networkHandlers.CfPop += this.NetworkHandlersOnCfPop; }
/// <summary> /// Set up client state access. /// </summary> /// <param name="dalamud">Dalamud instance</param> /// /// <param name="startInfo">StartInfo of the current Dalamud launch</param> /// <param name="scanner">Sig scanner</param> public ClientState(Dalamud dalamud, DalamudStartInfo startInfo, SigScanner scanner) { Address = new ClientStateAddressResolver(); Address.Setup(scanner); Log.Verbose("===== C L I E N T S T A T E ====="); this.ClientLanguage = startInfo.Language; this.Actors = new ActorTable(dalamud, Address); this.JobGauges = new JobGauges(Address); this.KeyState = new KeyState(Address, scanner.Module.BaseAddress); Log.Verbose("SetupTerritoryType address {SetupTerritoryType}", Address.SetupTerritoryType); this.setupTerritoryTypeHook = new Hook <SetupTerritoryTypeDelegate>(Address.SetupTerritoryType, new SetupTerritoryTypeDelegate(SetupTerritoryTypeDetour), this); dalamud.Framework.OnUpdateEvent += FrameworkOnOnUpdateEvent; }
/// <summary> /// Initializes a new instance of the <see cref="Condition"/> class. /// </summary> /// <param name="resolver">The ClientStateAddressResolver instance.</param> internal Condition(ClientStateAddressResolver resolver) { this.ConditionArrayBase = resolver.ConditionFlags; }
public PartyList(Dalamud dalamud, ClientStateAddressResolver addressResolver) { Address = addressResolver; this.dalamud = dalamud; this.partyListUpdateHook = new Hook <PartyListUpdateDelegate>(Address.PartyListUpdate, new PartyListUpdateDelegate(PartyListUpdateDetour), this); }
public KeyState(ClientStateAddressResolver addressResolver, IntPtr moduleBaseAddress) { this.bufferBase = moduleBaseAddress + Marshal.ReadInt32(addressResolver.KeyboardState); Log.Verbose($"Keyboard state buffer address {this.bufferBase}"); }
/// <summary> /// Initializes a new instance of the <see cref="JobGauges"/> class. /// </summary> /// <param name="addressResolver">Address resolver with the JobGauge memory location(s).</param> public JobGauges(ClientStateAddressResolver addressResolver) { this.Address = addressResolver; Log.Verbose($"JobGaugeData address 0x{this.Address.JobGaugeData.ToInt64():X}"); }
/// <summary> /// Initializes a new instance of the <see cref="GamepadState" /> class. /// </summary> /// <param name="resolver">Resolver knowing the pointer to the GamepadPoll function.</param> public GamepadState(ClientStateAddressResolver resolver) { Log.Verbose($"GamepadPoll address 0x{resolver.GamepadPoll.ToInt64():X}"); this.gamepadPoll = new Hook <ControllerPoll>(resolver.GamepadPoll, this.GamepadPollDetour); }
/// <summary> /// Initializes a new instance of the <see cref="JobGauges"/> class. /// </summary> /// <param name="addressResolver">Address resolver with the JobGauge memory location(s).</param> public JobGauges(ClientStateAddressResolver addressResolver) { this.Address = addressResolver; Log.Verbose("JobGaugeData address {JobGaugeData}", this.Address.JobGaugeData); }
public JobGauges(ClientStateAddressResolver addressResolver) { Address = addressResolver; Log.Verbose("JobGaugeData address {JobGaugeData}", Address.ActorTable); }