Code/Tikfinity/Actions/TikfinityTestEmitter.cs
using Sandbox;
namespace TikfinitySbox;
/// <summary>
/// Offline smoke-test component. It never impersonates a socket event.
/// </summary>
public sealed class TikfinityTestEmitter : Component
{
[Property] public TikfinityHub Hub { get; set; }
[Property] public bool EmitOnStart { get; set; }
[Property] public string Route { get; set; } = "gift.default";
[Property, Range( 1, 1000 )] public int Amount { get; set; } = 1;
[Property] public string Nickname { get; set; } = "Local Tester";
protected override void OnStart()
{
if ( !EmitOnStart || !Networking.IsHost ) return;
if ( !Hub.IsValid() ) Hub = Scene.Get<TikfinityHub>();
Hub?.DispatchTestInteraction( Route, Amount, Nickname );
}
}