Files
RAGECOOP-V/RageCoop.Client/Debug.cs

51 lines
1.2 KiB
C#
Raw Normal View History

2022-05-22 15:55:26 +08:00
using System;
using System.Collections.Generic;
namespace RageCoop.Client
{
internal enum TimeStamp
{
AddPeds,
PedTotal,
AddVehicles,
VehicleTotal,
SendPed,
SendPedState,
2022-05-22 15:55:26 +08:00
SendVehicle,
SendVehicleState,
UpdatePed,
2022-05-22 15:55:26 +08:00
UpdateVehicle,
CheckProjectiles,
GetAllEntities,
Receive,
2022-07-20 17:50:01 +08:00
ProjectilesTotal,
2022-05-22 15:55:26 +08:00
}
internal static class Debug
{
public static Dictionary<TimeStamp, long> TimeStamps = new Dictionary<TimeStamp, long>();
private static int _lastNfHandle;
static Debug()
{
2022-07-20 17:50:01 +08:00
foreach (TimeStamp t in Enum.GetValues(typeof(TimeStamp)))
2022-05-22 15:55:26 +08:00
{
TimeStamps.Add(t, 0);
}
}
public static string Dump(this Dictionary<TimeStamp, long> d)
{
string s = "";
2022-07-20 17:50:01 +08:00
foreach (KeyValuePair<TimeStamp, long> kvp in d)
2022-05-22 15:55:26 +08:00
{
2022-09-06 21:46:35 +08:00
s += kvp.Key + ":" + kvp.Value + "\n";
2022-05-22 15:55:26 +08:00
}
return s;
}
public static void ShowTimeStamps()
{
GTA.UI.Notification.Hide(_lastNfHandle);
2022-09-06 21:46:35 +08:00
_lastNfHandle = GTA.UI.Notification.Show(Debug.TimeStamps.Dump());
2022-05-22 15:55:26 +08:00
}
}
}