Skip to content

Commit 409c89f

Browse files
committed
feat: Cleaned up unused MLAPI transport channel types
BREAKING CHANGE: Removed previously unused ChannelTypes
1 parent 3ae8853 commit 409c89f

File tree

5 files changed

+12
-34
lines changed

5 files changed

+12
-34
lines changed

MLAPI.EnetTransport/EnetTransport.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,14 @@ public PacketFlags MLAPIChannelTypeToPacketFlag(ChannelType type)
265265
{
266266
return PacketFlags.Reliable;
267267
}
268-
case ChannelType.StateUpdate:
269-
{
270-
return PacketFlags.None;
271-
}
272268
case ChannelType.ReliableFragmentedSequenced:
273269
{
274270
return PacketFlags.Reliable;
275271
}
272+
case ChannelType.UnreliableSequenced:
273+
{
274+
return PacketFlags.None;
275+
}
276276
default:
277277
{
278278
throw new ArgumentOutOfRangeException(nameof(type), type, null);

MLAPI.RufflesTransport/RufflesTransport.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,10 @@ private Ruffles.Channeling.ChannelType ConvertChannelType(ChannelType type)
239239
return Ruffles.Channeling.ChannelType.ReliableSequenced;
240240
case ChannelType.ReliableSequenced:
241241
return Ruffles.Channeling.ChannelType.ReliableSequenced;
242-
case ChannelType.StateUpdate:
243-
return Ruffles.Channeling.ChannelType.Unreliable;
244242
case ChannelType.Unreliable:
245243
return Ruffles.Channeling.ChannelType.Unreliable;
244+
case ChannelType.UnreliableSequenced:
245+
return Ruffles.Channeling.ChannelType.UnreliableSequenced;
246246
}
247247

248248
return Ruffles.Channeling.ChannelType.Reliable;

MLAPI/Transports/ChannelType.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ public enum ChannelType
1010
/// </summary>
1111
Unreliable,
1212
/// <summary>
13-
/// Unreliable with fragmentation support
14-
/// </summary>
15-
UnreliableFragmented,
16-
/// <summary>
1713
/// Unreliable with sequencing
1814
/// </summary>
1915
UnreliableSequenced,
@@ -22,30 +18,10 @@ public enum ChannelType
2218
/// </summary>
2319
Reliable,
2420
/// <summary>
25-
/// Reliable with fragmentation support
26-
/// </summary>
27-
ReliableFragmented,
28-
/// <summary>
2921
/// Reliable message where messages are guaranteed to be in the right order
3022
/// </summary>
3123
ReliableSequenced,
3224
/// <summary>
33-
/// A unreliable state update message
34-
/// </summary>
35-
StateUpdate,
36-
/// <summary>
37-
/// A reliable state update message
38-
/// </summary>
39-
ReliableStateUpdate,
40-
/// <summary>
41-
/// A reliable message with high priority
42-
/// </summary>
43-
AllCostDelivery,
44-
/// <summary>
45-
/// Unreliable message with fragmentation where older messages are dropped
46-
/// </summary>
47-
UnreliableFragmentedSequenced,
48-
/// <summary>
4925
/// A reliable message with guaranteed order with fragmentation support
5026
/// </summary>
5127
ReliableFragmentedSequenced

MLAPI/Transports/Transport.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public abstract class Transport : MonoBehaviour
3232
new TransportChannel()
3333
{
3434
Name = "MLAPI_POSITION_UPDATE",
35-
Type = ChannelType.StateUpdate
35+
Type = ChannelType.UnreliableSequenced
3636
},
3737
new TransportChannel()
3838
{
@@ -47,7 +47,7 @@ public abstract class Transport : MonoBehaviour
4747
new TransportChannel()
4848
{
4949
Name = "MLAPI_NAV_AGENT_CORRECTION",
50-
Type = ChannelType.StateUpdate
50+
Type = ChannelType.UnreliableSequenced
5151
},
5252
new TransportChannel()
5353
{

MLAPI/Transports/UNET/UnetTransport.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,12 @@ public int AddMLAPIChannel(ChannelType type, ConnectionConfig config)
273273
return config.AddChannel(QosType.Reliable);
274274
case ChannelType.ReliableSequenced:
275275
return config.AddChannel(QosType.ReliableSequenced);
276-
case ChannelType.StateUpdate:
277-
return config.AddChannel(QosType.StateUpdate);
278276
case ChannelType.ReliableFragmentedSequenced:
279277
return config.AddChannel(QosType.ReliableFragmentedSequenced);
278+
case ChannelType.UnreliableSequenced:
279+
return config.AddChannel(QosType.UnreliableSequenced);
280280
}
281+
281282
return 0;
282283
}
283284

@@ -308,6 +309,7 @@ public int AddUNETChannel(QosType type, ConnectionConfig config)
308309
case QosType.ReliableFragmentedSequenced:
309310
return config.AddChannel(QosType.ReliableFragmentedSequenced);
310311
}
312+
311313
return 0;
312314
}
313315

0 commit comments

Comments
 (0)