Exemple #1
0
 internal static void NetworkMethodInvoke(NetworkIdentity identity, MethodPacket methodPacket, bool shouldInvokeSynchronously)
 {
     if (methodsByType.TryGetValue(identity.GetType(), out Dictionary <string, NetworkMethodExecuter> d))
     {
         if (d.TryGetValue(methodPacket.MethodName, out NetworkMethodExecuter memberExecuter))
         {
             memberExecuter.InvokeMemberFromNetwork(identity, shouldInvokeSynchronously, methodPacket.MethodArgs);
             return;
         }
     }
     NetworkBehavior.PrintWarning("No location with name: {0} was not found", methodPacket.MethodName);
 }
Exemple #2
0
 private protected virtual void ParseMethodPacket(MethodPacket methodPacket, bool shouldInvokeSynchronously, SocketInfo socketInfo)
 {
     if (TryGetNetworkIdentityByPacket(methodPacket, out NetworkIdentity identity))
     {
         NetworkIdentity.NetworkMethodInvoke(identity, methodPacket, shouldInvokeSynchronously);
     }
     else if (socketInfo.NetworkInterface == NetworkInterfaceType.TCP)
     {
         PrintWarning("cannot get network identity from packet:");
         Print(methodPacket.Data.ToArray());
     }
 }