Esempio n. 1
0
 public void ProcessRPCMessage(RPCMessageBody message)
 {
     if (message.type == RPCMessageBody.Type.call)
     {
         ProcessRemoteCall(message);
     }
     else
     {
         ProcessReturnValue(message);
     }
 }
Esempio n. 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;
                }
            }
        }
Esempio n. 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);
        }
Esempio n. 4
0
 protected virtual void ProcessRemoteCall(RPCMessageBody message)
 {
     throw new System.NotImplementedException();
 }