perf(fourkit): server gc, fast-path event dispatch, tps probe

This commit is contained in:
itsRevela
2026-04-24 21:31:06 -05:00
parent 6db68bda06
commit b64b1f17db
11 changed files with 486 additions and 57 deletions
@@ -160,4 +160,32 @@ public static partial class FourKitHost
ServerLog.Error("fourkit", $"SetWorldEntityCallbacks error: {ex}");
}
}
[UnmanagedCallersOnly]
public static void SetSubscriptionCallbacks(IntPtr setHandlerMask)
{
try
{
NativeBridge.SetSubscriptionCallbacks(setHandlerMask);
// Flush the mask accumulated during plugin onEnable.
FourKit.ResyncHandlerMask();
}
catch (Exception ex)
{
ServerLog.Error("fourkit", $"SetSubscriptionCallbacks error: {ex}");
}
}
[UnmanagedCallersOnly]
public static void SetServerCallbacks(IntPtr getServerTickCount)
{
try
{
NativeBridge.SetServerCallbacks(getServerTickCount);
}
catch (Exception ex)
{
ServerLog.Error("fourkit", $"SetServerCallbacks error: {ex}");
}
}
}