Stormancer.ClientConfiguration Class Reference

Configuration object for a Stormancer client. More...

Static Public Member Functions

static ClientConfiguration Create (string endpoint, string account, string application)
 Creates a ClientConfiguration object targeting the public online platform. More...
 

Public Attributes

bool HasPublicIp => !string.IsNullOrEmpty(DedicatedServerEndpoint)
 
string IpPort => DedicatedServerEndpoint + ":" + ServerGamePort
 

Properties

ushort ServerGamePort = 7777 [get]
 Local application port for direct communication with other clients, as P2P host or dedicated server. More...
 
bool IsLocalDev [get]
 A boolean value indicating if the client should try to connect to the local dev platform. More...
 
List< string > ServerEndpoints [get, set]
 A string containing the target server endpoint. More...
 
string Account [get]
 A string containing the account name of the application. More...
 
string Application [get]
 A string containing the name of the application. More...
 
ushort ClientSDKPort = 0 [get, set]
 Port that this client's stormancer transport socket should bind to. By default, set to 0 for automatic attribution. More...
 
bool EncryptionEnabled = false [get, set]
 Set whether the connection to the Stormancer server should be encrypted. More...
 
static bool AsynchrounousDispatch [get, set]
 Enable or disable the asynchrounous dispatch of received messages. More...
 
int PingInterval [get, set]
 The interval between successive ping requests, in milliseconds More...
 
TimeSpan DefaultTimeout = TimeSpan.FromMilliseconds(10000) [get]
 
Func< Task< AuthParameters > > TaskGetAuthParameters [get, set]
 
EndpointSelectionMode EndpointSelectionMode = EndpointSelectionMode.FALLBACK [get, set]
 
IPacketDispatcher Dispatcher [get, set]
 Gets or Sets the dispatcher to be used by the client. More...
 
Func< IDependencyResolver, ITransportTransportFactory [get, set]
 Gets or sets the transport to be used by the client. More...
 
List< ISerializerSerializers [get]
 List of available serializers for the client. More...
 
ushort MaxPeers [get, set]
 Maximum number of remote peers that can connect with this client. More...
 
ILogger Logger [get, set]
 
List< IClientPlugin > Plugins [get]
 
IScheduler Scheduler [get, set]
 The scheduler used by the client to run the transport and other repeated tasks. More...
 
string DedicatedServerEndpoint [get, set]
 If this stormancer client runs on a dedicated server, set this to the public IP of the server. This enables other clients to connect to it directly. More...
 
bool EnableNatPunchthrough = true [get, set]
 Disable or enable nat punch through on client side. More...
 
ushort TunnelPort = 0 [get, set]
 If using the P2P tunnel, set the port the tunnel will be bound to for clients. More...
 
SynchronizationContext SynchronizationContext [get, set]
 
bool IsSynchronizationContextSet [get]
 

Detailed Description

Configuration object for a Stormancer client.

Client configurations objects are often built using the FromAccount static method. The resulting object can be further customized afterwards.
For instance to target a custom Stormancer cluster change the ServerEndoint property to the http API endpoint of your custom cluster.

Member Function Documentation

◆ Create()

static ClientConfiguration Stormancer.ClientConfiguration.Create ( string  endpoint,
string  account,
string  application 
)
static

Creates a ClientConfiguration object targeting the public online platform.

Parameters
accountId of the target account
applicationName of the application the client will connect to.
Returns
A ClientConfiguration instance that enables connection to the application. The configuration can be modified afterwards.

Property Documentation

◆ Account

string Stormancer.ClientConfiguration.Account
get

A string containing the account name of the application.

◆ Application

string Stormancer.ClientConfiguration.Application
get

A string containing the name of the application.

◆ AsynchrounousDispatch

bool Stormancer.ClientConfiguration.AsynchrounousDispatch
staticgetset

Enable or disable the asynchrounous dispatch of received messages.

Asynchronous dispatch is enabled by default.

◆ ClientSDKPort

ushort Stormancer.ClientConfiguration.ClientSDKPort = 0
getset

Port that this client's stormancer transport socket should bind to. By default, set to 0 for automatic attribution.

◆ DedicatedServerEndpoint

string Stormancer.ClientConfiguration.DedicatedServerEndpoint
getset

If this stormancer client runs on a dedicated server, set this to the public IP of the server. This enables other clients to connect to it directly.

◆ Dispatcher

IPacketDispatcher Stormancer.ClientConfiguration.Dispatcher
getset

Gets or Sets the dispatcher to be used by the client.

◆ EnableNatPunchthrough

bool Stormancer.ClientConfiguration.EnableNatPunchthrough = true
getset

Disable or enable nat punch through on client side.

◆ EncryptionEnabled

bool Stormancer.ClientConfiguration.EncryptionEnabled = false
getset

Set whether the connection to the Stormancer server should be encrypted.

◆ IsLocalDev

bool Stormancer.ClientConfiguration.IsLocalDev
get

A boolean value indicating if the client should try to connect to the local dev platform.

◆ MaxPeers

ushort Stormancer.ClientConfiguration.MaxPeers
getset

Maximum number of remote peers that can connect with this client.

◆ PingInterval

int Stormancer.ClientConfiguration.PingInterval
getset

The interval between successive ping requests, in milliseconds

◆ Scheduler

IScheduler Stormancer.ClientConfiguration.Scheduler
getset

The scheduler used by the client to run the transport and other repeated tasks.

◆ Serializers

List<ISerializer> Stormancer.ClientConfiguration.Serializers
get

List of available serializers for the client.

When negotiating which serializer should be used for a given remote peer, the first compatible serializer in the list is the one prefered.

◆ ServerEndpoints

List<string> Stormancer.ClientConfiguration.ServerEndpoints
getset

A string containing the target server endpoint.

This value overrides the IsLocalDev property.

◆ ServerGamePort

ushort Stormancer.ClientConfiguration.ServerGamePort = 7777
get

Local application port for direct communication with other clients, as P2P host or dedicated server.

◆ TransportFactory

Func<IDependencyResolver, ITransport> Stormancer.ClientConfiguration.TransportFactory
getset

Gets or sets the transport to be used by the client.

◆ TunnelPort

ushort Stormancer.ClientConfiguration.TunnelPort = 0
getset

If using the P2P tunnel, set the port the tunnel will be bound to for clients.

This will have no effect on P2P hosts, as multiple clients can be connected to them.


The documentation for this class was generated from the following file:
  • Stormancer.Unity/Configuration/ClientConfiguration.cs