Search Results for

    Show / Hide Table of Contents

    Interface INetworkRoom

    This interface represents a network room.

    Inherited Members
    IRoomInfo.Name
    IRoomInfo.PlayerCount
    IRoomInfo.IsFull
    IRoomInfo.PropertiesListedInLobby
    IRoomInfo.MaxPlayers
    Namespace: Evergine.Networking.Rooms
    Assembly: Evergine.Networking.dll
    Syntax
    public interface INetworkRoom : IRoomInfo

    Properties

    AllPlayers

    Gets the list of all the players who are in that room (including the local player). Only updated while inside a room.

    Declaration
    IEnumerable<INetworkPlayer> AllPlayers { get; }
    Property Value
    Type Description
    IEnumerable<INetworkPlayer>

    CustomProperties

    Gets the custom properties of the room. These properties are synchronized by the server automatically.

    Declaration
    NetworkPropertiesTable CustomProperties { get; }
    Property Value
    Type Description
    NetworkPropertiesTable
    Remarks

    All players inside the room can change these properties. Setting properties in this table updates the server and other players.

    Keys in the table are bytes to reduce network traffic. It is recommended to use a custom enumerator for better clarity.

    Examples
    var matchmakingClient = Evergine.GetService<MatchmakingClientService>();
    var roomProperties = matchmakingClient.CurrentRoom.CustomProperties;
    roomProperties.Set((byte)CustomEnum.MapLevel, "cs_italy");
    var mapLevel = roomProperties.GetString((byte)CustomEnum.MapLevel);

    IsVisible

    Gets a value indicating whether the room is listed in its lobby.

    Declaration
    bool IsVisible { get; }
    Property Value
    Type Description
    bool
    Remarks

    Rooms can be created as invisible or changed to invisible.

    MasterClientId

    Gets the Id of the player who is the master of this room. Note: This changes when the current master leaves the room.

    Declaration
    int MasterClientId { get; }
    Property Value
    Type Description
    int

    Events

    MasterClientIdChanged

    Occurs when the master client ID changes.

    Declaration
    event EventHandler MasterClientIdChanged
    Event Type
    Type Description
    EventHandler

    Extension Methods

    ReflectionHelper.GetMemberAssembly(object)
    ReflectionHelper.GetTypeName(object)
    In this article
    Back to top
    Generated by DocFX