mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
comments
This commit is contained in:
parent
33a697896c
commit
0dfd4e15cc
@ -135,12 +135,16 @@ public override void ClientSend(ArraySegment<byte> segment, int channelId)
|
||||
// transport 0 will produce connection ids [0, 3, 6, 9, ...]
|
||||
// transport 1 will produce connection ids [1, 4, 7, 10, ...]
|
||||
// transport 2 will produce connection ids [2, 5, 8, 11, ...]
|
||||
|
||||
// convert transport relative connId to multiplexed connId
|
||||
public static int FromBaseId(int transportId, int connectionId, int transportAmount) =>
|
||||
connectionId * transportAmount + transportId;
|
||||
|
||||
// convert multiplexed connectionId back to transport relative connId
|
||||
public static int ToBaseId(int connectionId, int transportAmount) =>
|
||||
connectionId / transportAmount;
|
||||
|
||||
// convert multiplexed connectionid back to transport id
|
||||
public static int ToTransportId(int connectionId, int transportAmount) =>
|
||||
connectionId % transportAmount;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user