Exemplo n.º 1
0
    // 托管:加棒
    public static void trusteeshipLogic_JiaBang(DDZ_GameBase gameBase, DDZ_RoomData room, DDZ_PlayerData playerData)
    {
        try
        {
            LogUtil.getInstance().writeRoomLog(room, ":托管:帮" + playerData.m_uid + "加棒");

            JObject data = new JObject();

            data["tag"]        = room.m_tag;
            data["uid"]        = playerData.m_uid;
            data["playAction"] = (int)TLJCommon.Consts.DDZ_PlayAction.PlayAction_JiaBang;
            data["isJiaBang"]  = 1;

            DDZ_GameLogic.doTask_JiaBang(gameBase, playerData.m_connId, data.ToString());
        }
        catch (Exception ex)
        {
            TLJ_PlayService.PlayService.log.Error(m_logFlag + "----" + ".trusteeshipLogic_JiaBang: " + ex);
        }
    }
Exemplo n.º 2
0
    public void OnReceive(IntPtr connId, string data)
    {
        JObject respondJO = new JObject();

        try
        {
            JObject jo  = JObject.Parse(data);
            string  tag = jo.GetValue("tag").ToString();
            respondJO.Add("tag", tag);

            int playAction = Convert.ToInt32(jo.GetValue("playAction"));

            switch (playAction)
            {
            case (int)TLJCommon.Consts.DDZ_PlayAction.PlayAction_JoinGame:
            {
                doTask_JoinGame(connId, data);
            }
            break;

            case (int)TLJCommon.Consts.DDZ_PlayAction.PlayAction_ExitGame:
            {
                DDZ_GameLogic.doTask_ExitGame(this, connId, data);
            }
            break;

            case (int)TLJCommon.Consts.DDZ_PlayAction.PlayAction_QiangDiZhu:
            {
                DDZ_GameLogic.doTask_QiangDiZhu(this, connId, data);
            }
            break;

            case (int)TLJCommon.Consts.DDZ_PlayAction.PlayAction_JiaBang:
            {
                DDZ_GameLogic.doTask_JiaBang(this, connId, data);
            }
            break;

            case (int)TLJCommon.Consts.DDZ_PlayAction.PlayAction_PlayerOutPoker:
            {
                DDZ_GameLogic.doTask_ReceivePlayerOutPoker(this, connId, data);
            }
            break;

            case (int)TLJCommon.Consts.DDZ_PlayAction.PlayAction_Chat:
            {
                DDZ_GameLogic.doTask_Chat(this, connId, data);
            }
            break;

            case (int)TLJCommon.Consts.DDZ_PlayAction.PlayAction_SetTuoGuanState:
            {
                DDZ_GameLogic.doTask_SetTuoGuanState(this, connId, data);
            }
            break;
            }
        }
        catch (Exception ex)
        {
            LogUtil.getInstance().writeLogToLocalNow(m_logFlag + "----" + ".OnReceive()异常:" + ex.Message);
            // 客户端参数错误
            respondJO.Add("code", Convert.ToInt32(TLJCommon.Consts.Code.Code_ParamError));

            // 发送给客户端
            PlayService.m_serverUtil.sendMessage(connId, respondJO.ToString());
        }
    }