using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using NLog; using Sandbox; using Torch.API.Event; using Torch.Event; using VRage.Network; namespace Torch.Server.Managers { [EventShim] internal static class MultiplayerManagerDedicatedEventShim { private static readonly EventList _eventValidateAuthTicket = new EventList(); internal static void RaiseValidateAuthTicket(ref ValidateAuthTicketEvent info) { _eventValidateAuthTicket?.RaiseEvent(ref info); } } /// /// Event that occurs when a player tries to connect to a dedicated server. /// Use these values to choose a , /// or leave it unset to allow the default logic to handle the request. /// public struct ValidateAuthTicketEvent : IEvent { /// /// SteamID of the player /// public readonly ulong SteamID; /// /// SteamID of the game owner /// public readonly ulong SteamOwner; /// /// The response from steam /// public readonly JoinResult SteamResponse; /// /// ID of the queried group, or 0 if no group. /// public readonly ulong Group; /// /// Is this person a member of . If no group this is true. /// public readonly bool Member; /// /// Is this person an officer of . If no group this is false. /// public readonly bool Officer; /// /// A future verdict on this authorization request. If null, let the default logic choose. If not async use /// public Task FutureVerdict; internal ValidateAuthTicketEvent(ulong steamId, ulong steamOwner, JoinResult steamResponse, ulong serverGroup, bool member, bool officer) { SteamID = steamId; SteamOwner = steamOwner; SteamResponse = steamResponse; Group = serverGroup; Member = member; Officer = officer; FutureVerdict = null; } /// public bool Cancelled => FutureVerdict != null; } }