public void SendControlThrust(Vector3 controlThrust) { var msg = new ThrustMsg(); msg.GridEntityId = Entity.EntityId; msg.Thrust = controlThrust; if (m_thrustState.ShouldSend(msg.ThrustData)) { // Send to all because we want thrust animation on other ships if (msg.ThrustData == Vector3B.Zero) { // Send zero thrust as reliable var zeroMsg = new ThrustZeroMsg(); zeroMsg.GridEntityId = Entity.EntityId; Sync.Layer.SendMessageToAll(ref msg); } else { Sync.Layer.SendMessageToAll(ref msg); } } }
private static void OnThrustReceived(MySyncGrid sync, ref ThrustMsg msg, MyNetworkClient sender) { sync.Entity.GridSystems.ThrustSystem.ControlThrust = msg.Thrust; }
private static void OnThrustReceived(MySyncGrid sync, ref ThrustMsg msg, MyNetworkClient sender) { var thrustComp = sync.Entity.Components.Get<MyEntityThrustComponent>(); if (thrustComp != null) thrustComp.ControlThrust = msg.Thrust; if (Sync.IsServer) { Sync.Layer.SendAsRpcToAllButOne(ref msg, sender.SteamUserId); } }