Ejemplo n.º 1
0
        //---------------------------------------------------------------------
        // Interface: IRpcPeer.sendEntityRpcData
        public void sendEntityRpcData(ref _tEntityRpcData data)
        {
            Dictionary <byte, object> p = new Dictionary <byte, object>();

            p[0] = data.rpc_id;
            p[1] = data.from_node;
            p[2] = data.method_id;
            p[3] = data.map_param;

            if (PeerState != PeerStateValue.Connected)
            {
                // log error
                return;
            }

            try
            {
                bool send_queue_ok = OpCustom(data.getCmdId(), p, true, 0);
                if (!send_queue_ok)
                {
                    EbLog.Error("PhotonClientPeer.sendEntityRpcData() Failed! MethodId=" + data.method_id);
                }
            }
            catch (Exception ec)
            {
                EbLog.Error(ec.ToString());
            }
        }
Ejemplo n.º 2
0
        //---------------------------------------------------------------------
        // Interface: IRpcPeer.sendEntityRpcData
        public void sendEntityRpcData(ref _tEntityRpcData data)
        {
            Dictionary <byte, object> p = new Dictionary <byte, object>();

            p[0] = data.rpc_id;
            p[1] = data.from_node;
            p[2] = data.method_id;
            p[3] = data.map_param;

            if (!Connected)
            {
                // log error
                return;
            }

            try
            {
                OperationResponse operation_response = new OperationResponse(data.getCmdId(), p);
                SendResult        r = SendOperationResponse(operation_response, new SendParameters {
                    ChannelId = 0
                });
                if (r != SendResult.Ok)
                {
                    EbLog.Error("PhotonServerPeerS.sendEntityRpcData() Result=" + r + " MethodId=" + data.method_id);
                }
            }
            catch (Exception ec)
            {
                EbLog.Error(ec.ToString());
            }
        }