1
- using System . Collections . Generic ;
1
+ using System . Collections . Generic ;
2
2
using System . IO ;
3
3
using MLAPI . Messaging ;
4
4
using MLAPI . Serialization . Pooled ;
@@ -61,6 +61,11 @@ internal class ClientSendInfo
61
61
/// A higher value will result in continued extrapolation after an object has stopped moving
62
62
/// </summary>
63
63
public float MaxSendsToExtrapolate = 5 ;
64
+ /// <summary>
65
+ /// The channel to send the data on
66
+ /// </summary>
67
+ [ Tooltip ( "The channel to send the data on. Uses the default channel if left unspecified" ) ]
68
+ public string Channel = null ;
64
69
65
70
private float lerpT ;
66
71
private Vector3 lerpStartPos ;
@@ -156,9 +161,9 @@ private void Update()
156
161
writer . WriteSinglePacked ( transform . rotation . eulerAngles . z ) ;
157
162
158
163
if ( IsServer )
159
- InvokeClientRpcOnEveryoneExceptPerformance ( ApplyTransform , OwnerClientId , stream ) ;
164
+ InvokeClientRpcOnEveryoneExceptPerformance ( ApplyTransform , OwnerClientId , stream , string . IsNullOrEmpty ( Channel ) ? "MLAPI_DEFAULT_MESSAGE" : Channel ) ;
160
165
else
161
- InvokeServerRpcPerformance ( SubmitTransform , stream ) ;
166
+ InvokeServerRpcPerformance ( SubmitTransform , stream , string . IsNullOrEmpty ( Channel ) ? "MLAPI_DEFAULT_MESSAGE" : Channel ) ;
162
167
}
163
168
}
164
169
@@ -283,7 +288,7 @@ private void SubmitTransform(ulong clientId, Stream stream)
283
288
info . lastMissedPosition = null ;
284
289
info . lastMissedRotation = null ;
285
290
286
- InvokeClientRpcOnClientPerformance ( ApplyTransform , NetworkingManager . Singleton . ConnectedClientsList [ i ] . ClientId , writeStream ) ;
291
+ InvokeClientRpcOnClientPerformance ( ApplyTransform , NetworkingManager . Singleton . ConnectedClientsList [ i ] . ClientId , writeStream , string . IsNullOrEmpty ( Channel ) ? "MLAPI_DEFAULT_MESSAGE" : Channel ) ;
287
292
}
288
293
else
289
294
{
@@ -294,7 +299,7 @@ private void SubmitTransform(ulong clientId, Stream stream)
294
299
}
295
300
else
296
301
{
297
- InvokeClientRpcOnEveryoneExceptPerformance ( ApplyTransform , OwnerClientId , writeStream ) ;
302
+ InvokeClientRpcOnEveryoneExceptPerformance ( ApplyTransform , OwnerClientId , writeStream , string . IsNullOrEmpty ( Channel ) ? "MLAPI_DEFAULT_MESSAGE" : Channel ) ;
298
303
}
299
304
}
300
305
}
@@ -340,7 +345,7 @@ private void CheckForMissedSends()
340
345
writer . WriteSinglePacked ( rot . y ) ;
341
346
writer . WriteSinglePacked ( rot . z ) ;
342
347
343
- InvokeClientRpcOnClientPerformance ( ApplyTransform , NetworkingManager . Singleton . ConnectedClientsList [ i ] . ClientId , stream ) ;
348
+ InvokeClientRpcOnClientPerformance ( ApplyTransform , NetworkingManager . Singleton . ConnectedClientsList [ i ] . ClientId , stream , string . IsNullOrEmpty ( Channel ) ? "MLAPI_DEFAULT_MESSAGE" : Channel ) ;
344
349
}
345
350
}
346
351
}
0 commit comments