Ejemplo n.º 1
0
    /// <summary>
    /// 玩家离开房间
    /// </summary>
    /// <param name="msg"></param>
    private void NetOnPlayerLeaveRoom(MessageData msg)
    {
        OnGoldFlowerPlayerLeave ack = msg.Read <OnGoldFlowerPlayerLeave>();

        XXGoldFlowerGameModel.Inst.mSeatIdList.Remove(ack.seatId);
        XXGoldFlowerGameModel.Inst.mPlayerInfoDic.Remove(ack.seatId);
        if (ack.seatId == XXGoldFlowerGameModel.Inst.mMySeatId && XXGoldFlowerGameModel.Inst.mChangDesk == false)//不是换桌造成的这种情况
        {
            bool gold = XXGoldFlowerGameModel.Inst.mGoldPattern;
            Global.Inst.GetController <MainController>().SendGetWareInfo(() =>
            {
                if (XXGoldFlowerGameModel.Inst.mGoldPattern)
                {//平台房
                    XXGoldFlowerGameModel.Inst.CleanMode();
                    Global.Inst.GetController <SelectRoomController>().SendGetGoldPeopleNum((data) =>
                    {
                        SelectRoomView v = Global.Inst.GetController <SelectRoomController>().OpenWindow() as SelectRoomView;
                        v.SetData(data);
                        Global.Inst.GetController <MainController>().OpenWindow();
                        CloseWindow();
                    });
                }
                else
                {
                    Global.Inst.GetController <MainController>().OpenWindow();
                    CloseWindow();
                }
            });
        }
        else
        {
            mView.NetOnPlayerLeaveRoom(ack.seatId);
        }
    }
Ejemplo n.º 2
0
 //快速匹配点击
 public void OnQuicklyClick()
 {
     Global.Inst.GetController <SelectRoomController>().SendGetGoldPeopleNum((data) =>
     {
         SelectRoomView v = Global.Inst.GetController <SelectRoomController>().OpenWindow() as SelectRoomView;
         v.SetData(data);
         Close();
     });
 }
Ejemplo n.º 3
0
 //房间解散
 private void NetOnResolve(MessageData msg)
 {
     Global.Inst.GetController <CommonTipsController>().ShowTips("房间已解散");
     if (XXGoldFlowerGameModel.Inst.mGoldPattern)
     {//平台房
         XXGoldFlowerGameModel.Inst.CleanMode();
         Global.Inst.GetController <SelectRoomController>().SendGetGoldPeopleNum((data) =>
         {
             SelectRoomView v = Global.Inst.GetController <SelectRoomController>().OpenWindow() as SelectRoomView;
             v.SetData(data);
             Global.Inst.GetController <MainController>().OpenWindow();
             CloseWindow();
         });
     }
     else
     {
         Global.Inst.GetController <MainController>().OpenWindow();
         CloseWindow();
     }
 }
Ejemplo n.º 4
0
    /// <summary>
    /// 离开房间
    /// </summary>
    public void SendLeaveRoom()
    {
        CommonSendProto req = new CommonSendProto();

        NetProcess.SendRequest <CommonSendProto>(req, GoldFlowerProtoIdMap.CMD_SendLeaveRoom, (msg) =>
        {
            CommonRecieveProto ack = msg.Read <CommonRecieveProto>();
            if (ack.code == 1)
            {
            }
            else if (ack.code == 104 || ack.code == 105 || ack.code == 24 || ack.code == 13 || ack.code == 7 || ack.code == 6)
            {
                Global.Inst.GetController <MainController>().SendGetWareInfo(() =>
                {
                    if (XXGoldFlowerGameModel.Inst.mGoldPattern)
                    {//平台房
                        XXGoldFlowerGameModel.Inst.CleanMode();
                        Global.Inst.GetController <SelectRoomController>().SendGetGoldPeopleNum((data) =>
                        {
                            SelectRoomView v = Global.Inst.GetController <SelectRoomController>().OpenWindow() as SelectRoomView;
                            v.SetData(data);
                            Global.Inst.GetController <MainController>().OpenWindow();
                            CloseWindow();
                        });
                    }
                    else
                    {
                        Global.Inst.GetController <MainController>().OpenWindow();
                        CloseWindow();
                    }
                });
            }
            else
            {
                GameUtils.ShowErrorTips(ack.code);
            }
        });
    }