Skip to content

Commit

Permalink
remove extra async/await when requesting files from server
Browse files Browse the repository at this point in the history
  • Loading branch information
sorokya committed Mar 27, 2022
1 parent c7cabc7 commit 13011a3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions EndlessClient/Controllers/LoginController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,39 +129,39 @@ public async Task LoginToCharacter(ICharacter character)
if (unableToLoadMap || _fileRequestActions.NeedsFileForLogin(InitFileType.Map, _currentMapStateProvider.CurrentMapID))
{
gameLoadingDialog.SetState(GameLoadingDialogState.Map);
if (!await SafeGetFile(async () => await _fileRequestActions.GetMapFromServer(_currentMapStateProvider.CurrentMapID, sessionID)))
if (!await SafeGetFile(() => _fileRequestActions.GetMapFromServer(_currentMapStateProvider.CurrentMapID, sessionID)))
return;
await Task.Delay(1000);
}

if (_fileRequestActions.NeedsFileForLogin(InitFileType.Item))
{
gameLoadingDialog.SetState(GameLoadingDialogState.Item);
if (!await SafeGetFile(async () => await _fileRequestActions.GetItemFileFromServer(sessionID)))
if (!await SafeGetFile(() => _fileRequestActions.GetItemFileFromServer(sessionID)))
return;
await Task.Delay(1000);
}

if (_fileRequestActions.NeedsFileForLogin(InitFileType.Npc))
{
gameLoadingDialog.SetState(GameLoadingDialogState.NPC);
if (!await SafeGetFile(async () => await _fileRequestActions.GetNPCFileFromServer(sessionID)))
if (!await SafeGetFile(() => _fileRequestActions.GetNPCFileFromServer(sessionID)))
return;
await Task.Delay(1000);
}

if (_fileRequestActions.NeedsFileForLogin(InitFileType.Spell))
{
gameLoadingDialog.SetState(GameLoadingDialogState.Spell);
if (!await SafeGetFile(async () => await _fileRequestActions.GetSpellFileFromServer(sessionID)))
if (!await SafeGetFile(() => _fileRequestActions.GetSpellFileFromServer(sessionID)))
return;
await Task.Delay(1000);
}

if (_fileRequestActions.NeedsFileForLogin(InitFileType.Class))
{
gameLoadingDialog.SetState(GameLoadingDialogState.Class);
if (!await SafeGetFile(async () => await _fileRequestActions.GetClassFileFromServer(sessionID)))
if (!await SafeGetFile(() => _fileRequestActions.GetClassFileFromServer(sessionID)))
return;
await Task.Delay(1000);
}
Expand Down

0 comments on commit 13011a3

Please sign in to comment.