Skip to content

Commit

Permalink
Fix bug where idling at initial screen for a while and then logging i…
Browse files Browse the repository at this point in the history
…n immediately does an afk emote
  • Loading branch information
ethanmoffat committed Sep 19, 2022
1 parent f80b3b0 commit ebc8f06
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion EndlessClient/Controllers/LoginController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using EndlessClient.GameExecution;
using EndlessClient.HUD;
using EndlessClient.HUD.Chat;
using EndlessClient.Input;
using EndlessClient.Rendering.Map;
using EOLib.Domain.Character;
using EOLib.Domain.Chat;
Expand Down Expand Up @@ -34,6 +35,7 @@ public class LoginController : ILoginController
private readonly ILocalizedStringFinder _localizedStringFinder;
private readonly IChatRepository _chatRepository;
private readonly INewsProvider _newsProvider;
private readonly IUserInputTimeRepository _userInputTimeRepository;
private readonly IErrorDialogDisplayAction _errorDisplayAction;
private readonly ISafeNetworkOperationFactory _networkOperationFactory;
private readonly IGameLoadingDialogFactory _gameLoadingDialogFactory;
Expand All @@ -55,7 +57,8 @@ public LoginController(ILoginActions loginActions,
IStatusLabelSetter statusLabelSetter,
ILocalizedStringFinder localizedStringFinder,
IChatRepository chatRepository,
INewsProvider newsProvider)
INewsProvider newsProvider,
IUserInputTimeRepository userInputTimeRepository)
{
_loginActions = loginActions;
_mapFileLoadActions = mapFileLoadActions;
Expand All @@ -72,6 +75,7 @@ public LoginController(ILoginActions loginActions,
_localizedStringFinder = localizedStringFinder;
_chatRepository = chatRepository;
_newsProvider = newsProvider;
_userInputTimeRepository = userInputTimeRepository;
}

public async Task LoginToAccount(ILoginParameters loginParameters)
Expand Down Expand Up @@ -189,6 +193,8 @@ public async Task LoginToCharacter(Character character)
ClearChat();
AddDefaultTextToChat();

_userInputTimeRepository.LastInputTime = DateTime.Now;

await Task.Delay(1000).ConfigureAwait(false); //always wait 1 second
}
finally
Expand Down

0 comments on commit ebc8f06

Please sign in to comment.