1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

Additional zombie stast work

This commit is contained in:
RaidMax
2024-02-11 22:10:12 -06:00
parent 122b6dc79d
commit e1461582fa
45 changed files with 7663 additions and 292 deletions

View File

@ -136,6 +136,9 @@ namespace IW4MAdmin.Application
public IEnumerable<IPlugin> Plugins { get; }
public IInteractionRegistration InteractionRegistration { get; }
public IList<Func<Dictionary<int, List<EFMeta>>, long?, string, bool, Task>> CustomStatsMetrics { get; } =
new List<Func<Dictionary<int, List<EFMeta>>, long?, string, bool, Task>>();
public async Task ExecuteEvent(GameEvent newEvent)
{
ProcessingEvents.TryAdd(newEvent.IncrementalId, newEvent);
@ -249,7 +252,13 @@ namespace IW4MAdmin.Application
{
var thisIndex = index;
Interlocked.Increment(ref index);
return ProcessUpdateHandler(server, thisIndex);
return ProcessUpdateHandler(server, thisIndex).ContinueWith(result =>
{
if (result.IsFaulted)
{
_logger.LogError(result.Exception, "Encountered unexpected error processing updates");
}
}, CancellationToken);
}));
}
@ -598,19 +607,22 @@ namespace IW4MAdmin.Application
public async Task Start()
{
_eventHandlerTokenSource = new CancellationTokenSource();
var eventHandlerThread = new Thread(() =>
var eventHandlerTask = Task.Run(() =>
{
_coreEventHandler.StartProcessing(_eventHandlerTokenSource.Token);
})
{
Name = nameof(CoreEventHandler)
};
}, _eventHandlerTokenSource.Token);
eventHandlerThread.Start();
await UpdateServerStates();
_eventHandlerTokenSource.Cancel();
eventHandlerThread.Join();
try
{
await eventHandlerTask;
}
catch (OperationCanceledException)
{
}
}
public async Task Stop()

View File

@ -45,15 +45,13 @@ namespace IW4MAdmin.Application
public void StartProcessing(CancellationToken token)
{
_cancellationToken = token;
while (!_cancellationToken.IsCancellationRequested)
while (!token.IsCancellationRequested)
{
_onEventReady.Reset();
try
{
_onProcessingEvents.Wait(_cancellationToken);
_onProcessingEvents.Wait(token);
if (!_runningEventTasks.TryDequeue(out var coreEvent))
{
@ -62,7 +60,7 @@ namespace IW4MAdmin.Application
_onProcessingEvents.Release(1);
}
_onEventReady.Wait(_cancellationToken);
_onEventReady.Wait(token);
continue;
}

View File

@ -2439,6 +2439,7 @@
"left_foot": "Left Foot",
"left_arm_upper": "Upper Left Arm",
"left_arm_lower": "Lower Left Arm",
"head": "Head",
"gl": "Rifle Grenade",
"bigammo": "Round Drum",
"scoped": "Sniper Scope",
@ -2446,34 +2447,238 @@
"aperture": "Aperture Sight",
"flash": "Flash Hider",
"silenced": "Silencer",
"molotov": "Molotov Cocktail",
"sticky": "N° 74 ST",
"m2": "M2 Flamethrower",
"artillery": "Artillery Strike",
"dog": "Attack Dogs",
"colt": "Colt M1911",
"357magnum": ".357 Magnum",
"sw_357": ".357 Magnum",
"walther": "Walther P38",
"tokarev": "Tokarev TT-33",
"shotgun": "M1897 Trench Gun",
"doublebarreledshotgun": "Double-Barreled Shotgun",
"mp40": "MP40",
"type100smg": "Type 100",
"ppsh": "PPSh-41",
"svt40": "SVT-40",
"gewehr43": "Gewehr 43",
"doublebarrel": "Double-Barreled Shotgun",
"30cal": "Browning M1919",
"bar": "BAR",
"fg42": "FG42",
"m1garand": "M1 Garand",
"mp40": "MP40",
"ppsh": "PPSh-41",
"gewehr43": "Gewehr 43",
"svt40": "SVT-40",
"nambu": "Nambu",
"m1garand_bayonet": "M1 Garand Bayonet",
"m1a1carbine_bayonet": "M1A1 Carbine Bayonet",
"kar98k_bayonet": "Kar98k Bayonet",
"mosin_rifle_bayonet": "Mosin-Nagant Bayonet",
"mg42": "MG42",
"colt45": "Colt M1911",
"sten_silenced": "Silenced Sten",
"type99_lmg": "Type 99",
"dp28": "DP-28",
"mine_shoebox": "PMD-6",
"mine_bouncing_betty": "Bouncing Betty",
"357magnum": ".357 Magnum",
"ptrs41": "PTRS-41",
"remingtonmodel11": "Remington Model 11",
"tabun_grenade": "Tabun Gas",
"signal_flare": "Signal Flare",
"shotgun_double_barreled": "Double-Barreled Shotgun",
"m7_launcher": "M7 Grenade Launcher",
"fg42_telescopic": "Telescopic Sight",
"springfield_scoped": "Scoped Springfield",
"m1garand_gl": "M1 Garand w/ Launcher",
"sticky_grenade": "N\u00ba 74 ST",
"tokarev_tt30": "Tokarev TT-33",
"mg42_bipod": "Deployable MG42",
"dp28_bipod": "Deployable DP-28",
"fg42_bipod": "Deployable FG42",
"bar_bipod": "Deployable BAR",
"30cal_bipod": "Deployable Browning M1919",
"type99_lmg_bipod": "Deployable Type 99",
"type100smg": "Type 100",
"stg44": "STG-44",
"m1carbine": "M1A1 Carbine",
"type99lmg": "Type 99",
"bar": "BAR",
"dp28": "DP-28",
"mg42": "MG42",
"fg42": "FG42",
"30cal": "Browning M1919",
"type99rifle": "Arisaka",
"mosinrifle": "Mosin-Nagant",
"ptrs41": "PTRS-41"
"syrette": "Syrette",
"supportgunner": "Support Gunner",
"bren": "Bren LMG",
"rifleman": "Rifleman",
"lee_enfield": "Lee-Enfield",
"kar98k": "Kar98k",
"luger": "Luger",
"m1a1carbine": "M1A1 Carbine",
"mosin_rifle": "Mosin-Nagant",
"mosin_rifle_scoped": "Scoped Mosin-Nagant",
"sniper": "Sniper",
"submachinegunner": "Submachine Gunner",
"mp44": "MP44",
"springfield": "Springfield",
"mosinnagantammo": "Mosin-Nagant Ammo",
"sten": "Sten",
"armyengineer": "Army Engineer",
"thompson": "Thompson",
"fastauto": "Fast-Auto",
"slowauto": "Slow-Auto",
"fullauto": "Full-Auto",
"semiauto": "Semi-Auto",
"m2fraggrenade": "M2 Frag Grenade",
"mk1_frag_grenade": "MK1 Frag Grenade",
"russiangrenade": "RGD-33 Stick Grenade",
"germangrenade": "Stielhandgranate",
"panzerschrek": "Panzerschrek",
"panzerfaust": "Panzerfaust 60",
"scopedkar98k": "Scoped Kar98k",
"holdpin": "Hold-Pin",
"cookoff": "Cook-Off",
"medicplaceholder": "Medic",
"fraggrenade": "Frag",
"m8_white_smoke": "Smoke",
"shotgun": "M1897 Trench Gun",
"greasegun": "Grease Gun",
"pps42": "PPS42",
"webley": "Webley",
"scopedg43": "Scoped Gewehr 43",
"defaultweapon": "Default Weapon",
"satchel": "Satchel Charge",
"anm8_smoke_grenade": "AN-M8 Smoke Grenade",
"no77_wp_smoke_grenade": "No.77 WP Smoke Grenade",
"nebelhandgranate": "Nebelhandgranate",
"rgd1_smoke_grenade": "RGD-1 Smoke Grenade",
"potato": "Potato",
"no_ammo": "No Ammo",
"no_frag_grenade": "No Primary Grenades Remaining",
"no_smoke_grenade": "No Smoke Grenades Remaining",
"no_flash_grenade": "No Flashbang Grenades Remaining",
"noecial_grenade": "No Special Grenades Remaining",
"location_selector": "Select a location",
"smoke_grenade": "Smoke Grenade",
"flash_grenade": "Flash Grenade",
"concussion_grenade": "Stun Grenade",
"smgs": "Submachine Guns",
"assaultrifles": "Assault Rifles",
"shotguns": "Shotguns",
"sniperrifles": "Sniper Rifles",
"target_too_close": "Too Close to Target",
"lockon_required": "Lock-On Required",
"target_not_enough_clearance": "Not Enough Room To Fire",
"no_attachment": "No Attachment",
"silencer": "Suppressor",
"grenade_launcher": "Grenade Launcher",
"no_camo": "No Camo",
"golden_camo": "Golden",
"prestige_camo": "Prestige",
"binoculars": "Binoculars",
"grip": "Grip",
"m16a4_grenadier": "M16A4 Grenadier",
"panzershrek": "Panzershrek",
"bazooka": "M9A1 Bazooka",
"bazooka_man": "Bazooka",
"tokarev": "Tokarev TT-33",
"russian_flag": "Red Army Banner",
"stg-44": "STG-44",
"mortar_round": "Mortar Round",
"molotov": "Molotov Cocktail",
"fireblob": "Napalm Blob (Fire on Ground)",
"m2_flamethrower": "M2 Flamethrower",
"flamethrower_gunner": "Flamethrower",
"kar98k_scoped": "Scoped Kar98k",
"lee_enfield_scoped": "Scoped Lee-Enfield",
"type100_smg": "Type 100",
"type99_rifle": "Arisaka",
"type99_rifle_bayonet": "Arisaka Bayonet",
"type99_rifle_scoped": "Scoped Arisaka",
"walther_p38": "Walther P38",
"shotgunner": "Shotgunner",
"doublebarrel_sawed_grip": "Sawed-Off Double-Barreled Shotgun w/ Grip",
"antitank_gunner": "Anti-Tank Gunner",
"springfield_no_attachment": "No Attachment",
"springfield_bayonet": "Springfield Bayonet",
"springfield_rifle_grenade": "Rifle Grenade",
"type99_rifle_rifle_grenade": "Rifle Grenade",
"type99_rifle_no_attachment": "No Attachment",
"kar98k_no_attachment": "No Attachment",
"kar98k_rifle_grenade": "Rifle Grenade",
"mosin_rifle_no_attachment": "No Attachment",
"mosin_rifle_rifle_grenade": "Rifle Grenade",
"svt40_no_attachment": "No Attachment",
"svt40_flash": "Flash Hider",
"svt40_aperture": "Aperture Sight",
"svt40_telescopic": "Telescopic Sight",
"svt40_select_fire": "Select Fire",
"gewehr43_no_attachment": "No Attachment",
"gewehr43_silenced": "Suppressor",
"gewehr43_aperture": "Aperture Sight",
"gewehr43_telescopic": "Telescopic Sight",
"gewehr43_rifle_grenade": "Rifle Grenade",
"m1garand_no_attachment": "No Attachment",
"m1garand_rifle_grenade": "Rifle Grenade",
"m1garand_scoped": "Sniper Scope",
"m1garand_flash": "Flash Hider",
"m1a1carbine_no_attachment": "No Attachment",
"m1a1carbine_flash": "Flash Hider",
"m1a1carbine_bigammo": "Box Magazine",
"m1a1carbine_aperture": "Aperture Sight",
"stg-44_no_attachment": "No Attachment",
"stg-44_flash": "Flash Hider",
"stg-44_aperture": "Aperture Sight",
"stg-44_telescopic": "Telescopic Sight",
"stg-44_select_fire": "Select Fire",
"thompson_no_attachment": "No Attachment",
"thompson_silenced": "Suppressor",
"thompson_aperture": "Aperture Sight",
"thompson_bigammo": "Round Drum",
"type100_smg_no_attachment": "No Attachment",
"type100_smg_silenced": "Suppressor",
"type100_smg_bigammo": "Box Magazine",
"type100_smg_aperture": "Aperture Sight",
"mp40_no_attachment": "No Attachment",
"mp40_silenced": "Suppressor",
"mp40_aperture": "Aperture Sight",
"mp40_bigammo": "Dual Magazines",
"ppsh_no_attachment": "No Attachment",
"ppsh_aperture": "Aperture Sight",
"ppsh_bigammo": "Round Drum",
"shotgun_no_attachment": "No Attachment",
"shotgun_grip": "Grip",
"shotgun_bayonet": "Bayonet",
"shotgun_double_barreled_no_attachment": "No Attachment",
"shotgun_double_barreled_grip": "Grip",
"doublebarrel_sawed": "Sawed-Off Shotgun",
"sailor": "Crewman",
"fg42_scoped": "Scoped FG42",
"mosin_launcher": "Mosin-Nagant w/ Launcher",
"zombie_melee": "BRAAAINS...",
"ray_gun": "Ray Gun",
"nomad": "Nomad",
"tesla_gun": "Wunderwaffe DG-2",
"30cal_upgraded": "B115 accelerator",
"bar_upgraded": "The Widow Maker",
"colt_upgraded": "C-3000 b1at-ch35",
"shotgun_double_barreled_sawed_grip_upgraded": "The Snuff Box",
"shotgun_double_barreled_upgraded": "24 Bore long range",
"fg42_upgraded": "420 Impeller",
"gewehr43_upgraded": "G115 Compressor",
"m1a1carbine_upgraded": "Widdershins RC-1",
"m1garand_upgraded": "M1000",
"mg42_upgraded": "Barracuda FU-A11",
"mp40_upgraded": "The Afterburner",
"ppsh_upgraded": "The Reaper",
"shotgun_upgraded": "Gut Shot",
"stg-44_upgraded": "Spatz-447 +",
"sw_357_upgraded": ".357 Plus 1 K1L-u",
"thompson_upgraded": "Gibs-o-matic",
"type100_smg_upgraded": "1001 Samurais",
"type99_rifle_upgraded": "The Eviscerator",
"panzerschrek_upgraded": "Longinus",
"ray_gun_upgraded": "Porter's X2 Ray Gun",
"tesla_gun_upgraded": "Wunderwaffe DG-3 JZ",
"m2_flamethrower_upgraded": "FIW Nitrogen cooled",
"ptrs41_upgraded": "The Penetrator",
"m7_launcher_upgraded": "The Imploder",
"nazi_zombies_cap": "NAZI ZOMBIES",
"kar98k_upgraded": "Armageddon",
"m7_launcher_upgraded_nonade": "The Imploder",
"zombie_knuckle_crack": "Pack A Punch Knuckle Crack",
"cymbal_monkey": "Cymbal Monkey"
},
"T6" : {

View File

@ -98,10 +98,12 @@ namespace IW4MAdmin
ServerLogger.LogDebug("Client slot #{clientNumber} now reserved", clientFromLog.ClientNumber);
var client = await Manager.GetClientService().GetUnique(clientFromLog.NetworkId, GameName);
var foundClient = true;
// first time client is connecting to server
if (client == null)
{
foundClient = false;
ServerLogger.LogDebug("Client {client} first time connecting", clientFromLog.ToString());
clientFromLog.CurrentServer = this;
client = await Manager.GetClientService().Create(clientFromLog);
@ -109,12 +111,16 @@ namespace IW4MAdmin
client.CopyAdditionalProperties(clientFromLog);
// this is only a temporary version until the IPAddress is transmitted
client.CurrentAlias = new EFAlias()
if (foundClient)
{
Name = clientFromLog.Name,
IPAddress = clientFromLog.IPAddress
};
client.CurrentAlias = new EFAlias
{
AliasId = client.CurrentAliasId,
LinkId = client.AliasLinkId,
Name = clientFromLog.Name,
IPAddress = clientFromLog.IPAddress
};
}
// Do the player specific stuff
client.ClientNumber = clientFromLog.ClientNumber;
@ -413,10 +419,7 @@ namespace IW4MAdmin
{
if (E.Origin.State != ClientState.Connected)
{
E.Origin.State = ClientState.Connected;
E.Origin.Connections += 1;
ChatHistory.Add(new ChatInfo()
ChatHistory.Add(new ChatInfo
{
Name = E.Origin.Name,
Message = "CONNECTED",
@ -430,6 +433,10 @@ namespace IW4MAdmin
{
E.Origin.Tag = clientTag.Value;
}
await E.Origin.OnJoin(E.Origin.IPAddress, Manager.GetApplicationSettings().Configuration().EnableImplicitAccountLinking);
E.Origin.State = ClientState.Connected;
E.Origin.Connections += 1;
try
{
@ -449,8 +456,6 @@ namespace IW4MAdmin
ServerLogger.LogError(ex, "Could not get offline message count for {Client}", E.Origin.ToString());
throw;
}
await E.Origin.OnJoin(E.Origin.IPAddress, Manager.GetApplicationSettings().Configuration().EnableImplicitAccountLinking);
}
}
@ -907,6 +912,12 @@ namespace IW4MAdmin
context.Entry(gameServer).Property(property => property.HostName).IsModified = true;
}
if (gameServer.PerformanceBucket != PerformanceBucket)
{
gameServer.PerformanceBucket = PerformanceBucket;
context.Entry(gameServer).Property(property => property.PerformanceBucket).IsModified = true;
}
if (gameServer.IsPasswordProtected != !string.IsNullOrEmpty(GamePassword))
{
gameServer.IsPasswordProtected = !string.IsNullOrEmpty(GamePassword);