Skip to content

Commit 51ed068

Browse files
committed
docs(wiki): Updated wiki
1 parent b4f4a3b commit 51ed068

File tree

6 files changed

+25
-19
lines changed

6 files changed

+25
-19
lines changed

docs/_docs/advanced-topics/custom-transports.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,8 @@ title: Custom Transports
33
permalink: /wiki/custom-transports/
44
---
55

6-
The MLAPI supports custom transports. It uses UNET by default. You can also write custom transports. The MLAPI has a LiteNetLib transport example you can use (See the SampleTransports folder), or write your own one.
7-
8-
To do so, you need a class implementing the IUDPTransport interface. The flow works like this
9-
10-
GetSettings gets invoked, you can give it any object.
11-
12-
if Server, RegisterServerListenSocket get's invoked and gives the settings object.
6+
The MLAPI supports custom transports. It uses UNET by default. You can also write custom transports. A transport is the library that is responsible for sending the raw bytes and handle connections.
137

148
Usually, transports doesn't support support all channel types and event types. Sometimes they have more, in that case you manually have to do translation between them. See the LiteNetLib transport for examples.
159

16-
In order to use your own transport, you have to set the Transport to "Custom" and set the NetworkConfig NetworkTransport to your own transport. To get started writing transport interfaces, the current implementations for Unet and LiteNetLib are great starting points for learning their flow. If you do write a transport for a well known transport, feel free to open a PR to add it to the default supported.
10+
To get started writing transport interfaces, the current implementations for Unet and LiteNetLib are great starting points for learning their flow. If you do write a transport for a well known transport, feel free to open a PR to add it to the default supported.

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ private void Setup()
1313
NetworkingManager.Singleton.StartHost();
1414
}
1515

16-
private void ApprovalCheck(byte[] connectionData, uint clientId, MLAPI.NetworkingManager.ConnectionApprovedDelegate callback)
16+
private void ApprovalCheck(byte[] connectionData, ulong clientId, MLAPI.NetworkingManager.ConnectionApprovedDelegate callback)
1717
{
1818
//Your logic here
1919
bool approve = true;
@@ -24,6 +24,8 @@ private void ApprovalCheck(byte[] connectionData, uint clientId, MLAPI.Networkin
2424
callback(clientId, prefabHash, approve, positionToSpawnAt, rotationToSpawnWith);
2525
}
2626
```
27+
28+
2729
### Connection data
2830
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:
2931
```csharp
@@ -32,5 +34,13 @@ NetworkingManager.Singleton.StartClient();
3234
```
3335
The ConnectionData will then be passed to the server and it will decide if the client will be approved or not.
3436

35-
#### Security of connection data
36-
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.
37+
38+
### Timeout
39+
The MLAPI uses a callback system in order to allow for external validation. Forexample, you might have a steam authentication ticket sent as the ConnectionData (encrypted and authenticated by the MLAPI) that you want to validate against steams servers. This can take some time. If you don't call the callback method within the time specified in the ``ClientConnectionBufferTimeout`` configuration. The connection will be dropped. This time starts counting when the transport has told the MLAPI about the connection. This means that you cannot attack the MLAPI by never sending the buffer, it will still time you out.
40+
41+
42+
### Security
43+
If connection approval is enabled. Any messages sent before a connection is setup are silently ignored.
44+
45+
#### Connection Data
46+
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.

docs/_docs/getting-started/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The MLAPI comes with 3 main components
1818
##### MLAPI.dll
1919
This DLL's is the runtime portion. The actual library. This file is thus **required**. It comes in two variants. A "Lite" and a normal version. Most people will do fine with the full version. The Lite version has less features. At the time of writing the only difference is that it does not include encryption which adds better support on certain platforms. Note that the lite version might not be as stable as the full version and could contain additional bugs.
2020
##### MLAPI-Editor.unitypackage
21-
This unitypackage includes the source files for all the Editor scripts. The UnityPackage will automatically place these source files in the Editor folder to avoid it being included in a build. **While the MLAPI will function without this, it is not designed to work without the editor part and is thus recommended for all users**.
21+
This unitypackage includes the source files for all the Editor scripts. The UnityPackage will automatically place these source files in the Editor folder to avoid it being included in a build. **This is required**.
2222
##### MLAPI-Installer.unitypackage
2323
This unitypackage includes the source file for the installer. This component is totally optional. The Installer can help you manage versions. If you don't want to use the installer, you can simply place the MLAPI.dll and the Editor source files in your project and it will work just as well.
2424

docs/_docs/getting-started/library-initialization.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ title: Library Initialization
33
permalink: /wiki/library-initialization/
44
---
55

6-
Initializing the MLAPI is fairly simple. You need a GameObject with the NetworkingManager component added to it. The NetworkingManager class has a static singleton reference to itself making it easy to access from anywhere.
6+
Initializing the MLAPI is fairly simple. You need a GameObject with the NetworkingManager component added to it. The NetworkingManager class has a static singleton reference to itself making it easy to access from anywhere. The first configuration you have to do is to set the Transport. You can read more about Transports on the "Custom Transports" page.
7+
8+
79
To initialize the library. You have three options.
810

911
### Host mode
1012

11-
This mode runs a Server and a virtual Client connected to its own server.
13+
This mode runs a Server and a virtual Client connected to its own server. The virtual client has no real network connection to the server, but instead just talk via message queues. This makes the host both a Server and a Client in the same process.
1214

1315
Usage:
1416
```csharp
@@ -27,7 +29,7 @@ NetworkingManager.Singleton.StartClient();
2729

2830
### Server mode
2931

30-
This mode runs a Server which other Clients can connect to.
32+
This mode runs a Server which other Clients can connect to. It has no own client attached, and thus lack it's own player object and such. This is the "dedicated server" mode.
3133

3234
Usage:
3335
```csharp

docs/_docs/the-basics/messaging-system.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public float MyRpcWithReturnValue(float x, float y)
8080
```
8181

8282
#### Performance Example
83-
To use the performance mode, the RPC method require the following signature ``void (uint clientId, Stream readStream)`` and the sender is required to use the non generic Stream overload.
83+
To use the performance mode, the RPC method require the following signature ``void (ulong clientId, Stream readStream)`` and the sender is required to use the non generic Stream overload.
8484

8585
```csharp
8686
private void Update()
@@ -115,7 +115,7 @@ private void Update()
115115
}
116116

117117
[ServerRPC]
118-
private void MyServerRPC(uint clientId, Stream stream) //This signature is REQUIRED for the performance mode
118+
private void MyServerRPC(ulong clientId, Stream stream) //This signature is REQUIRED for the performance mode
119119
{
120120
using (PooledBitReader reader = PooledBitReader.Get(stream))
121121
{
@@ -126,7 +126,7 @@ private void MyServerRPC(uint clientId, Stream stream) //This signature is REQUI
126126
}
127127

128128
[ClientRPC]
129-
private void MyClientRPC(uint clientId, Stream stream) //This signature is REQUIRED for the performance mode
129+
private void MyClientRPC(ulong clientId, Stream stream) //This signature is REQUIRED for the performance mode
130130
{
131131
using (PooledBitReader reader = PooledBitReader.Get(stream))
132132
{

docs/_docs/the-basics/networkedvar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ If you want values to be synced only once (at spawn), the built-in containers se
3838
### Serialization
3939
Since the NetworkedVar class is a generic, editor serialization is NOT supported, it's only avalible through editor scripts for viewing the values. To get proper serialization. A clone of the NetworkedVar implementation has to be done for each type you wish to use. Ex: NetworkedVarInt where you replace all the usages of T with int.
4040

41-
The MLAPI provides a few default serializable implementations of the NetworkedVar, they are called NetworkedVar<TYPE> where "<TYPE>" is the type.
41+
The MLAPI provides a few default serializable implementations of the NetworkedVar, they are called NetworkedVar<TYPE> where "<TYPE>" is the type.

0 commit comments

Comments
 (0)