public void InitPanel()
 {
     EventMsgMgr.RegisterEvent(CommEventID.FrienCircleCutShowWanFa, FrienCircleCutShowWanFaEvent);
     _FiveStarRoomConfig = FiveStarRoomConfigFactory.Create(mData.RoomConfigLists);
     InitRoomItemInfo();
     mJoinBtn.Add(JoinRoom);
 }
Example #2
0
 public async void InitPanel()
 {
     mJwelAddBtn.Add(JwelAddBtnEvent);
     RefreshUserInfo();
     EventMsgMgr.RegisterEvent(CommEventID.SelfUserInfoRefresh, RefreshUserInfo);
     mHeadMaskBtn.Add(HeadMaskBtnEvent);
 }
Example #3
0
 //重连进入游戏
 public static void Reconnection(Actor_FiveStar_Reconnection roomData)
 {
     Game.Scene.GetComponent <ToyGameComponent>().StartGame(ToyGameId.CardFiveStar, roomData.Configs, roomData.RoomId, roomData.RoomType);
     CardFiveStarRoom.Ins._RoomState       = roomData.CurrRoomStateType; //状态改为等待中
     CardFiveStarRoom.Ins._FriendsCircleId = roomData.FriendsCircleId;   //更改亲友圈id
     if (roomData.ResidueCardCount > 0)
     {
         CardFiveStarRoom.Ins._ResideNum = roomData.ResidueCardCount;                                         //剩余牌数赋值
     }
     CardFiveStarRoom.Ins.iEndChuCardSize = roomData.EndPlayCardSize;                                         //出牌的最后一张牌
     CardFiveStarRoom.Ins._CuurRoomOffice = roomData.CurrOfficNum;                                            //当前局数赋值
     CardFiveStarRoom.Ins._RoomId         = roomData.RoomId;                                                  //roomId赋值
     EventMsgMgr.SendEvent(CardFiveStarEventID.HideAllPlayer);                                                //先隐藏所有玩家
     CardFiveStarRoom.Ins.ShowPlayerInfo(roomData.Players);                                                   //显示服务器发过来的玩家信息
     UIComponent.GetUiView <CardFiveStarRoomPanelComponent>().SetResidueNum(CardFiveStarRoom.Ins._ResideNum); //设置剩余牌数
     CardFiveStarRoom.Ins.SetUserPlayerAsLastSibling();                                                       //设置自己的节点到最后
     if (CardFiveStarRoom.Ins._config.RoomNumber == 4)                                                        //四人房还有玩家轮休
     {
         CardFiveStarRoom.Ins.PlayerRest(roomData.CurrRestSeatIndex);                                         //当前休息玩家索引
     }
     for (int i = 0; i < roomData.Players.Count; i++)
     {
         CardFiveStarRoom.Ins._ServerSeatIndexInPlayer[roomData.Players[i].SeatIndex].Reconnection(roomData.Players[i],
                                                                                                   roomData.CurrRoomStateType, roomData.IsDaPiaoBeing);//显示玩家对应的信息
     }
     if (roomData.CurrRoomStateType == RoomStateType.ReadyIn)
     {
         UIComponent.GetUiView <CardFiveStarRoomPanelComponent>().CutReadyInUI();//UI切换为准备中的状态
     }
     else
     {
         UIComponent.GetUiView <CardFiveStarRoomPanelComponent>().CutGameInUI();//UI切换为游戏中的状态
     }
 }
Example #4
0
        public override void Init(GameObject go)
        {
            base.Init(go);
            _HuPaiHintJianArrowsGo = gameObject.FindChild("HuPaiHintJianArrowsGo").gameObject;
            _PaoIconGo             = gameObject.FindChild("PaoIconGo").gameObject;
            _KouIconGo             = gameObject.FindChild("KouIconGo").gameObject;
            _NotStateGo            = gameObject.FindChild("NotStateGo").gameObject;

            if (_width == 0)
            {
                RectTransform rectTransform = gameObject.GetComponent <RectTransform>();
                _width = rectTransform.rect.width - _HandInterval;
            }

            _PointerEvent = gameObject.AddComponent <PointerEvent>();
            //注册事件委托
            _PointerEvent.OnPointerDownAction  -= OnPointerDown;
            _PointerEvent.OnPointerUpAction    -= OnPointerUp;
            _PointerEvent.OnPointerEnterAction -= OnPointerEnter;
            _PointerEvent.OnPointerDownAction  += OnPointerDown;
            _PointerEvent.OnPointerUpAction    += OnPointerUp;
            _PointerEvent.OnPointerEnterAction += OnPointerEnter;
            _PointerEvent.OnPointerExitAction  -= OnPointerExit;
            _PointerEvent.OnPointerExitAction  += OnPointerExit;



            EventMsgMgr.RegisterEvent(CardFiveStarEventID.CanChuCardHaveHuHint, DetetionChuCanHu);
            EventMsgMgr.RegisterEvent(CardFiveStarEventID.UserChuCard, UserChuCard);
            EventMsgMgr.RegisterEvent(CardFiveStarEventID.PlayerLiangDao, PlayerLiangDaoEvnet);
            EventMsgMgr.RegisterEvent(CardFiveStarEventID.PlayerSelectLiangCardState, PlayerSelectLiangCardStateEvent);
        }
Example #5
0
        public ETTask <IResponse> Call(IRequest request)
        {
            int rpcId = ++RpcId;
            var tcs   = new ETTaskCompletionSource <IResponse>();

            EventMsgMgr.SendEvent(CommEventID.CallRequest);
            this.requestCallback[rpcId] = (response) =>
            {
                try
                {
                    if (ErrorCode.IsRpcNeedThrowException(response.Error))
                    {
                        throw new RpcException(response.Error, response.Message);
                    }
                    EventMsgMgr.SendEvent(CommEventID.CallResponse);
                    tcs.SetResult(response);
                }
                catch (Exception e)
                {
                    tcs.SetException(new Exception($"Rpc Error: {request.GetType().FullName}", e));
                }
            };

            request.RpcId = rpcId;

            this.Send(0x00, request);
            return(tcs.Task);
        }
Example #6
0
 //匹配模式进入房间
 public static void MatchingEnterRoom(int roomId, RepeatedField <int> roomConfigs)
 {
     Game.Scene.GetComponent <ToyGameComponent>().StartGame(ToyGameId.CardFiveStar, roomConfigs, roomId, RoomType.Match);
     EventMsgMgr.SendEvent(CardFiveStarEventID.HideAllPlayer);                                                                                                   //先隐藏所有玩家
     CardFiveStarPlayerFactory.Creator(Game.Scene.GetComponent <UserComponent>().pSelfUser, 1, 0,
                                       UIComponent.GetUiView <CardFiveStarRoomPanelComponent>().mPlayerUIsGo.transform, (int)UserComponent.Ins.pSelfUser.Beans); //显示自己的信息
     UIComponent.GetUiView <CardFiveStarRoomPanelComponent>().CutBeginStartPrepareUI();                                                                          //UI切换为准备开始匹配
 }
 public void InitPanel()
 {
     mCloseBtn.Add(Hide);
     mConfirmBtn.Add(ConfirmBtnEvent);
     mMarketRecordBtn.Add(MarketRecordBtnEvent);
     _MarketRecordView = mMarketRecordViewGo.AddItem <MarketRecordView>();
     EventMsgMgr.RegisterEvent(CommEventID.SelfUserInfoRefresh, SetJewelNum);
 }
        protected override async void Run(ETModel.Session session, Actor_FiveStar_Deal message)
        {
            UIComponent.GetUiView <SelectPiaoNumPanelComponent>().Hide();                   //隐藏打漂面板
            EventMsgMgr.SendEvent(CardFiveStarEventID.ZhiSeZi);                             //发起玩家置赛事件
            await UIComponent.GetUiView <SifterAnimPanelComponent>().RandomPlaySifterNum(); //先掷筛子

            EventMsgMgr.SendEvent(CardFiveStarEventID.Deal, message.Cards);
        }
 public void InitEnterRoomUI()
 {
     EventMsgMgr.SendEvent(JoyLandlordsEventID.EnrerRoom);
     ShowUserPlayerInfo();
     JoyLandlordsOperationControl.Ins.ShowBtnType(JoyLandlordsOperationType.StartGame);
     mMathInText.gameObject.SetActive(false);
     DetroyLandlordThreeCard();
 }
Example #10
0
 //房卡模式正常进入进入游戏 加入房间 创建房间 在等待开局状态重连
 public static void RoomCardEnterRoom(RoomInfo roomInfo)
 {
     Game.Scene.GetComponent <ToyGameComponent>().StartGame(ToyGameId.CardFiveStar, roomInfo.RoomConfigLists, roomInfo.RoomId, RoomType.RoomCard);
     CardFiveStarRoom.Ins._RoomState       = RoomStateType.AwaitPerson;                    //状态改为等待中
     CardFiveStarRoom.Ins._FriendsCircleId = roomInfo.FriendsCircleId;                     //更改亲友圈id
     EventMsgMgr.SendEvent(CardFiveStarEventID.HideAllPlayer);                             //先隐藏所有玩家
     CardFiveStarRoom.Ins.ShowPlayerInfo(roomInfo.MatchPlayerInfos);                       //显示服务器发过来的玩家信息
     UIComponent.GetUiView <CardFiveStarRoomPanelComponent>().CutRoomCardEnterReadyInUI(); //UI切换为房卡等待开始
 }
Example #11
0
 public virtual void Init()
 {
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.Deal, Deal);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.AnewDeal, AnewDeal);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.CanAddTwice, CanAddTwice);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.EnrerRoom, EnrerRoom);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.ConfirmCamp, ConfirmCamp);
     Log.Debug(gameObject.name);
 }
Example #12
0
 public void InitPanel()
 {
     mCloseBtn.Add(CloseBtnEvent);
     mBeasnsAddBtn.Add(BeasnsAddBtnEvent);
     mFastStartBtn.Add(FastStartBtnEvent);
     InitRoomList();
     SetBeasnsNum();
     EventMsgMgr.RegisterEvent(CommEventID.SelfUserInfoRefresh, SetBeasnsNum);
 }
 public virtual void RegisterEvent()
 {
     EventMsgMgr.RegisterEvent(CardFiveStarEventID.Deal, Deal);
     EventMsgMgr.RegisterEvent(CardFiveStarEventID.HideAllPlayer, HideAllPlayer);
     EventMsgMgr.RegisterEvent(CardFiveStarEventID.CutMatchIn, CutMatchIn);
     EventMsgMgr.RegisterEvent(CardFiveStarEventID.CutReadyIn, CutReadyIn);
     EventMsgMgr.RegisterEvent(CardFiveStarEventID.CutGameIn, CutGameIn);
     EventMsgMgr.RegisterEvent(CardFiveStarEventID.CutBeginStartPrepare, CutBeginStartPrepare);
     EventMsgMgr.RegisterEvent(CardFiveStarEventID.CutRoomCardEnterReadyIn, CutRoomCardEnterReadyIn);
 }
Example #14
0
 //切换准备开始匹配中的UI
 public void CutBeginStartPrepareUI()
 {
     mMatchBtn.gameObject.SetActive(true);
     mMatchingInGo.SetActive(false);
     mReidueCardNumBgGo.SetActive(false);
     mInviteBtn.gameObject.SetActive(false);
     mTimeTurntableGo.SetActive(false);
     EventMsgMgr.SendEvent(CardFiveStarEventID.CutBeginStartPrepare);
     ShowRoomInfo();
 }
Example #15
0
 //切换游戏中的UI
 public void CutGameInUI()
 {
     mMilitaryBtn.gameObject.SetActive(CardFiveStarRoom.Ins._RoomType == RoomType.RoomCard);//战绩按钮 只有房卡模式才显示
     mMatchBtn.gameObject.SetActive(false);
     mMatchingInGo.SetActive(false);
     mTimeTurntableGo.SetActive(true);
     mInviteBtn.gameObject.SetActive(false);
     EventMsgMgr.SendEvent(CardFiveStarEventID.CutGameIn);
     ShowRoomInfo();
 }
 public void NormalWanFaToggleEvent(bool isOn)
 {
     if (isOn)
     {
         CurrSelectWanFa = FrienCircleWanFaType.Normal;
         EventMsgMgr.SendEvent(CommEventID.FrienCircleCutShowWanFa);
         mWanFaDescBgGo.SetActive(true);
         mNoneRoomGo.SetActive(false);
     }
 }
Example #17
0
        public async void Location(string message)
        {
            S2C_UploadingLocationIp s2CUploading = (S2C_UploadingLocationIp)await SessionComponent.Instance.Session.Call(new C2G_UploadingLocationIp()
            {
                Location = message
            });

            UserComponent.Ins.pSelfUser.Ip       = s2CUploading.Ip;
            UserComponent.Ins.pSelfUser.Location = message;
            EventMsgMgr.SendEvent(CommEventID.SelfUserInfoRefresh);
        }
Example #18
0
 //切换匹配中的UI
 public void CutMatchingUI()
 {
     if (CardFiveStarRoom.Ins._RoomState == RoomStateType.GameIn)
     {
         return;
     }
     EventMsgMgr.SendEvent(CardFiveStarEventID.CutMatchIn);
     mMatchBtn.gameObject.SetActive(false);
     mTimeTurntableGo.SetActive(false);
     mReidueCardNumBgGo.SetActive(false);
     mMatchingInGo.SetActive(true);
     UIComponent.GetUiView <FiveStarMingPaiHintPanelComponent>().Hide();//隐藏胡牌提示
 }
Example #19
0
        private async void GetAwardBtnEvent()
        {
            L2C_TodaySignIn g2CTodaySign = (L2C_TodaySignIn)await SessionComponent.Instance.Session.Call(new C2L_TodaySignIn());

            if (g2CTodaySign.Error == 0)
            {
                EventMsgMgr.SendEvent(CommEventID.UserFinshSignIn, ++mData.UserSinginInfo.SingInDays);
            }
            else
            {
                UIComponent.GetUiView <NormalHintPanelComponent>().ShowHintPanel(g2CTodaySign.Message);
            }
            FinshSingIn();
        }
        //收到出牌消息
        public async void  ChuCard(int card)
        {
            UIComponent.GetUiView <CanOpertionPanelComponent>().Hide();//隐藏可操作列表
            _IsCanChuCard = false;
            EventMsgMgr.SendEvent(CardFiveStarEventID.UserChuCard);
            UIComponent.GetUiView <FiveStarMingPaiHintPanelComponent>().HideHuCardHint(0); //隐藏胡牌提示
            _NewHand.SetActive(false);
            if (UpChuCardHand == null || UpChuCardHand.CardSize != card)                   //托管状态下 上个出牌的对象可能不准需要判断一下
            {
                UpChuCardHand = _NewHand;
            }
            await  PlayCardAnimation();

            CancelPartyHand();//出完牌取消预选牌
        }
 public override void Init(GameObject go)
 {
     base.Init(go);
     _OneChuCardGroupGo = _ChuCardGroupsGo.FindChild("OneChuCardGroup").gameObject;
     for (int i = 0; i < 3; i++)
     {
         GameObject.Instantiate(_OneChuCardGroupGo, _ChuCardGroupsGo.transform);
     }
     for (int i = _ChuCardGroupsGo.transform.childCount - 1; i >= 0; i--)
     {
         _ChuCardGroups.Add(_ChuCardGroupsGo.transform.GetChild(i));
     }
     _CardFiveStarHandComponent = this.AddComponent <CardFiveStarHandComponent, Transform, Transform>(_HandGroup.transform, _NewHandPointGo.transform);
     EventMsgMgr.RegisterEvent(CommEventID.SelfUserInfoRefresh, RefreshBeans);
 }
        //检测出牌的胡牌提示和 是否可以亮倒
        public void DetectionChuCardHintAndLiang()
        {
            _isSelectLiang = false;
            if (CardFiveStarRoom.Ins.GetUserPlayerInfo().IsLiangDao)
            {
                return;                                                                    //已经亮了 就不用检测了
            }
            _HuCardInMultiple.Clear();                                                     //清空 胡的牌 和对应的倍数
            UIComponent.GetUiView <FiveStarMingPaiHintPanelComponent>().HideHuCardHint(0); //先隐藏胡牌提示
            Dictionary <int, List <int> > chuCardHuDic = CardFiveStarHuPaiLogic.HuPaiTiShi(_NewestHands);

            if (chuCardHuDic.Count > 0)
            {
                EventMsgMgr.SendEvent(CardFiveStarEventID.CanChuCardHaveHuHint, chuCardHuDic);
                UIComponent.GetUiView <CanOpertionPanelComponent>().ShowCanOpration(FiveStarOperateType.Liang);
            }
        }
Example #23
0
 public void RegisterEvent()
 {
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.RequestOutRoom, RequestOutRoom);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.RequestPlayCard, RequestPlayCard);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.StarMathch, StarMathch);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.RobLanlord, RobLanlord);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.AddTwice, AddTwice);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.CallLanlord, CallLanlord);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.CanCallLanlord, CanCallLanlord);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.CanPlayCard, CanPlayCard);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.CanRobLanlord, CanRobLanlord);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.DissolveRoom, DissolveRoom);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.DontPlay, DontPlay);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.PlayCard, PlayCard);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.Prepare, Prepare);
     EventMsgMgr.RegisterEvent(JoyLandlordsEventID.ConfirmCamp, ConfirmCamp);
 }
 public void FreedomWanFaToggleEvent(bool isOn)
 {
     if (isOn)
     {
         CurrSelectWanFa = FrienCircleWanFaType.Freedom;
         EventMsgMgr.SendEvent(CommEventID.FrienCircleCutShowWanFa);
         mWanFaDescBgGo.SetActive(false);
         mNoneRoomGo.SetActive(true);
         for (int i = 0; i < mRoomItemGo.transform.parent.childCount; i++)
         {
             if (mRoomItemGo.transform.parent.GetChild(i).gameObject.activeInHierarchy)
             {
                 mNoneRoomGo.SetActive(false);
                 break;
             }
         }
     }
 }
        //亮倒
        public void LiangDao(RepeatedField <int> hands, bool isShowSpecial = true)
        {
            IsLiangDao = true;
            if (isShowSpecial)
            {
                OperationSpecialMgr.Ins.ShowSpecial(FiveStarOperateType.Liang, _OperationSpecialPoint); //亮倒 特效
                CardFiveStarSoundMgr.Ins.PlaySound(_user.Sex, FiveStarOperateType.Liang);               //亮倒 音效
            }
            List <int> tingCards = CardFiveStarHuPaiLogic.IsTingPai(hands);

            UIComponent.GetUiView <FiveStarMingPaiHintPanelComponent>().ShowMingCardHint(ClientSeatIndex, tingCards);
            ClearHand();
            ShowLiangDaoCards(hands);
            CardFiveStarRoom.Ins.AddLiangDaoCanHuCards(ClientSeatIndex, tingCards);
            if (ClientSeatIndex != 0)
            {
                CardFiveStarRoom.Ins.ReduceCardInNum(hands); //删除牌的剩余数量
            }
            EventMsgMgr.SendEvent(CardFiveStarEventID.PlayerLiangDao);
        }
Example #26
0
        public void GetGoodss(List <GetGoodsOne> goodss, bool isShowHintPanel)
        {
            foreach (var goods in goodss)
            {
                switch (goods.GoodsId)
                {
                case GoodsId.Jewel:
                    pSelfUser.Jewel = goods.NowAmount;
                    break;

                case GoodsId.Besans:
                    pSelfUser.Beans = goods.NowAmount;
                    break;
                }
            }
            if (isShowHintPanel)
            {
                EventMsgMgr.SendEvent(CommEventID.GetGodds, goodss);
            }
            EventMsgMgr.SendEvent(CommEventID.SelfUserInfoRefresh);
        }
Example #27
0
        //录像房间信息初始化
        private void GameInit(Video_GameInit gameInit)
        {
            if (_PlayerDic.Count > 0)
            {
                return;
            }

            //初始化房间信息
            _RoomConfig = FiveStarRoomConfigFactory.Create(gameInit.RoomConfigs);
            string roomInfo = "房号:" + gameInit.RoomNumber + "      " + gameInit.OfficeNumber + "/" +
                              _RoomConfig.MaxJuShu + "局      " + _RoomConfig.RoomNumber + "人局";

            _CurrRoomOffice = gameInit.OfficeNumber;
            _roomPanel.SetRoomInfo(roomInfo);
            //先隐藏所有玩家头像
            EventMsgMgr.SendEvent(CardFiveStarEventID.HideAllPlayer);

            //先记录出当前位置的服务器
            int selfSelfIndex = 0;

            for (int i = 0; i < gameInit.PlayerInfos.Count; i++)
            {
                if (gameInit.PlayerInfos[i].UserId == UserComponent.Ins.pUserId)
                {
                    selfSelfIndex = i;
                    break;
                }
            }
            //创建玩家头像信息
            for (int i = 0; i < gameInit.PlayerInfos.Count; i++)
            {
                User user = new User();
                user.Name     = gameInit.PlayerInfos[i].Name;
                user.Icon     = gameInit.PlayerInfos[i].Icon;
                user.UserId   = gameInit.PlayerInfos[i].UserId;
                user.IsOnLine = true;
                CardFiveStarPlayer player = CardFiveStarPlayerFactory.Creator(user, i, selfSelfIndex, _RoomConfig.RoomNumber, _roomPanel.mPlayerUIsGo.transform, gameInit.PlayerInfos[i].NowScore);//创建用户
                _PlayerDic[gameInit.PlayerInfos[i].SeatIndex] = player;
            }
        }
Example #28
0
        public void Init(CardFiveStarPlayer player, GameObject go)
        {
            _Player    = player;
            _User      = player._user;
            gameObject = go;
            Transform transform = gameObject.transform;

            _HeadImage            = ETModel.GameObjectHelper.FindChild(transform, "HeadImage").GetComponent <Image>();
            _NameText             = ETModel.GameObjectHelper.FindChild(transform, "HeadImage/NameBgGo/NameText").GetComponent <Text>();
            _ScoreText            = ETModel.GameObjectHelper.FindChild(transform, "ScoreBg/ScoreText").GetComponent <Text>();
            _PiaoNumText          = ETModel.GameObjectHelper.FindChild(transform, "PiaoNumText").GetComponent <Text>();
            _GetScoreText         = ETModel.GameObjectHelper.FindChild(transform, "GetScoreText").GetComponent <Text>();
            _LostConnectionHintGo = ETModel.GameObjectHelper.FindChild(transform, "LostConnectionHintGo").gameObject;
            _HouseIconGo          = ETModel.GameObjectHelper.FindChild(transform, "HouseIconGo").gameObject;
            _ExpressionPoint      = ETModel.GameObjectHelper.FindChild(transform, "ExpressionPoint");
            gameObject.GetComponent <Button>().Add(ShowUserInfo, false);
            InitHeadInfo(_Player);


            EventMsgMgr.RegisterEvent(CommEventID.UserOnLine, UserOnLine);   //用户上线
            EventMsgMgr.RegisterEvent(CommEventID.UserOffLine, UserOffLine); //用户下线
        }
Example #29
0
 protected override void Run(ETModel.Session session, Actor_JoyLds_AnewDeal message)
 {
     EventMsgMgr.SendEvent(JoyLandlordsEventID.AnewDeal);
 }
 protected override void Run(ETModel.Session session, Actor_UserOffline message)
 {
     EventMsgMgr.SendEvent(CommEventID.UserOffLine, message.UserId);//玩家下线
 }