Compare commits
29 Commits
master
...
2021.12.23
Author | SHA1 | Date | |
---|---|---|---|
8baa85c7c0 | |||
ecfcd760d6 | |||
8af40a7772 | |||
697a1884cb | |||
4899ef86cc | |||
794e1ee87b | |||
b025115cf8 | |||
f7c3db3712 | |||
f32ac3f45e | |||
3716255740 | |||
d36e19a077 | |||
12cc5f1820 | |||
61a131be9d | |||
d93bfc11d0 | |||
21f290ca58 | |||
d3df9623aa | |||
1b9ca676dc | |||
58616e18fe | |||
0dcbafd0f2 | |||
f8723e6a8c | |||
3ebdbde33d | |||
769faaa31b | |||
2734a3f138 | |||
914b37b20a | |||
755c149495 | |||
bbcbc4c042 | |||
f3bead8eb5 | |||
7eb45f2bc9 | |||
5837885653 |
@ -492,17 +492,13 @@ namespace IW4MAdmin.Application
|
|||||||
|
|
||||||
// this is because I want to store the command prefix in IW4MAdminSettings, but can't easily
|
// this is because I want to store the command prefix in IW4MAdminSettings, but can't easily
|
||||||
// inject it to all the places that need it
|
// inject it to all the places that need it
|
||||||
cmdConfig.CommandPrefix = _appConfig?.CommandPrefix ?? "!";
|
cmdConfig.CommandPrefix = _appConfig.CommandPrefix;
|
||||||
cmdConfig.BroadcastCommandPrefix = _appConfig?.BroadcastCommandPrefix ?? "@";
|
cmdConfig.BroadcastCommandPrefix = _appConfig.BroadcastCommandPrefix;
|
||||||
|
|
||||||
foreach (var cmd in commandsToAddToConfig)
|
foreach (var cmd in commandsToAddToConfig)
|
||||||
{
|
{
|
||||||
if (cmdConfig.Commands.ContainsKey(cmd.CommandConfigNameForType()))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
cmdConfig.Commands.Add(cmd.CommandConfigNameForType(),
|
cmdConfig.Commands.Add(cmd.CommandConfigNameForType(),
|
||||||
new CommandProperties
|
new CommandProperties()
|
||||||
{
|
{
|
||||||
Name = cmd.Name,
|
Name = cmd.Name,
|
||||||
Alias = cmd.Alias,
|
Alias = cmd.Alias,
|
||||||
|
@ -159,12 +159,12 @@
|
|||||||
"Game": "IW5",
|
"Game": "IW5",
|
||||||
"Gametypes": [
|
"Gametypes": [
|
||||||
{
|
{
|
||||||
"Name": "dom",
|
"Name": "tdm",
|
||||||
"Alias": "Domination"
|
"Alias": "Team Deathmatch"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "conf",
|
"Name": "dom",
|
||||||
"Alias": "Kill Confirmed"
|
"Alias": "Domination"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "ctf",
|
"Name": "ctf",
|
||||||
@ -175,29 +175,37 @@
|
|||||||
"Alias": "Demolition"
|
"Alias": "Demolition"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "dm",
|
"Name": "dz",
|
||||||
"Alias": "Free For All"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "grnd",
|
|
||||||
"Alias": "Drop Zone"
|
"Alias": "Drop Zone"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "gun",
|
"Name": "ffa",
|
||||||
|
"Alias": "Free For All"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Name": "gg",
|
||||||
"Alias": "Gun Game"
|
"Alias": "Gun Game"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Name": "hq",
|
||||||
|
"Alias": "Headquarters"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Name": "koth",
|
"Name": "koth",
|
||||||
"Alias": "Headquarters"
|
"Alias": "Headquarters"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "infect",
|
"Name": "inf",
|
||||||
"Alias": "Infected"
|
"Alias": "Infected"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "jugg",
|
"Name": "jug",
|
||||||
"Alias": "Juggernaut"
|
"Alias": "Juggernaut"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"Name": "kc",
|
||||||
|
"Alias": "Kill Confirmed"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"Name": "oic",
|
"Name": "oic",
|
||||||
"Alias": "One In The Chamber"
|
"Alias": "One In The Chamber"
|
||||||
@ -215,12 +223,8 @@
|
|||||||
"Alias": "Team Defender"
|
"Alias": "Team Defender"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Name": "tjugg",
|
"Name": "tj",
|
||||||
"Alias": "Team Juggernaut"
|
"Alias": "Team Juggernaut"
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "war",
|
|
||||||
"Alias": "Team Deathmatch"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -118,7 +118,7 @@ namespace Data.Context
|
|||||||
ent.HasIndex(a => a.Name);
|
ent.HasIndex(a => a.Name);
|
||||||
ent.Property(_alias => _alias.SearchableName).HasMaxLength(24);
|
ent.Property(_alias => _alias.SearchableName).HasMaxLength(24);
|
||||||
ent.HasIndex(_alias => _alias.SearchableName);
|
ent.HasIndex(_alias => _alias.SearchableName);
|
||||||
ent.HasIndex(_alias => new {_alias.Name, _alias.IPAddress});
|
ent.HasIndex(_alias => new {_alias.Name, _alias.IPAddress}).IsUnique();
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<EFMeta>(ent =>
|
modelBuilder.Entity<EFMeta>(ent =>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<PackageId>RaidMax.IW4MAdmin.Data</PackageId>
|
<PackageId>RaidMax.IW4MAdmin.Data</PackageId>
|
||||||
<Title>RaidMax.IW4MAdmin.Data</Title>
|
<Title>RaidMax.IW4MAdmin.Data</Title>
|
||||||
<Authors />
|
<Authors />
|
||||||
<PackageVersion>1.1.0</PackageVersion>
|
<PackageVersion>1.0.9</PackageVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,32 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace Data.Migrations.MySql
|
|
||||||
{
|
|
||||||
public partial class RemoveUniqueAliasIndexConstraint : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_EFAlias_Name_IPAddress",
|
|
||||||
table: "EFAlias");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_EFAlias_Name_IPAddress",
|
|
||||||
table: "EFAlias",
|
|
||||||
columns: new[] { "Name", "IPAddress" });
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_EFAlias_Name_IPAddress",
|
|
||||||
table: "EFAlias");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_EFAlias_Name_IPAddress",
|
|
||||||
table: "EFAlias",
|
|
||||||
columns: new[] { "Name", "IPAddress" },
|
|
||||||
unique: true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -816,7 +816,8 @@ namespace Data.Migrations.MySql
|
|||||||
|
|
||||||
b.HasIndex("SearchableName");
|
b.HasIndex("SearchableName");
|
||||||
|
|
||||||
b.HasIndex("Name", "IPAddress");
|
b.HasIndex("Name", "IPAddress")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("EFAlias");
|
b.ToTable("EFAlias");
|
||||||
});
|
});
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,32 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace Data.Migrations.Postgresql
|
|
||||||
{
|
|
||||||
public partial class RemoveUniqueAliasIndexConstraint : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_EFAlias_Name_IPAddress",
|
|
||||||
table: "EFAlias");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_EFAlias_Name_IPAddress",
|
|
||||||
table: "EFAlias",
|
|
||||||
columns: new[] { "Name", "IPAddress" });
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_EFAlias_Name_IPAddress",
|
|
||||||
table: "EFAlias");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_EFAlias_Name_IPAddress",
|
|
||||||
table: "EFAlias",
|
|
||||||
columns: new[] { "Name", "IPAddress" },
|
|
||||||
unique: true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -836,7 +836,8 @@ namespace Data.Migrations.Postgresql
|
|||||||
|
|
||||||
b.HasIndex("SearchableName");
|
b.HasIndex("SearchableName");
|
||||||
|
|
||||||
b.HasIndex("Name", "IPAddress");
|
b.HasIndex("Name", "IPAddress")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("EFAlias");
|
b.ToTable("EFAlias");
|
||||||
});
|
});
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,15 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace Data.Migrations.Sqlite
|
|
||||||
{
|
|
||||||
public partial class RemoveUniqueAliasIndexConstraint : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -815,7 +815,8 @@ namespace Data.Migrations.Sqlite
|
|||||||
|
|
||||||
b.HasIndex("SearchableName");
|
b.HasIndex("SearchableName");
|
||||||
|
|
||||||
b.HasIndex("Name", "IPAddress");
|
b.HasIndex("Name", "IPAddress")
|
||||||
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("EFAlias");
|
b.ToTable("EFAlias");
|
||||||
});
|
});
|
||||||
|
@ -57,11 +57,10 @@ 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(
|
{
|
||||||
HitLocations.Sum(c => c.HitOffsetAverage) /
|
get => (float)Math.Round(HitLocations.Sum(c => c.HitOffsetAverage) / Math.Max(1, HitLocations.Where(c => c.HitOffsetAverage > 0).Count()), 4);
|
||||||
Math.Max(1, HitLocations.Count(c => c.HitOffsetAverage > 0)), 4);
|
}
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public int SessionKills { get; set; }
|
public int SessionKills { get; set; }
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
@ -83,26 +82,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[^1] = value;
|
set => SessionScores[SessionScores.Count - 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[^1];
|
public int RoundScore => SessionScores[SessionScores.Count - 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]
|
||||||
@ -110,21 +109,6 @@ namespace Data.Models.Client.Stats
|
|||||||
[NotMapped]
|
[NotMapped]
|
||||||
public double SessionSPM { get; set; }
|
public double SessionSPM { get; set; }
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public SemaphoreSlim ProcessingHit { get; }
|
public SemaphoreSlim ProcessingHit { get; private set; }
|
||||||
|
|
||||||
[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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ScriptPlugins", "ScriptPlug
|
|||||||
Plugins\ScriptPlugins\ParserS1x.js = Plugins\ScriptPlugins\ParserS1x.js
|
Plugins\ScriptPlugins\ParserS1x.js = Plugins\ScriptPlugins\ParserS1x.js
|
||||||
Plugins\ScriptPlugins\ParserCSGO.js = Plugins\ScriptPlugins\ParserCSGO.js
|
Plugins\ScriptPlugins\ParserCSGO.js = Plugins\ScriptPlugins\ParserCSGO.js
|
||||||
Plugins\ScriptPlugins\ParserCSGOSM.js = Plugins\ScriptPlugins\ParserCSGOSM.js
|
Plugins\ScriptPlugins\ParserCSGOSM.js = Plugins\ScriptPlugins\ParserCSGOSM.js
|
||||||
Plugins\ScriptPlugins\ParserPlutoniumT4COZM.js = Plugins\ScriptPlugins\ParserPlutoniumT4COZM.js
|
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutomessageFeed", "Plugins\AutomessageFeed\AutomessageFeed.csproj", "{F5815359-CFC7-44B4-9A3B-C04BACAD5836}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutomessageFeed", "Plugins\AutomessageFeed\AutomessageFeed.csproj", "{F5815359-CFC7-44B4-9A3B-C04BACAD5836}"
|
||||||
|
@ -66,7 +66,6 @@ namespace Integrations.Source
|
|||||||
// ignored
|
// ignored
|
||||||
}
|
}
|
||||||
|
|
||||||
await Task.Delay(ConnectionTimeout);
|
|
||||||
_rconClient = _rconClientFactory.CreateClient(_ipEndPoint);
|
_rconClient = _rconClientFactory.CreateClient(_ipEndPoint);
|
||||||
_authenticated = false;
|
_authenticated = false;
|
||||||
_needNewSocket = false;
|
_needNewSocket = false;
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
|
||||||
<LangVersion>Latest</LangVersion>
|
<LangVersion>7.1</LangVersion>
|
||||||
<Configurations>Debug;Release;Prerelease</Configurations>
|
<Configurations>Debug;Release;Prerelease</Configurations>
|
||||||
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
|
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<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.20.1" PrivateAssets="All" />
|
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2021.11.21.1" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
<ApplicationIcon />
|
<ApplicationIcon />
|
||||||
<StartupObject />
|
<StartupObject />
|
||||||
<Configurations>Debug;Release;Prerelease</Configurations>
|
<Configurations>Debug;Release;Prerelease</Configurations>
|
||||||
<LangVersion>Latest</LangVersion>
|
<LangVersion>7.1</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.20.1" PrivateAssets="All" />
|
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2021.11.21.1" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
|
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
|
||||||
<Version>0.1.0.0</Version>
|
<Version>0.1.0.0</Version>
|
||||||
<Configurations>Debug;Release;Prerelease</Configurations>
|
<Configurations>Debug;Release;Prerelease</Configurations>
|
||||||
<LangVersion>Latest</LangVersion>
|
<LangVersion>7.1</LangVersion>
|
||||||
<ApplicationIcon />
|
<ApplicationIcon />
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<StartupObject />
|
<StartupObject />
|
||||||
@ -23,7 +23,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.20.1" PrivateAssets="All" />
|
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2021.11.21.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"></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" allow="@ViewBag.EnableColorCodes"></color-code></a>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<Company>Forever None</Company>
|
<Company>Forever None</Company>
|
||||||
<Product>Login Plugin for IW4MAdmin</Product>
|
<Product>Login Plugin for IW4MAdmin</Product>
|
||||||
<Configurations>Debug;Release;Prerelease</Configurations>
|
<Configurations>Debug;Release;Prerelease</Configurations>
|
||||||
<LangVersion>Latest</LangVersion>
|
<LangVersion>7.1</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
@ -19,7 +19,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.20.1" PrivateAssets="All" />
|
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2021.11.21.1" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
@ -12,11 +12,11 @@
|
|||||||
<Description>Warns and kicks players for using profanity</Description>
|
<Description>Warns and kicks players for using profanity</Description>
|
||||||
<Copyright>2018</Copyright>
|
<Copyright>2018</Copyright>
|
||||||
<Configurations>Debug;Release;Prerelease</Configurations>
|
<Configurations>Debug;Release;Prerelease</Configurations>
|
||||||
<LangVersion>Latest</LangVersion>
|
<LangVersion>7.1</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.20.1" PrivateAssets="All" />
|
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2021.11.21.1" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
@ -3,8 +3,8 @@ var eventParser;
|
|||||||
|
|
||||||
var plugin = {
|
var plugin = {
|
||||||
author: 'RaidMax, Chase',
|
author: 'RaidMax, Chase',
|
||||||
version: 0.4,
|
version: 0.3,
|
||||||
name: 'Plutonium T4 MP Parser',
|
name: 'Plutonium T4 Parser',
|
||||||
isParser: true,
|
isParser: true,
|
||||||
|
|
||||||
onEventAsync: function (gameEvent, server) {
|
onEventAsync: function (gameEvent, server) {
|
||||||
@ -20,7 +20,6 @@ var plugin = {
|
|||||||
rconParser.Configuration.CommandPrefixes.RConResponse = '\xff\xff\xff\xffprint\n';
|
rconParser.Configuration.CommandPrefixes.RConResponse = '\xff\xff\xff\xffprint\n';
|
||||||
rconParser.Configuration.GuidNumberStyle = 7; // Integer
|
rconParser.Configuration.GuidNumberStyle = 7; // Integer
|
||||||
rconParser.Configuration.DefaultRConPort = 28960;
|
rconParser.Configuration.DefaultRConPort = 28960;
|
||||||
rconParser.Configuration.OverrideDvarNameMapping.Add('fs_homepath', 'fs_localAppData');
|
|
||||||
|
|
||||||
rconParser.Configuration.DefaultInstallationDirectoryHint = '{LocalAppData}/Plutonium/storage/t4';
|
rconParser.Configuration.DefaultInstallationDirectoryHint = '{LocalAppData}/Plutonium/storage/t4';
|
||||||
|
|
||||||
@ -28,7 +27,7 @@ var plugin = {
|
|||||||
rconParser.GameName = 5; // T4
|
rconParser.GameName = 5; // T4
|
||||||
|
|
||||||
eventParser.Configuration.GuidNumberStyle = 7; // Integer
|
eventParser.Configuration.GuidNumberStyle = 7; // Integer
|
||||||
eventParser.Configuration.GameDirectory = 'main';
|
eventParser.Configuration.GameDirectory = 'raw';
|
||||||
|
|
||||||
eventParser.Version = 'Plutonium T4';
|
eventParser.Version = 'Plutonium T4';
|
||||||
},
|
},
|
||||||
|
@ -1,43 +0,0 @@
|
|||||||
var rconParser;
|
|
||||||
var eventParser;
|
|
||||||
|
|
||||||
var plugin = {
|
|
||||||
author: 'RaidMax',
|
|
||||||
version: 0.1,
|
|
||||||
name: 'Plutonium T4 CO-OP/Zombies Parser',
|
|
||||||
isParser: true,
|
|
||||||
|
|
||||||
onEventAsync: function (gameEvent, server) {
|
|
||||||
},
|
|
||||||
|
|
||||||
onLoadAsync: function (manager) {
|
|
||||||
rconParser = manager.GenerateDynamicRConParser(this.name);
|
|
||||||
eventParser = manager.GenerateDynamicEventParser(this.name);
|
|
||||||
|
|
||||||
rconParser.Configuration.CommandPrefixes.Kick = 'clientkick {0}';
|
|
||||||
rconParser.Configuration.CommandPrefixes.Ban = 'clientkick {0}';
|
|
||||||
rconParser.Configuration.CommandPrefixes.TempBan = 'clientkick {0}';
|
|
||||||
rconParser.Configuration.CommandPrefixes.RConResponse = '\xff\xff\xff\xffprint\n';
|
|
||||||
rconParser.Configuration.GuidNumberStyle = 7; // Integer
|
|
||||||
rconParser.Configuration.DefaultRConPort = 28960;
|
|
||||||
rconParser.Configuration.CommandPrefixes.RConGetInfo = undefined;
|
|
||||||
|
|
||||||
|
|
||||||
rconParser.Configuration.DefaultInstallationDirectoryHint = '{LocalAppData}/Plutonium/storage/t4';
|
|
||||||
rconParser.Configuration.OverrideDvarNameMapping.Add('fs_homepath', 'fs_localAppData');
|
|
||||||
|
|
||||||
rconParser.Version = 'Plutonium T4 Singleplayer';
|
|
||||||
rconParser.GameName = 5; // T4
|
|
||||||
|
|
||||||
eventParser.Configuration.GuidNumberStyle = 7; // Integer
|
|
||||||
eventParser.Configuration.GameDirectory = 'main';
|
|
||||||
|
|
||||||
eventParser.Version = 'Plutonium T4 Singleplayer';
|
|
||||||
},
|
|
||||||
|
|
||||||
onUnloadAsync: function () {
|
|
||||||
},
|
|
||||||
|
|
||||||
onTickAsync: function (server) {
|
|
||||||
}
|
|
||||||
};
|
|
@ -79,10 +79,7 @@ namespace Stats.Client
|
|||||||
.Where(AdvancedClientStatsResourceQueryHelper.GetRankingFunc(validPlayTime))
|
.Where(AdvancedClientStatsResourceQueryHelper.GetRankingFunc(validPlayTime))
|
||||||
.Where(s => s.Skill > 0)
|
.Where(s => s.Skill > 0)
|
||||||
.Where(s => s.EloRating > 0)
|
.Where(s => s.EloRating > 0)
|
||||||
.GroupBy(stat => stat.ClientId)
|
.MaxAsync(s => (double?)s.ZScore, token);
|
||||||
.Select(group =>
|
|
||||||
group.Sum(stat => stat.ZScore * stat.TimePlayed) / group.Sum(stat => stat.TimePlayed))
|
|
||||||
.MaxAsync(avgZScore => (double?) avgZScore, token);
|
|
||||||
return zScore ?? 0;
|
return zScore ?? 0;
|
||||||
}, MaxZScoreCacheKey, Utilities.IsDevelopment ? TimeSpan.FromMinutes(5) : TimeSpan.FromMinutes(30));
|
}, MaxZScoreCacheKey, Utilities.IsDevelopment ? TimeSpan.FromMinutes(5) : TimeSpan.FromMinutes(30));
|
||||||
|
|
||||||
@ -141,7 +138,6 @@ namespace Stats.Client
|
|||||||
{
|
{
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
var zScore = (Math.Log(value) - sdParams.Mean) / sdParams.Sigma;
|
var zScore = (Math.Log(value) - sdParams.Mean) / sdParams.Sigma;
|
||||||
return zScore;
|
return zScore;
|
||||||
}
|
}
|
||||||
@ -149,7 +145,7 @@ namespace Stats.Client
|
|||||||
public async Task<double?> GetRatingForZScore(double? value)
|
public async Task<double?> GetRatingForZScore(double? value)
|
||||||
{
|
{
|
||||||
var maxZScore = await _maxZScoreCache.GetCacheItem(MaxZScoreCacheKey);
|
var maxZScore = await _maxZScoreCache.GetCacheItem(MaxZScoreCacheKey);
|
||||||
return maxZScore == 0 ? null : value.GetRatingForZScore(maxZScore);
|
return maxZScore == 0 ? 0 : value.GetRatingForZScore(maxZScore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -19,10 +19,7 @@ using Data.Models.Client;
|
|||||||
using Data.Models.Client.Stats;
|
using Data.Models.Client.Stats;
|
||||||
using Data.Models.Server;
|
using Data.Models.Server;
|
||||||
using Humanizer.Localisation;
|
using Humanizer.Localisation;
|
||||||
using Microsoft.Data.Sqlite;
|
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using MySql.Data.MySqlClient;
|
|
||||||
using Npgsql;
|
|
||||||
using Stats.Client.Abstractions;
|
using Stats.Client.Abstractions;
|
||||||
using Stats.Config;
|
using Stats.Config;
|
||||||
using Stats.Helpers;
|
using Stats.Helpers;
|
||||||
@ -121,7 +118,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
{
|
{
|
||||||
return (ranking) => ranking.ServerId == serverId
|
return (ranking) => ranking.ServerId == serverId
|
||||||
&& ranking.Client.Level != Data.Models.Client.EFClient.Permission.Banned
|
&& ranking.Client.Level != Data.Models.Client.EFClient.Permission.Banned
|
||||||
&& ranking.CreatedDateTime >= Extensions.FifteenDaysAgo()
|
&& ranking.Client.LastConnection >= Extensions.FifteenDaysAgo()
|
||||||
&& ranking.ZScore != null
|
&& ranking.ZScore != null
|
||||||
&& ranking.PerformanceMetric != null
|
&& ranking.PerformanceMetric != null
|
||||||
&& ranking.Newest
|
&& ranking.Newest
|
||||||
@ -435,12 +432,6 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pl.ClientId <= 0)
|
|
||||||
{
|
|
||||||
_log.LogWarning("Stats for {Client} are not yet initialized", pl.ToString());
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// get the client's stats from the database if it exists, otherwise create and attach a new one
|
// get the client's stats from the database if it exists, otherwise create and attach a new one
|
||||||
// if this fails we want to throw an exception
|
// if this fails we want to throw an exception
|
||||||
|
|
||||||
@ -520,15 +511,6 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
return clientStats;
|
return clientStats;
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (DbUpdateException updateException) when (
|
|
||||||
updateException.InnerException is PostgresException {SqlState: "23503"}
|
|
||||||
|| updateException.InnerException is SqliteException {SqliteErrorCode: 787}
|
|
||||||
|| updateException.InnerException is MySqlException {SqlState: "23503"})
|
|
||||||
{
|
|
||||||
_log.LogWarning("Trying to add {Client} to stats before they have been added to the database",
|
|
||||||
pl.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_log.LogError(ex, "Could not add client to stats {@client}", pl.ToString());
|
_log.LogError(ex, "Could not add client to stats {@client}", pl.ToString());
|
||||||
@ -671,12 +653,6 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
var clientDetection = attacker.GetAdditionalProperty<Detection>(CLIENT_DETECTIONS_KEY);
|
var clientDetection = attacker.GetAdditionalProperty<Detection>(CLIENT_DETECTIONS_KEY);
|
||||||
var clientStats = attacker.GetAdditionalProperty<EFClientStatistics>(CLIENT_STATS_KEY);
|
var clientStats = attacker.GetAdditionalProperty<EFClientStatistics>(CLIENT_STATS_KEY);
|
||||||
|
|
||||||
if (clientDetection == null || clientStats?.ClientId == null)
|
|
||||||
{
|
|
||||||
_log.LogWarning("Client stats state for {Client} is not yet initialized", attacker.ToString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
waiter = clientStats.ProcessingHit;
|
waiter = clientStats.ProcessingHit;
|
||||||
await waiter.WaitAsync(Utilities.DefaultCommandTimeout, Plugin.ServerManager.CancellationToken);
|
await waiter.WaitAsync(Utilities.DefaultCommandTimeout, Plugin.ServerManager.CancellationToken);
|
||||||
|
|
||||||
@ -895,7 +871,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
|
|
||||||
public async Task AddStandardKill(EFClient attacker, EFClient victim)
|
public async Task AddStandardKill(EFClient attacker, EFClient victim)
|
||||||
{
|
{
|
||||||
var serverId = GetIdForServer(attacker.CurrentServer);
|
long serverId = GetIdForServer(attacker.CurrentServer);
|
||||||
|
|
||||||
var attackerStats = attacker.GetAdditionalProperty<EFClientStatistics>(CLIENT_STATS_KEY);
|
var attackerStats = attacker.GetAdditionalProperty<EFClientStatistics>(CLIENT_STATS_KEY);
|
||||||
var victimStats = victim.GetAdditionalProperty<EFClientStatistics>(CLIENT_STATS_KEY);
|
var victimStats = victim.GetAdditionalProperty<EFClientStatistics>(CLIENT_STATS_KEY);
|
||||||
@ -903,18 +879,6 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
// update the total stats
|
// update the total stats
|
||||||
_servers[serverId].ServerStatistics.TotalKills += 1;
|
_servers[serverId].ServerStatistics.TotalKills += 1;
|
||||||
|
|
||||||
if (attackerStats == null)
|
|
||||||
{
|
|
||||||
_log.LogWarning("Stats for {Client} are not yet initialized", attacker.ToString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (victimStats == null)
|
|
||||||
{
|
|
||||||
_log.LogWarning("Stats for {Client} are not yet initialized", victim.ToString());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// this happens when the round has changed
|
// this happens when the round has changed
|
||||||
if (attackerStats.SessionScore == 0)
|
if (attackerStats.SessionScore == 0)
|
||||||
{
|
{
|
||||||
@ -973,7 +937,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
|
|
||||||
// update their performance
|
// update their performance
|
||||||
if ((DateTime.UtcNow - attackerStats.LastStatHistoryUpdate).TotalMinutes >=
|
if ((DateTime.UtcNow - attackerStats.LastStatHistoryUpdate).TotalMinutes >=
|
||||||
(Utilities.IsDevelopment ? 0.5 : _configHandler.Configuration().EnableAdvancedMetrics ? 5.0 : 2.5))
|
(Utilities.IsDevelopment ? 0.5 : _configHandler.Configuration().EnableAdvancedMetrics ? 10.0 : 2.5))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -1190,17 +1154,16 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
public async Task UpdateHistoricalRanking(int clientId, EFClientStatistics clientStats, long serverId)
|
public async Task UpdateHistoricalRanking(int clientId, EFClientStatistics clientStats, long serverId)
|
||||||
{
|
{
|
||||||
await using var context = _contextFactory.CreateContext();
|
await using var context = _contextFactory.CreateContext();
|
||||||
var minPlayTime = _configHandler.Configuration().TopPlayersMinPlayTime;
|
|
||||||
|
|
||||||
var performances = await context.Set<EFClientStatistics>()
|
var performances = await context.Set<EFClientStatistics>()
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.Where(stat => stat.ClientId == clientId)
|
.Where(stat => stat.ClientId == clientId)
|
||||||
.Where(stat => stat.ServerId != serverId) // ignore the one we're currently tracking
|
.Where(stat => stat.ServerId != serverId) // ignore the one we're currently tracking
|
||||||
.Where(stats => stats.UpdatedAt >= Extensions.FifteenDaysAgo())
|
.Where(stats => stats.UpdatedAt >= Extensions.FifteenDaysAgo())
|
||||||
.Where(stats => stats.TimePlayed >= minPlayTime)
|
.Where(stats => stats.TimePlayed >= _configHandler.Configuration().TopPlayersMinPlayTime)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
||||||
if (clientStats.TimePlayed >= minPlayTime)
|
if (clientStats.TimePlayed >= _configHandler.Configuration().TopPlayersMinPlayTime)
|
||||||
{
|
{
|
||||||
clientStats.ZScore = await _serverDistributionCalculator.GetZScoreForServer(serverId,
|
clientStats.ZScore = await _serverDistributionCalculator.GetZScoreForServer(serverId,
|
||||||
clientStats.Performance);
|
clientStats.Performance);
|
||||||
@ -1211,7 +1174,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
_configHandler.Configuration().TopPlayersMinPlayTime, clientStats.ZScore, serverId))
|
_configHandler.Configuration().TopPlayersMinPlayTime, clientStats.ZScore, serverId))
|
||||||
.CountAsync();
|
.CountAsync();
|
||||||
|
|
||||||
var serverRankingSnapshot = new EFClientRankingHistory
|
var serverRankingSnapshot = new EFClientRankingHistory()
|
||||||
{
|
{
|
||||||
ClientId = clientId,
|
ClientId = clientId,
|
||||||
ServerId = serverId,
|
ServerId = serverId,
|
||||||
@ -1228,13 +1191,14 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
performances.Add(clientStats);
|
performances.Add(clientStats);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (performances.Any(performance => performance.TimePlayed >= minPlayTime))
|
if (performances.Any(performance => performance.TimePlayed >= _configHandler.Configuration().TopPlayersMinPlayTime))
|
||||||
{
|
{
|
||||||
var aggregateZScore = performances.WeightValueByPlaytime(nameof(EFClientStatistics.ZScore), minPlayTime);
|
var aggregateZScore = performances.WeightValueByPlaytime(nameof(EFClientStatistics.ZScore), _configHandler.Configuration().TopPlayersMinPlayTime);
|
||||||
|
|
||||||
int? aggregateRanking = await context.Set<EFClientStatistics>()
|
int? aggregateRanking = await context.Set<EFClientStatistics>()
|
||||||
.Where(stat => stat.ClientId != clientId)
|
.Where(stat => stat.ClientId != clientId)
|
||||||
.Where(AdvancedClientStatsResourceQueryHelper.GetRankingFunc(minPlayTime))
|
.Where(AdvancedClientStatsResourceQueryHelper.GetRankingFunc(_configHandler.Configuration()
|
||||||
|
.TopPlayersMinPlayTime))
|
||||||
.GroupBy(stat => stat.ClientId)
|
.GroupBy(stat => stat.ClientId)
|
||||||
.Where(group =>
|
.Where(group =>
|
||||||
group.Sum(stat => stat.ZScore * stat.TimePlayed) / group.Sum(stat => stat.TimePlayed) >
|
group.Sum(stat => stat.ZScore * stat.TimePlayed) / group.Sum(stat => stat.TimePlayed) >
|
||||||
@ -1242,21 +1206,12 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
.Select(c => c.Key)
|
.Select(c => c.Key)
|
||||||
.CountAsync();
|
.CountAsync();
|
||||||
|
|
||||||
var newPerformanceMetric = await _serverDistributionCalculator.GetRatingForZScore(aggregateZScore);
|
var aggregateRankingSnapshot = new EFClientRankingHistory()
|
||||||
|
|
||||||
if (newPerformanceMetric == null)
|
|
||||||
{
|
|
||||||
_log.LogWarning("Could not determine performance metric for {Client} {AggregateZScore}",
|
|
||||||
clientStats.Client?.ToString(), aggregateZScore);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var aggregateRankingSnapshot = new EFClientRankingHistory
|
|
||||||
{
|
{
|
||||||
ClientId = clientId,
|
ClientId = clientId,
|
||||||
ZScore = aggregateZScore,
|
ZScore = aggregateZScore,
|
||||||
Ranking = aggregateRanking,
|
Ranking = aggregateRanking,
|
||||||
PerformanceMetric = newPerformanceMetric,
|
PerformanceMetric = await _serverDistributionCalculator.GetRatingForZScore(aggregateZScore),
|
||||||
Newest = true,
|
Newest = true,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1310,14 +1265,12 @@ 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;
|
||||||
@ -1467,7 +1420,6 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
{
|
{
|
||||||
session.stat?.StartNewSession();
|
session.stat?.StartNewSession();
|
||||||
session.detection?.OnMapChange();
|
session.detection?.OnMapChange();
|
||||||
session.stat?.MatchData?.StartNewMatch();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using IW4MAdmin.Plugins.Stats.Helpers;
|
using IW4MAdmin.Plugins.Stats.Config;
|
||||||
|
using IW4MAdmin.Plugins.Stats.Helpers;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using SharedLibraryCore;
|
using SharedLibraryCore;
|
||||||
using SharedLibraryCore.Dtos.Meta.Responses;
|
using SharedLibraryCore.Dtos.Meta.Responses;
|
||||||
@ -14,7 +15,9 @@ using Data.Abstractions;
|
|||||||
using Data.Models.Client;
|
using Data.Models.Client;
|
||||||
using Data.Models.Client.Stats;
|
using Data.Models.Client.Stats;
|
||||||
using Data.Models.Server;
|
using Data.Models.Server;
|
||||||
|
using Humanizer;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using SharedLibraryCore.Commands;
|
||||||
using IW4MAdmin.Plugins.Stats.Client.Abstractions;
|
using IW4MAdmin.Plugins.Stats.Client.Abstractions;
|
||||||
using Stats.Client.Abstractions;
|
using Stats.Client.Abstractions;
|
||||||
using Stats.Config;
|
using Stats.Config;
|
||||||
|
@ -12,12 +12,12 @@
|
|||||||
<Description>Client Statistics Plugin for IW4MAdmin</Description>
|
<Description>Client Statistics Plugin for IW4MAdmin</Description>
|
||||||
<Copyright>2018</Copyright>
|
<Copyright>2018</Copyright>
|
||||||
<Configurations>Debug;Release;Prerelease</Configurations>
|
<Configurations>Debug;Release;Prerelease</Configurations>
|
||||||
<LangVersion>Latest</LangVersion>
|
<LangVersion>8.0</LangVersion>
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2022.1.20.1" PrivateAssets="All" />
|
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2021.11.21.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.20.1" PrivateAssets="All" />
|
<PackageReference Include="RaidMax.IW4MAdmin.SharedLibraryCore" Version="2021.11.21.1" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -62,7 +62,7 @@ namespace SharedLibraryCore
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper property to provide the syntax of the command
|
/// Helper property to provide the syntax of the command
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Syntax => $"{_translationLookup["COMMAND_HELP_SYNTAX"]} {_config.CommandPrefix ?? "!"}{Alias} {string.Join(" ", Arguments.Select(a => $"<{(a.Required ? "" : _translationLookup["COMMAND_HELP_OPTIONAL"] + " ")}{a.Name}>"))}";
|
public string Syntax => $"{_translationLookup["COMMAND_HELP_SYNTAX"]} {_config.CommandPrefix}{Alias} {string.Join(" ", Arguments.Select(a => $"<{(a.Required ? "" : _translationLookup["COMMAND_HELP_OPTIONAL"] + " ")}{a.Name}>"))}";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Alternate name for this command to be executed by
|
/// Alternate name for this command to be executed by
|
||||||
|
@ -153,7 +153,7 @@ namespace SharedLibraryCore.Services
|
|||||||
{
|
{
|
||||||
_logger.LogDebug("[{Method}] creating new Link and Alias for {Entity}", nameof(HandleNewCreate), entity.ToString());
|
_logger.LogDebug("[{Method}] creating new Link and Alias for {Entity}", nameof(HandleNewCreate), entity.ToString());
|
||||||
var link = new EFAliasLink();
|
var link = new EFAliasLink();
|
||||||
var alias = new EFAlias
|
var alias = new EFAlias()
|
||||||
{
|
{
|
||||||
Name = entity.Name,
|
Name = entity.Name,
|
||||||
SearchableName = entity.Name.StripColors().ToLower(),
|
SearchableName = entity.Name.StripColors().ToLower(),
|
||||||
@ -167,18 +167,9 @@ namespace SharedLibraryCore.Services
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_logger.LogDebug("[{Method}] associating new GUID {Guid} with new exact alias match with linkId {LinkId} for {Entity}",
|
_logger.LogDebug("[{Method}] associating new GUID {Guid} with existing alias id {aliasId} for {Entity}",
|
||||||
nameof(HandleNewCreate), entity.GuidString, existingAlias.LinkId, entity.ToString());
|
nameof(HandleNewCreate), entity.GuidString, existingAlias.AliasId, entity.ToString());
|
||||||
|
client.CurrentAliasId = existingAlias.AliasId;
|
||||||
var alias = new EFAlias
|
|
||||||
{
|
|
||||||
Name = existingAlias.Name,
|
|
||||||
SearchableName = entity.Name.StripColors().ToLower(),
|
|
||||||
DateAdded = DateTime.UtcNow,
|
|
||||||
IPAddress = entity.IPAddress,
|
|
||||||
LinkId = existingAlias.LinkId
|
|
||||||
};
|
|
||||||
client.CurrentAlias = alias;
|
|
||||||
client.AliasLinkId = existingAlias.LinkId;
|
client.AliasLinkId = existingAlias.LinkId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,7 +338,7 @@ namespace SharedLibraryCore.Services
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (existingExactAlias != null && entity.AliasLinkId == existingExactAlias.LinkId)
|
if (existingExactAlias != null)
|
||||||
{
|
{
|
||||||
entity.CurrentAlias = existingExactAlias;
|
entity.CurrentAlias = existingExactAlias;
|
||||||
entity.CurrentAliasId = existingExactAlias.AliasId;
|
entity.CurrentAliasId = existingExactAlias.AliasId;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<PackageId>RaidMax.IW4MAdmin.SharedLibraryCore</PackageId>
|
<PackageId>RaidMax.IW4MAdmin.SharedLibraryCore</PackageId>
|
||||||
<Version>2022.01.20.1</Version>
|
<Version>2021.11.21.1</Version>
|
||||||
<Authors>RaidMax</Authors>
|
<Authors>RaidMax</Authors>
|
||||||
<Company>Forever None</Company>
|
<Company>Forever None</Company>
|
||||||
<Configurations>Debug;Release;Prerelease</Configurations>
|
<Configurations>Debug;Release;Prerelease</Configurations>
|
||||||
@ -13,13 +13,13 @@
|
|||||||
<PackageTags>IW4MAdmin</PackageTags>
|
<PackageTags>IW4MAdmin</PackageTags>
|
||||||
<RepositoryUrl>https://github.com/RaidMax/IW4M-Admin/</RepositoryUrl>
|
<RepositoryUrl>https://github.com/RaidMax/IW4M-Admin/</RepositoryUrl>
|
||||||
<PackageProjectUrl>https://www.raidmax.org/IW4MAdmin/</PackageProjectUrl>
|
<PackageProjectUrl>https://www.raidmax.org/IW4MAdmin/</PackageProjectUrl>
|
||||||
<Copyright>2022</Copyright>
|
<Copyright>2021</Copyright>
|
||||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
<Description>Shared Library for IW4MAdmin</Description>
|
<Description>Shared Library for IW4MAdmin</Description>
|
||||||
<PackageVersion>2022.01.20.1</PackageVersion>
|
<PackageVersion>2021.11.21.1</PackageVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|AnyCPU'">
|
||||||
@ -44,25 +44,13 @@
|
|||||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.10" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.10" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.1.10" />
|
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.1.10" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
|
<PackageReference Include="RaidMax.IW4MAdmin.Data" Version="1.0.9" />
|
||||||
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
|
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
|
||||||
<PackageReference Include="SimpleCrypto.NetCore" Version="1.0.0" />
|
<PackageReference Include="SimpleCrypto.NetCore" Version="1.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Data\Data.csproj"/>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||||
<Exec Command="if not exist "$(ProjectDir)..\BUILD" (
if $(ConfigurationName) == Debug (
md "$(ProjectDir)..\BUILD"
)
)
if not exist "$(ProjectDir)..\BUILD\Plugins" (
if $(ConfigurationName) == Debug (
md "$(ProjectDir)..\BUILD\Plugins"
)
)" />
|
<Exec Command="if not exist "$(ProjectDir)..\BUILD" (
if $(ConfigurationName) == Debug (
md "$(ProjectDir)..\BUILD"
)
)
if not exist "$(ProjectDir)..\BUILD\Plugins" (
if $(ConfigurationName) == Debug (
md "$(ProjectDir)..\BUILD\Plugins"
)
)" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Target DependsOnTargets="BuildOnlySettings;ResolveReferences" Name="CopyProjectReferencesToPackage">
|
|
||||||
<ItemGroup>
|
|
||||||
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))"/>
|
|
||||||
</ItemGroup>
|
|
||||||
</Target>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,35 +1,28 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Microsoft.AspNetCore.Razor.TagHelpers;
|
using Microsoft.AspNetCore.Razor.TagHelpers;
|
||||||
using SharedLibraryCore.Configuration;
|
|
||||||
|
|
||||||
namespace SharedLibraryCore
|
namespace SharedLibraryCore
|
||||||
{
|
{
|
||||||
[HtmlTargetElement("color-code")]
|
[HtmlTargetElement("color-code")]
|
||||||
public class ColorCode : TagHelper
|
public class ColorCode : TagHelper
|
||||||
{
|
{
|
||||||
public ColorCode(ApplicationConfiguration appConfig)
|
|
||||||
{
|
|
||||||
_allow = appConfig?.EnableColorCodes ?? false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Value { get; set; }
|
public string Value { get; set; }
|
||||||
|
|
||||||
private readonly bool _allow;
|
public bool Allow { get; set; } = false;
|
||||||
|
|
||||||
public override void Process(TagHelperContext context, TagHelperOutput output)
|
public override void Process(TagHelperContext context, TagHelperOutput output)
|
||||||
{
|
{
|
||||||
output.TagName = "ColorCode";
|
output.TagName = "ColorCode";
|
||||||
output.TagMode = TagMode.StartTagAndEndTag;
|
output.TagMode = TagMode.StartTagAndEndTag;
|
||||||
|
|
||||||
if (_allow)
|
if (Allow)
|
||||||
{
|
{
|
||||||
var matches = Regex.Matches(Value, @"\^([0-9]|\:)([^\^]*)");
|
var matches = Regex.Matches(Value, @"\^([0-9]|\:)([^\^]*)");
|
||||||
foreach (Match match in matches)
|
foreach (Match match in matches)
|
||||||
{
|
{
|
||||||
var colorCode = match.Groups[1].ToString().Last();
|
char colorCode = match.Groups[1].ToString().Last();
|
||||||
output.PreContent.AppendHtml(
|
output.PreContent.AppendHtml($"<span class='text-color-code-{(colorCode >= 48 && colorCode <= 57 ? colorCode.ToString() : ((int)colorCode).ToString())}'>");
|
||||||
$"<span class='text-color-code-{(colorCode >= 48 && colorCode <= 57 ? colorCode.ToString() : ((int) colorCode).ToString())}'>");
|
|
||||||
output.PreContent.Append(match.Groups[2].ToString());
|
output.PreContent.Append(match.Groups[2].ToString());
|
||||||
output.PreContent.AppendHtml("</span>");
|
output.PreContent.AppendHtml("</span>");
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ namespace WebfrontCore.Controllers
|
|||||||
ViewBag.Title += " " + Localization["WEBFRONT_CLIENT_PROFILE_TITLE"];
|
ViewBag.Title += " " + Localization["WEBFRONT_CLIENT_PROFILE_TITLE"];
|
||||||
ViewBag.Description = $"Client information for {strippedName}";
|
ViewBag.Description = $"Client information for {strippedName}";
|
||||||
ViewBag.Keywords = $"IW4MAdmin, client, profile, {strippedName}";
|
ViewBag.Keywords = $"IW4MAdmin, client, profile, {strippedName}";
|
||||||
ViewBag.UseNewStats = _configurationHandler.Configuration()?.EnableAdvancedMetrics ?? true;
|
ViewBag.UseNewStats = _configurationHandler.Configuration().EnableAdvancedMetrics;
|
||||||
|
|
||||||
return View("Profile/Index", clientDto);
|
return View("Profile/Index", clientDto);
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
using System;
|
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 IW4MAdmin.Plugins.Stats.Helpers;
|
using SharedLibraryCore.Configuration;
|
||||||
using WebfrontCore.ViewModels;
|
|
||||||
|
|
||||||
namespace WebfrontCore.Controllers
|
namespace WebfrontCore.Controllers
|
||||||
{
|
{
|
||||||
public class ServerController : BaseController
|
public class ServerController : BaseController
|
||||||
{
|
{
|
||||||
public ServerController(IManager manager) : base(manager)
|
private readonly DefaultSettings _defaultSettings;
|
||||||
|
|
||||||
|
public ServerController(IManager manager, DefaultSettings defaultSettings) : base(manager)
|
||||||
{
|
{
|
||||||
|
_defaultSettings = defaultSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
@ -44,8 +44,7 @@ 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
|
ZScore = p.GetAdditionalProperty<EFClientStatistics>(IW4MAdmin.Plugins.Stats.Helpers.StatManager.CLIENT_STATS_KEY)?.ZScore
|
||||||
.CLIENT_STATS_KEY)?.ZScore
|
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
ChatHistory = s.ChatHistory.ToList(),
|
ChatHistory = s.ChatHistory.ToList(),
|
||||||
PlayerHistory = s.ClientHistory.ToArray(),
|
PlayerHistory = s.ClientHistory.ToArray(),
|
||||||
@ -53,58 +52,5 @@ 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(), null, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("[controller]/{id}/scoreboard")]
|
|
||||||
public ActionResult Scoreboard(long id, [FromQuery]string order = null, [FromQuery] bool down = true)
|
|
||||||
{
|
|
||||||
var server = Manager.GetServers().FirstOrDefault(srv => srv.EndPoint == id);
|
|
||||||
|
|
||||||
if (server == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
return View("_Scoreboard", ProjectScoreboard(new[] {server}, order, down).First());
|
|
||||||
}
|
|
||||||
|
|
||||||
private static IEnumerable<ScoreboardInfo> ProjectScoreboard(IEnumerable<Server> servers, string order,
|
|
||||||
bool down)
|
|
||||||
{
|
|
||||||
return servers.Select(server => new ScoreboardInfo
|
|
||||||
{
|
|
||||||
OrderByKey = order,
|
|
||||||
ShouldOrderDescending = down,
|
|
||||||
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 = Math.Max(clientData.client.Score, clientData.stats?.RoundScore ?? 0),
|
|
||||||
Ping = clientData.client.Ping,
|
|
||||||
Kills = clientData.stats?.MatchData?.Kills,
|
|
||||||
Deaths = clientData.stats?.MatchData?.Deaths,
|
|
||||||
ScorePerMinute = clientData.stats?.SessionSPM,
|
|
||||||
Kdr = clientData.stats?.MatchData?.Kdr,
|
|
||||||
ZScore = clientData.stats?.ZScore
|
|
||||||
})
|
|
||||||
.ToList()
|
|
||||||
}).ToList();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using IW4MAdmin.Plugins.Stats;
|
using IW4MAdmin.Plugins.Stats;
|
||||||
|
using IW4MAdmin.Plugins.Stats.Config;
|
||||||
using IW4MAdmin.Plugins.Stats.Helpers;
|
using IW4MAdmin.Plugins.Stats.Helpers;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using SharedLibraryCore.Interfaces;
|
using SharedLibraryCore.Interfaces;
|
||||||
@ -32,9 +33,9 @@ namespace WebfrontCore.ViewComponents
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ViewBag.UseNewStats = _configurationHandler.Configuration()?.EnableAdvancedMetrics ?? true;
|
ViewBag.UseNewStats = _configurationHandler.Configuration().EnableAdvancedMetrics;
|
||||||
return View("~/Views/Client/Statistics/Components/TopPlayers/_List.cshtml",
|
return View("~/Views/Client/Statistics/Components/TopPlayers/_List.cshtml",
|
||||||
ViewBag.UseNewStats
|
_configurationHandler.Configuration().EnableAdvancedMetrics
|
||||||
? await Plugin.Manager.GetNewTopStats(offset, count, serverId)
|
? await Plugin.Manager.GetNewTopStats(offset, count, serverId)
|
||||||
: await Plugin.Manager.GetTopStats(offset, count, serverId));
|
: await Plugin.Manager.GetTopStats(offset, count, serverId));
|
||||||
}
|
}
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
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 string OrderByKey { get; set; }
|
|
||||||
public bool ShouldOrderDescending { 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; }
|
|
||||||
public double? ZScore { 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"></color-code>
|
<color-code value="@Model.CommunityInformation.Name" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@Model.CommunityInformation.Description" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@serverName" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@rule" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@info.OriginName" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@info.TargetName" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@info.OriginName" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@info.TargetName" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@client.Name" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@client.Name" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@message.ClientName" allow="@ViewBag.EnableColorCodes"></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)"></color-code>
|
<color-code value="@SharedLibraryCore.Utilities.FormatExt(ViewBag.Localization["WEBFRONT_CLIENT_META_CHAT_HIDDEN"], message.HiddenMessage)" allow="@ViewBag.EnableColorCodes"></color-code>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<color-code value="@message.Message"></color-code>
|
<color-code value="@message.Message" allow="@ViewBag.EnableColorCodes"></color-code>
|
||||||
}
|
}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-light">
|
<td class="text-light">
|
||||||
<color-code value="@(message.ServerName ?? "--")"></color-code>
|
<color-code value="@(message.ServerName ?? "--")" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@message.ClientName" allow="@ViewBag.EnableColorCodes"></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)"></color-code>
|
<color-code value="@SharedLibraryCore.Utilities.FormatExt(ViewBag.Localization["WEBFRONT_CLIENT_META_CHAT_HIDDEN"], message.HiddenMessage)" allow="@ViewBag.EnableColorCodes"></color-code>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<color-code value="@message.Message"></color-code>
|
<color-code value="@message.Message" allow="@ViewBag.EnableColorCodes"></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 ?? "--")"></color-code>
|
<color-code value="@(message.ServerName ?? "--")" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@client.Name" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@Model.Name" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@alias" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@Model.OffenderName" allow="@ViewBag.EnableColorCodes"></color-code>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<color-code value="@Model.Offense"></color-code>
|
<color-code value="@Model.Offense" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@Model.ServerName" allow="@ViewBag.EnableColorCodes"></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"></color-code></span>
|
<span class="profile-meta-value text-primary"><color-code value="@meta.Value" allow="@ViewBag.EnableColorCodes"></color-code></span>
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<span class="profile-meta-value text-primary"><color-code value="@meta.Value"></color-code></span>
|
<span class="profile-meta-value text-primary"><color-code value="@meta.Value" allow="@ViewBag.EnableColorCodes"></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)"></color-code>
|
<color-code value="@SharedLibraryCore.Utilities.FormatExt(ViewBag.Localization["WEBFRONT_CLIENT_META_CHAT_HIDDEN"], Model.HiddenMessage)" allow="@ViewBag.EnableColorCodes"></color-code>
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<color-code value="@Model.Message"></color-code>
|
<color-code value="@Model.Message" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@Model.PunisherName" allow="@ViewBag.EnableColorCodes"></color-code>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
@ -34,7 +34,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<color-code value="@Model.Offense"></color-code>
|
<color-code value="@Model.Offense" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@Model.OffenderName" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@Model.Name" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@server.Name" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@Model.OffenderName" allow="@ViewBag.EnableColorCodes"></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 : "")}")"></color-code>
|
<color-code value="@($"{Model.Offense}{(ViewBag.Authorized ? Model.AdditionalPenaltyInformation : "")}")" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@Model.OffenderName" allow="@ViewBag.EnableColorCodes"></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 : "")}")"></color-code>
|
<color-code value="@($"{Model.Offense}{(ViewBag.Authorized ? Model.AdditionalPenaltyInformation : "")}")" allow="@ViewBag.EnableColorCodes"></color-code>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@Html.ActionLink(SharedLibraryCore.Utilities.StripColors(Model.PunisherName), "ProfileAsync",
|
@Html.ActionLink(SharedLibraryCore.Utilities.StripColors(Model.PunisherName), "ProfileAsync",
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
@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"></color-code>
|
<color-code value="@Model.ChatHistory[i].Name" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@Model.ChatHistory[i].Name" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@Model.ChatHistory[i].Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
—
|
—
|
||||||
<color-code value="@message.CapClientName(48)"></color-code>
|
<color-code value="@message.CapClientName(48)" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@Model.Players[i].Name" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@Model.Players[i].Name" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@Model.ChatHistory[i].Name" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@Model.ChatHistory[i].Name" allow="@ViewBag.EnableColorCodes"></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"></color-code>
|
<color-code value="@Model.ChatHistory[i].Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
—
|
—
|
||||||
<color-code value="@message.CapClientName(48)"></color-code>
|
<color-code value="@message.CapClientName(48)" allow="@ViewBag.EnableColorCodes"></color-code>
|
||||||
</span><br />
|
</span><br />
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,56 +0,0 @@
|
|||||||
@using WebfrontCore.ViewModels
|
|
||||||
@using System.Globalization
|
|
||||||
@model WebfrontCore.ViewModels.ScoreboardInfo
|
|
||||||
@{
|
|
||||||
Layout = null;
|
|
||||||
|
|
||||||
object OrderByFunc(ClientScoreboardInfo item)
|
|
||||||
{
|
|
||||||
var property = typeof(ClientScoreboardInfo).GetProperties().FirstOrDefault(prop =>
|
|
||||||
prop.CanRead && prop.Name.Equals(Model.OrderByKey, StringComparison.InvariantCultureIgnoreCase));
|
|
||||||
|
|
||||||
return property != null ? property.GetValue(item) : item.Score;
|
|
||||||
}
|
|
||||||
|
|
||||||
string GetColumnSortDisplay(string propertyName)
|
|
||||||
{
|
|
||||||
if (propertyName == (Model.OrderByKey ?? nameof(ClientScoreboardInfo.Score)))
|
|
||||||
{
|
|
||||||
return Model.ShouldOrderDescending ? "<span class=\"ml-2\">▼</span>" : "<span class=\"ml-2\">▲</span>";
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
<table class="table table-striped thead-light bg-dark mb-0 table-responsive-md table-sort"
|
|
||||||
data-sort-column="@(Model.OrderByKey ?? nameof(ClientScoreboardInfo.Score))"
|
|
||||||
data-sort-down="@Model.ShouldOrderDescending.ToString().ToLower()">
|
|
||||||
<tr class="bg-dark border-bottom">
|
|
||||||
<th class="table-sort-column" data-column-name="@nameof(ClientScoreboardInfo.ClientName)">@ViewBag.Localization["WEBFRONT_SCOREBOARD_TABLE_PLAYER"]@Html.Raw(GetColumnSortDisplay(nameof(ClientScoreboardInfo.ClientName)))</th>
|
|
||||||
<th class="table-sort-column" data-column-name="@nameof(ClientScoreboardInfo.Score)">@ViewBag.Localization["WEBFRONT_ADV_STATS_SCORE"]@Html.Raw(GetColumnSortDisplay(nameof(ClientScoreboardInfo.Score)))</th>
|
|
||||||
<th class="table-sort-column" data-column-name="@nameof(ClientScoreboardInfo.Kills)">@ViewBag.Localization["WEBFRONT_ADV_STATS_KILLS"]@Html.Raw(GetColumnSortDisplay(nameof(ClientScoreboardInfo.Kills)))</th>
|
|
||||||
<th class="table-sort-column" data-column-name="@nameof(ClientScoreboardInfo.Deaths)">@ViewBag.Localization["WEBFRONT_SCOREBOARD_TABLE_DEATHS"]@Html.Raw(GetColumnSortDisplay(nameof(ClientScoreboardInfo.Deaths)))</th>
|
|
||||||
<th class="table-sort-column" data-column-name="@nameof(ClientScoreboardInfo.Kdr)">@ViewBag.Localization["WEBFRONT_SCOREBOARD_TABLE_RATIO"]@Html.Raw(GetColumnSortDisplay(nameof(ClientScoreboardInfo.Kdr)))</th>
|
|
||||||
<th class="table-sort-column" data-column-name="@nameof(ClientScoreboardInfo.ScorePerMinute)">@ViewBag.Localization["WEBFRONT_SCOREBOARD_TABLE_SPM"]@Html.Raw(GetColumnSortDisplay(nameof(ClientScoreboardInfo.ScorePerMinute)))</th>
|
|
||||||
<th class="table-sort-column" data-column-name="@nameof(ClientScoreboardInfo.ZScore)">@ViewBag.Localization["WEBFRONT_ADV_STATS_ZSCORE"]@Html.Raw(GetColumnSortDisplay(nameof(ClientScoreboardInfo.ZScore)))</th>
|
|
||||||
<th class="text-right table-sort-column" data-column-name="@nameof(ClientScoreboardInfo.Ping)">@ViewBag.Localization["WEBFRONT_SCOREBOARD_TABLE_PING"]@Html.Raw(GetColumnSortDisplay(nameof(ClientScoreboardInfo.Ping)))</th>
|
|
||||||
</tr>
|
|
||||||
@foreach (var client in Model.ShouldOrderDescending ? Model.ClientInfo.OrderByDescending(OrderByFunc) : Model.ClientInfo.OrderBy(OrderByFunc))
|
|
||||||
{
|
|
||||||
<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>@(client.ZScore == null ? "--" : Math.Round(client.ZScore.Value, 2).ToString(CultureInfo.CurrentCulture))</td>
|
|
||||||
<td class="text-right">@client.Ping</td>
|
|
||||||
</tr>
|
|
||||||
}
|
|
||||||
</table>
|
|
@ -5,19 +5,15 @@
|
|||||||
|
|
||||||
<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"></color-code>
|
<color-code value="@Model.Name" allow="@ViewBag.EnableColorCodes"></color-code>
|
||||||
<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"]">
|
<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"]">
|
||||||
<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 mr-2" data-action="chat" data-action-id="@Model.ID"></span>
|
<span class="oi oi-chat align-self-center profile-action d-none d-md-flex" 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">
|
||||||
@ -47,10 +43,6 @@
|
|||||||
<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"></color-code>
|
<color-code value="@client.Name" allow="@ViewBag.EnableColorCodes"></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,6 +45,7 @@
|
|||||||
<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,7 +27,6 @@
|
|||||||
"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"
|
||||||
],
|
],
|
||||||
|
@ -197,7 +197,7 @@ form *, select, button.btn {
|
|||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.oi, .table-sort-column {
|
.oi {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
function refreshScoreboard() {
|
|
||||||
const serverPanel = $('.scoreboard-container.active');
|
|
||||||
const serverId = $(serverPanel).data('server-id');
|
|
||||||
|
|
||||||
const scoreboardTable = $(serverPanel).children('.table-sort');
|
|
||||||
|
|
||||||
$.get(`../Server/${serverId}/Scoreboard?order=${scoreboardTable.data('sort-column')}&down=${scoreboardTable.data('sort-down')}`, (response) => {
|
|
||||||
$(serverPanel).html(response);
|
|
||||||
setupDataSorting();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(() => {
|
|
||||||
$(window.location.hash).tab('show');
|
|
||||||
$(`${window.location.hash}_nav`).addClass('active');
|
|
||||||
|
|
||||||
setupDataSorting();
|
|
||||||
})
|
|
||||||
|
|
||||||
function setupDataSorting() {
|
|
||||||
const tableColumn = $('.table-sort-column');
|
|
||||||
$(tableColumn).off('click');
|
|
||||||
$(tableColumn).on('click', function() {
|
|
||||||
const columnName = $(this).data('column-name');
|
|
||||||
const table = $('.table-sort');
|
|
||||||
$(table).data('sort-column', columnName);
|
|
||||||
$(table).data('sort-down', $(table).data('sort-down') !== true);
|
|
||||||
refreshScoreboard();
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
setInterval(refreshScoreboard, 5000);
|
|
Reference in New Issue
Block a user