public void SendRotationAndElevation(float rotation, float elevation) { var msg = new UpdateRotationAndElevationMsg(); msg.EntityId = Entity.Entity.EntityId; msg.Rotation = rotation; msg.Elevation = elevation; Sync.Layer.SendMessageToServer(ref msg); }
private static void OnRotationAndElevationReceived(ref UpdateRotationAndElevationMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); var turret = entity as MyLargeTurretBase; if (turret != null) { turret.UpdateRotationAndElevation(msg.Rotation, msg.Elevation); } }
private static void OnRotationAndElevationReceived(ref UpdateRotationAndElevationMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); var turret = entity as MyLargeTurretBase; if (turret != null) { turret.UpdateRotationAndElevation(msg.Rotation, msg.Elevation); if (Sync.IsServer) { Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId); } } }
private static void OnRotationAndElevationReceived(ref UpdateRotationAndElevationMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); var turret = entity as MyLargeTurretBase; if (turret != null) { turret.UpdateRotationAndElevation(msg.Rotation, msg.Elevation); } }
public void SendRotationAndElevation(float rotation, float elevation) { var msg = new UpdateRotationAndElevationMsg(); msg.EntityId = Entity.Entity.EntityId; msg.Rotation = rotation; msg.Elevation = elevation; Sync.Layer.SendMessageToAll(ref msg); }
private static void OnRotationAndElevationReceived(ref UpdateRotationAndElevationMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); var turret = entity as MyLargeTurretBase; if (turret != null) { turret.UpdateRotationAndElevation(msg.Rotation, msg.Elevation); if (Sync.IsServer) { Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId); } } }