public void SendChangeRangeRequest(float range) { var msg = new ChangeRangeMsg(); msg.EntityId = m_turret.EntityId; msg.Range = range; Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request); }
static void ChangeRangeRequest(ref ChangeRangeMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); if (entity is MyLargeTurretBase) { Sync.Layer.SendMessageToAllAndSelf(ref msg, MyTransportMessageEnum.Success); } }
static void ChangeRangeSuccess(ref ChangeRangeMsg msg, MyNetworkClient sender) { MyEntity entity; MyEntities.TryGetEntityById(msg.EntityId, out entity); var turret = entity as MyLargeTurretBase; if (turret != null) { turret.ShootingRange = msg.Range; } }