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 NetworkUserRemarks
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:
IServiceAdapter.SignIn()returns aNetworkUser(e.g. from Unity Authentication).NetworkService.SignIn()stores it and packs it into aConnectionDatastruct.ConnectionDatais serialized as the Netcode connection payload (byte[]).On the host,
ConnectionDatais deserialized during connection approval to verify uniqueness.After approval, a
NetworkPlayeris created combining theNetworkUserwith theNetworkClient.
Properties
ID
The unique identifier assigned by the authentication service (e.g. Unity Authentication player ID).
Name
The user's display name.
Constructor
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
NetworkService — produces
NetworkUservia sign-inNetworkPlayer — wraps
NetworkUserwith aNetworkClientConnectionData — serializes
NetworkUserfor connection payloads
Last updated