PlayerLeftMessage

Network-serializable message struct broadcast by the session host to all remaining clients when a player leaves the session. Carries the departing player's identity and client information.

Definition

Namespace: Paragon.Core.Network Assembly: Paragon.dll

public struct PlayerLeftMessage : INetworkSerializable

Implements: INetworkSerializable

Remarks

This message is sent by the host inside NetworkSession.OnPlayerLeft() when a client disconnects. On the receiving end, NetworkSession.OnPlayerLeftMessage() deserializes the message and removes the player from the local player set.

The serialization format is identical to PlayerJoinedMessage: the three NetworkPlayer fields are written manually and the NetworkClient reference is resolved on deserialization.

Properties

Player

public NetworkPlayer Player { get; }

The player that left the session.

Constructor

Parameter
Type
Description

player

NetworkPlayer

The player that left

Methods

NetworkSerialize<T>

Serializes or deserializes the player data to/from a network buffer.

Write order:

  1. player.UserID (string)

  2. player.UserName (string)

  3. player.ClientID (ulong)

Read reconstruction: Creates a NetworkUser from the deserialized ID and name, then looks up the NetworkClient via NetworkManager.API.ConnectedClients[clientId] to construct a full NetworkPlayer.

See Also

Last updated