Files
Project-M/Assets/_Project/Scripts/Server/ServerStripAnimationSystem.cs
T
kronic 951b7ec273 Animate the player: Rukhanka skeletal locomotion (client-derived)
Replace the capsule with a rigged Synty SciFiSpace soldier driven by Rukhanka 2.9 (netcode replication off; animation derived client-side from replicated state). Adds a slim top-down AnimatorController (idle / 2D-strafe locomotion / death) from Synty clips; client-only PlayerAnimationDriveSystem (local CC-velocity + remote position-delta paths); AnimParamMath (+10 EditMode tests); ServerStripAnimationSystem (disables Rukhanka on the server, zero server-side animation). Client.asmdef gains Rukhanka.Runtime/CharacterController/Physics. EditMode 204/204; Play-validated. See DR-022.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 18:18:11 -07:00

38 lines
1.8 KiB
C#

using Unity.Entities;
using UnityEngine;
namespace ProjectM.Server
{
/// <summary>
/// Animation is a CLIENT-ONLY presentation concern (Rukhanka netcode OFF — see DR-022). Rukhanka still
/// touches the SERVER world: its deformation systems use [WorldSystemFilter(Default)] (Default includes
/// ServerSimulation), so a headless server would run skinned-mesh prep + mesh deformation on the player's
/// baked bones/meshes that nothing renders. (Rukhanka's bootstrap creates RukhankaAnimationSystemGroup on
/// the server too, but leaves it EMPTY — it only fills the update list for client/local worlds.)
///
/// This server-only one-shot disables every Rukhanka.Runtime system in the server world. Disabling a
/// ComponentSystemGroup stops all its children (managed AND unmanaged ISystems), so this covers the whole
/// Rukhanka stack — the server then does ZERO animation/deformation work. Matched by assembly name (no
/// hard Rukhanka type ref → no asmdef change), so it survives Rukhanka updates.
/// </summary>
[WorldSystemFilter(WorldSystemFilterFlags.ServerSimulation)]
public partial class ServerStripAnimationSystem : SystemBase
{
protected override void OnUpdate()
{
int disabled = 0;
foreach (var sys in World.Systems)
{
if (sys == null || !sys.Enabled) continue;
if (sys.GetType().Assembly.GetName().Name == "Rukhanka.Runtime")
{
sys.Enabled = false;
disabled++;
}
}
Debug.Log($"[ProjectM] ServerStripAnimationSystem: disabled {disabled} Rukhanka systems on the server world (animation is client-only).");
Enabled = false; // one-shot
}
}
}