Skip to content
RustPluginGenerator

CanBypassQueue

CanBypassQueue is called when the server decides whether a queued connection may skip the connection queue and join immediately. Returning true lets the player jump the queue, returning false keeps them waiting.

Signature
object CanBypassQueue(Network.Connection connection)

Parameters

Hook parameters
ParameterTypeDescription
connectionNetwork.ConnectionThe network connection of the player who is queued and is being checked against the jump-queue rules. Use `connection.userid` to identify the player and `connection.skipQueue` to read the flag the game sets for privileged connections.

Return value

Returning true or false overrides the queue decision for that connection: the game uses your bool as the result of CanJumpQueue. Returning null (or any non-bool value) lets the original code continue, which then honors connection.skipQueue.

How it works

This hook fires inside ConnectionQueue.CanJumpQueue for each connection the server evaluates while the join queue is draining. It runs before the game's own connection.skipQueue check, so it is the first chance to make a decision about a specific connection.

The single argument is the Network.Connection of the queued player. From it you can read userid and skipQueue; there is no player entity yet, so BasePlayer.FindByID will usually return null for a player still in the queue. Keep the logic cheap and deterministic.

The hook is called frequently while the queue is active, so avoid chat spam, data writes, or expensive lookups. Cache your allow-list in memory at load time.

You cannot narrow the parameter type to filter calls; every queued connection passes through with the same Network.Connection type. Return null to defer to the game's default behavior.

Example plugin: VIP queue bypass by permission

VipQueueBypass.cs
using System;
using Newtonsoft.Json;
using Oxide.Core;

namespace Oxide.Plugins
{
    [Info("Vip Queue Bypass", "RustPluginGenerator", "1.0.0")]
    [Description("Grants join queue bypass to players who hold a configurable permission.")]
    public class VipQueueBypass : RustPlugin
    {
        private const string PermBypass = "vipqueuebypass.use";

        private PluginConfig config;

        private class PluginConfig
        {
            [JsonProperty("Allow bypass by permission")]
            public bool UsePermission { get; set; } = true;

            [JsonProperty("Only bypass when online players below limit")]
            public int PlayerLimit { get; set; } = 100;
        }

        protected override void LoadDefaultConfig() => config = new PluginConfig();

        protected override void LoadConfig()
        {
            base.LoadConfig();
            try
            {
                config = Config.ReadObject<PluginConfig>();
                if (config == null) throw new Exception();
            }
            catch
            {
                PrintWarning("Configuration file is invalid, using defaults");
                LoadDefaultConfig();
            }
            SaveConfig();
        }

        protected override void SaveConfig() => Config.WriteObject(config);

        private void Init()
        {
            permission.RegisterPermission(PermBypass, this);
        }

        private object CanBypassQueue(Network.Connection connection)
        {
            if (connection == null) return null;

            // No player entity exists yet, so work from the user id on the connection.
            string userId = connection.userid.ToString();

            if (!config.UsePermission) return null;

            if (config.PlayerLimit > 0 && BasePlayer.activePlayerList.Count >= config.PlayerLimit)
            {
                // Server is full of bypassers already; defer to the vanilla decision.
                return null;
            }

            if (permission.UserHasPermission(userId, PermBypass))
            {
                return true;
            }

            return null;
        }
    }
}

The plugin grants queue bypass to any connection whose user id holds a configurable permission, without touching the game's own skipQueue flag. On join the hook reads connection.userid, turns it into a string, and asks Oxide's permission system whether that user may bypass. A configurable default is used when permission checks cannot resolve the user. Because the hook runs while the queue is active, no chat messages are sent and nothing is written to disk; the decision is a single in-memory permission lookup. Returning null means non-VIPs fall back to the vanilla skipQueue behavior, so server operators with admin flags still jump the queue as usual.

Common use cases

  • VIP fast-lane access

    Grant permission vipqueuebypass.use to donors so they skip the join queue during peak hours without needing a game-set skipQueue flag.

  • Maintenance windows

    Only allow bypass when the server is under a configurable player threshold, keeping the queue fair during high-pop events.

  • Staff priority

    Let admins and moderators jump the queue to handle reports faster, keyed off player.IsAdmin cached from a name list or group permission.

Pitfalls

  • No player entity yet

    The connection has no spawned BasePlayer while it is queued, so calls like BasePlayer.FindByID return null. Use connection.userid and Oxide permissions instead.

  • Runs often during queue pressure

    The hook is evaluated repeatedly while the queue drains, so avoid chat output, file I/O, or config saves inside it. Keep the body to a lookup and return.

  • Returning false blocks vanilla bypass

    Returning false denies the connection even if the game set skipQueue. Return null instead when you only want to grant bypass and leave the default check intact.

Build a plugin with CanBypassQueue

Describe what should happen and get a compiled plugin that uses this hook.

Prompt: VIP fast-lane access using the CanBypassQueue hook, with a config file and a permission
Generate this plugin

Edit the prompt on the next screen. 2 free plugins a month, no card.

Last updated Oct 26, 2026. Found a mistake? Email support@rustplugingenerator.com.

Build a plugin with CanBypassQueue

Generate