public void bot_stopAbility(string abilityName) { if (_game.UserHandler.UserExistsAndReady(Context.ConnectionId)) { try { Ship ship = _game.UserHandler.GetUserShip(Context.ConnectionId); if (ship.Controllable.Value) { ship.DeactivateAbility(abilityName); } } catch (Exception e) { _logger.LogError("registerAbilityStart", e); } } }
public void registerAbilityStop(string abilityName, bool pingBack, long commandID) { if (_game.UserHandler.UserExistsAndReady(Context.ConnectionId)) { try { if (pingBack) { Clients.Caller.pingBack(); } Ship ship = _game.UserHandler.GetUserShip(Context.ConnectionId); if (ship.Controllable.Value) { ship.DeactivateAbility(abilityName, commandID); } } catch (Exception e) { } } }
public async Task registerAbilityStop(string abilityName, Vector2 at, double angle, Vector2 velocity, bool pingBack) { if (_game.UserHandler.UserExistsAndReady(Context.ConnectionId)) { try { if (pingBack) { await Clients.Client(Context.ConnectionId).SendAsync("pingBack"); } Ship ship = _game.UserHandler.GetUserShip(Context.ConnectionId); if (ship.Controllable.Value) { ship.DeactivateAbility(abilityName, at, angle, velocity); } } catch (Exception e) { _logger.LogError("registerAbilityStop", e); } } }
public void registerAbilityStop(string abilityName, Vector2 at, double angle, Vector2 velocity, bool pingBack) { if (_game.UserHandler.UserExistsAndReady(Context.ConnectionId)) { try { if (pingBack) { Clients.Caller.pingBack(); } Ship ship = _game.UserHandler.GetUserShip(Context.ConnectionId); if (ship.Controllable.Value) { ship.DeactivateAbility(abilityName, at, angle, velocity); } } catch (Exception e) { ErrorLog.Instance.Log(e); } } }