/// <summary> /// Runs the script event with the given input. /// </summary> /// <param name="prio">The priority to run with.</param> /// <param name="oevt">The details of the script to be ran.</param> /// <returns>The event details after firing.</returns> public void Run(int prio, PlayerConnectingEventArgs oevt) { PlayerConnectingScriptEvent evt = (PlayerConnectingScriptEvent)Duplicate(); evt.Cancelled = oevt.Cancelled; evt.PlayerName = new TextTag(oevt.PlayerName); evt.Call(prio); oevt.Cancelled = evt.Cancelled; }
/// <summary> /// Runs the script event with the given input. /// </summary> /// <param name="prio">The priority to run with.</param> /// <param name="oevt">The details of the script to be ran.</param> /// <returns>The event details after firing.</returns> public void Run(int prio, PlayerConnectingEventArgs oevt) { PlayerConnectingScriptEvent evt = (PlayerConnectingScriptEvent)Duplicate(); evt.Cancelled = oevt.Cancelled; evt.PlayerName = new TextTag(oevt.PlayerName); evt.Call(prio); oevt.Cancelled = evt.Cancelled; }
public static bool PlayerConnecting(SteamPending pending) { PlayerConnectingEventArgs evt = new PlayerConnectingEventArgs(); evt.PlayerName = pending.playerID.playerName; UnturnedFreneticEvents.OnPlayerConnecting.Fire(evt); if (evt.Cancelled) { Provider.reject(pending.playerID.steamID, ESteamRejection.WHITELISTED); // TODO: Customizable rejection reason! } return evt.Cancelled; }