@@ -102,6 +102,11 @@ private void OnDestroy()
102
102
103
103
protected void SendToServer ( string messageType , string channelName , byte [ ] data )
104
104
{
105
+ if ( MessageManager . messageTypes [ messageType ] < 32 )
106
+ {
107
+ Debug . LogWarning ( "MLAPI: Sending messages on the internal MLAPI channels is not allowed!" ) ;
108
+ return ;
109
+ }
105
110
if ( isServer )
106
111
{
107
112
MessageManager . InvokeMessageHandlers ( messageType , data , - 1 ) ;
@@ -114,6 +119,11 @@ protected void SendToServer(string messageType, string channelName, byte[] data)
114
119
115
120
protected void SendToServerTarget ( string messageType , string channelName , byte [ ] data )
116
121
{
122
+ if ( MessageManager . messageTypes [ messageType ] < 32 )
123
+ {
124
+ Debug . LogWarning ( "MLAPI: Sending messages on the internal MLAPI channels is not allowed!" ) ;
125
+ return ;
126
+ }
117
127
if ( isServer )
118
128
{
119
129
MessageManager . InvokeTargetedMessageHandler ( messageType , data , - 1 , networkId ) ;
@@ -126,6 +136,11 @@ protected void SendToServerTarget(string messageType, string channelName, byte[]
126
136
127
137
protected void SendToLocalClient ( string messageType , string channelName , byte [ ] data )
128
138
{
139
+ if ( MessageManager . messageTypes [ messageType ] < 32 )
140
+ {
141
+ Debug . LogWarning ( "MLAPI: Sending messages on the internal MLAPI channels is not allowed!" ) ;
142
+ return ;
143
+ }
129
144
if ( ! isServer && ( ! NetworkingManager . singleton . NetworkConfig . AllowPassthroughMessages || ! NetworkingManager . singleton . NetworkConfig . PassthroughMessageTypes . Contains ( messageType ) ) )
130
145
{
131
146
Debug . LogWarning ( "MLAPI: Invalid Passthrough send. Ensure AllowPassthroughMessages are turned on and that the MessageType " + messageType + " is registered as a passthroughMessageType" ) ;
@@ -136,6 +151,11 @@ protected void SendToLocalClient(string messageType, string channelName, byte[]
136
151
137
152
protected void SendToLocalClientTarget ( string messageType , string channelName , byte [ ] data )
138
153
{
154
+ if ( MessageManager . messageTypes [ messageType ] < 32 )
155
+ {
156
+ Debug . LogWarning ( "MLAPI: Sending messages on the internal MLAPI channels is not allowed!" ) ;
157
+ return ;
158
+ }
139
159
if ( ! isServer && ( ! NetworkingManager . singleton . NetworkConfig . AllowPassthroughMessages || ! NetworkingManager . singleton . NetworkConfig . PassthroughMessageTypes . Contains ( messageType ) ) )
140
160
{
141
161
Debug . LogWarning ( "MLAPI: Invalid Passthrough send. Ensure AllowPassthroughMessages are turned on and that the MessageType " + messageType + " is registered as a passthroughMessageType" ) ;
@@ -146,6 +166,11 @@ protected void SendToLocalClientTarget(string messageType, string channelName, b
146
166
147
167
protected void SendToNonLocalClients ( string messageType , string channelName , byte [ ] data )
148
168
{
169
+ if ( MessageManager . messageTypes [ messageType ] < 32 )
170
+ {
171
+ Debug . LogWarning ( "MLAPI: Sending messages on the internal MLAPI channels is not allowed!" ) ;
172
+ return ;
173
+ }
149
174
if ( ! isServer )
150
175
{
151
176
Debug . LogWarning ( "MLAPI: Sending messages from client to other clients is not yet supported" ) ;
@@ -156,6 +181,11 @@ protected void SendToNonLocalClients(string messageType, string channelName, byt
156
181
157
182
protected void SendToNonLocalClientsTarget ( string messageType , string channelName , byte [ ] data )
158
183
{
184
+ if ( MessageManager . messageTypes [ messageType ] < 32 )
185
+ {
186
+ Debug . LogWarning ( "MLAPI: Sending messages on the internal MLAPI channels is not allowed!" ) ;
187
+ return ;
188
+ }
159
189
if ( ! isServer )
160
190
{
161
191
Debug . LogWarning ( "MLAPI: Sending messages from client to other clients is not yet supported" ) ;
@@ -166,6 +196,11 @@ protected void SendToNonLocalClientsTarget(string messageType, string channelNam
166
196
167
197
protected void SendToClient ( int clientId , string messageType , string channelName , byte [ ] data )
168
198
{
199
+ if ( MessageManager . messageTypes [ messageType ] < 32 )
200
+ {
201
+ Debug . LogWarning ( "MLAPI: Sending messages on the internal MLAPI channels is not allowed!" ) ;
202
+ return ;
203
+ }
169
204
if ( ! isServer && ( ! NetworkingManager . singleton . NetworkConfig . AllowPassthroughMessages || ! NetworkingManager . singleton . NetworkConfig . PassthroughMessageTypes . Contains ( messageType ) ) )
170
205
{
171
206
Debug . LogWarning ( "MLAPI: Invalid Passthrough send. Ensure AllowPassthroughMessages are turned on and that the MessageType " + messageType + " is registered as a passthroughMessageType" ) ;
@@ -176,6 +211,11 @@ protected void SendToClient(int clientId, string messageType, string channelName
176
211
177
212
protected void SendToClientTarget ( int clientId , string messageType , string channelName , byte [ ] data )
178
213
{
214
+ if ( MessageManager . messageTypes [ messageType ] < 32 )
215
+ {
216
+ Debug . LogWarning ( "MLAPI: Sending messages on the internal MLAPI channels is not allowed!" ) ;
217
+ return ;
218
+ }
179
219
if ( ! isServer && ( ! NetworkingManager . singleton . NetworkConfig . AllowPassthroughMessages || ! NetworkingManager . singleton . NetworkConfig . PassthroughMessageTypes . Contains ( messageType ) ) )
180
220
{
181
221
Debug . LogWarning ( "MLAPI: Invalid Passthrough send. Ensure AllowPassthroughMessages are turned on and that the MessageType " + messageType + " is registered as a passthroughMessageType" ) ;
@@ -186,6 +226,11 @@ protected void SendToClientTarget(int clientId, string messageType, string chann
186
226
187
227
protected void SendToClients ( int [ ] clientIds , string messageType , string channelName , byte [ ] data )
188
228
{
229
+ if ( MessageManager . messageTypes [ messageType ] < 32 )
230
+ {
231
+ Debug . LogWarning ( "MLAPI: Sending messages on the internal MLAPI channels is not allowed!" ) ;
232
+ return ;
233
+ }
189
234
if ( ! isServer )
190
235
{
191
236
Debug . LogWarning ( "MLAPI: Sending messages from client to other clients is not yet supported" ) ;
@@ -196,6 +241,11 @@ protected void SendToClients(int[] clientIds, string messageType, string channel
196
241
197
242
protected void SendToClientsTarget ( int [ ] clientIds , string messageType , string channelName , byte [ ] data )
198
243
{
244
+ if ( MessageManager . messageTypes [ messageType ] < 32 )
245
+ {
246
+ Debug . LogWarning ( "MLAPI: Sending messages on the internal MLAPI channels is not allowed!" ) ;
247
+ return ;
248
+ }
199
249
if ( ! isServer )
200
250
{
201
251
Debug . LogWarning ( "MLAPI: Sending messages from client to other clients is not yet supported" ) ;
@@ -206,6 +256,11 @@ protected void SendToClientsTarget(int[] clientIds, string messageType, string c
206
256
207
257
protected void SendToClients ( List < int > clientIds , string messageType , string channelName , byte [ ] data )
208
258
{
259
+ if ( MessageManager . messageTypes [ messageType ] < 32 )
260
+ {
261
+ Debug . LogWarning ( "MLAPI: Sending messages on the internal MLAPI channels is not allowed!" ) ;
262
+ return ;
263
+ }
209
264
if ( ! isServer )
210
265
{
211
266
Debug . LogWarning ( "MLAPI: Sending messages from client to other clients is not yet supported" ) ;
@@ -216,6 +271,11 @@ protected void SendToClients(List<int> clientIds, string messageType, string cha
216
271
217
272
protected void SendToClientsTarget ( List < int > clientIds , string messageType , string channelName , byte [ ] data )
218
273
{
274
+ if ( MessageManager . messageTypes [ messageType ] < 32 )
275
+ {
276
+ Debug . LogWarning ( "MLAPI: Sending messages on the internal MLAPI channels is not allowed!" ) ;
277
+ return ;
278
+ }
219
279
if ( ! isServer )
220
280
{
221
281
Debug . LogWarning ( "MLAPI: Sending messages from client to other clients is not yet supported" ) ;
@@ -226,6 +286,11 @@ protected void SendToClientsTarget(List<int> clientIds, string messageType, stri
226
286
227
287
protected void SendToClients ( string messageType , string channelName , byte [ ] data )
228
288
{
289
+ if ( MessageManager . messageTypes [ messageType ] < 32 )
290
+ {
291
+ Debug . LogWarning ( "MLAPI: Sending messages on the internal MLAPI channels is not allowed!" ) ;
292
+ return ;
293
+ }
229
294
if ( ! isServer )
230
295
{
231
296
Debug . LogWarning ( "MLAPI: Sending messages from client to other clients is not yet supported" ) ;
@@ -236,6 +301,11 @@ protected void SendToClients(string messageType, string channelName, byte[] data
236
301
237
302
protected void SendToClientsTarget ( string messageType , string channelName , byte [ ] data )
238
303
{
304
+ if ( MessageManager . messageTypes [ messageType ] < 32 )
305
+ {
306
+ Debug . LogWarning ( "MLAPI: Sending messages on the internal MLAPI channels is not allowed!" ) ;
307
+ return ;
308
+ }
239
309
if ( ! isServer )
240
310
{
241
311
Debug . LogWarning ( "MLAPI: Sending messages from client to other clients is not yet supported" ) ;
0 commit comments