备份,准备做双端
This commit is contained in:
@@ -18,6 +18,13 @@ public static class GameplaySkillLogger
|
||||
private static float s_sessionStartRealtime;
|
||||
private static int s_lastSecondBucket = -1;
|
||||
|
||||
// Master gate. This is a diagnostic disk logger: when disabled, every Record* method
|
||||
// returns before doing any Sanitize/string-concat/StringBuilder work, so it costs
|
||||
// nothing on the per-damage/per-note/per-score hot paths in production. Latched from
|
||||
// GameConfig at BeginSession so a whole session is consistently on or off. Hot call
|
||||
// sites can also check GameplaySkillLogger.Enabled to skip building argument strings.
|
||||
public static bool Enabled { get; private set; }
|
||||
|
||||
private const float RapidDuplicateSkillThresholdSeconds = 0.05f;
|
||||
|
||||
// Off-thread writer: judge/skill events push formatted lines into this queue and a
|
||||
@@ -45,6 +52,14 @@ public static class GameplaySkillLogger
|
||||
|
||||
public static void BeginSession(string sessionLabel)
|
||||
{
|
||||
// Latch the gate for the whole session from the debug flags. Disabled in production
|
||||
// (both flags default false) so the logger adds zero hot-path cost.
|
||||
Enabled = GameConfig.verboseLogs || GameConfig.skillDebugMode;
|
||||
if (!Enabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
lock (s_fileLock)
|
||||
{
|
||||
BeginSessionInternal(sessionLabel);
|
||||
@@ -58,6 +73,7 @@ public static class GameplaySkillLogger
|
||||
string attributeSummary,
|
||||
string targetSummary)
|
||||
{
|
||||
if (!Enabled) return;
|
||||
lock (s_fileLock)
|
||||
{
|
||||
EnsureSessionLocked();
|
||||
@@ -106,6 +122,7 @@ public static class GameplaySkillLogger
|
||||
float hitTime,
|
||||
float scheduledEndTime)
|
||||
{
|
||||
if (!Enabled) return;
|
||||
lock (s_fileLock)
|
||||
{
|
||||
EnsureSessionLocked();
|
||||
@@ -141,6 +158,7 @@ public static class GameplaySkillLogger
|
||||
int allIdol,
|
||||
int totalScore)
|
||||
{
|
||||
if (!Enabled) return;
|
||||
lock (s_fileLock)
|
||||
{
|
||||
EnsureSessionLocked();
|
||||
@@ -173,6 +191,7 @@ public static class GameplaySkillLogger
|
||||
float damageResistance,
|
||||
string sourceName)
|
||||
{
|
||||
if (!Enabled) return;
|
||||
lock (s_fileLock)
|
||||
{
|
||||
EnsureSessionLocked();
|
||||
@@ -200,6 +219,7 @@ public static class GameplaySkillLogger
|
||||
int maxMana,
|
||||
string source)
|
||||
{
|
||||
if (!Enabled) return;
|
||||
lock (s_fileLock)
|
||||
{
|
||||
EnsureSessionLocked();
|
||||
@@ -226,6 +246,7 @@ public static class GameplaySkillLogger
|
||||
int maxValue,
|
||||
string sourceName)
|
||||
{
|
||||
if (!Enabled) return;
|
||||
lock (s_fileLock)
|
||||
{
|
||||
EnsureSessionLocked();
|
||||
@@ -248,6 +269,7 @@ public static class GameplaySkillLogger
|
||||
|
||||
public static void RecordConflictHint(string subsystem, string issueType, string details)
|
||||
{
|
||||
if (!Enabled) return;
|
||||
lock (s_fileLock)
|
||||
{
|
||||
EnsureSessionLocked();
|
||||
|
||||
Reference in New Issue
Block a user