Add CultNet schema write forwarder

This commit is contained in:
Meta Vens 2026-05-19 17:47:43 +01:00
commit 061ffe54bc
6 changed files with 168 additions and 19 deletions

View file

@ -87,6 +87,11 @@ namespace GameCult.Networking
/// </summary>
public bool LogSensitivePayloads { get; set; }
/// <summary>
/// Gets or sets whether CultNet schema-v0 messages may be sent before user session verification.
/// </summary>
public bool AllowUnverifiedCultNetMessages { get; set; }
/// <summary>
/// Gets a value indicating whether the client currently has a verified session.
/// </summary>
@ -152,7 +157,7 @@ namespace GameCult.Networking
if (Connected && _peer != null)
{
if (Verified || message is CultNetLoginMessage or CultNetRegisterMessage or CultNetVerifyMessage)
if (AllowUnverifiedCultNetMessages || Verified || message is CultNetLoginMessage or CultNetRegisterMessage or CultNetVerifyMessage)
{
Logger.LogDebug($"Sending CultNet schema message {message.SchemaVersion}");
_peer.SendCultNet(message);