Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ We needed a networking library that allows us to [**launch our games**](https://
* Five flavors of [**Interest Management**](manual/interest-management/), and you can make your own custom version.
* Support for [**Additive Scenes**](manual/examples/) with Physics Isolation (battle instances, levels, etc.)
* Several complete [**Examples**](manual/examples/) included.
* Constant improvements and enhancements [**every month**](manual/general/changelog/)**.**
* Constant improvements and enhancements [**every month**](manual/general/changelog/).
* Full time support available in our [**Discord**](https://discord.gg/2BvnM4R).

## Unity Versions

We will follow Unity's support for **LTS releases**. Any version beyond those may work, but you're on your own, especially with regard to preview / beta versions.
We will follow Unity's support for **LTS releases**. Any version beyond those may work, but you're on your own, especially with regard to preview / beta versions.

At the moment, we recommend using Unity 2020 or 2021 LTS releases.

Expand Down
2 changes: 1 addition & 1 deletion community-guides/ios-appstore-udp.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Add it to the app provisioning, then add the capability to the app itself, makin
Latest versions may need this: Add NSLocalNetworkUsageDescription to the info.plist.

\
Note: If LAN Broadcasting does not work, try another address, for example, change 0.0.0.0 to 255.255.255.255 (remember to rebuild after changing)
Note: If LAN Broadcasting does not work, try another address, for example, change 0.0.0.0 to 255.255.255.255 (remember to rebuild after changing).

This should get Network Discovery features working, Kudos to overmatch-iman, Sylvain and other Discord users for reporting back the working steps.

2 changes: 1 addition & 1 deletion community-guides/quick-start-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ void CmdShootRay()
[ClientRpc]
void RpcFireWeapon()
{
//bulletAudio.Play(); muzzleflash etc
//bulletAudio.Play(); muzzleflash etc.
GameObject bullet = Instantiate(activeWeapon.weaponBullet, activeWeapon.weaponFirePosition.position, activeWeapon.weaponFirePosition.rotation);
bullet.GetComponent<Rigidbody>().velocity = bullet.transform.forward * activeWeapon.weaponSpeed;
Destroy(bullet, activeWeapon.weaponLife);
Expand Down
2 changes: 1 addition & 1 deletion community-guides/ready-up-and-die.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void Awake()
public override void OnStartLocalPlayer()
{
// local player sets reference to scene scripts variable, so they can communicate with each other
// you could also use regular Start() and if( isLocalPlayer ) { } instead of OnStartLocalPlayer()
// you could also use regular Start() and if( isLocalPlayer ) { } instead of OnStartLocalPlayer()
sceneScript.playerScript = this;
sceneScript.SetupScene();
}
Expand Down
2 changes: 1 addition & 1 deletion community-guides/video-tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
* [**Recreating 'Among Us' by Lignus**](https://www.youtube.com/watch?v=j5ja-pKz05A) **-** A tutorial using Unity and Mirror to recreate the famous game.

\
(Tip: Do not speak these Languages? Set Youtube captions to on, and Auto Translate -> Your Language)
(Tip: Do not speak these Languages? Set Youtube captions to on, and Auto Translate -> Your Language)
2 changes: 1 addition & 1 deletion hosting/edgegap-hosting-plugin-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Return to the plugin and select **Build Server** to start the build process. You

**3. Containerize your Game Server**

First, make sure Docker is running by selecting **Validate**. You should see “Docker is running” in green.
First, make sure Docker is running by selecting **Validate**. You should see “Docker is running” in green.

While you may want to change the image name, build path, and tags in the future, we recommend skipping this entirely and select **Containerize with Docker** button to start the containerization process.&#x20;

Expand Down
2 changes: 1 addition & 1 deletion hosting/server-hosting/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Nothing has to be changed. Keep it default. Click on **"Next: Configure Security
Create a new security group and you can give it your own name and description. Add the following rules:

* RDP with source "Anywhere", Description can be whatever but put it as Remote Desktop Program.
* Custom TCP Rule with port 7777 and source "Anywhere", Description can be whatever but put it as Mirror. (If KCP is on your NetworkManager, unblock UDP, not TCP)
* Custom TCP Rule with port 7777 and source "Anywhere", Description can be whatever but put it as Mirror. (If KCP is on your NetworkManager, unblock UDP, not TCP)
* SSH with source "Anywhere", Description can be whatever but put it as SSH.

SSH is not strictly necessary but can be used to remote connect to it through other means than the RDP.
Expand Down
4 changes: 2 additions & 2 deletions manual/components/network-authenticators/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ When you have a multiplayer game, often you need to store information about your

## Encryption Notice <a href="#encryption-notice" id="encryption-notice"></a>

Few of the available transports support encryption, so if you want to do authentication through Mirror, we highly recommend you use a transport that does, e.g. [SimpleWebSocket ](https://mirror-networking.gitbook.io/docs/transports/websockets-transport)Transport, or carry out your exchange of sensitive data using UnityWebRequest with a service over HTTPS. This can be done inside an Authenticator, or before calling `StartClient`.
Few of the available transports support encryption, so if you want to do authentication through Mirror, we highly recommend you use a transport that does, e.g. [SimpleWebSocket ](https://mirror-networking.gitbook.io/docs/transports/websockets-transport)Transport, or carry out your exchange of sensitive data using UnityWebRequest with a service over HTTPS. This can be done inside an Authenticator, or before calling `StartClient`.

## Offline / Online Scenes

Authentication takes place in the Offline scene, and messages are exchanged with the game server in a pre-connect phase, so client stays in the Offline scene until authentication completes.

## Persisting Data

`NetworkConnection` has an **`authenticationData`** property of type `Object` that can be set to pretty much anything you need, such as account id's, tokens, character selection, etc., including a struct of data, on the server and/or client during the authentication process. That data is available everywhere else in Mirror where you have the client's `NetworkConnection`...just cast it back to whatever type you put into it.
`NetworkConnection` has an **`authenticationData`** property of type `Object` that can be set to pretty much anything you need, such as account id's, tokens, character selection, etc., including a struct of data, on the server and/or client during the authentication process. That data is available everywhere else in Mirror where you have the client's `NetworkConnection`...just cast it back to whatever type you put into it.

## Built-in Authenticators <a href="#basic-authenticator" id="basic-authenticator"></a>

Expand Down
4 changes: 2 additions & 2 deletions manual/components/network-discovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class NewNetworkDiscovery: NetworkDiscoveryBase

protected override DiscoveryResponse ProcessRequest(DiscoveryRequest request, IPEndPoint endpoint)
{
// TODO: Create your response and return it
// TODO: Create your response and return it
return new DiscoveryResponse();
}

Expand All @@ -111,7 +111,7 @@ public class NewNetworkDiscovery: NetworkDiscoveryBase

protected override void ProcessResponse(DiscoveryResponse response, IPEndPoint endpoint)
{
// TODO: a server replied, do something with the response such as invoking a unityevent
// TODO: a server replied, do something with the response such as invoking a unityevent
}

#endregion
Expand Down
2 changes: 1 addition & 1 deletion manual/components/network-manager.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Network Manager

The Network Manager is a component for managing the networking aspects of a multiplayer game. It wraps up a lot of useful functionality into a single place, and makes creating, running and debugging multiplayer games as simple as possible.
The Network Manager is a component for managing the networking aspects of a multiplayer game. It wraps up a lot of useful functionality into a single place, and makes creating, running and debugging multiplayer games as simple as possible.

The Network Manager features include:

Expand Down
2 changes: 1 addition & 1 deletion manual/examples/additive-levels.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Next, add a Player and Portal Layer to Project Settings under Tags and Layers:
Finally, open the Offline scene, and click Play in the editor, and click Host in the HUD.

* Player controls are WASD+QE to move and turn.
* Move into the Portal in the corner with a scene label over it. Your player will be changed to the other level scene.
* Move into the Portal in the corner with a scene label over it. Your player will be changed to the other level scene.
* Move into the Portal in the corner of the 2nd scene, and your player will be changed back to the first scene

If you make a build and start two or more instances (one as Host or Server, the other(s) as clients, and move each one, you'll see that only players in the same level can see and collide with each other.
2 changes: 1 addition & 1 deletion manual/examples/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public event System.Action<Color32> OnPlayerColorChanged;
public event System.Action<int> OnPlayerDataChanged;
```

When the Player object is spawned on the client, a `PlayerUI` is instantiated as a child of the `PlayersPanel` in the Canvas via the references provided in the `CanvasUI` script, and the `SetPlayer` method is called with the corresponding Player script reference. The `PlayerUI` script subscribes to the events above, and updates its UI elements as the `SyncVars` are updated from the server.
When the Player object is spawned on the client, a `PlayerUI` is instantiated as a child of the `PlayersPanel` in the Canvas via the references provided in the `CanvasUI` script, and the `SetPlayer` method is called with the corresponding Player script reference. The `PlayerUI` script subscribes to the events above, and updates its UI elements as the `SyncVars` are updated from the server.
8 changes: 4 additions & 4 deletions manual/examples/room.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The hotel staff gets annoyed if you party in the Lobby, they'll tell you to get
Mirror's Room system is intended to be the "next step" after a separate Lobby service, typically a master server with match making and game server launching features.

{% hint style="warning" %}
Note that Mirror's Room system is not designed to allow late joiners / spectators once the game has started. If you need these features, you're better off making your game based on Additive Scenes instead.
Note that Mirror's Room system is not designed to allow late joiners / spectators once the game has started. If you need these features, you're better off making your game based on Additive Scenes instead.
{% endhint %}

## Initial Setup
Expand All @@ -26,7 +26,7 @@ The typical setup involves 3 scenes:
To make your own game with the Room system, we have [Script Templates](../general/script-templates.md) to get you started.
{% endhint %}

1. Create 3 empty scenes: Offline, Room, Game. You can use your own game scene for Game scene if you already have one.
1. Create 3 empty scenes: Offline, Room, Game. You can use your own game scene for Game scene if you already have one.
2. In both the Offline and Room scenes, delete the Directional Light, and change the Clear Flags setting in the Main Camera to Solid Color (to make the default UI easier to see).
3. From the Script Templates, create your own Network Room Manager and Network Room Player scripts.
4. In the Offline scene, create an empty game object called `RoomPlayer` and attach the Network Room Player script you just created, then make a prefab of this object and delete it from the scene.
Expand All @@ -42,11 +42,11 @@ To make your own game with the Room system, we have [Script Templates](../genera
9. With the Offline scene open, click Play, and then Host button in the HUD
10. Start one or more built clients and click Client in the HUD for each one.
11. When all clients have clicked their respective Ready buttons, the Game scene will be loaded for everyone.
12. In the Game scene, the Host client will see a Return to Room button that will take everyone back to the Room scene to start another game with the same players. Room Player objects do nothing in the Game scene, but are not destroyed so that when returning to the Room scene they'll be intact.
12. In the Game scene, the Host client will see a Return to Room button that will take everyone back to the Room scene to start another game with the same players. Room Player objects do nothing in the Game scene, but are not destroyed so that when returning to the Room scene they'll be intact.

## Next Steps

Review the stubbed out overrides in the Network Room Manager and Network Room Player scripts you created from the templates. They're heavily commented on what they're to be used for.
Review the stubbed out overrides in the Network Room Manager and Network Room Player scripts you created from the templates. They're heavily commented on what they're to be used for.

You can turn off the default UI in the Network Room Manager and Network Room Player inspectors by unchecking the Show Room UI checkbox, and then make your own UI for the Room scene.

Expand Down
22 changes: 11 additions & 11 deletions manual/general/changelog/2021-change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Mirror uses semantic versioning, and the versions shown here are those that were
* Fixed: `NetworkManager.StopClient` no longer fires twice in certain cases.
* Fixed: `NetworkMatch` was missing attributes.
* Changed: `NetworkLoop` static class is now public.
* Changed: `NetworkConnection.observing` is now public.
* Changed: `NetworkConnection.observing` is now public.

Changed: `NetworkTransformV2` default values updated. `interpolateScale` also defaults to `false` now.
* Changed: `NetworkTransformV2` default values updated. `interpolateScale` also defaults to `false` now.
* Changed: `NetworkTransformV2` `isClientAuthority` now `protected` instead of `private`.
* Changed: Examples using `NetworkTransformV2` now using default values.
* Changed: Updated `NetworkManager` Script Template.
Expand Down Expand Up @@ -53,11 +53,11 @@ Mirror uses semantic versioning, and the versions shown here are those that were

## [v44.0.2](https://github.com/MirrorNetworking/Mirror/releases/tag/v44.0.2) -- 2021-Aug-08

* Added: Scene Interest Management. Put this on Network Manager and remove all Network Scene Checker components.
* Added: Match Interest Management. Put this on Network Manager and replace Network Match Checker with new Network Match component.
* Added: Scene Interest Management. Put this on Network Manager and remove all Network Scene Checker components.
* Added: Match Interest Management. Put this on Network Manager and replace Network Match Checker with new Network Match component.
* Added: Interest Management now has `OnSpawned` / `OnDestroyed` events.
* Added: Network Transform V2 with Snapshot Interpolation.
* Added: Network Transport exception events that transports can raise to Network Manager's `OnServerError` and `OnClientError` overrides. Transports still need to implement their part.
* Added: Network Transport exception events that transports can raise to Network Manager's `OnServerError` and `OnClientError` overrides. Transports still need to implement their part.
* Added: `ZigZag VarInt` added back to Compression module.
* Fixed: Network Discovery HUD now calls `StopDiscovery` when stopping server/host/client.
* Fixed: `NetworkTime.lastPingTime` is now reset properly.
Expand Down Expand Up @@ -141,10 +141,10 @@ Mirror uses semantic versioning, and the versions shown here are those that were
* Fixed: Client Shutdown is no longer run twice via user code calling `StopClient`.
* Fixed: `SyncVar` field label not shown in Unity 2020 versions (Unity bug).
* Changed: Network Manager `OnServerAddPlayer` now adds the connection id to the object name (on the server only, not synced to clients).
* Changed: Several fields in `NetworkTime` were renamed. The previous field names are still there and **obsolete** and will be removed in a later version.
* Changed: Most of `ClientScene` is now **obsolete**, use same or similar properties in `NetworkClient` instead. `ClientScene` will be fully deprecated and removed in a later version.
* Changed: `NetworkClient.RegisterHandler` overload that included a `NetworkConnection` is now **obsolete** and will be removed in a later version. Handlers can use `NetworkClient.connection` directly.
* Changed: Channel constants names were shortened. The original constants are still there and **obsolete**, and will be removed in a later version.
* Changed: Several fields in `NetworkTime` were renamed. The previous field names are still there and **obsolete** and will be removed in a later version.
* Changed: Most of `ClientScene` is now **obsolete**, use same or similar properties in `NetworkClient` instead. `ClientScene` will be fully deprecated and removed in a later version.
* Changed: `NetworkClient.RegisterHandler` overload that included a `NetworkConnection` is now **obsolete** and will be removed in a later version. Handlers can use `NetworkClient.connection` directly.
* Changed: Channel constants names were shortened. The original constants are still there and **obsolete**, and will be removed in a later version.
* **Breaking**: Minimum supported Unity version is now 2019.4.x LTS.
* **Breaking**: `ClientScene.onLocalPlayerChanged` removed.
* **Breaking**: Compiler symbols culled to Mirror 17 and later versions.
Expand All @@ -155,7 +155,7 @@ Mirror uses semantic versioning, and the versions shown here are those that were
* Added: Global Interest Management. This may eventually lead to replacement of Scene Checker, Match Checker, and Owner Checker components.
* Added: GUI Console ported from uMMORPG (F12 to show/hide).
* Added: Network Manager now takes itself out of DDOL in `StopServer` / `StopClient` when offline scene is defined to avoid singleton collision.
* Added: Message batching. Enable in Network Manager.
* Added: Message batching. Enable in Network Manager.
* Added: Custom Player Loop:
* `NetworkEarlyUpdate` (before any Update/FixedUpdate)
* `NetworkLateUpdate` (after any Update/FixedUpdate/LateUpdate) loops
Expand All @@ -179,7 +179,7 @@ Mirror uses semantic versioning, and the versions shown here are those that were
* Fixed: Telepathy 1.6 fixes data races and improves stability.
* Fixed: KCP 1.8 fixes empty message sending / receiving undefined behaviour and fixes IPv6 on Nintendo Switch.
* Changed: Network Manager default max connections is now 100.
* **Breaking**: `NetworkServer` / `NetworkClient` don't use Connect/Disconnect messages any more. Connect/Disconnect events are raised by the transport instead.
* **Breaking**: `NetworkServer` / `NetworkClient` don't use Connect/Disconnect messages any more. Connect/Disconnect events are raised by the transport instead.
* **Breaking**: `OnServerError` / `OnClientError` removed since no transport ever implemented them.
* **Breaking** Removed `NetworkConnection.InvokeHandler` as no longer needed.

Expand Down
Loading