Пример #1
0
 private void RoomKFBZ(MsgGlobal msg)
 {
     Debug.Log("房卡不足");
     //MemoryStream ms = new MemoryStream(msg.ReadBytes());
     //MsgRoomInfo msg_data_head = Game.Serial.Deserialize(ms, null, typeof(MsgRoomInfo)) as MsgRoomInfo;
     NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EGUANDAN_ROOM_GD_FKBZ);
 }
Пример #2
0
        public void Execute(MsgGlobal msg)
        {
            var callBackCode = msg.session.callbackCode;

            RefreshSession(msg.session);

            if (m_CallBacks.ContainsKey(callBackCode))
            {
                Debug.Log("========================Execute:" + callBackCode);
                try
                {
                    m_CallBacks[callBackCode](msg);
                }
                catch (Exception what)
                {
                    //这边应该添加 向服务器发送数据
                    Debug.LogError(what.StackTrace);
                    Debug.LogError(what.Message);
                    Debug.LogError("!!!!!!!!RecvMsg Execute:" + callBackCode);
                }
            }
            else
            {
                Debug.LogError("Msg Not Found Callback: " + callBackCode);
            }
        }
Пример #3
0
 void RoomCardMode()
 {
     if (RoomInfo.Instance.IsZhuandanGameType || RoomInfo.Instance.IsGuandan2GameType)
     {
         //转蛋
         Debug.Log(string.Format("打完第{0}局,总共,{1}局", PlayingGameInfo.Instance.mGameInfo.game_index, RoomInfo.Instance.mRoom.game_num));
         if (!isTotalOver)
         {
             PlayingGameInfo.Instance.EnterNextBureauGame();
         }
         else
         {
             MsgGlobal mG = new MsgGlobal();
             Debug.Log("Send Total roomId:" + RoomInfo.Instance.mRoomId);
             mG.room_id = RoomInfo.Instance.mRoomId;
             TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_TOTAL_GOAL, mG);
         }
     }
     else
     {
         Debug.Log("掼蛋非打二进入下一局");
         //如果结束就不会有这个界面
         if (isOver)
         {
             GameManager.Instance.BackToHomeModule();
         }
         else
         {
             PlayingGameInfo.Instance.EnterNextBureauGame();
         }
     }
 }
Пример #4
0
    //void RecevEnterGoldNotEnough(MsgGlobal msg)
    //{
    //    Debug.Log("金币不够使用道具");
    //    UIManagers.Instance.EnqueueTip("金币不足");
    //    NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EGoldNotEnough);
    //}

    void RecevGoldEnterSuc(MsgGlobal msg)
    {
        Debug.Log("RecevEnterSuc");


        //思想:Module层控制数据,View层纯显示
        GameManager.Instance.ClearCurGame();

        MsgGuandanRoom data = msg.guandan_room;

        if (data.gold_ready_player != null)
        {
            var playerReadyList = data.gold_ready_player.pid;
            if (playerReadyList != null)
            {
                GoldFiledManager.Instance.UpdateReadyPlayer(playerReadyList);
            }
        }

        if (data.gold_playground.type == (uint)EJoinRoomType.EEnter)
        {
            UIManagers.Instance.EnqueueTip("加入房间成功");
        }
        else
        {
            UIManagers.Instance.EnqueueTip("加入房间成功");
        }

        GoldFiledManager.Instance.UpdateGoldPlayerGroundData(msg.guandan_room.gold_playground);
        RoomInfo.Instance.GetRoomInfo(data.room_info);
        PlayerInfo.Instance.mPlayerData.roomCode = data.room_info.roomCode;
        RoomInfo.Instance.UpdatePlayersDic(data.player_info);
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ERoomJoin_Suc);
    }
Пример #5
0
    void RoomJoinFAIL(MsgGlobal msg)
    {
        ArgsJoinRoomReason args = new ArgsJoinRoomReason();

        args.reason = EJoinRoomFailReason.ERSYM;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EJoinRoomFail, args);
    }
Пример #6
0
    void RecevTonghuanshun(MsgGlobal msg)
    {
        MsgCardTip data = msg.card_tip;

        SelfCardsManager.Instance.mTonghuashunTipList = data.cardGroup;
        Debug.Log("同花顺数量:" + SelfCardsManager.Instance.mTonghuashunTipList.Count);
        SelfCardsManager.Instance.PostTonghuashunToCards();
    }
Пример #7
0
    void RecevCardTypeChoose(MsgGlobal msg)
    {
        MsgAction         data = msg.action;
        ArgsCanputOutCard args = new ArgsCanputOutCard();

        args.msgCardGroup = data.cardGroup;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EChooseCardType, args);
    }
Пример #8
0
    void RoomJoinFull(MsgGlobal msg)
    {
        Debug.Log("房间不存在");
        ArgsJoinRoomReason args = new ArgsJoinRoomReason();

        args.reason = EJoinRoomFailReason.EROOM_NULL;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EJoinRoomFail, args);
    }
Пример #9
0
    public void SendMsgToServer(string key)
    {
        MsgGlobal msg = new MsgGlobal();

        msg.session = new MsgSession();
        SetSession(msg.session, key);
        SendByteToServer(Serial(msg));
        Debug.Log("SendMsgTo Server :" + key);
    }
Пример #10
0
    public void SendServerCardTip()
    {
        SelfCardsManager.Instance.mIsRecevCardTip = false;
        MsgGlobal mGl = new MsgGlobal();

        mGl.guandan_room        = new MsgGuandanRoom();
        mGl.guandan_room.action = mMsgAction;
        TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_CARD_TIP, mGl);
    }
Пример #11
0
    void RecevSQDHZWSuc(MsgGlobal msg)
    {
        MsgChangeSeatInfo  data = msg.change_seat_info;
        ArgsChangeSeatInfo args = new ArgsChangeSeatInfo();

        args.applyId = data.apply_player_id;
        args.toId    = data.to_player_id;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EApplyChangeSeat, args);
    }
Пример #12
0
    void RoomCreaterOut(MsgGlobal msg)
    {
        if (!RoomInfo.Instance.IsCreater())
        {
            UIManagers.Instance.EnqueueTip("房主解散房间");
        }

        DismissRoom();
    }
Пример #13
0
    void RecevIpConfirm(MsgGlobal msg)
    {
        MsgIpConfirm        data = msg.ip_confirm;
        ArgsIpConfirmPlayer args = new ArgsIpConfirmPlayer();

        Debug.Log("IpConFirm" + args.playerId);
        args.playerId   = (uint)data.player_id;
        args.mPlayerIds = data.pids;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EIpConfirmNotify, args);
    }
Пример #14
0
    /// <summary>
    /// 解散房间请求 (战斗中)
    /// </summary>
    public void SendDissRoomApplyMsg()
    {
        MsgGlobal mGl = new MsgGlobal();

        mGl.dis_room_info = new MsgDisRoomInfo();
        MsgDisRoomInfo msg = mGl.dis_room_info;

        msg.voteTime = TimeUtils.ConvertDateTimeInt(System.DateTime.Now).ToString();
        TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_DISS_ROOM, mGl);
    }
Пример #15
0
    public void SendTalkServer(string voiceName, uint time)
    {
        MsgGlobal      mGl = new MsgGlobal();
        MsgGuandanRoom msg = mGl.guandan_room;

        msg.voiceName     = voiceName;
        msg.msg_talk      = new MsgTalk();
        msg.msg_talk.time = time;
        TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_TALK, mGl);
    }
Пример #16
0
    public void SendMsgToServer(string key, MsgGlobal msgGlobal)
    {
        msgGlobal.session = new MsgSession();
        SetSession(msgGlobal.session, key);
        Debug.Log("SendMsgToServer.session:" + msgGlobal.session);
        Debug.Log("msgGlobal:" + msgGlobal);

        SendByteToServer(Serial(msgGlobal));
        Debug.Log("SendMsgTo Server :" + key);
    }
Пример #17
0
    public void SendJoinRoomServer(int roomCode)
    {
        MsgGlobal mGl = new MsgGlobal();

        mGl.room_info = new MsgRoomInfo();
        MsgRoomInfo msg = mGl.room_info;

        msg.roomCode = (uint)roomCode;
        TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_ENTER_ROOM, mGl);
    }
Пример #18
0
    /// <summary>
    /// 发起回贡
    /// </summary>
    public void SendBackTribute(uint cardId)
    {
        MsgGlobal mGl = new MsgGlobal();

        mGl.tribute_info = new MsgTributeInfo();
        MsgTributeInfo msg = mGl.tribute_info;

        msg.hgpz_card = cardId;
        TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_BACK_TRIBUTE, mGl);
    }
Пример #19
0
    void RecevRoomRefuse(MsgGlobal msg)
    {
        uint pid = (uint)msg.actionId;

        Debug.Log("RecevRoomApply :" + ">>>pid:" + pid);
        ArgsDismissRoomApplyResult args = new ArgsDismissRoomApplyResult();

        args.playerId = pid;
        args.isAgree  = false;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ESingleDissRoomApplyResult, args);
    }
Пример #20
0
    private void RoomCreateSuccess(MsgGlobal msg)
    {
        RoomInfo.Instance.mRoomId         = msg.room_id;
        SDKManager.Instance.shareRoomCode = PlayerInfo.Instance.mPlayerData.roomCode;
        Debug.Log("开房成功");
        MsgRoomInfo data = msg.room_info;

        Debug.Log("RoomCode: " + RoomInfo.Instance.mRoomCode.ToString());
        RoomInfo.Instance.GetRoomInfo(data);
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EGUANDAN_ROOM_GD_KF_SUC);
    }
Пример #21
0
    /// <summary>
    /// 回答是否换座位
    /// </summary>
    /// <param name="toPlayerId"></param>
    public void SendAgreeChangeSeat(ulong applyId, uint result)
    {
        MsgGlobal mGl = new MsgGlobal();

        mGl.change_seat_info = new MsgChangeSeatInfo();
        MsgChangeSeatInfo msg = mGl.change_seat_info;

        msg.apply_player_id = applyId;
        msg.to_player_id    = PlayerInfo.Instance.mPlayerPid;
        msg.apply_result    = result;
        TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_AGREE_CHANGE_SEAT, mGl);
    }
Пример #22
0
    void RecevRoomApply(MsgGlobal msg)
    {
        MsgDisRoomInfo data = msg.dis_room_info;
        ulong          pid  = data.voteFirst; //(uint)msg.ReadUInt64(); //发起投票人

        Debug.Log("RecevRoomApply :" + ">>>pid:" + pid);
        ArgsDissmissRoomApplyer args = new ArgsDissmissRoomApplyer();

        args.playerId = (uint)pid;
        args.voteTime = data.voteTime;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EDissmisRoomApply, args);
    }
Пример #23
0
    public void SendExchangeRoomServer()
    {
        MsgGlobal mGl = new MsgGlobal();

        mGl.gold_playground = new MsgGoldPlayground();
        MsgGoldPlayground msg = mGl.gold_playground;

        msg.gold_playground_type = curGroundType;
        msg.cost = curGroundCost;
        msg.min  = curGroundMinScore;
        msg.type = (uint)EJoinRoomType.EExchange;
        TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_GOLD_EXCHANGE_ROOM, mGl);
    }
Пример #24
0
    /// <summary>
    /// 要不起
    /// </summary>
    public void SendRefusePutOutCard()
    {
        ClearAllSelectCards();  //清空所有被选中的打出的牌
        MsgGlobal mGl = new MsgGlobal();

        mGl.guandan_room        = new MsgGuandanRoom();
        mGl.guandan_room.action = new MsgAction();
        MsgAction msg = mGl.guandan_room.action;

        msg.action_id = (ulong)PlayerInfo.Instance.mPlayerPid;
        msg.action_ct = TGuanDanCT.CT_BUCHU;
        TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_SHOW_CARD, mGl);
    }
Пример #25
0
    //消息的发送等
    void RequestEmticonInfo(MsgEmoticon em = 0, string message = "")
    {
        MsgGlobal gl = new MsgGlobal();

        gl.emotion_info = new MsgEmotionInfo();
        var msg = gl.emotion_info;

        msg.action_id  = PlayerInfo.Instance.mPlayerPid;
        msg.emoticonId = em;
        msg.message    = message;
        TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_USE_EMOTICON, gl);
        OnCloseClick(null);
    }
Пример #26
0
    void RecevDHZWFail(MsgGlobal msg)
    {
        MsgChangeSeatInfo data = msg.change_seat_info;
        string            str  = string.Format("applyId:{0},toId:{1}", data.apply_player_id, data.to_player_id);

        Debug.Log(str);
        ArgsChangeSeatInfo args = new ArgsChangeSeatInfo();

        args.applyId = data.apply_player_id;
        args.toId    = data.to_player_id;
        args.result  = 1;
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.EAgreeChangeSeat, args);
    }
Пример #27
0
    public void ReSendEnterGoldFiledServer()
    {
        MsgGlobal mGl = new MsgGlobal();

        mGl.gold_playground = new MsgGoldPlayground();
        MsgGoldPlayground msg = mGl.gold_playground;

        msg.gold_playground_type = (TGoldPlaygroundType)curGroundType;
        msg.cost = curGroundCost;
        msg.min  = curGroundMinScore;
        msg.type = (uint)EJoinRoomType.EEnter;
        TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_ENTER_GOLD_FILED, mGl);
    }
Пример #28
0
    public void SendServerSortCard()
    {
        MsgGlobal mGl = new MsgGlobal();

        mGl.action = new MsgAction();
        MsgAction msg = mGl.action;

        for (int i = 0; i < mCurSelectCardIds.Count; i++)
        {
            msg.action_card.Add(mCurSelectCardIds[i]);
        }
        TCPNetWork.GetInstance().SendMsgToServer(ServerMsgKey.CLIENT_SORT_CARD, mGl);
    }
Пример #29
0
    /// <summary>
    /// 进贡成功回调
    /// </summary>
    /// <param name="msg"></param>
    void RecevTributeSuc(MsgGlobal msg)
    {
        //进贡id为自己的情况,自己牌,清空,并出发出动画到被进贡玩家,被进贡玩家牌+1
        MsgTributeInfo data = msg.tribute_info;
        ArgsTribute    args = new ArgsTribute();

        args.addId     = data.bjg_player_id[0];
        args.removeId  = data.jg_player_id[0];
        args.card      = data.jgpz_card[0];
        args.isJingong = true;
        args.isStart   = false;
        Debug.Log("进贡回调:" + "进贡id" + args.addId + "回贡id" + args.removeId + "牌值:" + args.card + "isjingong" + args.isJingong);
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ETributeSuc, args);
    }
Пример #30
0
    /// <summary>
    /// 回贡成功回调
    /// </summary>
    /// <param name="msg"></param>
    void RecevBackTributeSuc(MsgGlobal msg)
    {
        //回贡成功后,正式开始游戏
        MsgTributeInfo data = msg.tribute_info;
        ArgsTribute    args = new ArgsTribute();

        args.addId     = data.jg_player_id[0];
        args.removeId  = data.bjg_player_id[0];
        args.card      = data.hgpz_card;
        args.isJingong = false;
        args.isStart   = data.start_tag == 1;
        Debug.Log("回贡回调:" + "回贡id" + args.removeId + "被回贡id" + args.addId + "牌值:" + args.card + "isjingong" + args.isJingong);
        Debug.Log("start_tag:" + data.start_tag);
        NotificationCenter.Instance().PostDispatchEvent((uint)ENotificationMsgType.ETributeSuc, args);
    }