Skip to content

Commit 5f474e5

Browse files
authored
docs: Update connection-approval.md (#366)
Give clarity what namespaces need to be included
1 parent 806b06d commit 5f474e5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/_docs/getting-started/connection-approval.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ During every new connection the MLAPI performs a handshake on top of the one(s)
77

88
However, when ConnectionApproval is true you are also required to provide a callback where you put your approval logic inside. (Server only) Example:
99
```csharp
10+
using MLAPI;
11+
using MLAPI.Spawning;
12+
1013
private void Setup()
1114
{
1215
NetworkingManager.Singleton.ConnectionApprovalCallback += ApprovalCheck;
@@ -31,6 +34,8 @@ private void ApprovalCheck(byte[] connectionData, ulong clientId, MLAPI.Networki
3134
### Connection data
3235
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:
3336
```csharp
37+
using MLAPI;
38+
3439
NetworkingManager.Singleton.NetworkConfig.ConnectionData = System.Text.Encoding.ASCII.GetBytes("room password");
3540
NetworkingManager.Singleton.StartClient();
3641
```
@@ -45,4 +50,4 @@ The MLAPI uses a callback system in order to allow for external validation. For
4550
If connection approval is enabled. Any messages sent before a connection is setup are silently ignored.
4651

4752
#### Connection Data
48-
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.
53+
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.

0 commit comments

Comments
 (0)