public void SendGyroTorqueRequest(Vector3 torque) { var msg = new OverrideGyroTorqueMsg(); msg.EntityId = m_block.EntityId; msg.Torque = torque; Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success); }
static void OverrideGyroTorqueSuccess(ref OverrideGyroTorqueMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); var block = entity as MyGyro; if (block != null) { block.SetGyroTorque(msg.Torque); } }
static void OverrideGyroTorqueSuccess(ref OverrideGyroTorqueMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); var block = entity as MyGyro; if (block != null) { block.SetGyroTorque(msg.Torque); if (Sync.IsServer) { Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId, MyTransportMessageEnum.Success); } } }
public void SendGyroTorqueRequest(Vector3 torque) { var msg = new OverrideGyroTorqueMsg(); msg.EntityId = m_block.EntityId; msg.Torque = torque; Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Success); }
static void OverrideGyroTorqueSuccess(ref OverrideGyroTorqueMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); var block = entity as MyGyro; if (block != null) block.SetGyroTorque(msg.Torque); }