@@ -98,7 +98,7 @@ public uint networkId
9898 /// <summary>
9999 /// Gets the clientId that owns the NetworkedObject
100100 /// </summary>
101- public int ownerClientId
101+ public uint ownerClientId
102102 {
103103 get
104104 {
@@ -146,7 +146,7 @@ public virtual void OnLostOwnership()
146146 /// <param name="name">The MessageType to register</param>
147147 /// <param name="action">The callback to get invoked whenever a message is received</param>
148148 /// <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 )
150150 {
151151 if ( ! MessageManager . messageTypes . ContainsKey ( name ) )
152152 {
@@ -157,7 +157,7 @@ protected int RegisterMessageHandler(string name, Action<int, byte[]> action)
157157 ushort behaviourOrder = networkedObject . GetOrderIndex ( this ) ;
158158
159159 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 [ ] > > ( ) ) ;
161161 if ( networkedObject . targetMessageActions [ behaviourOrder ] . ContainsKey ( messageType ) )
162162 {
163163 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)
368368 syncedVarHooks [ fieldIndex ] . Invoke ( this , null ) ;
369369 }
370370
371- internal void FlushToClient ( int clientId )
371+ internal void FlushToClient ( uint clientId )
372372 {
373373 //This NetworkedBehaviour has no SyncVars
374374 if ( dirtyFields . Length == 0 )
@@ -689,7 +689,7 @@ protected void SendToServer(string messageType, string channelName, byte[] data)
689689 Debug . LogWarning ( "MLAPI: Server can not send messages to server." ) ;
690690 return ;
691691 }
692- NetworkingManager . singleton . Send ( NetworkingManager . singleton . serverClientId , messageType , channelName , data ) ;
692+ NetworkingManager . singleton . Send ( NetId . ServerNetId . GetClientId ( ) , messageType , channelName , data ) ;
693693 }
694694
695695 /// <summary>
@@ -722,7 +722,7 @@ protected void SendToServerTarget(string messageType, string channelName, byte[]
722722 Debug . LogWarning ( "MLAPI: Server can not send messages to server." ) ;
723723 return ;
724724 }
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 ) ) ;
726726 }
727727
728728 /// <summary>
@@ -876,7 +876,7 @@ protected void SendToNonLocalClientsTarget<T>(string messageType, string channel
876876 /// <param name="messageType">User defined messageType</param>
877877 /// <param name="channelName">User defined channelName</param>
878878 /// <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 )
880880 {
881881 if ( MessageManager . messageTypes [ messageType ] < 32 )
882882 {
@@ -911,7 +911,7 @@ protected void SendToClient<T>(int clientId, string messageType, string channelN
911911 /// <param name="messageType">User defined messageType</param>
912912 /// <param name="channelName">User defined channelName</param>
913913 /// <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 )
915915 {
916916 if ( MessageManager . messageTypes [ messageType ] < 32 )
917917 {
@@ -946,7 +946,7 @@ protected void SendToClientTarget<T>(int clientId, string messageType, string ch
946946 /// <param name="messageType">User defined messageType</param>
947947 /// <param name="channelName">User defined channelName</param>
948948 /// <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 )
950950 {
951951 if ( MessageManager . messageTypes [ messageType ] < 32 )
952952 {
@@ -981,7 +981,7 @@ protected void SendToClients<T>(int[] clientIds, string messageType, string chan
981981 /// <param name="messageType">User defined messageType</param>
982982 /// <param name="channelName">User defined channelName</param>
983983 /// <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 )
985985 {
986986 if ( MessageManager . messageTypes [ messageType ] < 32 )
987987 {
@@ -1016,7 +1016,7 @@ protected void SendToClientsTarget<T>(int[] clientIds, string messageType, strin
10161016 /// <param name="messageType">User defined messageType</param>
10171017 /// <param name="channelName">User defined channelName</param>
10181018 /// <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 )
10201020 {
10211021 if ( MessageManager . messageTypes [ messageType ] < 32 )
10221022 {
@@ -1051,7 +1051,7 @@ protected void SendToClients<T>(List<int> clientIds, string messageType, string
10511051 /// <param name="messageType">User defined messageType</param>
10521052 /// <param name="channelName">User defined channelName</param>
10531053 /// <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 )
10551055 {
10561056 if ( MessageManager . messageTypes [ messageType ] < 32 )
10571057 {
@@ -1074,7 +1074,7 @@ protected void SendToClientsTarget(List<int> clientIds, string messageType, stri
10741074 /// <param name="messageType">User defined messageType</param>
10751075 /// <param name="channelName">User defined channelName</param>
10761076 /// <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 )
10781078 {
10791079 SendToClientsTarget ( clientIds , messageType , channelName , BinarySerializer . Serialize < T > ( instance ) ) ;
10801080 }
0 commit comments