diff --git a/Application/BuildScripts/PostPublish.bat b/Application/BuildScripts/PostPublish.bat index 317b111ec..46922feb8 100644 --- a/Application/BuildScripts/PostPublish.bat +++ b/Application/BuildScripts/PostPublish.bat @@ -98,10 +98,8 @@ if "%CurrentConfiguration%" == "Release" ( ) echo making start scripts -@(echo dotnet Lib/IW4MAdmin.dll && echo pause) > "%SolutionDir%Publish\WindowsPrerelease\StartIW4MAdmin.cmd" -@(echo dotnet Lib/IW4MAdmin.dll && echo pause) > "%SolutionDir%Publish\Windows\StartIW4MAdmin.cmd" +@(echo dotnet Lib\IW4MAdmin.dll && echo pause) > "%SolutionDir%Publish\WindowsPrerelease\StartIW4MAdmin.cmd" +@(echo dotnet Lib\IW4MAdmin.dll && echo pause) > "%SolutionDir%Publish\Windows\StartIW4MAdmin.cmd" -@(echo #!/bin/bash && echo dotnet Lib\IW4MAdmin.dll) > "%SolutionDir%Publish\WindowsPrerelease\StartIW4MAdmin.sh" -@(echo #!/bin/bash && echo dotnet Lib\IW4MAdmin.dll) > "%SolutionDir%Publish\Windows\StartIW4MAdmin.sh" - -eCHO "%CurrentConfiguration%" +@(echo #!/bin/bash && echo dotnet Lib/IW4MAdmin.dll) > "%SolutionDir%Publish\WindowsPrerelease\StartIW4MAdmin.sh" +@(echo #!/bin/bash && echo dotnet Lib/IW4MAdmin.dll) > "%SolutionDir%Publish\Windows\StartIW4MAdmin.sh" diff --git a/Application/DefaultSettings.json b/Application/DefaultSettings.json index 2c609d1c0..153474185 100644 --- a/Application/DefaultSettings.json +++ b/Application/DefaultSettings.json @@ -17,6 +17,184 @@ "Balance teams at ALL times" ], "Maps": [ + { + "Game": "IW3", + "Maps": [ + { + "Alias": "Ambush", + "Name": "mp_convoy" + }, + { + "Alias": "Backlot", + "Name": "mp_backlot" + }, + { + "Alias": "Bloc", + "Name": "mp_bloc" + }, + { + "Alias": "Bog", + "Name": "mp_bog" + }, + { + "Alias": "Countdown", + "Name": "mp_countdown" + }, + { + "Alias": "Crash", + "Name": "mp_crash" + }, + { + "Alias": "Crossfire", + "Name": "mp_crossfire" + }, + { + "Alias": "District", + "Name": "mp_citystreets" + }, + { + "Alias": "Downpour", + "Name": "mp_farm" + }, + { + "Alias": "Overgrown", + "Name": "mp_overgrown" + }, + { + "Alias": "Pipeline", + "Name": "mp_pipeline" + }, + { + "Alias": "Shipment", + "Name": "mp_shipment" + }, + { + "Alias": "Showdown", + "Name": "mp_showdown" + }, + { + "Alias": "Strike", + "Name": "mp_strike" + }, + { + "Alias": "Vacant", + "Name": "mp_vacant" + }, + { + "Alias": "Wet Work", + "Name": "mp_cargoship" + }, + { + "Alias": "Winter Crash", + "Name": "mp_crash_snow" + }, + { + "Alias": "Broadcast", + "Name": "mp_broadcast" + }, + { + "Alias": "Creek", + "Name": "mp_creek" + }, + { + "Alias": "Chinatown", + "Name": "mp_carentan" + }, + { + "Alias": "Killhouse", + "Name": "mp_killhouse" + } + ] + }, + { + "Game": "T4", + "Maps": [ + { + "Alias": "Airfield", + "Name": "mp_airfield" + }, + { + "Alias": "Asylum", + "Name": "mp_asylum" + }, + { + "Alias": "Castle", + "Name": "mp_castle" + }, + { + "Alias": "Cliffside", + "Name": "mp_shrine" + }, + { + "Alias": "Courtyard", + "Name": "mp_courtyard" + }, + { + "Alias": "Dome", + "Name": "mp_dome" + }, + { + "Alias": "Downfall", + "Name": "mp_downfall" + }, + { + "Alias": "Hanger", + "Name": "mp_hangar" + }, + { + "Alias": "Makin", + "Name": "mp_makin" + }, + { + "Alias": "Outskirts", + "Name": "mp_outskirts" + }, + { + "Alias": "Roundhouse", + "Name": "mp_roundhouse" + }, + { + "Alias": "Upheaval", + "Name": "mp_suburban" + }, + { + "Alias": "Knee Deep", + "Name": "mp_kneedeep" + }, + { + "Alias": "Nightfire", + "Name": "mp_nachtfeuer" + }, + { + "Alias": "Station", + "Name": "mp_subway" + }, + { + "Alias": "Banzai", + "Name": "mp_kwai" + }, + { + "Alias": "Corrosion", + "Name": "mp_stalingrad" + }, + { + "Alias": "Sub Pens", + "Name": "mp_docks" + }, + { + "Alias": "Battery", + "Name": "mp_drum" + }, + { + "Alias": "Breach", + "Name": "mp_bgate" + }, + { + "Alias": "Revolution", + "Name": "mp_vodka" + } + ] + }, { "Game": "IW4", "Maps": [ @@ -246,6 +424,260 @@ } ] }, + { + "Game": "T5", + "Maps": [ + { + "Alias": "Array", + "Name": "mp_array" + }, + { + "Alias": "Berlin Wall", + "Name": "mp_berlinwall2" + }, + { + "Alias": "Convoy", + "Name": "mp_gridlock" + }, + { + "Alias": "Cracked", + "Name": "mp_cracked" + }, + { + "Alias": "Crisis", + "Name": "mp_crisis" + }, + { + "Alias": "Discovery", + "Name": "mp_discovery" + }, + { + "Alias": "Drive-In", + "Name": "mp_drivein" + }, + { + "Alias": "Firing Range", + "Name": "mp_firingrange" + }, + { + "Alias": "Grid", + "Name": "mp_duga" + }, + { + "Alias": "Hangar 18", + "Name": "mp_area51" + }, + { + "Alias": "Hanoi", + "Name": "mp_hanoi" + }, + { + "Alias": "Hazard", + "Name": "mp_golfcourse" + }, + { + "Alias": "Hotel", + "Name": "mp_hotel" + }, + { + "Alias": "Jungle", + "Name": "mp_havoc" + }, + { + "Alias": "Kowloon", + "Name": "mp_kowloon" + }, + { + "Alias": "Launch", + "Name": "mp_cosmodrome" + }, + { + "Alias": "Nuketown", + "Name": "mp_nuked" + }, + { + "Alias": "Radiation", + "Name": "mp_radiation" + }, + { + "Alias": "Silo", + "Name": "mp_silo" + }, + { + "Alias": "Stadium", + "Name": "mp_stadium" + }, + { + "Alias": "Stockpile", + "Name": "mp_outskirts" + }, + { + "Alias": "Summit", + "Name": "mp_mountain" + }, + { + "Alias": "Villa", + "Name": "mp_villa" + }, + { + "Alias": "WMD", + "Name": "mp_russianbase" + }, + { + "Alias": "Zoo", + "Name": "mp_zoo" + } + ] + }, + { + "Game": "IW5", + "Maps": [ + { + "Alias": "Seatown", + "Name": "mp_seatown" + }, + { + "Alias": "Lockdown", + "Name": "mp_alpha" + }, + { + "Alias": "Mission", + "Name": "mp_bravo" + }, + { + "Alias": "Carbon", + "Name": "mp_carbon" + }, + { + "Alias": "Dome", + "Name": "mp_dome" + }, + { + "Alias": "Arkaden", + "Name": "mp_plaza2" + }, + { + "Alias": "Downturn", + "Name": "mp_exchange" + }, + { + "Alias": "Bootleg", + "Name": "mp_bootleg" + }, + { + "Alias": "Hardhat", + "Name": "mp_hardhat" + }, + { + "Alias": "Interchange", + "Name": "mp_interchange" + }, + { + "Alias": "Fallen", + "Name": "mp_lambeth" + }, + { + "Alias": "Outpost", + "Name": "mp_radar" + }, + { + "Alias": "Bakaara", + "Name": "mp_mogadishu" + }, + { + "Alias": "Resistance", + "Name": "mp_paris" + }, + { + "Alias": "Underground", + "Name": "mp_underground" + }, + { + "Alias": "Village", + "Name": "mp_village" + }, + { + "Alias": "Aground", + "Name": "mp_aground_ss" + }, + { + "Alias": "Boardwalk", + "Name": "mp_boardwalk" + }, + { + "Alias": "U-turn", + "Name": "mp_burn_ss" + }, + { + "Alias": "Foundation", + "Name": "mp_cement" + }, + { + "Alias": "Erosion", + "Name": "mp_courtyard_ss" + }, + { + "Alias": "Intersection", + "Name": "mp_crosswalk_ss" + }, + { + "Alias": "Getaway", + "Name": "mp_hillside_ss" + }, + { + "Alias": "Piazza", + "Name": "mp_italy" + }, + { + "Alias": "Sanctuary", + "Name": "mp_meteora" + }, + { + "Alias": "Gulch", + "Name": "mp_moab" + }, + { + "Alias": "Black Box", + "Name": "mp_morningwood" + }, + { + "Alias": "Parish", + "Name": "mp_nola" + }, + { + "Alias": "Overwatch", + "Name": "mp_overwatch" + }, + { + "Alias": "Liberation", + "Name": "mp_park" + }, + { + "Alias": "Oasis", + "Name": "mp_qadeem" + }, + { + "Alias": "Lookout", + "Name": "mp_restrepo_ss" + }, + { + "Alias": "Off Shore", + "Name": "mp_roughneck" + }, + { + "Alias": "Decommission", + "Name": "mp_shipbreaker" + }, + { + "Alias": "Vortex", + "Name": "mp_six_ss" + }, + { + "Alias": "Terminal", + "Name": "mp_terminal_cls" + } + ] + }, { "Game": "T6", "Maps": [ @@ -402,95 +834,6 @@ "Name": "zm_transit" } ] - }, - { - "Game": "IW3", - "Maps": [ - { - "Alias": "Ambush", - "Name": "mp_convoy" - }, - { - "Alias": "Backlot", - "Name": "mp_backlot" - }, - { - "Alias": "Bloc", - "Name": "mp_bloc" - }, - { - "Alias": "Bog", - "Name": "mp_bog" - }, - { - "Alias": "Countdown", - "Name": "mp_countdown" - }, - { - "Alias": "Crash", - "Name": "mp_crash" - }, - { - "Alias": "Crossfire", - "Name": "mp_crossfire" - }, - { - "Alias": "District", - "Name": "mp_citystreets" - }, - { - "Alias": "Downpour", - "Name": "mp_farm" - }, - { - "Alias": "Overgrown", - "Name": "mp_overgrown" - }, - { - "Alias": "Pipeline", - "Name": "mp_pipeline" - }, - { - "Alias": "Shipment", - "Name": "mp_shipment" - }, - { - "Alias": "Showdown", - "Name": "mp_showdown" - }, - { - "Alias": "Strike", - "Name": "mp_strike" - }, - { - "Alias": "Vacant", - "Name": "mp_vacant" - }, - { - "Alias": "Wet Work", - "Name": "mp_cargoship" - }, - { - "Alias": "Winter Crash", - "Name": "mp_crash_snow" - }, - { - "Alias": "Broadcast", - "Name": "mp_broadcast" - }, - { - "Alias": "Creek", - "Name": "mp_creek" - }, - { - "Alias": "Chinatown", - "Name": "mp_carentan" - }, - { - "Alias": "Killhouse", - "Name": "mp_killhouse" - } - ] } ] } diff --git a/Plugins/Web/StatsWeb/StatsWeb.csproj b/Plugins/Web/StatsWeb/StatsWeb.csproj index c0e420009..86f57f88c 100644 --- a/Plugins/Web/StatsWeb/StatsWeb.csproj +++ b/Plugins/Web/StatsWeb/StatsWeb.csproj @@ -1,9 +1,8 @@  netcoreapp2.2 - true - true - RazorSdk + true + true Debug;Release;Prerelease @@ -16,7 +15,9 @@ - + + Never + diff --git a/Plugins/Web/StatsWeb/Views/Stats/Components/TopPlayers/_List.cshtml b/Plugins/Web/StatsWeb/Views/Stats/Components/TopPlayers/_List.cshtml index d9afb1e9d..66cac6315 100644 --- a/Plugins/Web/StatsWeb/Views/Stats/Components/TopPlayers/_List.cshtml +++ b/Plugins/Web/StatsWeb/Views/Stats/Components/TopPlayers/_List.cshtml @@ -25,6 +25,7 @@ return "0_no-place/menu_div_no_place.png"; } } + @if (Model.Count == 0) {
@SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex.Set["PLUGINS_STATS_TEXT_NOQUALIFY"]
diff --git a/Plugins/Web/StatsWeb/Views/Stats/Index.cshtml b/Plugins/Web/StatsWeb/Views/Stats/Index.cshtml index 7195452f0..831c5a7d3 100644 --- a/Plugins/Web/StatsWeb/Views/Stats/Index.cshtml +++ b/Plugins/Web/StatsWeb/Views/Stats/Index.cshtml @@ -10,15 +10,14 @@ } -
-
+
@await Component.InvokeAsync("TopPlayers", new { count = 10, offset = 0 })
@foreach (var server in ViewBag.Servers) { -
+
}
diff --git a/Plugins/Web/StatsWeb/Views/_ViewImports.cshtml b/Plugins/Web/StatsWeb/Views/_ViewImports.cshtml new file mode 100644 index 000000000..a757b413b --- /dev/null +++ b/Plugins/Web/StatsWeb/Views/_ViewImports.cshtml @@ -0,0 +1 @@ +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/SharedLibraryCore/Helpers/BaseConfigurationHandler.cs b/SharedLibraryCore/Helpers/BaseConfigurationHandler.cs index a40a0da08..6a84d6648 100644 --- a/SharedLibraryCore/Helpers/BaseConfigurationHandler.cs +++ b/SharedLibraryCore/Helpers/BaseConfigurationHandler.cs @@ -1,47 +1,42 @@ -using Microsoft.Extensions.Configuration; -using Newtonsoft.Json; -using SharedLibraryCore.Exceptions; +using Newtonsoft.Json; using SharedLibraryCore.Interfaces; -using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; using System.Threading.Tasks; namespace SharedLibraryCore.Configuration { public class BaseConfigurationHandler : IConfigurationHandler where T : IBaseConfiguration { - readonly string Filename; - IConfigurationRoot ConfigurationRoot { get; set; } + readonly string _configurationPath; T _configuration; public BaseConfigurationHandler(string fn) { - Filename = fn; + _configurationPath = Path.Join(Utilities.OperatingDirectory, "Configuration", $"{fn}.json"); Build(); } public void Build() { - ConfigurationRoot = new ConfigurationBuilder() - .AddJsonFile(Path.Join(Utilities.OperatingDirectory, "Configuration", $"{Filename}.json"), true) - .Build(); - - _configuration = ConfigurationRoot.Get(); + var configContent = File.ReadAllText(_configurationPath); + _configuration = JsonConvert.DeserializeObject(configContent); if (_configuration == null) + { _configuration = default(T); + } } public Task Save() { var appConfigJSON = JsonConvert.SerializeObject(_configuration, Formatting.Indented); - return File.WriteAllTextAsync(Path.Join(Utilities.OperatingDirectory, "Configuration", $"{Filename}.json"), appConfigJSON); + return File.WriteAllTextAsync(_configurationPath, appConfigJSON); } - public T Configuration() => _configuration; + public T Configuration() + { + return _configuration; + } public void Set(T config) { diff --git a/WebfrontCore/WebfrontCore.csproj b/WebfrontCore/WebfrontCore.csproj index d80aedd60..2c97f0374 100644 --- a/WebfrontCore/WebfrontCore.csproj +++ b/WebfrontCore/WebfrontCore.csproj @@ -3,8 +3,8 @@ netcoreapp2.2 2.2.2 - false - true + true + true true 2.6 RaidMax.IW4MAdmin.WebfrontCore @@ -37,6 +37,7 @@ + @@ -47,6 +48,7 @@ +