mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Users no longer need to remove channels
Command, RPC and events methods now have channel attributes. Users no longer need to remove the channel when migrating to mirror.
This commit is contained in:
parent
724ebc00d8
commit
a5adb450ad
18
migration.md
18
migration.md
@ -30,15 +30,14 @@ public class Player : NetworkBehaviour {
|
|||||||
```
|
```
|
||||||
At this point, you might get some compilation errors. Don't panic, these are easy to fix. Keep going
|
At this point, you might get some compilation errors. Don't panic, these are easy to fix. Keep going
|
||||||
|
|
||||||
## 4. Remove all channels
|
## 4. Remove channels from NetworkSettings
|
||||||
As of this writing, all messages are reliable, ordered, fragmented. There is no need for channels at all.
|
NetworkSettings in HLAPI have channels, but this is flat out broken. Rather than ignoring your settings we removed channels from NetworkSettings.
|
||||||
To avoid misleading code, we have removed channels.
|
|
||||||
|
|
||||||
For example, if you have this code:
|
For example, if you have this code:
|
||||||
|
|
||||||
```C#
|
```C#
|
||||||
[Command(channel= Channels.DefaultReliable)]
|
[NetworkSettings(channel=1,sendInterval=0.05f)]
|
||||||
public void CmdMove(int x, int y)
|
public class NetStreamer : NetworkBehaviour
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
@ -46,19 +45,20 @@ public void CmdMove(int x, int y)
|
|||||||
|
|
||||||
replace it with:
|
replace it with:
|
||||||
```C#
|
```C#
|
||||||
[Command]
|
[NetworkSettings(sendInterval=0.05f)]
|
||||||
public void CmdMove(int x, int y)
|
public class NetStreamer : NetworkBehaviour
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
The same applies for `[ClientRPC]`, `[NetworkSettings]`, `[SyncEvent]`, `[SyncVar]`, `[TargetRPC]`
|
|
||||||
|
Please note that the default transport (Telepathy), completely ignores channels, all messages are reliable, sequenced and fragmented. They just work with no fuss. If you want to take advantage of unreliable channels use LLAPITransport instead.
|
||||||
|
|
||||||
## 5. Rename SyncListStruct to SyncListSTRUCT
|
## 5. Rename SyncListStruct to SyncListSTRUCT
|
||||||
There is a bug in the original UNET Weaver that makes it mess with our `Mirror.SyncListStruct` without checking the namespace.
|
There is a bug in the original UNET Weaver that makes it mess with our `Mirror.SyncListStruct` without checking the namespace.
|
||||||
Until Unity officially removes UNET in 2019.1, we will have to use the name `SyncListSTRUCT` instead.
|
Until Unity officially removes UNET in 2019.1, we will have to use the name `SyncListSTRUCT` instead.
|
||||||
|
|
||||||
So for example, if you have definitions like:
|
For example, if you have definitions like:
|
||||||
|
|
||||||
```C#
|
```C#
|
||||||
public class SyncListQuest : SyncListStruct<Quest> {}
|
public class SyncListQuest : SyncListStruct<Quest> {}
|
||||||
|
Loading…
Reference in New Issue
Block a user