ignore hat/weapon state changes
This commit is contained in:
@@ -5,6 +5,7 @@ using MareSynchronos.Mediator;
|
||||
using MareSynchronos.Models;
|
||||
using MareSynchronos.Utils;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Collections;
|
||||
|
||||
namespace MareSynchronos.Managers;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<Authors></Authors>
|
||||
<Company></Company>
|
||||
<Version>0.7.38</Version>
|
||||
<Version>0.7.39</Version>
|
||||
<Description></Description>
|
||||
<Copyright></Copyright>
|
||||
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>
|
||||
|
||||
@@ -165,11 +165,11 @@ public class GameObjectHandler : MediatorSubscriberBase
|
||||
}
|
||||
}
|
||||
|
||||
var customizeDiff = CompareAndUpdateCustomizeData(chara->CustomizeData, out bool doNotSendUpdate);
|
||||
var customizeDiff = CompareAndUpdateCustomizeData(chara->CustomizeData);
|
||||
|
||||
if (addrDiff || equipDiff || customizeDiff || drawObjDiff || nameChange)
|
||||
{
|
||||
if (_isOwnedObject && !doNotSendUpdate)
|
||||
if (_isOwnedObject)
|
||||
{
|
||||
_logger.LogTrace("[{this}] Changed", this);
|
||||
|
||||
@@ -203,10 +203,9 @@ public class GameObjectHandler : MediatorSubscriberBase
|
||||
_clearCts = null;
|
||||
}
|
||||
|
||||
private unsafe bool CompareAndUpdateCustomizeData(byte* customizeData, out bool doNotSendUpdate)
|
||||
private unsafe bool CompareAndUpdateCustomizeData(byte* customizeData)
|
||||
{
|
||||
bool hasChanges = false;
|
||||
doNotSendUpdate = false;
|
||||
|
||||
for (int i = 0; i < CustomizeData.Length; i++)
|
||||
{
|
||||
@@ -218,30 +217,6 @@ public class GameObjectHandler : MediatorSubscriberBase
|
||||
}
|
||||
}
|
||||
|
||||
var newHatState = Marshal.ReadByte((IntPtr)customizeData + 30, 0);
|
||||
var newWeaponOrVisorState = Marshal.ReadByte((IntPtr)customizeData + 31, 0);
|
||||
if (newHatState != HatState)
|
||||
{
|
||||
if (HatState != null && !hasChanges)
|
||||
{
|
||||
_logger.LogDebug("[{this}] Not Sending Update, only Hat changed", this);
|
||||
doNotSendUpdate = true;
|
||||
}
|
||||
HatState = newHatState;
|
||||
}
|
||||
|
||||
newWeaponOrVisorState &= 0b1101; // ignore drawing weapon
|
||||
|
||||
if (newWeaponOrVisorState != VisorWeaponState)
|
||||
{
|
||||
if (VisorWeaponState != null && !hasChanges)
|
||||
{
|
||||
_logger.LogDebug("[{this}] Not Sending Update, only Visor/Weapon changed", this);
|
||||
doNotSendUpdate = true;
|
||||
}
|
||||
VisorWeaponState = newWeaponOrVisorState;
|
||||
}
|
||||
|
||||
return hasChanges;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user