mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Remove ReadProcessMemory call
New performance metric for the uncached case: About `55ms`
This commit is contained in:
parent
ebbd79274b
commit
32aa32d64a
1 changed files with 1 additions and 8 deletions
|
|
@ -73,14 +73,7 @@ namespace Dalamud.Game.ClientState.Actors {
|
||||||
private Actor ReadActorFromMemory(IntPtr offset)
|
private Actor ReadActorFromMemory(IntPtr offset)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
// FIXME: hack workaround for trying to access the player on logout, after the main object has been deleted
|
var actorStruct = Marshal.PtrToStructure<Structs.Actor>(offset);
|
||||||
if (!ReadProcessMemory(Process.GetCurrentProcess().Handle, offset, actorMem, actorMemSize, out _))
|
|
||||||
{
|
|
||||||
Log.Debug("ActorTable - ReadProcessMemory failed: likely player deletion during logout");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
var actorStruct = Marshal.PtrToStructure<Structs.Actor>(actorMem);
|
|
||||||
|
|
||||||
switch (actorStruct.ObjectKind) {
|
switch (actorStruct.ObjectKind) {
|
||||||
case ObjectKind.Player: return new PlayerCharacter(offset, actorStruct, this.dalamud);
|
case ObjectKind.Player: return new PlayerCharacter(offset, actorStruct, this.dalamud);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue