ObjectNet uses two connections to work, a Server connection and a Client connection. The server connection is the network instance that runs on the server side to handle all connected clients, on the other hand, the client connection is the entity used to enter into a game as invited.
Server Connection : TCP/UDP Socket used on the server side to accept all incoming data on the server side.
Client Connection : TCP/UDP connection used to enter into a server as client.
Server Connection is a mode running on instances directly as server, this option shall be used on build to run server only on Authoritative or Relay server modes. This option can also be used to run a server on any mode designed by the developer.
Server mode allow to select how to listen for incoming connections over network, depending how you host you server you may need a different type of binding ( see Server Connection )
Client Connection is a mode running on instances directly as client, this option shall be used on game compiled to run client-only instances. A game compiled with Client Connection needs a server to connect to.
Client connections allow to statically or dynamic select the IP address where server is located ( see Client Connection)
Manual Mode is a mode used to let the client decide which mode he wishes to run after the game starts. This option shall be used when the user needs to run the Server on the Client depending on how he wishes to run, is commonly used to run embedded mode where the same player is Server and Client at the same time.
Connect On Start
The option "Connect on Start" starts the socket connection automatically when the game is started.
This option is useful and mandatory when a dedicated server is built for Authoritative and Relay modes, otherwise, the server will not be started.
Auto Reconnect
ObjectNet allows to clients auto-reconnect on the server when the connection is lost. This option can be enabled by checking the "Auto Reconnect" option.
When activated, the client will try to reconnect at the server after the time defined on the "Reconnection Interval" configuration.
Once disconnection is detected on the client side, the system will wait the amount of time defined on "Reconnection Interval" before trying to reconnect, and in case of failure will try this again up to reconnecting is established..
During the re-connection procedure, the system will try to reconnect a certain number of times before stopping re-connection, this can be configured on the "Reconnection Attempts" slider.
Don't Block UI
The option "Don't Block UI" starts the socket connection into a separate coroutine to avoid blocking user interact operations.
This option should be used if some connection process UI will be displayed to the user, otherwise, UI will freeze while the connection process is in progress.
Detect server restart
ObjectNet provides a facility to clients detect when the server is restarted. This can be useful to finish the game on the client side when the client reconnects after the server is restarted.
ObjectNet can bring the player back restoring all player status after the connection is the player reconnects after being released from the server side, nonetheless, this can't be done if the server restarts due to the fact that the server lost all game status. In this case, the client needs to leave the match is a server restart if detected.
You can Detect server restart by checking the option on NetworkManager.
When activated, an event will be raised when a server restart is detected. This event can be caught on NetworkEventsManager or by the API method OnServerRestarted on NetworkTransport class ( see API reference to more information's ).
Disconnect Detection
ObjectNet allows users to decide how much time the server will take to detect when the client disconnects from the server. This option can be useful to not disconnect the client when the connection is lost and reconnected in a short period of time due to some network problem.
ObjectNet when using OnlineObjectTranport implements a keep-alive message to detect if the client is still connected to the server, when this message does not arrive after this period of time the system assumes that this client was disconnected.
To update this value you need to slide the horizontal according to the desired value, and each unity represents 1 second on time.