prevent missing config from causing stats error

small advanced stats fixes
This commit is contained in:
RaidMax 2021-03-23 10:16:27 -05:00
parent 802ec8cea5
commit a8b331a5e5
4 changed files with 9 additions and 153 deletions

View File

@ -56,10 +56,10 @@
<ItemGroup> <ItemGroup>
<None Update="DefaultSettings.json"> <None Update="DefaultSettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
<None Update="Configuration\LoggingConfiguration.json"> <None Update="Configuration\LoggingConfiguration.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None> </None>
</ItemGroup> </ItemGroup>

View File

@ -1,4 +1,4 @@
{ {
"AutoMessagePeriod": 60, "AutoMessagePeriod": 60,
"AutoMessages": [ "AutoMessages": [
"This server uses ^5IW4M Admin v{{VERSION}} ^7get it at ^5raidmax.org/IW4MAdmin", "This server uses ^5IW4M Admin v{{VERSION}} ^7get it at ^5raidmax.org/IW4MAdmin",
@ -846,155 +846,6 @@
"Name": "zm_transit" "Name": "zm_transit"
} }
] ]
},
{
"Game": "IW6",
"Maps": [
{
"Alias": "Prision Break",
"Name": "mp_prisonbreak"
},
{
"Alias": "Octane",
"Name": "mp_dart"
},
{
"Alias": "Tremor",
"Name": "mp_lonestar"
},
{
"Alias": "Freight",
"Name": "mp_frag"
},
{
"Alias": "Whiteout",
"Name": "mp_snow"
},
{
"Alias": "Stormfront",
"Name": "mp_fahrenheit"
},
{
"Alias": "Siege",
"Name": "mp_hashima"
},
{
"Alias": "Warhawk",
"Name": "mp_warhawk"
},
{
"Alias": "Sovereign",
"Name": "mp_sovereign"
},
{
"Alias": "Overload",
"Name": "mp_zebra"
},
{
"Alias": "Stonehaven",
"Name": "mp_skeleton"
},
{
"Alias": "Chasm",
"Name": "mp_chasm"
},
{
"Alias": "Flooded",
"Name": "mp_flooded"
},
{
"Alias": "Strikezone",
"Name": "mp_strikezone"
},
{
"Alias": "Free Fall",
"Name": "mp_descent_new"
},
{
"Alias": "Unearthed",
"Name": "mp_dome_ns"
},
{
"Alias": "Collision",
"Name": "mp_ca_impact"
},
{
"Alias": "Behemoth",
"Name": "mp_ca_behemoth"
},
{
"Alias": "Ruins",
"Name": "mp_battery3"
},
{
"Alias": "Pharaoh",
"Name": "mp_dig"
},
{
"Alias": "Favela",
"Name": "mp_favela_iw6"
},
{
"Alias": "Mutiny",
"Name": "mp_pirate"
},
{
"Alias": "Departed",
"Name": "mp_zulu"
},
{
"Alias": "Dynasty",
"Name": "mp_conflict"
},
{
"Alias": "Goldrush",
"Name": "mp_mine"
},
{
"Alias": "Showtime",
"Name": "mp_shipment_ns"
},
{
"Alias": "Subzero",
"Name": "mp_zerosub"
},
{
"Alias": "Ignition",
"Name": "mp_boneyard_ns"
},
{
"Alias": "Containment",
"Name": "mp_ca_red_river"
},
{
"Alias": "Bayview",
"Name": "mp_ca_rumble"
},
{
"Alias": "Fog",
"Name": "mp_swamp"
},
{
"Alias": "Point of Contact",
"Name": "mp_alien_town"
},
{
"Alias": "Nightfall",
"Name": "mp_alien_armory"
},
{
"Alias": "Mayday",
"Name": "mp_alien_beacon"
},
{
"Alias": "Awakening",
"Name": "mp_alien_dlc3"
},
{
"Alias": "Exodus",
"Name": "mp_alien_last"
}
]
} }
], ],
"GameStrings": { "GameStrings": {

View File

@ -16,7 +16,8 @@
const string meleeKey = "MOD_MELEE"; const string meleeKey = "MOD_MELEE";
var suicideKeys = new[] {"MOD_SUICIDE", "MOD_FALLING"}; var suicideKeys = new[] {"MOD_SUICIDE", "MOD_FALLING"};
var config = (GameStringConfiguration) ViewBag.Config; // if they've not copied default settings config this could be null
var config = (GameStringConfiguration) ViewBag.Config ?? new GameStringConfiguration();
var headerClass = Model.Level == EFClient.Permission.Banned ? "bg-danger" : "bg-primary"; var headerClass = Model.Level == EFClient.Permission.Banned ? "bg-danger" : "bg-primary";
var textClass = Model.Level == EFClient.Permission.Banned ? "text-danger" : "text-primary"; var textClass = Model.Level == EFClient.Permission.Banned ? "text-danger" : "text-primary";

View File

@ -254,6 +254,10 @@ function drawHitLocationChart(context, background, scalar, width, height) {
const color = '#' + red + green + '0077'; const color = '#' + red + green + '0077';
const location = hitLocations[hit.name]; const location = hitLocations[hit.name];
if (location === undefined) {
return true;
}
if (location.type === 'polygon') { if (location.type === 'polygon') {
drawPolygon(context, scalar, location.p1, location.p2, location.p3, location.p4, color); drawPolygon(context, scalar, location.p1, location.p2, location.p3, location.p4, color);
} else { } else {