NetworkUser

Immutable record representing an authenticated user identity within the network service layer. Contains a unique service ID and a display name. Produced by IServiceAdapter.SignIn() and used throughout the networking layer to identify players.

Definition

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

public record NetworkUser

Remarks

NetworkUser is a C# record type, providing value-based equality by default. Two NetworkUser instances with the same ID and Name are considered equal.

The user identity flows through the networking layer as follows:

  1. IServiceAdapter.SignIn() returns a NetworkUser (e.g. from Unity Authentication).

  2. NetworkService.SignIn() stores it and packs it into a ConnectionData struct.

  3. ConnectionData is serialized as the Netcode connection payload (byte[]).

  4. On the host, ConnectionData is deserialized during connection approval to verify uniqueness.

  5. After approval, a NetworkPlayer is created combining the NetworkUser with the NetworkClient.

Properties

ID

The unique identifier assigned by the authentication service (e.g. Unity Authentication player ID).

Name

The user's display name.

Constructor

Parameter
Type
Description

id

string

Unique service identifier

name

string

Display name

Methods

ToString

Returns a formatted string with the user's ID and name.

Returns: "ID: {ID}, Name: {Name}"

Examples

Creating a NetworkUser

Accessing via NetworkService

See Also

Last updated