Class NetworkConfiguration
Configuration data for network handlers.
Inherited Members
Namespace: Unity.Services.Multiplayer
Assembly: Unity.Services.Multiplayer.dll
Syntax
public class NetworkConfiguration
Remarks
Used in StartAsync(NetworkConfiguration).
Properties
DirectNetworkListenAddress
Endpoint (IP address and port) to listen on.
Declaration
public NetworkEndpoint DirectNetworkListenAddress { get; }
Property Value
Type | Description |
---|---|
NetworkEndpoint |
Remarks
May differ from DirectNetworkPublishAddress but the ports must match. Only available when NetworkType is Direct.
DirectNetworkPublishAddress
Endpoint (IP address and port) to be used by connecting clients.
Declaration
public NetworkEndpoint DirectNetworkPublishAddress { get; }
Property Value
Type | Description |
---|---|
NetworkEndpoint |
Remarks
May differ from DirectNetworkListenAddress but the ports must match. Only available when NetworkType is Direct.
RelayClientData
Relay configuration data for a client.
Declaration
public RelayServerData RelayClientData { get; }
Property Value
Type | Description |
---|---|
RelayServerData |
Remarks
Not available when NetworkType is Direct.
RelayServerData
Relay configuration data for a host or server.
Declaration
public RelayServerData RelayServerData { get; }
Property Value
Type | Description |
---|---|
RelayServerData |
Remarks
Not available when NetworkType is Direct. Not available when Role is Client.
Role
Networking role for this session.
Declaration
public NetworkRole Role { get; }
Property Value
Type | Description |
---|---|
NetworkRole |
Remarks
Some flows, such as peer-to-peer matchmaking or CreateOrJoinAsync(string, SessionOptions), will randomly assign roles to players as being either a Client or a Host.
Type
The type of network to use for the session.
Declaration
public NetworkType Type { get; }
Property Value
Type | Description |
---|---|
NetworkType |
Methods
UpdatePublishPort(ushort)
Update the port for clients to connect to that will be shared through the session.
Declaration
public void UpdatePublishPort(ushort port)
Parameters
Type | Name | Description |
---|---|---|
ushort | port | The port for clients to connect to |