add server scoreboard functionality
This commit is contained in:
parent
cd37bc5c11
commit
e2affb7635
@ -57,10 +57,11 @@ namespace Data.Models.Client.Stats
|
|||||||
public double MaxStrain { get; set; }
|
public double MaxStrain { get; set; }
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public float AverageHitOffset
|
public float AverageHitOffset =>
|
||||||
{
|
(float) Math.Round(
|
||||||
get => (float)Math.Round(HitLocations.Sum(c => c.HitOffsetAverage) / Math.Max(1, HitLocations.Where(c => c.HitOffsetAverage > 0).Count()), 4);
|
HitLocations.Sum(c => c.HitOffsetAverage) /
|
||||||
}
|
Math.Max(1, HitLocations.Count(c => c.HitOffsetAverage > 0)), 4);
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public int SessionKills { get; set; }
|
public int SessionKills { get; set; }
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
@ -82,26 +83,26 @@ namespace Data.Models.Client.Stats
|
|||||||
KillStreak = 0;
|
KillStreak = 0;
|
||||||
DeathStreak = 0;
|
DeathStreak = 0;
|
||||||
LastScore = 0;
|
LastScore = 0;
|
||||||
SessionScores.Add(0);
|
_sessionScores.Add(0);
|
||||||
Team = 0;
|
Team = 0;
|
||||||
}
|
}
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public int SessionScore
|
public int SessionScore
|
||||||
{
|
{
|
||||||
set => SessionScores[SessionScores.Count - 1] = value;
|
set => _sessionScores[^1] = value;
|
||||||
|
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
lock (SessionScores)
|
lock (_sessionScores)
|
||||||
{
|
{
|
||||||
return new List<int>(SessionScores).Sum();
|
return new List<int>(_sessionScores).Sum();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public int RoundScore => SessionScores[SessionScores.Count - 1];
|
public int RoundScore => _sessionScores[^1];
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
private readonly List<int> SessionScores = new List<int>() { 0 };
|
private readonly List<int> _sessionScores = new List<int> { 0 };
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public int Team { get; set; }
|
public int Team { get; set; }
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
@ -109,6 +110,21 @@ namespace Data.Models.Client.Stats
|
|||||||
[NotMapped]
|
[NotMapped]
|
||||||
public double SessionSPM { get; set; }
|
public double SessionSPM { get; set; }
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public SemaphoreSlim ProcessingHit { get; private set; }
|
public SemaphoreSlim ProcessingHit { get; }
|
||||||
|
|
||||||
|
[NotMapped] public MatchData MatchData { get; } = new MatchData();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MatchData
|
||||||
|
{
|
||||||
|
public int Kills { get; set; }
|
||||||
|
public int Deaths { get; set; }
|
||||||
|
public double Kdr => Deaths == 0 ? Kills : Math.Round(Kills / (double) Deaths, 2);
|
||||||
|
|
||||||
|
public void StartNewMatch()
|
||||||
|
{
|
||||||
|
Kills = 0;
|
||||||
|
Deaths = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.SyndicationFeed.ReaderWriter" Version="1.0.2" />
|
<PackageReference Include="Microsoft.SyndicationFeed.ReaderWriter" Version="1.0.2" />
|
||||||
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.8.1" PrivateAssets="All" />
|
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.20.1" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.8.1" PrivateAssets="All" />
|
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.20.1" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.8.1" PrivateAssets="All" />
|
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.20.1" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
@foreach (SharedLibraryCore.Dtos.ServerInfo server in ViewBag.Servers)
|
@foreach (SharedLibraryCore.Dtos.ServerInfo server in ViewBag.Servers)
|
||||||
{
|
{
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a asp-controller="Radar" asp-action="Index" asp-route-serverId="@server.ID" class="nav-link @(server.ID == ViewBag.ActiveServerId ? "active": "")" aria-selected="@(server.ID == ViewBag.ActiveServerId ? "true": "false")"><color-code value="@server.Name" allow="@ViewBag.EnableColorCodes"></color-code></a>
|
<a asp-controller="Radar" asp-action="Index" asp-route-serverId="@server.ID" class="nav-link @(server.ID == ViewBag.ActiveServerId ? "active": "")" aria-selected="@(server.ID == ViewBag.ActiveServerId ? "true": "false")"><color-code value="@server.Name"></color-code></a>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.8.1" PrivateAssets="All" />
|
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.20.1" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.8.1" PrivateAssets="All" />
|
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.20.1" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
@ -1289,12 +1289,14 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
if (!suicide)
|
if (!suicide)
|
||||||
{
|
{
|
||||||
attackerStats.Kills += 1;
|
attackerStats.Kills += 1;
|
||||||
|
attackerStats.MatchData.Kills += 1;
|
||||||
attackerStats.SessionKills += 1;
|
attackerStats.SessionKills += 1;
|
||||||
attackerStats.KillStreak += 1;
|
attackerStats.KillStreak += 1;
|
||||||
attackerStats.DeathStreak = 0;
|
attackerStats.DeathStreak = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
victimStats.Deaths += 1;
|
victimStats.Deaths += 1;
|
||||||
|
victimStats.MatchData.Deaths += 1;
|
||||||
victimStats.SessionDeaths += 1;
|
victimStats.SessionDeaths += 1;
|
||||||
victimStats.DeathStreak += 1;
|
victimStats.DeathStreak += 1;
|
||||||
victimStats.KillStreak = 0;
|
victimStats.KillStreak = 0;
|
||||||
@ -1444,6 +1446,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
{
|
{
|
||||||
session.stat?.StartNewSession();
|
session.stat?.StartNewSession();
|
||||||
session.detection?.OnMapChange();
|
session.detection?.OnMapChange();
|
||||||
|
session.stat?.MatchData?.StartNewMatch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.8.1" PrivateAssets="All" />
|
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.20.1" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.8.1" PrivateAssets="All" />
|
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.20.1" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,20 +1,19 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SharedLibraryCore;
|
using SharedLibraryCore;
|
||||||
using SharedLibraryCore.Dtos;
|
using SharedLibraryCore.Dtos;
|
||||||
using SharedLibraryCore.Interfaces;
|
using SharedLibraryCore.Interfaces;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Data.Models.Client.Stats;
|
using Data.Models.Client.Stats;
|
||||||
using SharedLibraryCore.Configuration;
|
using IW4MAdmin.Plugins.Stats.Helpers;
|
||||||
|
using WebfrontCore.ViewModels;
|
||||||
|
|
||||||
namespace WebfrontCore.Controllers
|
namespace WebfrontCore.Controllers
|
||||||
{
|
{
|
||||||
public class ServerController : BaseController
|
public class ServerController : BaseController
|
||||||
{
|
{
|
||||||
private readonly DefaultSettings _defaultSettings;
|
public ServerController(IManager manager) : base(manager)
|
||||||
|
|
||||||
public ServerController(IManager manager, DefaultSettings defaultSettings) : base(manager)
|
|
||||||
{
|
{
|
||||||
_defaultSettings = defaultSettings;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
@ -44,7 +43,8 @@ namespace WebfrontCore.Controllers
|
|||||||
ClientId = p.ClientId,
|
ClientId = p.ClientId,
|
||||||
Level = p.Level.ToLocalizedLevelName(),
|
Level = p.Level.ToLocalizedLevelName(),
|
||||||
LevelInt = (int) p.Level,
|
LevelInt = (int) p.Level,
|
||||||
ZScore = p.GetAdditionalProperty<EFClientStatistics>(IW4MAdmin.Plugins.Stats.Helpers.StatManager.CLIENT_STATS_KEY)?.ZScore
|
ZScore = p.GetAdditionalProperty<EFClientStatistics>(IW4MAdmin.Plugins.Stats.Helpers.StatManager
|
||||||
|
.CLIENT_STATS_KEY)?.ZScore
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
ChatHistory = s.ChatHistory.ToList(),
|
ChatHistory = s.ChatHistory.ToList(),
|
||||||
PlayerHistory = s.ClientHistory.ToArray(),
|
PlayerHistory = s.ClientHistory.ToArray(),
|
||||||
@ -52,5 +52,54 @@ namespace WebfrontCore.Controllers
|
|||||||
};
|
};
|
||||||
return PartialView("_ClientActivity", serverInfo);
|
return PartialView("_ClientActivity", serverInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public ActionResult Scoreboard()
|
||||||
|
{
|
||||||
|
ViewBag.Title = Localization["WEBFRONT_TITLE_SCOREBOARD"];
|
||||||
|
|
||||||
|
return View(ProjectScoreboard(Manager.GetServers()));
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("[controller]/{id}/scoreboard")]
|
||||||
|
public ActionResult Scoreboard(long id)
|
||||||
|
{
|
||||||
|
var server = Manager.GetServers().FirstOrDefault(srv => srv.EndPoint == id);
|
||||||
|
|
||||||
|
if (server == null)
|
||||||
|
{
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
return View("_Scoreboard", ProjectScoreboard(new[] {server}).First());
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnumerable<ScoreboardInfo> ProjectScoreboard(IEnumerable<Server> servers)
|
||||||
|
{
|
||||||
|
return servers.Select(server => new ScoreboardInfo
|
||||||
|
{
|
||||||
|
MapName = server.CurrentMap.ToString(),
|
||||||
|
ServerName = server.Hostname,
|
||||||
|
ServerId = server.EndPoint,
|
||||||
|
ClientInfo = server.GetClientsAsList().Select(client =>
|
||||||
|
new
|
||||||
|
{
|
||||||
|
stats = client.GetAdditionalProperty<EFClientStatistics>(StatManager.CLIENT_STATS_KEY),
|
||||||
|
client
|
||||||
|
})
|
||||||
|
.Select(clientData => new ClientScoreboardInfo
|
||||||
|
{
|
||||||
|
ClientName = clientData.client.Name,
|
||||||
|
ClientId = clientData.client.ClientId,
|
||||||
|
Score = clientData.client.Score,
|
||||||
|
Ping = clientData.client.Ping,
|
||||||
|
Kills = clientData.stats?.MatchData?.Kills,
|
||||||
|
Deaths = clientData.stats?.MatchData?.Deaths,
|
||||||
|
ScorePerMinute = clientData.stats?.SessionSPM,
|
||||||
|
Kdr = clientData.stats?.MatchData?.Kdr
|
||||||
|
})
|
||||||
|
.ToList()
|
||||||
|
}).ToList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
25
WebfrontCore/ViewModels/ScoreboardInfo.cs
Normal file
25
WebfrontCore/ViewModels/ScoreboardInfo.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace WebfrontCore.ViewModels
|
||||||
|
{
|
||||||
|
|
||||||
|
public class ScoreboardInfo
|
||||||
|
{
|
||||||
|
public string ServerName { get; set; }
|
||||||
|
public long ServerId { get; set; }
|
||||||
|
public string MapName { get; set; }
|
||||||
|
public List<ClientScoreboardInfo> ClientInfo { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ClientScoreboardInfo
|
||||||
|
{
|
||||||
|
public string ClientName { get; set; }
|
||||||
|
public long ClientId { get; set; }
|
||||||
|
public int Score { get; set; }
|
||||||
|
public int Ping { get; set; }
|
||||||
|
public int? Kills { get; set; }
|
||||||
|
public int? Deaths { get; set; }
|
||||||
|
public double? ScorePerMinute { get; set; }
|
||||||
|
public double? Kdr { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -18,7 +18,7 @@
|
|||||||
@if (!string.IsNullOrWhiteSpace(Model.CommunityInformation.Name))
|
@if (!string.IsNullOrWhiteSpace(Model.CommunityInformation.Name))
|
||||||
{
|
{
|
||||||
<h2 class="mb-4 p-0 col-12 text-center text-md-left">
|
<h2 class="mb-4 p-0 col-12 text-center text-md-left">
|
||||||
<color-code value="@Model.CommunityInformation.Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.CommunityInformation.Name"></color-code>
|
||||||
</h2>
|
</h2>
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,7 +26,7 @@
|
|||||||
{
|
{
|
||||||
<div class="p-4 bg-dark border border-primary mb-4 text-white-50 col-12">
|
<div class="p-4 bg-dark border border-primary mb-4 text-white-50 col-12">
|
||||||
<h4 class="text-primary">@ViewBag.Localization["WEBFRONT_ABOUT_TITLE"]</h4>
|
<h4 class="text-primary">@ViewBag.Localization["WEBFRONT_ABOUT_TITLE"]</h4>
|
||||||
<color-code value="@Model.CommunityInformation.Description" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.CommunityInformation.Description"></color-code>
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
@foreach (var social in Model.CommunityInformation.SocialAccounts ?? new SocialAccountConfiguration[0])
|
@foreach (var social in Model.CommunityInformation.SocialAccounts ?? new SocialAccountConfiguration[0])
|
||||||
{
|
{
|
||||||
@ -66,13 +66,13 @@
|
|||||||
var start = 1;
|
var start = 1;
|
||||||
<div class="col-12 bg-dark p-4 border border-primary mb-4 col-12">
|
<div class="col-12 bg-dark p-4 border border-primary mb-4 col-12">
|
||||||
<div class="text-primary h4">
|
<div class="text-primary h4">
|
||||||
<color-code value="@serverName" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@serverName"></color-code>
|
||||||
</div>
|
</div>
|
||||||
@foreach (var rule in rules)
|
@foreach (var rule in rules)
|
||||||
{
|
{
|
||||||
<div class="text-white-50">
|
<div class="text-white-50">
|
||||||
<span class="text-white">@start.</span>
|
<span class="text-white">@start.</span>
|
||||||
<color-code value="@rule" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@rule"></color-code>
|
||||||
</div>
|
</div>
|
||||||
start++;
|
start++;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<th scope="row" class="bg-primary">@loc["WEBFRONT_PENALTY_TEMPLATE_ADMIN"]</th>
|
<th scope="row" class="bg-primary">@loc["WEBFRONT_PENALTY_TEMPLATE_ADMIN"]</th>
|
||||||
<td>
|
<td>
|
||||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@info.OriginId" class="link-inverse">
|
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@info.OriginId" class="link-inverse">
|
||||||
<color-code value="@info.OriginName" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@info.OriginName"></color-code>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -27,7 +27,7 @@
|
|||||||
@if (info.TargetId != null)
|
@if (info.TargetId != null)
|
||||||
{
|
{
|
||||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@info.TargetId" class="link-inverse">
|
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@info.TargetId" class="link-inverse">
|
||||||
<color-code value="@info.TargetName" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@info.TargetName"></color-code>
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -68,14 +68,14 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@info.OriginId" class="link-inverse">
|
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@info.OriginId" class="link-inverse">
|
||||||
<color-code value="@info.OriginName" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@info.OriginName"></color-code>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@if (info.TargetId != null)
|
@if (info.TargetId != null)
|
||||||
{
|
{
|
||||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@info.TargetId" class="link-inverse">
|
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@info.TargetId" class="link-inverse">
|
||||||
<color-code value="@info.TargetName" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@info.TargetName"></color-code>
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<div class="row pt-2 pb-2 bg-dark">
|
<div class="row pt-2 pb-2 bg-dark">
|
||||||
<div class="col-5">
|
<div class="col-5">
|
||||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@client.ClientId">
|
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@client.ClientId">
|
||||||
<color-code value="@client.Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@client.Name"></color-code>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@if (!ViewBag.Authorized && ViewBag.EnablePrivilegedUserPrivacy)
|
@if (!ViewBag.Authorized && ViewBag.EnablePrivilegedUserPrivacy)
|
||||||
@ -45,7 +45,7 @@
|
|||||||
<div class="col-7 bg-dark border-bottom">
|
<div class="col-7 bg-dark border-bottom">
|
||||||
<div class="p-2">
|
<div class="p-2">
|
||||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@client.ClientId" class="link-inverse">
|
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@client.ClientId" class="link-inverse">
|
||||||
<color-code value="@client.Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@client.Name"></color-code>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@if (!ViewBag.Authorized && ViewBag.EnablePrivilegedUserPrivacy)
|
@if (!ViewBag.Authorized && ViewBag.EnablePrivilegedUserPrivacy)
|
||||||
|
@ -7,21 +7,21 @@
|
|||||||
<tr class="d-none d-lg-table-row">
|
<tr class="d-none d-lg-table-row">
|
||||||
<td>
|
<td>
|
||||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@message.ClientId" class="link-inverse">
|
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@message.ClientId" class="link-inverse">
|
||||||
<color-code value="@message.ClientName" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@message.ClientName"></color-code>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-light w-50 text-break">
|
<td class="text-light w-50 text-break">
|
||||||
@if (message.IsHidden && !ViewBag.Authorized)
|
@if (message.IsHidden && !ViewBag.Authorized)
|
||||||
{
|
{
|
||||||
<color-code value="@SharedLibraryCore.Utilities.FormatExt(ViewBag.Localization["WEBFRONT_CLIENT_META_CHAT_HIDDEN"], message.HiddenMessage)" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@SharedLibraryCore.Utilities.FormatExt(ViewBag.Localization["WEBFRONT_CLIENT_META_CHAT_HIDDEN"], message.HiddenMessage)"></color-code>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<color-code value="@message.Message" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@message.Message"></color-code>
|
||||||
}
|
}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-light">
|
<td class="text-light">
|
||||||
<color-code value="@(message.ServerName ?? "--")" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@(message.ServerName ?? "--")"></color-code>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right text-light">
|
<td class="text-right text-light">
|
||||||
@message.When
|
@message.When
|
||||||
@ -33,7 +33,7 @@
|
|||||||
<th scope="row" class="bg-primary">@ViewBag.Localization["WEBFRONT_PENALTY_TEMPLATE_ADMIN"]</th>
|
<th scope="row" class="bg-primary">@ViewBag.Localization["WEBFRONT_PENALTY_TEMPLATE_ADMIN"]</th>
|
||||||
<td class="text-light">
|
<td class="text-light">
|
||||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@message.ClientId" class="link-inverse">
|
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@message.ClientId" class="link-inverse">
|
||||||
<color-code value="@message.ClientName" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@message.ClientName"></color-code>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -43,11 +43,11 @@
|
|||||||
<td class="text-light">
|
<td class="text-light">
|
||||||
@if (message.IsHidden && !ViewBag.Authorized)
|
@if (message.IsHidden && !ViewBag.Authorized)
|
||||||
{
|
{
|
||||||
<color-code value="@SharedLibraryCore.Utilities.FormatExt(ViewBag.Localization["WEBFRONT_CLIENT_META_CHAT_HIDDEN"], message.HiddenMessage)" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@SharedLibraryCore.Utilities.FormatExt(ViewBag.Localization["WEBFRONT_CLIENT_META_CHAT_HIDDEN"], message.HiddenMessage)"></color-code>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<color-code value="@message.Message" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@message.Message"></color-code>
|
||||||
}
|
}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -55,7 +55,7 @@
|
|||||||
<tr class="d-table-row d-lg-none bg-dark">
|
<tr class="d-table-row d-lg-none bg-dark">
|
||||||
<th scope="row" class="bg-primary">@ViewBag.Localization["WEBFRONT_STATS_MESSAGE_SERVER_NAME"]</th>
|
<th scope="row" class="bg-primary">@ViewBag.Localization["WEBFRONT_STATS_MESSAGE_SERVER_NAME"]</th>
|
||||||
<td class="text-light">
|
<td class="text-light">
|
||||||
<color-code value="@(message.ServerName ?? "--")" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@(message.ServerName ?? "--")"></color-code>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
@foreach (var client in Model[key])
|
@foreach (var client in Model[key])
|
||||||
{
|
{
|
||||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@client.ClientId">
|
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@client.ClientId">
|
||||||
<color-code value="@client.Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@client.Name"></color-code>
|
||||||
</a>
|
</a>
|
||||||
<br />
|
<br />
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<div class="w-50 d-block d-lg-inline-flex flex-column flex-fill text-center text-lg-left pb-3 pb-lg-0 pt-3 pt-lg-0 pl-3 pr-3 ml-auto mr-auto" style="overflow-wrap: anywhere">
|
<div class="w-50 d-block d-lg-inline-flex flex-column flex-fill text-center text-lg-left pb-3 pb-lg-0 pt-3 pt-lg-0 pl-3 pr-3 ml-auto mr-auto" style="overflow-wrap: anywhere">
|
||||||
<div class="mt-n2 d-block d-lg-inline-flex @(ViewBag.Authorized ? "" : "flex-fill")">
|
<div class="mt-n2 d-block d-lg-inline-flex @(ViewBag.Authorized ? "" : "flex-fill")">
|
||||||
<div id="profile_name" class="client-name h1 mb-0">
|
<div id="profile_name" class="client-name h1 mb-0">
|
||||||
<color-code value="@Model.Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.Name"></color-code>
|
||||||
</div>
|
</div>
|
||||||
@if (ViewBag.Authorized)
|
@if (ViewBag.Authorized)
|
||||||
{
|
{
|
||||||
@ -50,7 +50,7 @@
|
|||||||
@foreach (var alias in Model.Aliases)
|
@foreach (var alias in Model.Aliases)
|
||||||
{
|
{
|
||||||
<div>
|
<div>
|
||||||
<color-code value="@alias" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@alias"></color-code>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
{
|
{
|
||||||
<span class="text-highlight">
|
<span class="text-highlight">
|
||||||
<a class="link-inverse" href="@Model.OffenderClientId">
|
<a class="link-inverse" href="@Model.OffenderClientId">
|
||||||
<color-code value="@Model.OffenderName" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.OffenderName"></color-code>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<color-code value="@Model.Offense" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.Offense"></color-code>
|
||||||
}
|
}
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
break;
|
break;
|
||||||
case "server":
|
case "server":
|
||||||
<span class="text-white">
|
<span class="text-white">
|
||||||
<color-code value="@Model.ServerName" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.ServerName"></color-code>
|
||||||
</span>
|
</span>
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
{
|
{
|
||||||
if (result.IsInterpolation)
|
if (result.IsInterpolation)
|
||||||
{
|
{
|
||||||
<span class="profile-meta-value text-primary"><color-code value="@meta.Value" allow="@ViewBag.EnableColorCodes"></color-code></span>
|
<span class="profile-meta-value text-primary"><color-code value="@meta.Value"></color-code></span>
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<span class="profile-meta-value text-primary"><color-code value="@meta.Value" allow="@ViewBag.EnableColorCodes"></color-code></span>
|
<span class="profile-meta-value text-primary"><color-code value="@meta.Value"></color-code></span>
|
||||||
<span class="profile-meta-title text-muted"> @meta.Key</span>
|
<span class="profile-meta-title text-muted"> @meta.Key</span>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
@ -11,12 +11,12 @@
|
|||||||
|
|
||||||
@if (Model.IsHidden && !ViewBag.Authorized)
|
@if (Model.IsHidden && !ViewBag.Authorized)
|
||||||
{
|
{
|
||||||
<color-code value="@SharedLibraryCore.Utilities.FormatExt(ViewBag.Localization["WEBFRONT_CLIENT_META_CHAT_HIDDEN"], Model.HiddenMessage)" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@SharedLibraryCore.Utilities.FormatExt(ViewBag.Localization["WEBFRONT_CLIENT_META_CHAT_HIDDEN"], Model.HiddenMessage)"></color-code>
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<color-code value="@Model.Message" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.Message"></color-code>
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
@ -19,7 +19,7 @@
|
|||||||
{
|
{
|
||||||
<span class="text-highlight">
|
<span class="text-highlight">
|
||||||
<a class="link-inverse" href="@Model.PunisherClientId">
|
<a class="link-inverse" href="@Model.PunisherClientId">
|
||||||
<color-code value="@Model.PunisherName" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.PunisherName"></color-code>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
@ -34,7 +34,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<color-code value="@Model.Offense" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.Offense"></color-code>
|
||||||
}
|
}
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
@ -65,7 +65,7 @@
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
<a class="link-inverse" href="@Model.OffenderClientId">
|
<a class="link-inverse" href="@Model.OffenderClientId">
|
||||||
<color-code value="@Model.OffenderName" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.OffenderName"></color-code>
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
break;
|
break;
|
||||||
case "alias":
|
case "alias":
|
||||||
<span class="text-white">
|
<span class="text-white">
|
||||||
<color-code value="@Model.Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.Name"></color-code>
|
||||||
[@Model.IPAddress]
|
[@Model.IPAddress]
|
||||||
</span>
|
</span>
|
||||||
break;
|
break;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
{
|
{
|
||||||
<li class="nav-item ">
|
<li class="nav-item ">
|
||||||
<a class="nav-link top-players-link" href="#server_@server.ID" role="tab" data-toggle="tab" aria-selected="false" data-serverid="@server.ID">
|
<a class="nav-link top-players-link" href="#server_@server.ID" role="tab" data-toggle="tab" aria-selected="false" data-serverid="@server.ID">
|
||||||
<color-code value="@server.Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@server.Name"></color-code>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<th scope="row" class="bg-primary">@loc["WEBFRONT_PENALTY_TEMPLATE_NAME"]</th>
|
<th scope="row" class="bg-primary">@loc["WEBFRONT_PENALTY_TEMPLATE_NAME"]</th>
|
||||||
<td>
|
<td>
|
||||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@Model.OffenderId" class="link-inverse">
|
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@Model.OffenderId" class="link-inverse">
|
||||||
<color-code value="@Model.OffenderName" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.OffenderName"></color-code>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -24,7 +24,7 @@
|
|||||||
<tr class="d-table-row d-lg-none bg-dark">
|
<tr class="d-table-row d-lg-none bg-dark">
|
||||||
<th scope="row" class="bg-primary">@loc["WEBFRONT_PENALTY_TEMPLATE_OFFENSE"]</th>
|
<th scope="row" class="bg-primary">@loc["WEBFRONT_PENALTY_TEMPLATE_OFFENSE"]</th>
|
||||||
<td class="text-light">
|
<td class="text-light">
|
||||||
<color-code value="@($"{Model.Offense}{(ViewBag.Authorized ? Model.AdditionalPenaltyInformation : "")}")" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@($"{Model.Offense}{(ViewBag.Authorized ? Model.AdditionalPenaltyInformation : "")}")"></color-code>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@ -59,14 +59,14 @@
|
|||||||
<tr class="d-none d-lg-table-row">
|
<tr class="d-none d-lg-table-row">
|
||||||
<td>
|
<td>
|
||||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@Model.OffenderId" class="link-inverse">
|
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@Model.OffenderId" class="link-inverse">
|
||||||
<color-code value="@Model.OffenderName" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.OffenderName"></color-code>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="penalties-color-@Model.PenaltyTypeText.ToLower()">
|
<td class="penalties-color-@Model.PenaltyTypeText.ToLower()">
|
||||||
@Model.PenaltyType
|
@Model.PenaltyType
|
||||||
</td>
|
</td>
|
||||||
<td class="text-light w-50">
|
<td class="text-light w-50">
|
||||||
<color-code value="@($"{Model.Offense}{(ViewBag.Authorized ? Model.AdditionalPenaltyInformation : "")}")" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@($"{Model.Offense}{(ViewBag.Authorized ? Model.AdditionalPenaltyInformation : "")}")"></color-code>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@Html.ActionLink(SharedLibraryCore.Utilities.StripColors(Model.PunisherName), "ProfileAsync",
|
@Html.ActionLink(SharedLibraryCore.Utilities.StripColors(Model.PunisherName), "ProfileAsync",
|
||||||
|
30
WebfrontCore/Views/Server/Scoreboard.cshtml
Normal file
30
WebfrontCore/Views/Server/Scoreboard.cshtml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
@model IEnumerable<WebfrontCore.ViewModels.ScoreboardInfo>
|
||||||
|
|
||||||
|
<ul class="nav nav-tabs border-top border-bottom nav-fill row" role="tablist" id="scoreboard_servers">
|
||||||
|
@{ var i = 0; }
|
||||||
|
@foreach (var server in Model)
|
||||||
|
{
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="#server_@server.ServerId" role="tab" data-toggle="tab" id="server_@(server.ServerId)_nav" data-serverid="@server.ServerId">
|
||||||
|
<color-code value="@server.ServerName"></color-code>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
<div class="tab-content border-bottom row">
|
||||||
|
@{ i = 0; }
|
||||||
|
@foreach (var server in Model)
|
||||||
|
{
|
||||||
|
<div role="tabpanel" class="scoreboard-container tab-pane striped flex-fill" id="server_@server.ServerId" data-server-id="@server.ServerId">
|
||||||
|
@await Html.PartialAsync("_Scoreboard", server)
|
||||||
|
</div>
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@section scripts {
|
||||||
|
<environment include="Development">
|
||||||
|
<script type="text/javascript" src="~/js/scoreboard.js" defer="defer"></script>
|
||||||
|
</environment>
|
||||||
|
}
|
@ -21,24 +21,24 @@
|
|||||||
{
|
{
|
||||||
<span class="text-light">
|
<span class="text-light">
|
||||||
<span class="oi oi-account-login mr-2 text-success"> </span>
|
<span class="oi oi-account-login mr-2 text-success"> </span>
|
||||||
<color-code value="@Model.ChatHistory[i].Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.ChatHistory[i].Name"></color-code>
|
||||||
</span><br />
|
</span><br />
|
||||||
}
|
}
|
||||||
if (Model.ChatHistory[i].Message == "DISCONNECTED")
|
if (Model.ChatHistory[i].Message == "DISCONNECTED")
|
||||||
{
|
{
|
||||||
<span class="text-light">
|
<span class="text-light">
|
||||||
<span class="oi oi-account-logout mr-2 text-danger"> </span>
|
<span class="oi oi-account-logout mr-2 text-danger"> </span>
|
||||||
<color-code value="@Model.ChatHistory[i].Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.ChatHistory[i].Name"></color-code>
|
||||||
</span><br />
|
</span><br />
|
||||||
}
|
}
|
||||||
if (Model.ChatHistory[i].Message != "CONNECTED" && Model.ChatHistory[i].Message != "DISCONNECTED")
|
if (Model.ChatHistory[i].Message != "CONNECTED" && Model.ChatHistory[i].Message != "DISCONNECTED")
|
||||||
{
|
{
|
||||||
<span class="text-light">
|
<span class="text-light">
|
||||||
<color-code value="@Model.ChatHistory[i].Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.ChatHistory[i].Name"></color-code>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
—
|
—
|
||||||
<color-code value="@message.CapClientName(48)" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@message.CapClientName(48)"></color-code>
|
||||||
</span><br />
|
</span><br />
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -63,7 +63,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@Model.Players[i].ClientId" class="@levelColorClass">
|
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@Model.Players[i].ClientId" class="@levelColorClass">
|
||||||
<color-code value="@Model.Players[i].Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.Players[i].Name"></color-code>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
@if (ViewBag.Authorized)
|
@if (ViewBag.Authorized)
|
||||||
@ -88,7 +88,7 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@Model.Players[i].ClientId" class="@levelColorClass">
|
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@Model.Players[i].ClientId" class="@levelColorClass">
|
||||||
<color-code value="@Model.Players[i].Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.Players[i].Name"></color-code>
|
||||||
</a>
|
</a>
|
||||||
@if (ViewBag.Authorized)
|
@if (ViewBag.Authorized)
|
||||||
{
|
{
|
||||||
@ -122,24 +122,24 @@
|
|||||||
{
|
{
|
||||||
<span class="text-light">
|
<span class="text-light">
|
||||||
<span class="oi oi-account-login mr-2 text-success"> </span>
|
<span class="oi oi-account-login mr-2 text-success"> </span>
|
||||||
<color-code value="@Model.ChatHistory[i].Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.ChatHistory[i].Name"></color-code>
|
||||||
</span><br />
|
</span><br />
|
||||||
}
|
}
|
||||||
if (Model.ChatHistory[i].Message == "DISCONNECTED")
|
if (Model.ChatHistory[i].Message == "DISCONNECTED")
|
||||||
{
|
{
|
||||||
<span class="text-light">
|
<span class="text-light">
|
||||||
<span class="oi oi-account-logout mr-2 text-danger"> </span>
|
<span class="oi oi-account-logout mr-2 text-danger"> </span>
|
||||||
<color-code value="@Model.ChatHistory[i].Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.ChatHistory[i].Name"></color-code>
|
||||||
</span><br />
|
</span><br />
|
||||||
}
|
}
|
||||||
if (Model.ChatHistory[i].Message != "CONNECTED" && Model.ChatHistory[i].Message != "DISCONNECTED")
|
if (Model.ChatHistory[i].Message != "CONNECTED" && Model.ChatHistory[i].Message != "DISCONNECTED")
|
||||||
{
|
{
|
||||||
<span class="text-light">
|
<span class="text-light">
|
||||||
<color-code value="@Model.ChatHistory[i].Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.ChatHistory[i].Name"></color-code>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
—
|
—
|
||||||
<color-code value="@message.CapClientName(48)" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@message.CapClientName(48)"></color-code>
|
||||||
</span><br />
|
</span><br />
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
32
WebfrontCore/Views/Server/_Scoreboard.cshtml
Normal file
32
WebfrontCore/Views/Server/_Scoreboard.cshtml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
@model WebfrontCore.ViewModels.ScoreboardInfo
|
||||||
|
@{
|
||||||
|
Layout = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
<table class="table table-striped thead-light bg-dark mb-0 table-responsive-md">
|
||||||
|
<tr class="bg-dark border-bottom">
|
||||||
|
<th>@ViewBag.Localization["WEBFRONT_SCOREBOARD_TABLE_PLAYER"]</th>
|
||||||
|
<th>@ViewBag.Localization["WEBFRONT_ADV_STATS_SCORE"]</th>
|
||||||
|
<th>@ViewBag.Localization["WEBFRONT_ADV_STATS_KILLS"]</th>
|
||||||
|
<th>@ViewBag.Localization["WEBFRONT_SCOREBOARD_TABLE_DEATHS"]</th>
|
||||||
|
<th>@ViewBag.Localization["WEBFRONT_SCOREBOARD_TABLE_RATIO"]</th>
|
||||||
|
<th>@ViewBag.Localization["WEBFRONT_SCOREBOARD_TABLE_SPM"]</th>
|
||||||
|
<th class="text-right">@ViewBag.Localization["WEBFRONT_SCOREBOARD_TABLE_PING"]</th>
|
||||||
|
</tr>
|
||||||
|
@foreach (var client in Model.ClientInfo.OrderByDescending(c => c.Score))
|
||||||
|
{
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@client.ClientId">
|
||||||
|
<color-code value="@client.ClientName"></color-code>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>@client.Score</td>
|
||||||
|
<td>@(client.Kills ?? 0)</td>
|
||||||
|
<td>@(client.Deaths ?? 0)</td>
|
||||||
|
<td>@Math.Round(client.Kdr ?? 0, 2)</td>
|
||||||
|
<td>@Math.Round(client.ScorePerMinute ?? 0)</td>
|
||||||
|
<td class="text-right">@client.Ping</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</table>
|
@ -5,15 +5,19 @@
|
|||||||
|
|
||||||
<div class="row server-header pt-1 pb-1 bg-primary " id="server_header_@Model.ID">
|
<div class="row server-header pt-1 pb-1 bg-primary " id="server_header_@Model.ID">
|
||||||
<div class="col-md-4 text-center text-md-left d-inline-flex justify-content-center justify-content-md-start">
|
<div class="col-md-4 text-center text-md-left d-inline-flex justify-content-center justify-content-md-start">
|
||||||
<color-code value="@Model.Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@Model.Name"></color-code>
|
||||||
<a href="@Model.ConnectProtocolUrl" class="ml-2 mr-2 align-self-center d-none d-md-flex server-join-button" title="@SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_HOME_JOIN_DESC"]">
|
<a href="@Model.ConnectProtocolUrl" class="ml-2 mr-2 align-self-center d-none d-md-flex server-join-button" title="@Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_HOME_JOIN_DESC"]">
|
||||||
<span class="oi oi-play-circle mr-1 align-self-center"></span>
|
<span class="oi oi-play-circle mr-1 align-self-center"></span>
|
||||||
<span class="server-header-ip-address" style="display:none;">@Model.IPAddress</span>
|
<span class="server-header-ip-address" style="display:none;">@Model.IPAddress</span>
|
||||||
</a>
|
</a>
|
||||||
@if (ViewBag.Authorized)
|
@if (ViewBag.Authorized)
|
||||||
{
|
{
|
||||||
<span class="oi oi-chat align-self-center profile-action d-none d-md-flex" data-action="chat" data-action-id="@Model.ID"></span>
|
<span class="oi oi-chat align-self-center profile-action d-none d-md-flex mr-2" data-action="chat" data-action-id="@Model.ID"></span>
|
||||||
}
|
}
|
||||||
|
<a asp-controller="Server" asp-action="Scoreboard" asp-fragment="server_@Model.ID" title="@ViewBag.Localization["WEBFRONT_TITLE_SCOREBOARD"]"
|
||||||
|
class="align-self-center d-none d-md-flex">
|
||||||
|
<span class="oi oi-spreadsheet ml-1"></span>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text-center col-md-4 align-self-center">
|
<div class="text-center col-md-4 align-self-center">
|
||||||
@ -43,6 +47,10 @@
|
|||||||
<span class="oi oi-chat align-self-center profile-action d-flex d-md-none" data-action="chat" data-action-id="@Model.ID"></span>
|
<span class="oi oi-chat align-self-center profile-action d-flex d-md-none" data-action="chat" data-action-id="@Model.ID"></span>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
<a asp-controller="Server" asp-action="Scoreboard" title="@ViewBag.Localization["WEBFRONT_TITLE_SCOREBOARD"]"
|
||||||
|
class="p-1 d-flex d-md-none justify-content-center col-12">
|
||||||
|
<span class="oi oi-spreadsheet ml-1"></span>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="server_clientactivity_@Model.ID" class="bg-dark row server-activity @(Model.ClientCount > 0 ? "pt-2 pb-2" : "")">
|
<div id="server_clientactivity_@Model.ID" class="bg-dark row server-activity @(Model.ClientCount > 0 ? "pt-2 pb-2" : "")">
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
<div class="p-2 mb-3 border-bottom" style="background-color: #222;">
|
<div class="p-2 mb-3 border-bottom" style="background-color: #222;">
|
||||||
<div class="d-flex flex-row">
|
<div class="d-flex flex-row">
|
||||||
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@client.ClientId" class="h4 mr-auto">
|
<a asp-controller="Client" asp-action="ProfileAsync" asp-route-id="@client.ClientId" class="h4 mr-auto">
|
||||||
<color-code value="@client.Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
<color-code value="@client.Name"></color-code>
|
||||||
</a>
|
</a>
|
||||||
<div class="client-location-flag align-self-center" data-ip="@client.IPAddress"></div>
|
<div class="client-location-flag align-self-center" data-ip="@client.IPAddress"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -45,7 +45,6 @@
|
|||||||
<None Include="wwwroot\css\global.min.css" CopyToPublishDirectory="PreserveNewest" />
|
<None Include="wwwroot\css\global.min.css" CopyToPublishDirectory="PreserveNewest" />
|
||||||
<None Include="wwwroot\js\global.min.js" CopyToPublishDirectory="PreserveNewest" />
|
<None Include="wwwroot\js\global.min.js" CopyToPublishDirectory="PreserveNewest" />
|
||||||
<None Include="wwwroot\images\**\*.*" CopyToPublishDirectory="PreserveNewest" />
|
<None Include="wwwroot\images\**\*.*" CopyToPublishDirectory="PreserveNewest" />
|
||||||
<Content Remove="wwwroot\images\icons\crosshair.png" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
"wwwroot/js/search.js",
|
"wwwroot/js/search.js",
|
||||||
"wwwroot/js/loader.js",
|
"wwwroot/js/loader.js",
|
||||||
"wwwroot/js/stats.js",
|
"wwwroot/js/stats.js",
|
||||||
|
"wwwroot/js/scoreboard.js",
|
||||||
"wwwroot/js/configuration.js",
|
"wwwroot/js/configuration.js",
|
||||||
"wwwroot/js/advanced_stats.js"
|
"wwwroot/js/advanced_stats.js"
|
||||||
],
|
],
|
||||||
|
15
WebfrontCore/wwwroot/js/scoreboard.js
Normal file
15
WebfrontCore/wwwroot/js/scoreboard.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
function refreshScoreboard() {
|
||||||
|
const serverPanel = $('.scoreboard-container.active');
|
||||||
|
const serverId = $(serverPanel).data('server-id');
|
||||||
|
|
||||||
|
$.get(`../Server/${serverId}/Scoreboard`, (response) => {
|
||||||
|
$(serverPanel).html(response);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(() => {
|
||||||
|
$(window.location.hash).tab('show');
|
||||||
|
$(`${window.location.hash}_nav`).addClass('active');
|
||||||
|
})
|
||||||
|
|
||||||
|
setInterval(refreshScoreboard, 5000);
|
Loading…
x
Reference in New Issue
Block a user