using Unity.Entities; using UnityEngine; namespace ProjectM.Server { /// /// 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. /// [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 } } }