HandleResult OnReceive(TcpClient sender, byte[] bytes)
    {
        try
        {
            string str = Encoding.UTF8.GetString(bytes, 0, bytes.Length);
            LogUtil.getInstance().addDebugLog("收到数据库服务器消息:" + str);

            JObject jo  = JObject.Parse(str);
            string  tag = jo.GetValue("tag").ToString();

            // 获取游戏内玩家信息
            if (tag.CompareTo(TLJCommon.Consts.Tag_UserInfo_Game) == 0)
            {
                int connId = Convert.ToInt32(jo.GetValue("connId"));
                Request_UserInfo_Game.onMySqlRespond(str);
            }
            // 获取pvp场次信息
            else if (tag.CompareTo(TLJCommon.Consts.Tag_GetPVPGameRoom) == 0)
            {
                int connId = Convert.ToInt32(jo.GetValue("connId"));
                NetRespond_GetPVPGameRoom.onMySqlRespond(connId, str);
            }
            // 拉取机器人列表
            else if (tag.CompareTo(TLJCommon.Consts.Tag_GetAIList) == 0)
            {
                Request_GetAIList.onMySqlRespond(str);
            }
            // 使用buff
            else if (tag.CompareTo(TLJCommon.Consts.Tag_UseBuff) == 0)
            {
                int connId = Convert.ToInt32(jo.GetValue("connId"));
                NetRespond_UseBuff.onMySqlRespond(connId, str);
            }
        }
        catch (Exception ex)
        {
            TLJ_PlayService.PlayService.log.Error("MySqlServerUtil.OnReceive----异常:" + ex.Message);
        }

        return(HandleResult.Ok);
    }
    // 处理客户端的请求
    void doAskCilentReq(object obj)
    {
        ReceiveObj receiveObj = (ReceiveObj)obj;
        string     text       = receiveObj.m_data;

        // 日志
        {
            PlayerData playerData = GameUtil.getPlayerDataByConnId(receiveObj.m_connId);
            if (playerData != null)
            {
                RoomData room = GameUtil.getRoomByUid(playerData.m_uid);
                if (room != null)
                {
                    LogUtil.getInstance().writeRoomLog(room, "收到客户端消息:" + text);
                }
                else
                {
                    LogUtil.getInstance().addDebugLog("收到客户端消息:" + text);
                }
            }
            else
            {
                LogUtil.getInstance().addDebugLog("收到客户端消息:" + text);
            }
        }

        JObject jo;

        try
        {
            jo = JObject.Parse(text);
        }
        catch (JsonReaderException ex)
        {
            // 传过来的数据不是json格式的,一律不理
            // 日志
            {
                PlayerData playerData = GameUtil.getPlayerDataByConnId(receiveObj.m_connId);
                if (playerData != null)
                {
                    RoomData room = GameUtil.getRoomByUid(playerData.m_uid);
                    if (room != null)
                    {
                        LogUtil.getInstance().writeRoomLog(room, "客户端传来非json数据:" + text);
                    }
                    else
                    {
                        LogUtil.getInstance().addDebugLog("客户端传来非json数据:" + text);
                    }
                }
                else
                {
                    LogUtil.getInstance().addDebugLog("客户端传来非json数据:" + text);
                }
            }

            m_endStr = "";

            return;
        }

        if (jo.GetValue("tag") != null)
        {
            string tag = jo.GetValue("tag").ToString();

            // 休闲场相关
            if (tag.CompareTo(TLJCommon.Consts.Tag_XiuXianChang) == 0)
            {
                PlayLogic_Relax.getInstance().OnReceive(receiveObj.m_connId, text);
            }
            // 比赛场相关
            else if (tag.CompareTo(TLJCommon.Consts.Tag_JingJiChang) == 0)
            {
                PlayLogic_PVP.getInstance().OnReceive(receiveObj.m_connId, text);
            }
            // 获取pvp场次信息
            else if (tag.CompareTo(TLJCommon.Consts.Tag_GetPVPGameRoom) == 0)
            {
                NetRespond_GetPVPGameRoom.doAskCilentReq_GetPVPGameRoom(receiveObj.m_connId, text);
            }
            // 请求服务器在线玩家信息接口
            else if (tag.CompareTo(TLJCommon.Consts.Tag_OnlineInfo) == 0)
            {
                NetRespond_OnlineInfo.doAskCilentReq_OnlineInfo(receiveObj.m_connId, text);
            }
            // 使用buff
            else if (tag.CompareTo(TLJCommon.Consts.Tag_UseBuff) == 0)
            {
                NetRespond_UseBuff.doAskCilentReq_UseBuff(receiveObj.m_connId, text);
            }
            // 是否已经加入游戏
            else if (tag.CompareTo(TLJCommon.Consts.Tag_IsJoinGame) == 0)
            {
                NetRespond_IsJoinGame.doAskCilentReq_IsJoinGame(receiveObj.m_connId, text);
            }
            // 请求恢复房间
            else if (tag.CompareTo(TLJCommon.Consts.Tag_RetryJoinGame) == 0)
            {
                NetRespond_RetryJoinGame.doAskCilentReq_RetryJoinGame(receiveObj.m_connId, text);
            }
            // 自定义牌型
            else if (tag.CompareTo(TLJCommon.Consts.Tag_DebugSetPoker) == 0)
            {
                NetRespond_DebugSetPoker.doAskCilentReq_DebugSetPoker(receiveObj.m_connId, text);
            }
            // 心跳
            else if (tag.CompareTo(TLJCommon.Consts.Tag_HeartBeat_Play) == 0)
            {
                NetRespond_HeartBeat_Play.doAskCilentReq_HeartBeat_Play(receiveObj.m_connId, text);
            }
            // 解散房间
            else if (tag.CompareTo(TLJCommon.Consts.Tag_BreakRoom) == 0)
            {
                NetRespond_BreakRoom.doAskCilentReq_BreakRoom(receiveObj.m_connId, text);
            }
            // 斗地主相关
            else if (tag.CompareTo(TLJCommon.Consts.Tag_DouDiZhu_Game) == 0)
            {
                PlayLogic_DDZ.getInstance().OnReceive(receiveObj.m_connId, text);
            }
            // 未知Tag
            else
            {
                LogUtil.getInstance().addDebugLog("未知Tag:" + tag);
            }
        }
        else
        {
            // 传过来的数据没有tag字段的,一律不理
            // 日志
            {
                PlayerData playerData = GameUtil.getPlayerDataByConnId(receiveObj.m_connId);
                if (playerData != null)
                {
                    RoomData room = GameUtil.getRoomByUid(playerData.m_uid);
                    if (room != null)
                    {
                        LogUtil.getInstance().writeRoomLog(room, "客户端传来的数据没有Tag:" + text);
                    }
                    else
                    {
                        LogUtil.getInstance().addDebugLog("客户端传来的数据没有Tag:" + text);
                    }
                }
                else
                {
                    LogUtil.getInstance().addDebugLog("客户端传来的数据没有Tag:" + text);
                }
            }
            return;
        }
    }