Skip to main content

NetworkingSettings

A class in Root.Township, Alta.Networking.

Global networking settings: transport (KCP) settings, channels and send and receive limits.

Constructors​

MemberWhat it is
NetworkingSettings()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

13 private and internal fields
MemberWhat it is
private ConnectionChannel[] channelsBacking field for Channels, the connection channels.
private ConnectionConfig connectionConfigurationBacking field for ConnectionConfiguration.
private TransportSystem currentTransportSystemTransport chosen by SetTransportSystem.
private ConnectionChannel defaultChannelBacking field for DefaultChannel.
private readonly TransportSystem defaultNetworkTransportTransport used when the server info has no override: KCP.
private KcpSettings kcpSettingsBacking field for KcpSettings.
private static Logger LoggerLogger for transport selection messages.
private uint maxBitsPerSerializationMessageBit limit for one entity sync message (default 1300); SceneSerializer stops adding entities past it.
private int maxConnectionQueueSizeOutgoing queue size per connection above which further packets are held back for the frame.
private int maxServerQueueSizeOutgoing queue size for the whole socket above which packets are held back for the frame.
private int maxUnreliableReceivedPerFrameSize of the server's per-connection unreliable buffer (default 100); older unreliable packets in a frame are dropped.
private GlobalConfig networkConfigurationBacking field for NetworkConfiguration.
private bool simulateNoInternetInEditorEditor only: makes SimulateNoInternet true.

Properties​

MemberWhat it is
ConnectionChannel[] Channels { get; }All channels to create on the transport.
ConnectionConfig ConnectionConfiguration { get; }Unity network connection config. Its channel list is cleared on start.
ConnectionChannel DefaultChannel { get; }Channel used when none is given.
KcpSettings KcpSettings { get; }Settings for the KCP transport.
uint MaxBitsPerSerializationMessage { get; }Size limit for one entity serialization message, in bits. 1300 by default.
int MaxConnectionQueueSize { get; }Outgoing queue size per connection at which sends start being dropped.
int MaxServerQueueSize { get; }Outgoing queue size across the socket at which sends start being dropped.
int MaxUnreliableReceivedPerFrame { get; }Most unreliable messages the server handles per connection each frame. 100 by default.
GlobalConfig NetworkConfiguration { get; }Unity network global config (older UNET settings).
bool SimulateNoInternet { get; }Editor only: pretend there's no internet.
TransportSystem TransportSystem { get; }The transport chosen for this run.

Methods​

MemberWhat it is
TransportSystem GetTransportSystem(GameServerInfo serverInfo)The transport a server asks for, or KCP if it doesn't say.
void SetTransportSystem(TransportSystem transport)Sets the transport for this run and logs it.

Used in​

Members of other types that take, return or hold a NetworkingSettings: