docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GameServer

    Game-server Steam API lifecycle, the server-pipe counterpart of SteamAPI. Subscribe with gameServer: true on SteamCallbacks to receive its callbacks. Its SteamDispatchMode is set separately from the client pipe's.

    Inheritance
    object
    GameServer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Steamworks.Interop
    Assembly: Unity.Steamworks.Interop.dll
    Syntax
    public static class GameServer

    Methods

    BSecure()

    True when the game server is VAC-secured.

    Declaration
    public static bool BSecure()
    Returns
    Type Description
    bool

    true when the server is VAC-secured.

    GetSteamID()

    The game server's Steam ID.

    Declaration
    public static CSteamID GetSteamID()
    Returns
    Type Description
    CSteamID

    The server's own Steam ID, invalid until it has logged on.

    InitEx(uint, ushort, ushort, EServerMode, string, out string, SteamDispatchMode)

    Initializes the Steam game server; on success resolves its interfaces and starts dispatch for its pipe.

    Declaration
    public static ESteamAPIInitResult InitEx(uint unIP, ushort usGamePort, ushort usQueryPort, EServerMode eServerMode, string pchVersionString, out string errMsg, SteamDispatchMode dispatch = SteamDispatchMode.Package)
    Parameters
    Type Name Description
    uint unIP

    The IPv4 address to bind, in host byte order; 0 binds all interfaces.

    ushort usGamePort

    The port clients connect to the game on.

    ushort usQueryPort

    The port the server browser queries on.

    EServerMode eServerMode

    How much authentication the server requires of its clients.

    string pchVersionString

    The server build version, "x.x.x.x"; Steam uses it to detect out-of-date servers.

    string errMsg

    Receives Steam's description of the failure, or null on success.

    SteamDispatchMode dispatch

    Who reads the game-server pipe's callbacks. Defaults to this package.

    Returns
    Type Description
    ESteamAPIInitResult

    k_ESteamAPIInitResult_OK, or the reason initialization failed.

    ReleaseCurrentThreadMemory()

    Frees the memory Steam keeps for the calling thread; useful on worker threads that call Steam.

    Declaration
    public static void ReleaseCurrentThreadMemory()

    Shutdown()

    Stops callback dispatch for the game-server pipe and shuts the game server down.

    Declaration
    public static void Shutdown()
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)