Skip to content

Commit

Permalink
Trim invalid starting character from plugin name tag
Browse files Browse the repository at this point in the history
  • Loading branch information
features-not-bugs committed Feb 22, 2023
1 parent 518b336 commit c5899f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/RustServerMetrics/MetricsLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace RustServerMetrics
public class MetricsLogger : SingletonComponent<MetricsLogger>
{
const string CONFIGURATION_PATH = "HarmonyMods_Data/ServerMetrics/Configuration.json";
readonly static char[] PLUGIN_NAME_TRIMSTART = new char[] { '_' };
readonly StringBuilder _stringBuilder = new();
readonly Dictionary<ulong, Action> _playerStatsActions = new();
readonly Dictionary<ulong, uint> _perfReportDelayCounter = new();
Expand Down Expand Up @@ -186,7 +187,7 @@ internal void OnOxidePluginMetrics(Dictionary<string, double> metrics)
UploadPacket("oxide_plugins", metric, (builder, report) =>
{
builder.Append(",plugin=\"");
builder.Append(report.Key.Replace("\"", "\\\""));
builder.Append(report.Key.TrimStart(PLUGIN_NAME_TRIMSTART).Replace("\"", "\\\""));
builder.Append("\" hookTime=");
builder.Append(report.Value);
});
Expand Down

0 comments on commit c5899f5

Please sign in to comment.