@@ -98,7 +98,7 @@ public uint networkId
98
98
/// <summary>
99
99
/// Gets the clientId that owns the NetworkedObject
100
100
/// </summary>
101
- public int ownerClientId
101
+ public uint ownerClientId
102
102
{
103
103
get
104
104
{
@@ -146,7 +146,7 @@ public virtual void OnLostOwnership()
146
146
/// <param name="name">The MessageType to register</param>
147
147
/// <param name="action">The callback to get invoked whenever a message is received</param>
148
148
/// <returns>HandlerId for the messageHandler that can be used to deregister the messageHandler</returns>
149
- protected int RegisterMessageHandler ( string name , Action < int , byte [ ] > action )
149
+ protected int RegisterMessageHandler ( string name , Action < uint , byte [ ] > action )
150
150
{
151
151
if ( ! MessageManager . messageTypes . ContainsKey ( name ) )
152
152
{
@@ -157,7 +157,7 @@ protected int RegisterMessageHandler(string name, Action<int, byte[]> action)
157
157
ushort behaviourOrder = networkedObject . GetOrderIndex ( this ) ;
158
158
159
159
if ( ! networkedObject . targetMessageActions . ContainsKey ( behaviourOrder ) )
160
- networkedObject . targetMessageActions . Add ( behaviourOrder , new Dictionary < ushort , Action < int , byte [ ] > > ( ) ) ;
160
+ networkedObject . targetMessageActions . Add ( behaviourOrder , new Dictionary < ushort , Action < uint , byte [ ] > > ( ) ) ;
161
161
if ( networkedObject . targetMessageActions [ behaviourOrder ] . ContainsKey ( messageType ) )
162
162
{
163
163
Debug . LogWarning ( "MLAPI: Each NetworkedBehaviour can only register one callback per instance per message type" ) ;
@@ -368,7 +368,7 @@ internal void OnSyncVarUpdate(object value, byte fieldIndex)
368
368
syncedVarHooks [ fieldIndex ] . Invoke ( this , null ) ;
369
369
}
370
370
371
- internal void FlushToClient ( int clientId )
371
+ internal void FlushToClient ( uint clientId )
372
372
{
373
373
//This NetworkedBehaviour has no SyncVars
374
374
if ( dirtyFields . Length == 0 )
@@ -689,7 +689,7 @@ protected void SendToServer(string messageType, string channelName, byte[] data)
689
689
Debug . LogWarning ( "MLAPI: Server can not send messages to server." ) ;
690
690
return ;
691
691
}
692
- NetworkingManager . singleton . Send ( NetworkingManager . singleton . serverClientId , messageType , channelName , data ) ;
692
+ NetworkingManager . singleton . Send ( NetId . ServerNetId . GetClientId ( ) , messageType , channelName , data ) ;
693
693
}
694
694
695
695
/// <summary>
@@ -722,7 +722,7 @@ protected void SendToServerTarget(string messageType, string channelName, byte[]
722
722
Debug . LogWarning ( "MLAPI: Server can not send messages to server." ) ;
723
723
return ;
724
724
}
725
- NetworkingManager . singleton . Send ( NetworkingManager . singleton . serverClientId , messageType , channelName , data , networkId , networkedObject . GetOrderIndex ( this ) ) ;
725
+ NetworkingManager . singleton . Send ( NetId . ServerNetId . GetClientId ( ) , messageType , channelName , data , networkId , networkedObject . GetOrderIndex ( this ) ) ;
726
726
}
727
727
728
728
/// <summary>
@@ -876,7 +876,7 @@ protected void SendToNonLocalClientsTarget<T>(string messageType, string channel
876
876
/// <param name="messageType">User defined messageType</param>
877
877
/// <param name="channelName">User defined channelName</param>
878
878
/// <param name="data">The binary data to send</param>
879
- protected void SendToClient ( int clientId , string messageType , string channelName , byte [ ] data )
879
+ protected void SendToClient ( uint clientId , string messageType , string channelName , byte [ ] data )
880
880
{
881
881
if ( MessageManager . messageTypes [ messageType ] < 32 )
882
882
{
@@ -911,7 +911,7 @@ protected void SendToClient<T>(int clientId, string messageType, string channelN
911
911
/// <param name="messageType">User defined messageType</param>
912
912
/// <param name="channelName">User defined channelName</param>
913
913
/// <param name="data">The binary data to send</param>
914
- protected void SendToClientTarget ( int clientId , string messageType , string channelName , byte [ ] data )
914
+ protected void SendToClientTarget ( uint clientId , string messageType , string channelName , byte [ ] data )
915
915
{
916
916
if ( MessageManager . messageTypes [ messageType ] < 32 )
917
917
{
@@ -946,7 +946,7 @@ protected void SendToClientTarget<T>(int clientId, string messageType, string ch
946
946
/// <param name="messageType">User defined messageType</param>
947
947
/// <param name="channelName">User defined channelName</param>
948
948
/// <param name="data">The binary data to send</param>
949
- protected void SendToClients ( int [ ] clientIds , string messageType , string channelName , byte [ ] data )
949
+ protected void SendToClients ( uint [ ] clientIds , string messageType , string channelName , byte [ ] data )
950
950
{
951
951
if ( MessageManager . messageTypes [ messageType ] < 32 )
952
952
{
@@ -981,7 +981,7 @@ protected void SendToClients<T>(int[] clientIds, string messageType, string chan
981
981
/// <param name="messageType">User defined messageType</param>
982
982
/// <param name="channelName">User defined channelName</param>
983
983
/// <param name="data">The binary data to send</param>
984
- protected void SendToClientsTarget ( int [ ] clientIds , string messageType , string channelName , byte [ ] data )
984
+ protected void SendToClientsTarget ( uint [ ] clientIds , string messageType , string channelName , byte [ ] data )
985
985
{
986
986
if ( MessageManager . messageTypes [ messageType ] < 32 )
987
987
{
@@ -1016,7 +1016,7 @@ protected void SendToClientsTarget<T>(int[] clientIds, string messageType, strin
1016
1016
/// <param name="messageType">User defined messageType</param>
1017
1017
/// <param name="channelName">User defined channelName</param>
1018
1018
/// <param name="data">The binary data to send</param>
1019
- protected void SendToClients ( List < int > clientIds , string messageType , string channelName , byte [ ] data )
1019
+ protected void SendToClients ( List < uint > clientIds , string messageType , string channelName , byte [ ] data )
1020
1020
{
1021
1021
if ( MessageManager . messageTypes [ messageType ] < 32 )
1022
1022
{
@@ -1051,7 +1051,7 @@ protected void SendToClients<T>(List<int> clientIds, string messageType, string
1051
1051
/// <param name="messageType">User defined messageType</param>
1052
1052
/// <param name="channelName">User defined channelName</param>
1053
1053
/// <param name="data">The binary data to send</param>
1054
- protected void SendToClientsTarget ( List < int > clientIds , string messageType , string channelName , byte [ ] data )
1054
+ protected void SendToClientsTarget ( List < uint > clientIds , string messageType , string channelName , byte [ ] data )
1055
1055
{
1056
1056
if ( MessageManager . messageTypes [ messageType ] < 32 )
1057
1057
{
@@ -1074,7 +1074,7 @@ protected void SendToClientsTarget(List<int> clientIds, string messageType, stri
1074
1074
/// <param name="messageType">User defined messageType</param>
1075
1075
/// <param name="channelName">User defined channelName</param>
1076
1076
/// <param name="instance">The instance to send</param>
1077
- protected void SendToClientsTarget < T > ( List < int > clientIds , string messageType , string channelName , T instance )
1077
+ protected void SendToClientsTarget < T > ( List < uint > clientIds , string messageType , string channelName , T instance )
1078
1078
{
1079
1079
SendToClientsTarget ( clientIds , messageType , channelName , BinarySerializer . Serialize < T > ( instance ) ) ;
1080
1080
}
0 commit comments