예제 #1
0
 public override void OnRegister()
 {
     base.OnRegister();
     hallProxy             = ApplicationFacade.Instance.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy;
     loginProxy            = ApplicationFacade.Instance.RetrieveProxy(Proxys.LOGIN_PROXY) as LoginProxy;
     View.HallView         = (HallView)UIManager.Instance.ShowUI(UIViewID.HALL_VIEW);
     View.TopView          = (TopMenuView)UIManager.Instance.ShowUI(UIViewID.TOPMENU_VIEW);
     View.HallRoomListView = (HallRoomListView)UIManager.Instance.ShowUI(UIViewID.HALLROOMLIST_VIEW);
     View.MiddleView       = (MiddleMenuView)UIManager.Instance.ShowUI(UIViewID.MIDDLEMENU_VIEW);
     View.BottomView       = (BottomMenuView)UIManager.Instance.ShowUI(UIViewID.BOTTOMMENU_VIEW);
     TopMenuAddEvent();
     MiddleMenuAddEvent();
     BottomMenuAddEvent();
     RefreshUserInfo();
     AudioSystem.Instance.PlayBgm("Voices/Bgm/91bgmusic");
     if (GlobalData.LoginServer != "127.0.0.1" && NetMgr.Instance.ConnentionDic.ContainsKey(SocketType.BATTLE))
     {
         NetMgr.Instance.StopTcpConnection(SocketType.BATTLE);
         if (!NetMgr.Instance.ConnentionDic.ContainsKey(SocketType.HALL))
         {
             NetMgr.Instance.CreateConnect(SocketType.HALL, loginProxy.hallServerIP, loginProxy.hallServerPort);
         }
     }
     StartUp();
 }
예제 #2
0
    public override void OnRegister()
    {
        base.OnRegister();
        this.View.ButtonAddListening(this.View.CloseButton,
                                     () =>
        {
            UIManager.Instance.HideUI(UIViewID.JOINROOM_VIEW);
            this.ClearRoomID();
        });

        foreach (Transform child in this.View.NumberTrans)
        {
            Button numBtn = child.GetComponent <Button>();
            this.View.ButtonAddListening(numBtn, InputRoomID, false, numBtn.gameObject.name);
        }

        this.View.RoomIDMAX = this.View.RoomNumTrans.childCount;
        foreach (Transform child in this.View.RoomNumTrans)
        {
            Text text = child.FindChild("NumText").GetComponent <Text>();
            this.View.RoomNumTexts.Add(text);
        }
        this.View.ButtonAddListening(this.View.DelButton, DeleteRoomID);
        this.View.ButtonAddListening(this.View.ResButton, ClearRoomID);
        this.hallProxy = Facade.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy;
    }
예제 #3
0
    /// <summary>
    /// 设置启动
    /// </summary>
    private void StartUp()
    {
        if (!Application.isMobilePlatform)
        {
            return;
        }
        if (GlobalData.isStartUp)
        {
            if (GlobalData.sdkPlatform == SDKPlatform.ANDROID)
            {
                GlobalData.StartUpParam = AndroidSdkInterface.GetStartParam();
            }
            GlobalData.isStartUp = false;
        }
        Dictionary <string, string> paramDic = StringUtil.ParseParam(GlobalData.StartUpParam);

        if (paramDic.ContainsKey(StartUpParam.ROOMID))
        {
            HallProxy hallProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy;
            hallProxy.HallInfo.roomCode = paramDic [StartUpParam.ROOMID];
            JoinInRoomC2S package = new JoinInRoomC2S();
            package.roomCode = hallProxy.HallInfo.roomCode;
            package.seat     = 0;
            NetMgr.Instance.SendBuff <JoinInRoomC2S> (SocketType.HALL, MsgNoC2S.C2S_Hall_JOIN_IN_ROOM.GetHashCode(), 0, package);
        }
        GlobalData.StartUpParam = null;
    }
예제 #4
0
    private void UpdateRankList()
    {
        HallProxy hallProxy    = Facade.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy;
        ArrayList dataProvider = new ArrayList();

        dataProvider.AddRange(hallProxy.HallInfo.userInfo);
        View.rankTable.DataProvider = dataProvider;
    }
예제 #5
0
    public ActivContnet(GameObject contnetRoot, HallNoticeType noticeType)
    {
        btn      = contnetRoot.transform.FindChild("Button").GetComponent <Button>();
        selected = contnetRoot.transform.FindChild("Selected").gameObject;
        title    = contnetRoot.transform.FindChild("Title").gameObject;
        Text     = contnetRoot.transform.FindChild("Text").GetComponent <Text>();
        HallProxy hallProxy = (HallProxy)ApplicationFacade.Instance.RetrieveProxy(Proxys.HALL_PROXY);

        Text.text = hallProxy.HallInfo.NoticeList[noticeType].content;
    }
예제 #6
0
    /// <summary>
    /// 发送匹配请求
    /// </summary>
    private void SendMatchingRequest()
    {
        HallProxy        hallProxy = Facade.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy;
        ApplyMatchingC2S package   = new ApplyMatchingC2S();

        package.roomType   = (int)hallProxy.HallInfo.CompetitionRule;
        package.roomRounds = (int)hallProxy.HallInfo.CompetitionRound;
        Debug.Log(package.roomType);
        Debug.Log(package.roomRounds);
        NetMgr.Instance.SendBuff <ApplyMatchingC2S>(SocketType.HALL, MsgNoC2S.REQUEST_APPLYMATCHING_C2S.GetHashCode(), 0, package);
    }
예제 #7
0
    public override void OnInit()
    {
        hallProxy     = ApplicationFacade.Instance.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy;
        this.viewRoot = this.LaunchUIView("Prefab/UI/Shopping/shoppingtips");
        wxID          = viewRoot.transform.Find("Text").GetComponent <Text> ();
        closeButton   = viewRoot.transform.Find("close").GetComponent <Button> ();

        closeButton.onClick.AddListener(() => {
            UIManager.Instance.HideUI(UIViewID.SHOPPINGTIPS_VIEW);
        });
    }
예제 #8
0
 public override void OnRegister()
 {
     base.OnRegister();
     this.hallProxy = Facade.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy;
     this.playerInfoProxy = Facade.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy;
     this.View.ButtonAddListening(this.View.CloseButton,
         () =>
         {
             UIManager.Instance.HideUI(UIViewID.CREATEROOM_VIEW);
         });
     this.View.FourModeInfo.Toggle.onValueChanged.AddListener(
         (bool isOn) =>
         {
             this.ChangeGameModel(isOn,this.View.FourModeInfo.Model);
             this.View.NotWord.Toggle.interactable = false;
         });
     this.View.EightModeInfo.Toggle.onValueChanged.AddListener(
         (bool isOn) =>
         {
             this.ChangeGameModel(isOn, this.View.EightModeInfo.Model);
             this.View.NotWord.Toggle.interactable = false;
         });
     this.View.SixteenModeInfo.Toggle.onValueChanged.AddListener(
         (bool isOn) =>
         {
             this.ChangeGameModel(isOn, this.View.SixteenModeInfo.Model);
             this.View.NotWord.Toggle.interactable = true;
         });
     this.View.CapScore.Toggle.onValueChanged.AddListener(
         (bool isOn)=>
         {
             this.ChangeGameCap(isOn,this.View.CapScore.Cap);
         }
         );
     this.View.NotWord.Toggle.onValueChanged.AddListener(
         (bool isOn)=> 
         {
             this.View.FourModeInfo.Toggle.interactable = false;
             this.View.EightModeInfo.Toggle.interactable = false;
             this.ChangeGameRule(isOn, this.View.NotWord.Rule);
         });
     this.View.Word.Toggle.onValueChanged.AddListener(
         (bool isOn)=>
         {
             this.View.FourModeInfo.Toggle.interactable = true;
             this.View.EightModeInfo.Toggle.interactable = true;
             this.ChangeGameRule(isOn, this.View.Word.Rule);
         }
         );
     this.View.ButtonAddListening(this.View.CreateButton, SendCreateRoom);
     this.hallProxy.HallInfo.Innings = (int)(GameMode.FOUR_ROUND);
 }
예제 #9
0
 public override void OnRegister()
 {
     base.OnRegister();
     this.View.ButtonAddListening(this.View.CloseButton,
                                  () =>
     {
         HallProxy hallProxy       = Facade.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy;
         CancelMatchingC2S package = new CancelMatchingC2S();
         package.roomType          = (int)hallProxy.HallInfo.CompetitionRule;
         package.roomRounds        = (int)hallProxy.HallInfo.CompetitionRound;
         NetMgr.Instance.SendBuff <CancelMatchingC2S>(SocketType.HALL, MsgNoC2S.REQUEST_CANCELMATCHING_C2S.GetHashCode(), 0, package);
     });
     this.InitTimer();
 }
예제 #10
0
    public override void OnRegister()
    {
        base.OnRegister();
        hallProxy       = Facade.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy;
        playerInfoProxy = Facade.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy;
        View.ButtonAddListening(this.View.CloseButton,
                                () =>
        {
            UIManager.Instance.HideUI(UIViewID.CREATEROOM_VIEW);
        });

        View.ButtonAddListening(this.View.CreateButton, SendCreateRoom);
        //hallProxy.HallInfo.innings = GameMode.EIGHT_ROUND;
        //hallProxy.HallInfo.gameRule = GameRule.WORD;
    }
예제 #11
0
    /// <summary>
    /// 初始化签到界面
    /// </summary>
    private void InitSignInInfo()
    {
        HallProxy hallProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy;

        for (int i = 0; i < hallProxy.HallInfo.SignInDay; i++)
        {
            Transform dayState = this.View.DataList[i];
            dayState.FindChild("Unused").gameObject.SetActive(false);
            dayState.FindChild("Used").gameObject.SetActive(true);
        }
        if (hallProxy.HallInfo.SignInDay >= 7)
        {
            this.View.SignInButton.gameObject.SetActive(false);
            this.View.GetButton.gameObject.SetActive(true);
        }
    }
예제 #12
0
 public override void OnRegister()
 {
     base.OnRegister();
     hallProxy                = Facade.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy;
     gameMgrProxy             = Facade.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy;
     View.ruleValueTxt.text   = hallProxy.HallInfo.ruleDesc;
     View.rewardValueTxt.text = hallProxy.HallInfo.rewardDesc;
     View.closeBtn.onClick.AddListener(() =>
     {
         UIManager.Instance.HideUI(UIViewID.ARENA_VIEW);
     });
     View.applyBtn.onClick.AddListener(ApplyHandler);
     View.battleBtn.onClick.AddListener(BattleHandler);
     View.rankBtn.onClick.AddListener(RankHandler);
     updateTimeId = Timer.Instance.AddTimer(1, 0, 0, UpdateBtns);
 }
예제 #13
0
 public override void OnRegister()
 {
     base.OnRegister();
     this.View.ButtonAddListening(this.View.CloseButton,
                                  () =>
     {
         HallProxy hallProxy         = Facade.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy;
         CancelMatchingC2S package   = new CancelMatchingC2S();
         hallProxy.HallInfo.gameRule = GameRule.ARENA;
         hallProxy.HallInfo.innings  = GameMode.ONE;
         package.roomType            = (int)hallProxy.HallInfo.gameRule;
         package.roomRounds          = (int)hallProxy.HallInfo.innings;
         NetMgr.Instance.SendBuff <CancelMatchingC2S>(SocketType.HALL, MsgNoC2S.C2S_Hall_Cancel_Match.GetHashCode(), 0, package);
     });
     this.InitTimer();
 }
예제 #14
0
    /// <summary>
    /// 刷新签到界面
    /// </summary>
    private void RefreshSignInInfo()
    {
        HallProxy hallProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy;

        if (hallProxy.HallInfo.SignInState == (int)ErrorCode.SUCCESS)
        {
            for (int i = 0; i < hallProxy.HallInfo.SignInDay; i++)
            {
                Transform dayState = this.View.DataList[i];
                if (i == hallProxy.HallInfo.SignInDay - 1)
                {
                    SignInInfoAnimation(dayState);
                }
                else
                {
                    dayState.FindChild("Unused").gameObject.SetActive(false);
                    dayState.FindChild("Used").gameObject.SetActive(true);
                }
            }
            if (hallProxy.HallInfo.SignInDay >= 7)
            {
                this.View.SignInButton.transform.DOScale(Vector3.zero, 0.2f).SetEase(Ease.Linear).OnComplete(
                    () =>
                {
                    this.View.SignInButton.transform.gameObject.SetActive(false);
                    this.View.SignInButton.transform.localScale = Vector3.one;
                    this.View.GetButton.transform.localScale    = Vector3.zero;
                    this.View.GetButton.gameObject.SetActive(true);
                    this.View.GetButton.transform.DOScale(Vector3.one, 0.2f).SetEase(Ease.Linear);
                });
            }
        }
        else
        {
            DialogMsgVO dialogVO = new DialogMsgVO();
            dialogVO.dialogType = DialogType.ALERT;
            dialogVO.title      = "签到失败";
            dialogVO.content    = "今日已签到,请勿重复签到";
            DialogView dialogView = UIManager.Instance.ShowUI(UIViewID.DIALOG_VIEW) as DialogView;
            dialogView.data = dialogVO;
        }
    }
예제 #15
0
    /// <summary>
    /// 刷新比赛场信息View
    /// </summary>
    private void RefreshAthleticsView()
    {
        HallProxy hallProxy       = ApplicationFacade.Instance.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy;
        DateTime  currentDateTime = TimeHandle.Instance.GetDateTimeByTimestamp(hallProxy.HallInfo.CurrentTime);
        DateTime  startDateTime   = TimeHandle.Instance.GetDateTimeByTimestamp(hallProxy.HallInfo.StartTime);
        DateTime  endDateTime     = TimeHandle.Instance.GetDateTimeByTimestamp(hallProxy.HallInfo.EndTime);
        TimeSpan  startTime       = startDateTime - currentDateTime;

        if (startTime.TotalMinutes > 5)
        {
            this.View.Title.text = "未开启";
            this.View.Tint.text  = "查看上一轮排名";
            this.View.Time.text  = "";
            this.View.State.text = "";
        }
        else if (startTime.TotalMinutes > 0 && startTime.TotalMinutes <= 5)
        {
            this.View.Title.text = "即将开启";
            this.View.Tint.text  = "";
            this.View.Time.text  = startDateTime.ToString("HH:mm");
            this.View.State.text = "开始";
        }
        else if (startTime.TotalMinutes <= 0)
        {
            if (currentDateTime.TimeOfDay.TotalMilliseconds <= endDateTime.TimeOfDay.TotalMilliseconds)
            {
                this.View.Title.text = "活动开启";
                this.View.Tint.text  = "";
                this.View.Time.text  = endDateTime.ToString("HH:mm");
                this.View.State.text = "结束";
            }
            else if (currentDateTime.TimeOfDay.TotalMilliseconds > endDateTime.TimeOfDay.TotalMilliseconds)
            {
                this.View.Title.text = "未开启";
                this.View.Tint.text  = "查看上一轮排名";
                this.View.Time.text  = "";
                this.View.State.text = "";
            }
        }
    }
예제 #16
0
    public override void OnRegister()
    {
        base.OnRegister();
        hallProxy       = ApplicationFacade.Instance.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy;
        loginProxy      = ApplicationFacade.Instance.RetrieveProxy(Proxys.LOGIN_PROXY) as LoginProxy;
        View.HallView   = (HallView)UIManager.Instance.ShowUI(UIViewID.HALL_VIEW);
        View.TopView    = (TopMenuView)UIManager.Instance.ShowUI(UIViewID.TOPMENU_VIEW);
        View.MiddleView = (MiddleMenuView)UIManager.Instance.ShowUI(UIViewID.MIDDLEMENU_VIEW);
        TopMenuAddEvent();
        MiddleMenuAddEvent();
        View.TopView.ViewRoot.SetActive(false);
        View.MiddleView.ViewRoot.SetActive(false);
        AudioSystem.Instance.PlayBgm(Resources.Load <AudioClip>("Voices/Bgm/HallBgm"));
        if (GlobalData.LoginServer != "127.0.0.1")
        {
            NetMgr.Instance.StopTcpConnection(SocketType.BATTLE);
            if (!NetMgr.Instance.ConnentionDic.ContainsKey(SocketType.HALL))
            {
                NetMgr.Instance.CreateConnect(SocketType.HALL, loginProxy.hallServerIP, loginProxy.hallServerPort);
            }
        }
        var startUpParam = AndroidSdkInterface.GetStartParam();

        if (startUpParam != null)
        {
            Dictionary <string, string> paramDic = StringUtil.ParseParam(startUpParam);
            if (paramDic.ContainsKey(StartUpParam.TYPE) && paramDic[StartUpParam.TYPE] == StartUpType.JOINROOM)
            {
                hallProxy.HallInfo.RoomCode = paramDic[StartUpParam.ROOMID];
                JoinInRoomC2S package = new JoinInRoomC2S();
                package.roomCode = hallProxy.HallInfo.RoomCode;
                package.seat     = 0;
                NetMgr.Instance.SendBuff <JoinInRoomC2S>(SocketType.HALL, MsgNoC2S.REQUEST_JOINROOM_C2S.GetHashCode(), 0, package);
            }
        }
    }