docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MsgType

    Container class for networking system built-in message types.

    Inheritance
    object
    MsgType
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Networking
    Assembly: com.unity.multiplayer-hlapi.Runtime.dll
    Syntax
    [Obsolete("The high level API classes are deprecated and will be removed in the future.")]
    public class MsgType

    Fields

    AddPlayer

    Internal networking system message for adding player objects to client instances.

    This is sent to the server when a client calls NetworkClient.AddPlayer(). The server should have a handler for this message type to add the player object to the game and notify the client with NetworkServer.AddPlayer().

    Declaration
    public const short AddPlayer = 37
    Field Value
    Type Description
    short

    Animation

    Internal networking system message for sending synchronizing animation state.

    Used by the NetworkAnimation component.

    Declaration
    public const short Animation = 40
    Field Value
    Type Description
    short

    AnimationParameters

    Internal networking system message for sending synchronizing animation parameter state.

    Used by the NetworkAnimation component.

    Declaration
    public const short AnimationParameters = 41
    Field Value
    Type Description
    short

    AnimationTrigger

    Internal networking system message for sending animation triggers.

    Used by the NetworkAnimation component.

    Declaration
    public const short AnimationTrigger = 42
    Field Value
    Type Description
    short

    CRC

    Internal networking system message for HLAPI CRC checking.

    Declaration
    public const short CRC = 14
    Field Value
    Type Description
    short

    Command

    Internal networking system message for sending a command from client to server.

    Declaration
    public const short Command = 5
    Field Value
    Type Description
    short

    Connect

    Internal networking system message for communicating a connection has occurred.

    Ensure you use RegisterHandler on the client or server. Insert MsgType.Connect as a parameter to listen for connections.

    Declaration
    public const short Connect = 32
    Field Value
    Type Description
    short

    Disconnect

    Internal networking system message for communicating a disconnect has occurred.

    To help understand the reason for a disconnect, an IntegerMessage number is written to the message body, which can be read and converted to the error enum.

    Declaration
    public const short Disconnect = 33
    Field Value
    Type Description
    short

    Error

    Internal networking system message for communicating an error.

    Declaration
    public const short Error = 34
    Field Value
    Type Description
    short

    Fragment

    Internal networking system message for identifying fragmented packets.

    Declaration
    public const short Fragment = 17
    Field Value
    Type Description
    short

    Highest

    The highest value of built-in networking system message ids. User messages must be above this value.

    Declaration
    public const short Highest = 47
    Field Value
    Type Description
    short

    InternalHighest

    The highest value of internal networking system message ids. User messages must be above this value. User code cannot replace these handlers.

    Declaration
    public const short InternalHighest = 31
    Field Value
    Type Description
    short

    LobbyAddPlayerFailed

    Internal networking system message for communicating failing to add lobby player.

    Declaration
    public const short LobbyAddPlayerFailed = 45
    Field Value
    Type Description
    short

    LobbyReadyToBegin

    Internal networking system message for communicating a player is ready in the lobby.

    Declaration
    public const short LobbyReadyToBegin = 43
    Field Value
    Type Description
    short

    LobbyReturnToLobby

    Internal networking system messages used to return the game to the lobby scene.

    Declaration
    public const short LobbyReturnToLobby = 46
    Field Value
    Type Description
    short

    LobbySceneLoaded

    Internal networking system message for communicating a lobby player has loaded the game scene.

    Declaration
    public const short LobbySceneLoaded = 44
    Field Value
    Type Description
    short

    LocalChildTransform

    Internal networking system message for sending tranforms for client object from client to server.

    Declaration
    public const short LocalChildTransform = 16
    Field Value
    Type Description
    short

    LocalClientAuthority

    Internal networking system message for setting authority to a client for an object.

    Declaration
    public const short LocalClientAuthority = 15
    Field Value
    Type Description
    short

    LocalPlayerTransform

    Internal networking system message for sending tranforms from client to server.

    Declaration
    public const short LocalPlayerTransform = 6
    Field Value
    Type Description
    short

    NetworkInfo

    Internal networking system message for sending information about network peers to clients.

    Declaration
    public const short NetworkInfo = 11
    Field Value
    Type Description
    short

    NotReady

    Internal networking system message for server to tell clients they are no longer ready.

    Can be used when switching scenes, to stop receiving network traffic during the switch.

    Declaration
    public const short NotReady = 36
    Field Value
    Type Description
    short

    ObjectDestroy

    Internal networking system message for destroying objects.

    Declaration
    public const short ObjectDestroy = 1
    Field Value
    Type Description
    short

    ObjectHide

    Internal networking system message for hiding objects.

    Declaration
    public const short ObjectHide = 13
    Field Value
    Type Description
    short

    ObjectSpawn

    Internal networking system message for spawning objects.

    Declaration
    public const short ObjectSpawn = 3
    Field Value
    Type Description
    short

    ObjectSpawnScene

    Internal networking system message for spawning scene objects.

    Declaration
    public const short ObjectSpawnScene = 10
    Field Value
    Type Description
    short

    Owner

    Internal networking system message for telling clients they own a player object.

    Declaration
    public const short Owner = 4
    Field Value
    Type Description
    short

    PeerClientAuthority

    Internal networking system message for sending information about changes in authority for non-player objects to clients.

    Declaration
    public const short PeerClientAuthority = 18
    Field Value
    Type Description
    short

    Ready

    Internal networking system message for clients to tell server they are ready.

    Declaration
    public const short Ready = 35
    Field Value
    Type Description
    short

    ReconnectPlayer

    Internal networking system message used when a client connects to the new host of a game.

    Declaration
    public const short ReconnectPlayer = 47
    Field Value
    Type Description
    short

    RemovePlayer

    Internal networking system message for removing a player object which was spawned for a client.

    Declaration
    public const short RemovePlayer = 38
    Field Value
    Type Description
    short

    Rpc

    Internal networking system message for sending a ClientRPC from server to client.

    Declaration
    public const short Rpc = 2
    Field Value
    Type Description
    short

    Scene

    Internal networking system message that tells clients which scene to load when they connect to a server.

    Declaration
    public const short Scene = 39
    Field Value
    Type Description
    short

    SpawnFinished

    Internal networking system messages used to tell when the initial contents of a scene is being spawned.

    Declaration
    public const short SpawnFinished = 12
    Field Value
    Type Description
    short

    SyncEvent

    Internal networking system message for sending a SyncEvent from server to client.

    Declaration
    public const short SyncEvent = 7
    Field Value
    Type Description
    short

    SyncList

    Internal networking system message for sending a USyncList generic list.

    Declaration
    public const short SyncList = 9
    Field Value
    Type Description
    short

    UpdateVars

    Internal networking system message for updating SyncVars on a client from a server.

    Declaration
    public const short UpdateVars = 8
    Field Value
    Type Description
    short

    Methods

    MsgTypeToString(short)

    Returns the name of internal message types by their id.

    Declaration
    public static string MsgTypeToString(short value)
    Parameters
    Type Name Description
    short value

    A internal message id value.

    Returns
    Type Description
    string

    The name of the internal message.

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