Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/_docs/getting-started/connection-approval.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ During every new connection the MLAPI performs a handshake on top of the one(s)

However, when ConnectionApproval is true you are also required to provide a callback where you put your approval logic inside. (Server only) Example:
```csharp
using MLAPI;
using MLAPI.Spawning;

private void Setup()
{
NetworkingManager.Singleton.ConnectionApprovalCallback += ApprovalCheck;
Expand All @@ -29,6 +32,8 @@ private void ApprovalCheck(byte[] connectionData, ulong clientId, MLAPI.Networki
### Connection data
The connectionData parameter is any custom data of your choice that the client should send to the server. Usually, this should be some sort of ticket, room password or similar that will decide if a connection should be approved or not. The connectionData is specified on the Client side in the NetworkingConfig supplied when connecting. Example:
```csharp
using MLAPI;

NetworkingManager.Singleton.NetworkConfig.ConnectionData = System.Text.Encoding.ASCII.GetBytes("room password");
NetworkingManager.Singleton.StartClient();
```
Expand All @@ -43,4 +48,4 @@ The MLAPI uses a callback system in order to allow for external validation. For
If connection approval is enabled. Any messages sent before a connection is setup are silently ignored.

#### Connection Data
If Encryption is enabled, the connection handshake with the buffer will be encrypted AND authenticated. (AES-256 encryption and HMAC-SHA-256 authentication). Please note that if the key exchange is not signed, a man in the middle attack can be done. If you plan on sending authentication tokens such as steam tickets. It's strongly suggested that you sign the handshake.
If Encryption is enabled, the connection handshake with the buffer will be encrypted AND authenticated. (AES-256 encryption and HMAC-SHA-256 authentication). Please note that if the key exchange is not signed, a man in the middle attack can be done. If you plan on sending authentication tokens such as steam tickets. It's strongly suggested that you sign the handshake.