mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 18:47:23 +01:00
heave fewer redraws as main method for data application, minor fixes
This commit is contained in:
parent
f89bbc45e6
commit
1522d8d7e7
8 changed files with 53 additions and 52 deletions
|
|
@ -173,7 +173,7 @@ public class DalamudUtilService : IHostedService
|
|||
|
||||
public async Task<string> GetPlayerNameHashedAsync()
|
||||
{
|
||||
return await RunOnFrameworkThread(() => (GetPlayerName() + GetWorldId()).GetHash256()).ConfigureAwait(false);
|
||||
return await RunOnFrameworkThread(() => (GetPlayerName() + GetHomeWorldId()).GetHash256()).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public IntPtr GetPlayerPointer()
|
||||
|
|
@ -187,17 +187,28 @@ public class DalamudUtilService : IHostedService
|
|||
return await RunOnFrameworkThread(GetPlayerPointer).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public uint GetWorldId()
|
||||
public uint GetHomeWorldId()
|
||||
{
|
||||
EnsureIsOnFramework();
|
||||
return _clientState.LocalPlayer!.HomeWorld.Id;
|
||||
}
|
||||
|
||||
public uint GetWorldId()
|
||||
{
|
||||
EnsureIsOnFramework();
|
||||
return _clientState.LocalPlayer!.CurrentWorld.Id;
|
||||
}
|
||||
|
||||
public async Task<uint> GetWorldIdAsync()
|
||||
{
|
||||
return await RunOnFrameworkThread(GetWorldId).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task<uint> GetHomeWorldIdAsync()
|
||||
{
|
||||
return await RunOnFrameworkThread(GetHomeWorldId).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public unsafe bool IsGameObjectPresent(IntPtr key)
|
||||
{
|
||||
return _objectTable.Any(f => f.Address == key);
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public class ServerConfigurationManager
|
|||
}
|
||||
|
||||
var charaName = _dalamudUtil.GetPlayerNameAsync().GetAwaiter().GetResult();
|
||||
var worldId = _dalamudUtil.GetWorldIdAsync().GetAwaiter().GetResult();
|
||||
var worldId = _dalamudUtil.GetHomeWorldIdAsync().GetAwaiter().GetResult();
|
||||
if (!currentServer.Authentications.Any() && currentServer.SecretKeys.Any())
|
||||
{
|
||||
currentServer.Authentications.Add(new Authentication()
|
||||
|
|
@ -136,7 +136,7 @@ public class ServerConfigurationManager
|
|||
server.Authentications.Add(new Authentication()
|
||||
{
|
||||
CharacterName = _dalamudUtil.GetPlayerNameAsync().GetAwaiter().GetResult(),
|
||||
WorldId = _dalamudUtil.GetWorldIdAsync().GetAwaiter().GetResult(),
|
||||
WorldId = _dalamudUtil.GetHomeWorldIdAsync().GetAwaiter().GetResult(),
|
||||
SecretKeyIdx = addLastSecretKey ? server.SecretKeys.Last().Key : -1,
|
||||
});
|
||||
Save();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue