Beispiel #1
0
        public void InvokeRpc(NetworkConnection conn, string methodName, RpcArgs args, int priority)
        {
            NetworkMessage.RpcInvokeMessage rpcDef = new NetworkMessage.RpcInvokeMessage(instanceId, priority, methodName, args);

            if (ServerStage.active)
            {
                ServerStage.SendNetworkMessage(rpcDef, conn);
            }
        }
Beispiel #2
0
        public void InvokeRpc(string methodName, RpcArgs args, int priority)
        {
            NetworkMessage.RpcInvokeMessage rpcDef = new NetworkMessage.RpcInvokeMessage(instanceId, priority, methodName, args);

            if (ClientStage.active)
            {
                ClientStage.SendNetworkMessage(rpcDef);
            }

            if (ServerStage.active)
            {
                ServerStage.SendNetworkMessage(rpcDef);
            }
        }
Beispiel #3
0
        private static void ParseRpc(NetworkMessage rpcMsg)
        {
            NetworkMessage.RpcInvokeMessage invokeMessage = (NetworkMessage.RpcInvokeMessage)rpcMsg;
            NetworkEntity entity = null;

            try {
                entity = objectRegistryCallback(invokeMessage.objectId);
            }
            catch (EntityNotFoundException e) {
                Debug.LogWarning("Unable to invoke RPC on network entity with id " + invokeMessage.objectId.id);
                return;
            }
            finally {
                entity.ReceiveRpc(invokeMessage.functionName, invokeMessage.arguments);
            }
        }