Skip to content

Commit 3718f72

Browse files
feat: Enhance related player details with linking IP information and update project dependencies
1 parent 09db697 commit 3718f72

4 files changed

Lines changed: 42 additions & 31 deletions

File tree

src/XtremeIdiots.Portal.Web/Controllers/PlayersController.cs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -82,30 +82,10 @@ public async Task<IActionResult> Details(Guid id, CancellationToken cancellation
8282

8383
if (playerData.RelatedPlayers is not null && playerData.RelatedPlayers.Count != 0)
8484
{
85-
// All related players share the same IP (the current player's IP) — reuse existing intelligence
86-
var sharedIntelligence = playerDetailsViewModel.Intelligence;
87-
8885
foreach (var rp in playerData.RelatedPlayers)
8986
{
9087
if (rp is null) continue;
91-
92-
var vm = RelatedPlayerEnrichedViewModel.FromRelatedPlayerDto(rp);
93-
94-
if (sharedIntelligence is not null)
95-
{
96-
if (!string.IsNullOrWhiteSpace(sharedIntelligence.CountryCode))
97-
vm.CountryCode = sharedIntelligence.CountryCode;
98-
99-
if (sharedIntelligence.ProxyCheck is not null)
100-
{
101-
vm.RiskScore = sharedIntelligence.ProxyCheck.RiskScore;
102-
vm.IsProxy = sharedIntelligence.ProxyCheck.IsProxy;
103-
vm.IsVpn = sharedIntelligence.ProxyCheck.IsVpn;
104-
vm.ProxyType = sharedIntelligence.ProxyCheck.ProxyType;
105-
}
106-
}
107-
108-
playerDetailsViewModel.EnrichedRelatedPlayers.Add(vm);
88+
playerDetailsViewModel.EnrichedRelatedPlayers.Add(RelatedPlayerEnrichedViewModel.FromRelatedPlayerDto(rp));
10989
}
11090
}
11191

src/XtremeIdiots.Portal.Web/ViewModels/RelatedPlayerEnrichedViewModel.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ public class RelatedPlayerEnrichedViewModel
1616
public DateTime LastSeen { get; set; }
1717
public bool HasActiveBan { get; set; }
1818
public int AdminActionCount { get; set; }
19+
public string LinkingIpAddress { get; set; } = string.Empty;
20+
public DateTime LinkingIpLastUsedByPlayer { get; set; }
21+
public DateTime LinkingIpLastUsedByRelated { get; set; }
22+
public bool IsCurrentIp { get; set; }
23+
public int SharedIpCount { get; set; }
1924

2025
// Geo enrichment
2126
public int? RiskScore { get; set; }
@@ -34,7 +39,12 @@ public static RelatedPlayerEnrichedViewModel FromRelatedPlayerDto(RelatedPlayerD
3439
GameType = (int)dto.GameType,
3540
LastSeen = dto.LastSeen,
3641
HasActiveBan = dto.HasActiveBan,
37-
AdminActionCount = dto.AdminActionCount
42+
AdminActionCount = dto.AdminActionCount,
43+
LinkingIpAddress = dto.LinkingIpAddress,
44+
LinkingIpLastUsedByPlayer = dto.LinkingIpLastUsedByPlayer,
45+
LinkingIpLastUsedByRelated = dto.LinkingIpLastUsedByRelated,
46+
IsCurrentIp = dto.IsCurrentIp,
47+
SharedIpCount = dto.SharedIpCount
3848
};
3949
}
4050
}

src/XtremeIdiots.Portal.Web/Views/Players/Details.cshtml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -517,12 +517,19 @@
517517
<div class="ibox">
518518
<div class="ibox-title"><h5>Related Players <span class="badge bg-secondary ms-1">@(player.RelatedPlayerCount)</span></h5></div>
519519
<div class="ibox-content">
520+
<p class="text-muted small mb-2">
521+
<i class="fa-solid fa-fw fa-circle-info" aria-hidden="true"></i>
522+
Players linked by shared IP address history. Sorted by ban status, then by number of shared IPs.
523+
</p>
520524
<div class="table-responsive">
521525
<table class="table table-striped table-hover w-100" id="relatedPlayersTable">
522526
<thead>
523527
<tr>
524528
<th>Player Name</th>
525-
<th>Connected By IP</th>
529+
<th>Linking IP</th>
530+
<th class="table-date-col">IP Last Used (Player)</th>
531+
<th class="table-date-col">IP Last Used (Related)</th>
532+
<th>Shared IPs</th>
526533
<th class="table-date-col">Last Seen</th>
527534
<th>Actions</th>
528535
<th>Status</th>
@@ -539,13 +546,27 @@
539546
data-player-id="@related.PlayerId"></span>
540547
</td>
541548
<td>
542-
<span class="ip-address-container"
543-
data-ip="@related.IpAddress"
544-
data-risk="@related.RiskScore"
545-
data-is-proxy="@((related.IsProxy ?? false).ToString().ToLower())"
546-
data-is-vpn="@((related.IsVpn ?? false).ToString().ToLower())"
547-
data-type="@related.ProxyType"
548-
data-country-code="@related.CountryCode"></span>
549+
<code>@related.LinkingIpAddress</code>
550+
@if (related.IsCurrentIp)
551+
{
552+
<span class="badge bg-info text-dark ms-1">Current</span>
553+
}
554+
else
555+
{
556+
<span class="badge bg-secondary ms-1">Historical</span>
557+
}
558+
</td>
559+
<td><time user-time utc="@related.LinkingIpLastUsedByPlayer"></time></td>
560+
<td><time user-time utc="@related.LinkingIpLastUsedByRelated"></time></td>
561+
<td>
562+
@if (related.SharedIpCount > 1)
563+
{
564+
<span class="badge bg-warning text-dark" data-bs-toggle="tooltip" title="@related.SharedIpCount distinct IPs shared between these players">@related.SharedIpCount</span>
565+
}
566+
else
567+
{
568+
<span>1</span>
569+
}
549570
</td>
550571
<td><time user-time utc="@related.LastSeen"></time></td>
551572
<td>

src/XtremeIdiots.Portal.Web/XtremeIdiots.Portal.Web.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<PackageReference Include="MX.Api.Abstractions" Version="2.3.31" />
4848
<PackageReference Include="MX.Api.Client" Version="2.3.31" />
4949
<PackageReference Include="XtremeIdiots.Portal.Integrations.Servers.Api.Client.V1" Version="2.1.138" />
50-
<PackageReference Include="XtremeIdiots.Portal.Repository.Api.Client.V1" Version="2.1.196" />
50+
<PackageReference Include="XtremeIdiots.Portal.Repository.Api.Client.V1" Version="2.1.197" />
5151
<PackageReference Include="MX.GeoLocation.Api.Client.V1" Version="1.2.39" />
5252
</ItemGroup>
5353

0 commit comments

Comments
 (0)