private static void OnAttachRotor(MySyncMotorStator block, ref AttachRotorMsg msg, MyNetworkClient sender) { MyMotorStator stator = (MyMotorStator)block.Entity; stator.AttachRotor(); if (Sync.IsServer) { Sync.Layer.SendMessageToAll(ref msg); } }
private static void OnChangeStatorMaxAngle(MySyncMotorStator block, ref ChangeStatorMaxAngleMsg msg, MyNetworkClient sender) { MyMotorStator stator = (MyMotorStator)block.Entity; stator.MaxAngle = msg.MaxAngleNormalized; if (Sync.IsServer) { Sync.Layer.SendMessageToAll(ref msg); } }
private static void OnChangeStatorTargetVelocity(MySyncMotorStator block, ref ChangeStatorTargetVelocityMsg msg, MyNetworkClient sender) { MyMotorStator stator = (MyMotorStator)block.Entity; stator.TargetVelocity = msg.TargetVelocity; if (Sync.IsServer) { Sync.Layer.SendMessageToAll(ref msg); } }
private static void OnChangeStatorBrakingTorque(MySyncMotorStator block, ref ChangeStatorBrakingTorqueMsg msg, MyNetworkClient sender) { MyMotorStator stator = (MyMotorStator)block.Entity; stator.BrakingTorque = msg.BrakingTorque; if (Sync.IsServer) { Sync.Layer.SendMessageToAll(ref msg); } }
private static void OnChangeRotorDisplacement(MySyncMotorStator sync, ref SetRotorDisplacementMsg msg, MyNetworkClient sender) { MyMotorStator stator = (MyMotorStator)sync.Entity; stator.DummyDisplacement = msg.Displacement; if (Sync.IsServer) { Sync.Layer.SendMessageToAll(ref msg); } }
static void OnSetCurrentAngle(MySyncMotorStator sync, ref SetCurrentAngleMsg msg, MyNetworkClient sender) { sync.SetAngle(msg.CurrentAngle); }
private static void OnChangeStatorMaxAngle(MySyncMotorStator block, ref ChangeStatorMaxAngleMsg msg, MyNetworkClient sender) { MyMotorStator stator = (MyMotorStator)block.Entity; stator.MaxAngle = msg.MaxAngleNormalized; if (Sync.IsServer) Sync.Layer.SendMessageToAll(ref msg); }
private static void OnChangeStatorTargetVelocity(MySyncMotorStator block, ref ChangeStatorTargetVelocityMsg msg, MyNetworkClient sender) { MyMotorStator stator = (MyMotorStator)block.Entity; stator.TargetVelocity = msg.TargetVelocity; if (Sync.IsServer) Sync.Layer.SendMessageToAll(ref msg); }
private static void OnChangeStatorBrakingTorque(MySyncMotorStator block, ref ChangeStatorBrakingTorqueMsg msg, MyNetworkClient sender) { MyMotorStator stator = (MyMotorStator)block.Entity; stator.BrakingTorque = msg.BrakingTorque; if (Sync.IsServer) Sync.Layer.SendMessageToAll(ref msg); }
protected override MySyncEntity OnCreateSync() { var sync = new MySyncMotorStator(this); sync.SetAngle = SyncAngle; return sync; }