Search Results for

    Show / Hide Table of Contents

    Class Server

    A set of tools to easily work with the server.

    Inheritance
    System.Object
    Server
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Exiled.API.Features
    Assembly: Exiled.API.dll
    Syntax
    public static class Server

    Properties

    | Improve this Doc View Source

    Broadcast

    Gets the cached Broadcast component.

    Declaration
    public static Broadcast Broadcast { get; }
    Property Value
    Type Description
    Broadcast
    | Improve this Doc View Source

    BuildType

    Gets a value indicating the type of build this server is hosted on.

    Declaration
    public static Version.VersionType BuildType { get; }
    Property Value
    Type Description
    GameCore.Version.VersionType
    | Improve this Doc View Source

    Frametime

    Gets the actual frametime of the server.

    Declaration
    public static double Frametime { get; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    FriendlyFire

    Gets or sets a value indicating whether or not friendly fire is enabled.

    Declaration
    public static bool FriendlyFire { get; set; }
    Property Value
    Type Description
    System.Boolean
    See Also
    IsFriendlyFireEnabled
    | Improve this Doc View Source

    Host

    Gets the player's host of the server. Might be null when called when the server isn't loaded.

    Declaration
    public static Player Host { get; }
    Property Value
    Type Description
    Player
    | Improve this Doc View Source

    IpAddress

    Gets the Ip address of the server.

    Declaration
    public static string IpAddress { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    IsBeta

    Gets a value indicating whether or not this server is on a beta version of SCP:SL.

    Declaration
    public static bool IsBeta { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsDedicated

    Gets a value indicating whether or not this server is a dedicated server.

    Declaration
    public static bool IsDedicated { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsHeavilyModded

    Gets or sets a value indicating whether the server is marked as Heavily Modded. Read the VSR for more info about its usage.

    Declaration
    public static bool IsHeavilyModded { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsIdleModeEnabled

    Gets or sets a value indicating whether or not idle mode is enabled.

    Declaration
    public static bool IsIdleModeEnabled { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsVerified

    Gets a value indicating whether or not this server is verified.

    Declaration
    public static bool IsVerified { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsWhitelisted

    Gets or sets a value indicating whether or not this server has the whitelist enabled.

    Declaration
    public static bool IsWhitelisted { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    LateJoinEnabled

    Gets a value indicating whether or not late join is enabled.

    Declaration
    public static bool LateJoinEnabled { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    LateJoinTime

    Gets the late join time, in seconds. If a player joins less than this many seconds into a game, they will be given a random class.

    Declaration
    public static float LateJoinTime { get; }
    Property Value
    Type Description
    System.Single
    | Improve this Doc View Source

    MaxPlayerCount

    Gets or sets the maximum number of players able to be on the server.

    Declaration
    public static int MaxPlayerCount { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Name

    Gets or sets the name of the server.

    Declaration
    public static string Name { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    PermissionsHandler

    Gets the RemoteAdmin permissions handler.

    Declaration
    public static PermissionsHandler PermissionsHandler { get; }
    Property Value
    Type Description
    PermissionsHandler
    | Improve this Doc View Source

    PlayerCount

    Gets the number of players currently on the server.

    Declaration
    public static int PlayerCount { get; }
    Property Value
    Type Description
    System.Int32
    See Also
    List
    | Improve this Doc View Source

    PluginAssemblies

    Gets a dictionary that pairs assemblies with their associated plugins.

    Declaration
    public static Dictionary<Assembly, IPlugin<IConfig>> PluginAssemblies { get; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.Reflection.Assembly, IPlugin<IConfig>>
    | Improve this Doc View Source

    Port

    Gets the port of the server.

    Declaration
    public static ushort Port { get; }
    Property Value
    Type Description
    System.UInt16
    | Improve this Doc View Source

    SendSpawnMessage

    Gets the cached SendSpawnMessage System.Reflection.MethodInfo.

    Declaration
    public static MethodInfo SendSpawnMessage { get; }
    Property Value
    Type Description
    System.Reflection.MethodInfo
    | Improve this Doc View Source

    SessionVariables

    Gets the dictionary of the server's session variables.

    Session variables can be used to save temporary data. Data is stored in a System.Collections.Generic.Dictionary<TKey, TValue>. The key of the data is always a System.String, whereas the value can be any System.Object. The data stored in a session variable can be accessed by different assemblies; it is recommended to uniquely identify stored data so that it does not conflict with other plugins that may also be using the same name. Data saved with session variables is not being saved on server restart. If the data must be saved after a restart, a database must be used instead.

    Declaration
    public static Dictionary<string, object> SessionVariables { get; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Object>
    | Improve this Doc View Source

    StreamingAllowed

    Gets a value indicating whether or not streaming of this version is allowed.

    Declaration
    public static bool StreamingAllowed { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Tps

    Gets the actual ticks per second of the server.

    Declaration
    public static double Tps { get; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    Version

    Gets the server's version.

    Declaration
    public static string Version { get; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    ExecuteCommand(String, CommandSender)

    Executes a server command.

    Declaration
    public static string ExecuteCommand(string command, CommandSender sender = null)
    Parameters
    Type Name Description
    System.String command

    The command to be run.

    CommandSender sender

    The CommandSender running the command.

    Returns
    Type Description
    System.String

    Command response, if there is one; otherwise, null.

    | Improve this Doc View Source

    Restart()

    Restarts the server, reconnects all players.

    Declaration
    public static void Restart()
    See Also
    RestartRedirect(UInt16)
    | Improve this Doc View Source

    RestartRedirect(UInt16)

    Redirects players to a server on another port, restarts the current server.

    Declaration
    public static bool RestartRedirect(ushort redirectPort)
    Parameters
    Type Name Description
    System.UInt16 redirectPort

    The port to redirect players to.

    Returns
    Type Description
    System.Boolean

    true if redirection was successful; otherwise, false.

    Remarks

    If the returned value is false, the server won't restart.

    | Improve this Doc View Source

    RunCommand(String, CommandSender)

    Runs a server command.

    Declaration
    [Obsolete("Use Server.ExecuteCommand() instead.")]
    public static void RunCommand(string command, CommandSender sender = null)
    Parameters
    Type Name Description
    System.String command

    The command to be run.

    CommandSender sender

    The CommandSender running the command.

    | Improve this Doc View Source

    Shutdown()

    Shutdowns the server, disconnects all players.

    Declaration
    public static void Shutdown()
    See Also
    ShutdownRedirect(UInt16)
    | Improve this Doc View Source

    ShutdownRedirect(UInt16)

    Redirects players to a server on another port, shutdowns the current server.

    Declaration
    public static bool ShutdownRedirect(ushort redirectPort)
    Parameters
    Type Name Description
    System.UInt16 redirectPort

    The port to redirect players to.

    Returns
    Type Description
    System.Boolean

    true if redirection was successful; otherwise, false.

    Remarks

    If the returned value is false, the server won't shutdown.

    | Improve this Doc View Source

    TryGetSessionVariable<T>(String, out T)

    Safely gets an System.Object from SessionVariables, then casts it to T.

    Declaration
    public static bool TryGetSessionVariable<T>(string key, out T result)
    Parameters
    Type Name Description
    System.String key

    The key of the object to get.

    T result

    When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter is used.

    Returns
    Type Description
    System.Boolean

    true if the SessionVariables contains an element with the specified key; otherwise, false.

    Type Parameters
    Name Description
    T

    The returned object type.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX