docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IMultiplayService

    Interface of the Multiplay SDK for using the Multiplay Service.

    Namespace: Unity.Services.Multiplay
    Assembly: Unity.Services.Multiplayer.Multiplay.dll
    Syntax
    public interface IMultiplayService

    Properties

    ServerConfig

    Gets the server config for the current session.

    Declaration
    ServerConfig ServerConfig { get; }
    Property Value
    Type Description
    ServerConfig

    Methods

    GetPayloadAllocationAsPlainText()

    Gets the payload allocation as plain text.

    Declaration
    Task<string> GetPayloadAllocationAsPlainText()
    Returns
    Type Description
    Task<string>

    The payload allocation as plain text.

    GetPayloadAllocationFromJsonAs<TPayload>(bool)

    Gets the payload allocation, in JSON, and deserializes it as the given object.

    Declaration
    Task<TPayload> GetPayloadAllocationFromJsonAs<TPayload>(bool throwOnMissingMembers = false)
    Parameters
    Type Name Description
    bool throwOnMissingMembers

    Throws an exception if the given class is missing a member.

    Returns
    Type Description
    Task<TPayload>

    An object representing the payload allocation.

    Type Parameters
    Name Description
    TPayload

    The object to be deserialized as.

    ReadyServerForPlayersAsync()

    Readies this server. To be called after the server has been Allocated to notify that the server is ready to accept players.

    Declaration
    Task ReadyServerForPlayersAsync()
    Returns
    Type Description
    Task

    A task that should be awaited.

    StartServerQueryHandlerAsync(ushort, string, string, string, string)

    Starts the server query handler. The handler provides the Multiplay Service with information about this server.

    Declaration
    Task<IServerQueryHandler> StartServerQueryHandlerAsync(ushort maxPlayers, string serverName, string gameType, string buildId, string map)
    Parameters
    Type Name Description
    ushort maxPlayers

    The max players for this server.

    string serverName

    The name of this server.

    string gameType

    The game type of this server.

    string buildId

    The build ID of this server.

    string map

    The map of this server.

    Returns
    Type Description
    Task<IServerQueryHandler>

    A task returning a manager for changing the current response.

    SubscribeToServerEventsAsync(MultiplayEventCallbacks)

    Subscribes to the SDK Daemon and provides updates via callbacks.

    Declaration
    Task<IServerEvents> SubscribeToServerEventsAsync(MultiplayEventCallbacks callbacks)
    Parameters
    Type Name Description
    MultiplayEventCallbacks callbacks
    Returns
    Type Description
    Task<IServerEvents>

    A task returning a handle for server event management.

    UnreadyServerAsync()

    Unreadies this server. To be called to prevent the server being given new players.

    Declaration
    Task UnreadyServerAsync()
    Returns
    Type Description
    Task

    A task that should be awaited.

    In This Article
    Back to top
    Copyright © 2024 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)