Skip to content

Commit

Permalink
fix: incognito via party id
Browse files Browse the repository at this point in the history
  • Loading branch information
pwall2222 committed Nov 20, 2023
1 parent 9dded51 commit 74733de
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions NOWT/Helpers/LiveMatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private async Task<Player> GetPrePlayerInfo(RiotPrePlayer riotPlayer, sbyte inde
player.IdentityData = cardTask.Result;
player.RankData = historyTask.Result;
player.PlayerUiData = presenceTask.Result;
player.IgnData = await GetIgcUsernameAsync(riotPlayer.Subject, riotPlayer.PlayerIdentity.Incognito, player.PlayerUiData.PartyUuid).ConfigureAwait(false);
player.IgnData = await GetIgcUsernameAsync(riotPlayer.Subject, riotPlayer.PlayerIdentity.Incognito, false).ConfigureAwait(false);
player.AccountLevel = !riotPlayer.PlayerIdentity.HideAccountLevel ? riotPlayer.PlayerIdentity.AccountLevel.ToString() : "-";
player.TeamId = "Blue";
player.Active = Visibility.Visible;
Expand Down Expand Up @@ -162,7 +162,7 @@ private async Task<Player> GetLivePlayerInfo(RiotLivePlayer riotPlayer, sbyte in
player.RankData = playerTask.Result;
player.SkinData = skinTask.Result;
player.PlayerUiData = presenceTask.Result;
player.IgnData = await GetIgcUsernameAsync(riotPlayer.Subject, riotPlayer.PlayerIdentity.Incognito, player.PlayerUiData.PartyUuid).ConfigureAwait(false);
player.IgnData = await GetIgcUsernameAsync(riotPlayer.Subject, riotPlayer.PlayerIdentity.Incognito, false).ConfigureAwait(false);
player.AccountLevel = !riotPlayer.PlayerIdentity.HideAccountLevel ? riotPlayer.PlayerIdentity.AccountLevel.ToString() : "-";
player.TeamId = riotPlayer.TeamId;
player.Active = Visibility.Visible;
Expand Down Expand Up @@ -312,7 +312,7 @@ private async Task<Player> GetPartyPlayerInfo(Member riotPlayer, sbyte index, Gu
PartyColour = "Transparent",
Puuid = riotPlayer.PlayerIdentity.Subject
};
player.IgnData = await GetIgcUsernameAsync(riotPlayer.Subject, false, player.PlayerUiData.PartyUuid).ConfigureAwait(false);
player.IgnData = await GetIgcUsernameAsync(riotPlayer.Subject, false, true).ConfigureAwait(false);
player.AccountLevel = !riotPlayer.PlayerIdentity.HideAccountLevel ? riotPlayer.PlayerIdentity.AccountLevel.ToString() : "-";
player.TeamId = "Blue";
player.Active = Visibility.Visible;
Expand Down Expand Up @@ -346,13 +346,13 @@ public async Task<List<Player>> PartyOutputAsync()
return playerList;
}

private static async Task<IgnData> GetIgcUsernameAsync(Guid puuid, bool isIncognito, Guid partyId)
private static async Task<IgnData> GetIgcUsernameAsync(Guid puuid, bool isIncognito, bool inParty)
{
IgnData ignData = new();
ignData.TrackerEnabled = Visibility.Hidden;
ignData.TrackerDisabled = Visibility.Visible;

if (isIncognito && partyId != Constants.PPartyId)
if (isIncognito && !inParty)
{
ignData.Username = "----";
return ignData;
Expand Down Expand Up @@ -877,6 +877,9 @@ private async Task<PlayerUIData> GetPresenceInfoAsync(Guid puuid, PresencesRespo

MatchInfo.GameModeImage = new Uri(Constants.LocalAppDataPath + $"\\ValAPI\\gamemodeimg\\{gameModeId}.png");
}
catch (InvalidOperationException) {
return playerUiData;
}
catch (Exception e)
{
Constants.Log.Error("GetPresenceInfoAsync Failed; To Base 64 failed: {Exception}", e);
Expand Down

0 comments on commit 74733de

Please sign in to comment.