Namespace UnityEngine.Networking.NetworkSystem | Multiplayer HLAPI | 1.0.8
docs.unity.cn
    Show / Hide Table of Contents

    Namespace UnityEngine.Networking.NetworkSystem

    Classes

    AddPlayerMessage

    This is passed to handler funtions registered for the AddPlayer built-in message.

    EmptyMessage

    A utility class to send a network message with no contents.

    using UnityEngine;
    using UnityEngine.Networking;
    using UnityEngine.Networking.NetworkSystem;
    
    public class Test
    {
       void SendNotification()
       {
           var msg = new EmptyMessage();
           NetworkServer.SendToAll(667, msg);
       }
    }

    ErrorMessage

    This is passed to handler functions registered for the SYSTEM_ERROR built-in message.

    IntegerMessage

    A utility class to send simple network messages that only contain an integer.

    using UnityEngine;
    using UnityEngine.Networking;
    using UnityEngine.Networking.NetworkSystem;
    
    public class Test
    {
       void SendValue(int value)
       {
           var msg = new IntegerMessage(value);
           NetworkServer.SendToAll(MsgType.Scene, msg);
       }
    }

    NotReadyMessage

    This is passed to handler funtions registered for the SYSTEM_NOT_READY built-in message.

    PeerAuthorityMessage

    Information about a change in authority of a non-player in the same network game.

    This information is cached by clients and used during host-migration.

    PeerInfoMessage

    Information about another participant in the same network game.

    This information is cached by clients and used during host-migration.

    PeerListMessage

    Internal UNET message for sending information about network peers to clients.

    ReadyMessage

    This is passed to handler funtions registered for the SYSTEM_READY built-in message.

    ReconnectMessage

    This network message is used when a client reconnect to the new host of a game.

    RemovePlayerMessage

    This is passed to handler funtions registered for the SYSTEM_REMOVE_PLAYER built-in message.

    StringMessage

    This is a utility class for simple network messages that contain only a string.

    This example sends a message with the name of the scene.

    using UnityEngine;
    using UnityEngine.Networking;
    using UnityEngine.Networking.NetworkSystem;
    
    public class Test
    {
       void SendSceneName(string sceneName)
       {
           var msg = new StringMessage(sceneName);
           NetworkServer.SendToAll(MsgType.Scene, msg);
       }
    }

    Structs

    PeerInfoPlayer

    A structure used to identify player object on other peers for host migration.

    In This Article
    • Classes
    • Structs
    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on 15 December 2020