Fix GeoLite crash, add PerfMode profiling, reload cache invalidation
- GeoLite/MaxMind lookup wrapped in try/catch and disabled for the session on failure (stops the per-tick exception spam when the assembly cannot load during hot-reload) - New PerfMode config option: writes performance logs to logs/perf_<date>.txt (DisableAll/SetSkill/PlayerDeath totals, per-skill SkillAction timings, aggregated OnTick/CheckTransmit avg-max summaries) - css_reload now invalidates the skill-info and freeze-time caches - Removed the last null-forgiving player lookups (Command, Armored, Baseball, FriendlyFire, OneShot)
This commit is contained in:
parent
25cd8eb989
commit
b68a033b4c
14 changed files with 157 additions and 10 deletions
|
|
@ -440,6 +440,7 @@ namespace src.player
|
|||
|
||||
private static void OnTick()
|
||||
{
|
||||
long perfStart = PerfLog.Start();
|
||||
lock (setLock)
|
||||
{
|
||||
_activeSkillsSet.Clear();
|
||||
|
|
@ -462,6 +463,7 @@ namespace src.player
|
|||
Instance.SkillAction(_skillNames[skill], "OnTick");
|
||||
}
|
||||
}
|
||||
PerfLog.Sample("OnTick(skills)", perfStart);
|
||||
}
|
||||
|
||||
private static void OnPlayerConnectedBot(int playerSlot)
|
||||
|
|
@ -618,6 +620,13 @@ namespace src.player
|
|||
}
|
||||
|
||||
private static void DisableAll()
|
||||
{
|
||||
long perfStart = PerfLog.Start();
|
||||
DisableAllCore();
|
||||
PerfLog.End("DisableAll total", perfStart, 2.0);
|
||||
}
|
||||
|
||||
private static void DisableAllCore()
|
||||
{
|
||||
lock (setLock)
|
||||
{
|
||||
|
|
@ -742,6 +751,14 @@ namespace src.player
|
|||
}
|
||||
|
||||
private static HookResult PlayerDeath(EventPlayerDeath @event, GameEventInfo info)
|
||||
{
|
||||
long perfStart = PerfLog.Start();
|
||||
var result = PlayerDeathCore(@event, info);
|
||||
PerfLog.End("PlayerDeath total", perfStart, 2.0);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static HookResult PlayerDeathCore(EventPlayerDeath @event, GameEventInfo info)
|
||||
{
|
||||
lock (setLock)
|
||||
{
|
||||
|
|
@ -847,6 +864,13 @@ namespace src.player
|
|||
}
|
||||
|
||||
private static void SetSkill()
|
||||
{
|
||||
long perfStart = PerfLog.Start();
|
||||
SetSkillCore();
|
||||
PerfLog.End("SetSkill total", perfStart, 2.0);
|
||||
}
|
||||
|
||||
private static void SetSkillCore()
|
||||
{
|
||||
setSkillTimer = null;
|
||||
lock (setLock)
|
||||
|
|
@ -1149,10 +1173,12 @@ namespace src.player
|
|||
|
||||
public static void CheckTransmit([CastFrom(typeof(nint))] CCheckTransmitInfoList infoList)
|
||||
{
|
||||
long perfStart = PerfLog.Start();
|
||||
lock (setLock)
|
||||
{
|
||||
DispatchToActiveSkills("CheckTransmit", infoList);
|
||||
}
|
||||
PerfLog.Sample("CheckTransmit", perfStart);
|
||||
}
|
||||
|
||||
public static void UpdateSkillHUD(CCSPlayerController? player, string? headerLine, string? centerLine, string? extraLine, bool isDescription)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue