示例#1
0
 public void ProcessRPCMessage(RPCMessageBody message)
 {
     if (message.type == RPCMessageBody.Type.call)
     {
         ProcessRemoteCall(message);
     }
     else
     {
         ProcessReturnValue(message);
     }
 }
示例#2
0
        protected void ProcessReturnValue(RPCMessageBody message)
        {
            foreach (var handle in registeredReturnHandles)
            {
                // find matched handle
                if (handle.signature == message.rpcSignature)
                {
                    handle.isReady     = true;
                    handle.returnValue = message.rpcVariable;

                    registeredReturnHandles.Remove(handle);
                    break;
                }
            }
        }
示例#3
0
        public RPCReturnHandle Call(string functionName, RPCVariable parameter)
        {
            var signature = new RPCSignature(functionName);

            var messageBody = new RPCMessageBody(signature, parameter, RPCMessageBody.Type.call);

            var transmitableBody = new TransmitableRPCMessageBody();

            transmitableBody.InitFromOriginalObejct(messageBody);
            var message = new Message(Message.Type.RPC, transmitableBody.Encode());

            MessageCollector.instance.Collect(message);

            var returnHanlde = new RPCReturnHandle(signature);

            registeredReturnHandles.Add(returnHanlde);
            return(returnHanlde);
        }
示例#4
0
 protected virtual void ProcessRemoteCall(RPCMessageBody message)
 {
     throw new System.NotImplementedException();
 }