mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Doc for replacing playerController with identity
This commit is contained in:
parent
6e4409b786
commit
8db08002d5
@ -1,31 +1,34 @@
|
||||
# Deprecations
|
||||
|
||||
Certain features of Unity Networking were removed from Mirror for various reasons.
|
||||
This page will identify all removed features, the reason for removal, and possible alternatives.
|
||||
Certain features of Unity Networking were removed from Mirror for various reasons. This page will identify all removed features, the reason for removal, and possible alternatives.
|
||||
|
||||
## Match Namespace
|
||||
|
||||
As part of the Unity Services, this entire namespace was removed. It didn't work well to begin with, and was incredibly complex to be part of the core networking package. We expect this, along with other back-end services, will be provided through standalone apps that have integration to Mirror.
|
||||
As part of the Unity Services, this entire namespace was removed. It didn't work well to begin with, and was incredibly complex to be part of the core networking package. We expect this, along with other back-end services, will be provided through standalone apps that have integration to Mirror.
|
||||
|
||||
## Network Discovery
|
||||
|
||||
NetworkDiscovery was a UNet component intended for UDP projects. Since Mirror was built on TCP, it was removed. Now that all [transports](../Transports/index.md) are separate components, Discovery has been reimplemented in at least one of them.
|
||||
NetworkDiscovery was a UNet component intended for UDP projects. Since Mirror was built on TCP, it was removed. Now that all [transports](../Transports/index.md) are separate components, Discovery has been re-implemented in at least one of them.
|
||||
|
||||
## networkPort in Network Manager
|
||||
|
||||
Network Manager's `networkPort` property was removed now that all transports are separate components. Not all transports use ports, but those that do have a field for it. See [Transports](../Transports/index.md) for more info.
|
||||
Network Manager's `networkPort` property was removed now that all transports are separate components. Not all transports use ports, but those that do have a field for it. See [Transports](../Transports/index.md) for more info.
|
||||
|
||||
## Network Server Simple
|
||||
## playerController in NetworkConnection
|
||||
|
||||
This was too complex and impractical to maintain for what little it did, and was removed. There are much easier ways to make a basic listen server, with or without one of our transports.
|
||||
This was renamed to `identity` since that's what it is: the `NetworkIdentity` for the connection. If you need to convert a project after this change, Visual Studio / VS Code can help...read more here.
|
||||
|
||||
## Network Server Simple
|
||||
|
||||
This was too complex and impractical to maintain for what little it did, and was removed. There are much easier ways to make a basic listen server, with or without one of our transports.
|
||||
|
||||
## Couch Co-Op
|
||||
|
||||
The core networking was greatly simplified by removing this low-hanging fruit. It was buggy, and too convoluted to be worth fixing.
|
||||
The core networking was greatly simplified by removing this low-hanging fruit. It was buggy, and too convoluted to be worth fixing. For those that need something like this, consider defining a non-visible player prefab as a message conduit that spawns actual player prefabs with client authority. All inputs would route through the conduit prefab to control the player objects.
|
||||
|
||||
## Network Transform
|
||||
|
||||
This component was significantly simplified so that it only syncs position and rotation. Rigidbody support was removed. We will create a new separate compontent for NetworkRigidbody that will be server authoritative with physics simulation and interpolation.
|
||||
This component was significantly simplified so that it only syncs position and rotation. Rigidbody support was removed. We will create a new separate component for NetworkRigidbody that will be server authoritative with physics simulation and interpolation.
|
||||
|
||||
## Quality of Service Flags
|
||||
|
||||
@ -34,8 +37,9 @@ In classic UNET, QoS Flags were used to determine how packets got to the remote
|
||||
In Mirror, QoS flags were replaced with a "Channels" system. This system paves the way for future Mirror improvements, so you can send data on different channels - for example, you could have all game activity on channel 0, while in-game text chat is sent on channel 1 and voice chat is sent on channel 2. In the future, it may be possible to assign a transport system per channel, allowing one to have a TCP transport for critical game network data on channel 0, while in-game text and voice chat is running on a UDP transport in parallel on channel 1. Some transports (such as Ignorance.md) also provide legacy compatibility for those attached to QoS flags.
|
||||
|
||||
The currently defined channels are:
|
||||
- Channels.DefaultReliable = 0
|
||||
- Channels.DefaultUnreliable = 1
|
||||
|
||||
- `Channels.DefaultReliable = 0`
|
||||
|
||||
- `Channels.DefaultUnreliable = 1`
|
||||
|
||||
Currently, Mirror using it's default TCP transport will always send everything over a reliable channel. There is no way to bypass this behaviour without using a third-party transport, since TCP is always reliable. Other transports may support other channel sending methods.
|
||||
|
||||
|
37
doc/articles/General/PlayerControllerToIdentity.md
Normal file
37
doc/articles/General/PlayerControllerToIdentity.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Changing playerController to identity
|
||||
|
||||
If you need to fix up a project after `NetworkConnection.playerController` was changed to `identity` these instructions should be helpful.
|
||||
|
||||
Open your Unity project and look for Assets/Mirror/Runtime/**NetworkConnection**:
|
||||
|
||||
![Project window in Unity](pc2i-1.png)
|
||||
|
||||
Open this file in Visual Studio or Visual Code from Unity and look for these lines:
|
||||
|
||||
![Code snip in NetworkConnection.cs](pc2i-2.png)
|
||||
|
||||
The line numbers could be off a bit if minor file changes happen above them after this document was written.
|
||||
|
||||
Comment the last line shown:
|
||||
|
||||
```cs
|
||||
// public NetworkIdentity identity { get; internal set; }
|
||||
```
|
||||
|
||||
Double-click and then right-click `playerController` and select Rename:
|
||||
|
||||
![Start of Rename process](pc2i-3.png)
|
||||
|
||||
Change `playerController` to `identity` and click Apply:
|
||||
|
||||
![Finishing the Rename process](pc2i-4.png)
|
||||
|
||||
Visual Studio will now have applied the change throughout your project, but you're not done yet!
|
||||
|
||||
Without using the replace feature this time, simply retype the name back to `playerController` and un-comment the last line in the first image that you commented out in step 1.
|
||||
|
||||
Your code should now look like the first image again.
|
||||
|
||||
**Save your work!**
|
||||
|
||||
|
BIN
doc/articles/General/pc2i-1.png
Normal file
BIN
doc/articles/General/pc2i-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
BIN
doc/articles/General/pc2i-2.png
Normal file
BIN
doc/articles/General/pc2i-2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
BIN
doc/articles/General/pc2i-3.png
Normal file
BIN
doc/articles/General/pc2i-3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
BIN
doc/articles/General/pc2i-4.png
Normal file
BIN
doc/articles/General/pc2i-4.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
Loading…
Reference in New Issue
Block a user