mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-31 12:53:41 +01:00
Rewrite parts of ClientState (#2065)
- Completely relies on hooks now, instead of the Framework.Update loop - Support for Logout codes
This commit is contained in:
parent
c88e008672
commit
c7facaf072
5 changed files with 120 additions and 67 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ internal class AutoUpdateManager : IServiceType
|
|||
t =>
|
||||
{
|
||||
t.Result.Login += this.OnLogin;
|
||||
t.Result.Logout += this.OnLogout;
|
||||
t.Result.Logout += (int type, int code) => this.OnLogout();
|
||||
});
|
||||
Service<Framework>.GetAsync().ContinueWith(t => { t.Result.Update += this.OnUpdate; });
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,13 @@ public interface IClientState
|
|||
/// <param name="level">The level of the corresponding ClassJob.</param>
|
||||
public delegate void LevelChangeDelegate(uint classJobId, uint level);
|
||||
|
||||
/// <summary>
|
||||
/// A delegate type used for the <see cref="Logout"/> event.
|
||||
/// </summary>
|
||||
/// <param name="type">The type of logout.</param>
|
||||
/// <param name="code">The success/failure code.</param>
|
||||
public delegate void LogoutDelegate(int type, int code);
|
||||
|
||||
/// <summary>
|
||||
/// Event that gets fired when the current Territory changes.
|
||||
/// </summary>
|
||||
|
|
@ -46,7 +53,7 @@ public interface IClientState
|
|||
/// <summary>
|
||||
/// Event that fires when a character is logging out.
|
||||
/// </summary>
|
||||
public event Action Logout;
|
||||
public event LogoutDelegate Logout;
|
||||
|
||||
/// <summary>
|
||||
/// Event that fires when a character is entering PvP.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue