Connecting
There are several steps that need to happen before a client can join a room. Most of these can happen automatically using the default VelNetManager
script.
1. Connecting
First, the TCP connection to the server must be established. If this step fails, offline mode is activated. This step happens automatically on Play in VelNetManager
.
2. Logging in
void Login(string appName, string deviceId)
VelNetManager
automatically logs in after a connection has been established.
If onlyConnectToSameVersion
is true, VelNetManager
calls Login with:
- appName: $"{Application.productName}_{Application.version}"
- deviceId: Hash128.Compute(SystemInfo.deviceUniqueIdentifier + Application.productName).ToString()
- This guarantees a different deviceId per application per device
otherwise it uses just Application.productName
for the appName field.
3. Joining a room
void JoinRoom(string roomName)
VelNetManager.LeaveRoom()
method, or call JoinRoom("")
with an empty string for the room name.