mirror of
https://github.com/edgegamers/Jailbreak.git
synced 2025-12-06 04:42:57 -08:00
Debugging Messages For AutoRTD
Added some debugging messages to chat so that I can view the state of the variable values at runtime
This commit is contained in:
@@ -57,4 +57,13 @@ public class RTDLocale : IRTDLocale, ILanguage<Formatting.Languages.English> {
|
||||
" credits!"
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Debug prints a message to chat. For testing purposes ONLY.
|
||||
/// </summary>
|
||||
/// <param name="message">Message to print to chat.</param>
|
||||
/// <returns></returns>
|
||||
public IView DebugPrintMessage(string message) {
|
||||
return new SimpleView { PREFIX, message };
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using CounterStrikeSharp.API.Core.Attributes.Registration;
|
||||
using CounterStrikeSharp.API.Modules.Admin;
|
||||
using CounterStrikeSharp.API.Modules.Commands;
|
||||
using CounterStrikeSharp.API.Modules.Cvars;
|
||||
using Jailbreak.Formatting.Base;
|
||||
using Jailbreak.Formatting.Extensions;
|
||||
using Jailbreak.Formatting.Views;
|
||||
using Jailbreak.Formatting.Views.RTD;
|
||||
@@ -90,7 +91,23 @@ public class AutoRTD(IRTDRewarder rewarder, IAutoRTDLocale locale,
|
||||
var steam = executor.SteamID;
|
||||
Task.Run(async () => {
|
||||
var value = await cookie.Get(steam);
|
||||
|
||||
// Debugging value return from cookie.Get
|
||||
if (value != null) {
|
||||
rtdLocale.DebugPrintMessage($"Value was: {value}!").ToChat(executor);
|
||||
} else {
|
||||
rtdLocale.DebugPrintMessage($"Value was: null!").ToChat(executor);
|
||||
}
|
||||
|
||||
var enable = value is not (null or "Y");
|
||||
|
||||
// Debugging enable value
|
||||
if (enable != null) {
|
||||
rtdLocale.DebugPrintMessage($"Enable was: {enable}!").ToChat(executor);
|
||||
} else {
|
||||
rtdLocale.DebugPrintMessage($"Enable was: null!").ToChat(executor);
|
||||
}
|
||||
|
||||
await cookie.Set(steam, enable ? "Y" : "N");
|
||||
await Server.NextFrameAsync(() => {
|
||||
if (!executor.IsValid) return;
|
||||
|
||||
@@ -10,4 +10,6 @@ public interface IRTDLocale {
|
||||
public IView CannotRollYet();
|
||||
public IView RollingDisabled();
|
||||
public IView JackpotReward(CCSPlayerController winner, int credits);
|
||||
|
||||
public IView DebugPrintMessage(string message);
|
||||
}
|
||||
Reference in New Issue
Block a user