public void SendChangeTargetingRequest(MyTurretTargetFlags flags) { var msg = new ChangeTargetingMsg(); msg.EntityId = m_turret.EntityId; msg.TargetFlags = flags; Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request); }
static void ChangeTargetingRequest(ref ChangeTargetingMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); if (entity is MyLargeTurretBase) { Sync.Layer.SendMessageToAllAndSelf(ref msg, MyTransportMessageEnum.Success); } }
static void ChangeTargetingSuccess(ref ChangeTargetingMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); var turret = entity as MyLargeTurretBase; if (turret != null) { turret.TargetFlags = msg.TargetFlags; } }