Skip to content

Commit

Permalink
Merge pull request #244 from ethanmoffat/hotfix
Browse files Browse the repository at this point in the history
Apply hotfixes from master to 0.10 release branch
  • Loading branch information
ethanmoffat authored Nov 18, 2022
2 parents c8223d4 + d444a65 commit a46a1ff
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
14 changes: 9 additions & 5 deletions EndlessClient/GameExecution/GameRunnerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,17 @@ public virtual bool SetupDependencies()
if (string.Equals(arg, "--host") && i < _args.Length - 1)
{
var host = _args[i + 1];
_registry.Resolve<IConfigurationRepository>().Host = host;

if (IPEndPoint.TryParse(host, out var endpoint)) {
_registry.Resolve<IConfigurationRepository>()
.Host = endpoint.Address.ToString();
i++;
}
else if(string.Equals(arg, "--port") && i < _args.Length - 1)
{
var port = _args[i + 1];

_registry.Resolve<IConfigurationRepository>()
.Port = endpoint.Port;
if (int.TryParse(port, out var intPort))
{
_registry.Resolve<IConfigurationRepository>().Port = intPort;
}

i++;
Expand Down
7 changes: 7 additions & 0 deletions EndlessClient/GameExecution/GameStateActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using EndlessClient.ControlSets;
using EndlessClient.Network;
using EOLib.Domain.Character;
using EOLib.Domain.Login;
using Microsoft.Xna.Framework;

namespace EndlessClient.GameExecution
Expand All @@ -17,20 +18,23 @@ public class GameStateActions : IGameStateActions
private readonly IControlSetRepository _controlSetRepository;
private readonly IControlSetFactory _controlSetFactory;
private readonly IEndlessGameProvider _endlessGameProvider;
private readonly IPlayerInfoRepository _playerInfoRepository;
private readonly ISfxPlayer _sfxPlayer;
private readonly IMfxPlayer _mfxPlayer;

public GameStateActions(IGameStateRepository gameStateRepository,
IControlSetRepository controlSetRepository,
IControlSetFactory controlSetFactory,
IEndlessGameProvider endlessGameProvider,
IPlayerInfoRepository playerInfoRepository,
ISfxPlayer sfxPlayer,
IMfxPlayer mfxPlayer)
{
_gameStateRepository = gameStateRepository;
_controlSetRepository = controlSetRepository;
_controlSetFactory = controlSetFactory;
_endlessGameProvider = endlessGameProvider;
_playerInfoRepository = playerInfoRepository;
_sfxPlayer = sfxPlayer;
_mfxPlayer = mfxPlayer;
}
Expand All @@ -40,6 +44,9 @@ public void ChangeToState(GameStates newState)
if (newState == _gameStateRepository.CurrentState)
return;

if (_gameStateRepository.CurrentState == GameStates.PlayingTheGame)
_playerInfoRepository.PlayerIsInGame = false;

var currentSet = _controlSetRepository.CurrentControlSet;
var nextSet = _controlSetFactory.CreateControlsForState(newState, currentSet);

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ Here's a working list of things I want to add that would be additional features

**--host <server>** Overrides the server set in the config file with a different value. Convenient for testing against different servers from Visual Studio, since the build process will overwrite the configuration file in the output directory.

**--port <port>** Overrides the port set in the config file with a different value.

**--version <version>** Overrides the version set in the config file or hard-coded into the client. Convenient for connecting to different servers that might require different version numbers.

**--account_delay_ms <value>** Sets the delay when creating an account. Some servers enforce a specific limit. Defaults to 2 seconds if unset.
Expand Down

0 comments on commit a46a1ff

Please sign in to comment.