コード例 #1
0
    public static void TestRegisterInfoRsp(DkRspMsg msg)
    {
        protoSources.GameProto.GameAccountRegisterRsp res = (protoSources.GameProto.GameAccountRegisterRsp)msg.body;
        if (res == null)
        {
            Log.error("S2CProtobufTest", "GameAccountRegisterRsp is null");
            return;
        }

        //debug...
        Log.info("S2CProtobufTest", "res.result:" + res.result);
        Log.info("S2CProtobufTest", "res.uid:" + res.uid);
    }
コード例 #2
0
    public static void TestLoginRsp(DkRspMsg msg)
    {
        protoSources.GameProto.GameAccountLoginRsp res = (protoSources.GameProto.GameAccountLoginRsp)msg.body;
        if (res == null)
        {
            Log.error("S2CProtobufTest", "GameAccountLoginRsp is null");
            return;
        }

        Log.info("S2CProtobufTest", "res.result:" + res.result);
        Log.info("S2CProtobufTest", "res.uid:" + res.uid);
        Log.info("S2CProtobufTest", "res.money:" + res.money);
    }
コード例 #3
0
    // Update is called once per frame
    void LateUpdate()
    {
        DkRspMsg drm = DkProtoQueue.Instance.pop();

        //收到服务器消息..
        if (drm != null && msgBacks.ContainsKey(drm.head.shMsgID))
        {
            //not considering retransmitting and heart beat...
            //simplize processing
            NetworkMsgCallFunc ed = msgBacks[drm.head.shMsgID];
            if (ed != null)
            {
                ed(drm);
            }
        }
        else if (drm != null)
        {
            Debug.LogError("接收到消息号为:" + (protoSources.GameProto.GameCmdCode)drm.head.shMsgID + "   ,但是您的协议未注册");
        }
    }