Class MsgType | Multiplayer HLAPI | 1.0.8
docs.unity3d.com
    Show / Hide Table of Contents

    Class MsgType

    Container class for networking system built-in message types.

    Inheritance
    Object
    MsgType
    Namespace: UnityEngine.Networking
    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
    Int16

    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
    Int16

    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
    Int16

    AnimationTrigger

    Internal networking system message for sending animation triggers.

    Used by the NetworkAnimation component.

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

    Command

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

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

    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
    Int16

    CRC

    Internal networking system message for HLAPI CRC checking.

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

    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
    Int16

    Error

    Internal networking system message for communicating an error.

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

    Fragment

    Internal networking system message for identifying fragmented packets.

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

    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
    Int16

    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
    Int16

    LobbyAddPlayerFailed

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

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

    LobbyReadyToBegin

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

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

    LobbyReturnToLobby

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

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

    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
    Int16

    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
    Int16

    LocalClientAuthority

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

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

    LocalPlayerTransform

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

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

    NetworkInfo

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

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

    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
    Int16

    ObjectDestroy

    Internal networking system message for destroying objects.

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

    ObjectHide

    Internal networking system message for hiding objects.

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

    ObjectSpawn

    Internal networking system message for spawning objects.

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

    ObjectSpawnScene

    Internal networking system message for spawning scene objects.

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

    Owner

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

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

    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
    Int16

    Ready

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

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

    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
    Int16

    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
    Int16

    Rpc

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

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

    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
    Int16

    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
    Int16

    SyncEvent

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

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

    SyncList

    Internal networking system message for sending a USyncList generic list.

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

    UpdateVars

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

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

    Methods

    MsgTypeToString(Int16)

    Returns the name of internal message types by their id.

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

    A internal message id value.

    Returns
    Type Description
    String

    The name of the internal message.

    In This Article
    • Fields
      • AddPlayer
      • Animation
      • AnimationParameters
      • AnimationTrigger
      • Command
      • Connect
      • CRC
      • Disconnect
      • Error
      • Fragment
      • Highest
      • InternalHighest
      • LobbyAddPlayerFailed
      • LobbyReadyToBegin
      • LobbyReturnToLobby
      • LobbySceneLoaded
      • LocalChildTransform
      • LocalClientAuthority
      • LocalPlayerTransform
      • NetworkInfo
      • NotReady
      • ObjectDestroy
      • ObjectHide
      • ObjectSpawn
      • ObjectSpawnScene
      • Owner
      • PeerClientAuthority
      • Ready
      • ReconnectPlayer
      • RemovePlayer
      • Rpc
      • Scene
      • SpawnFinished
      • SyncEvent
      • SyncList
      • UpdateVars
    • Methods
      • MsgTypeToString(Int16)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023