Ejemplo n.º 1
0
    void updateTime()
    {
        setShenMoOpenTime();
        System.DateTime serverDate  = ServerTimeKit.getDateTime();
        godsWarTime     godsTimes   = GodsWarInfoConfigManager.Instance().getSampleBySid(6001).times[2];
        int             currnetTime = serverDate.Hour * 3600 + serverDate.Minute * 60 + serverDate.Second;
        int             rushTime    = godsTimes.hour * 3600 + godsTimes.minute * 60;

        if ((rushTime - currnetTime > 0 && rushTime - currnetTime < 300) || (currnetTime - rushTime > 0 && currnetTime - rushTime < 100))
        {
            zhanOrReplay.gameObject.SetActive(false);
            return;
        }
        if (!rushFlag && rushTime - currnetTime < 0)
        {
            rushFlag = true;
            if (UiManager.Instance.isInGodsBattle)
            {
                UiManager.Instance.isInGodsBattle = false;
                UiManager.Instance.BackToWindow <MainWindow>();
                UiManager.Instance.backGround.switchBackGround("backGround_1");
                UiManager.Instance.openDialogWindow <MessageLineWindow>((win) => {
                    win.Initialize(LanguageConfigManager.Instance.getLanguage("godsCloseInfo"));
                });
                return;
            }
            OnDataLoad();
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 决赛预告是否开启(神魔大战)
    /// </summary>
    public bool isFinalOpen()
    {
        if (GodsWarManagerment.Instance.getGodsWarStateInfo() == "not_open")
        {
            return(false);
        }
        System.DateTime serverDate = ServerTimeKit.getDateTime();
        if (serverDate.DayOfWeek != DayOfWeek.Friday)
        {
            return(false);
        }

        List <godsWarTime> goodsTime = GodsWarInfoConfigManager.Instance().getSampleBySid(8001).times;
        int min = GodsWarInfoConfigManager.Instance().getSampleBySid(9001).num[0];

        if (goodsTime == null)
        {
            return(false);
        }
        if (goodsTime[goodsTime.Count - 1].hour * 60 + goodsTime[goodsTime.Count - 1].minute - serverDate.Hour * 60 - serverDate.Minute <= min && goodsTime[goodsTime.Count - 1].hour * 60 + goodsTime[goodsTime.Count - 1].minute - serverDate.Hour * 60 - serverDate.Minute > 0)
        {
            return(true);
        }
        return(false);
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 获取赛程描述
    /// </summary>
    private void getTimeDesc()
    {
        GodsWarInfoConfigManager manager = GodsWarInfoConfigManager.Instance();

        timeDesc = new string[timeLabels.Length];
        for (int i = 0; i < timeLabels.Length; i++)
        {
            timeDesc[i] = manager.getSampleBySid(i + 1).des;
        }
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 判断当前是否是服务器开服30天后
    /// </summary>
    public bool isOnlineDay30()
    {
        int onlineDay = (ServerTimeKit.getSecondTime() - ServerTimeKit.onlineTime) / 3600 / 24;

        if (GodsWarInfoConfigManager.Instance().getSampleBySid(7001).num[0] >= onlineDay)
        {
            return(false);
        }
        return(true);
    }
Ejemplo n.º 5
0
    /// <summary>
    /// 设置淘汰赛时间标签
    /// </summary>
    public void setTimeLabel(int hour, int minute)
    {
        List <godsWarTime> time = new List <godsWarTime> ();

        time = GodsWarInfoConfigManager.Instance().getSampleBySid(6001).times;
        int currentTime = hour * 3600 + minute * 60;

        for (int k = time.Count - 1; k >= 0; k--)
        {
            timelabels[k].text = time[k].hour + ":" + (time[k].minute == 0 ? "00" : time[k].minute + "");
            int tempTime = time[k].hour * 3600 + time[k].minute * 60;
            if (k == time.Count - 1)
            {
                if (currentTime >= tempTime + 600)
                {
                    nodePoint[k].spriteName = "point_green";
                }
                else if (currentTime >= tempTime)
                {
                    nodePoint[k].spriteName = "point-y";
                }
                continue;
            }
            int temp = time[k + 1].hour * 3600 + time[k + 1].minute * 60;
            if (currentTime >= temp)
            {
                nodePoint[k].spriteName = "point_green";
                nodeLine[k].gameObject.SetActive(true);
            }
            else if (currentTime >= tempTime)
            {
                nodePoint[k].spriteName = "point-y";
            }
        }
        //for (int i = 0; i < time.Count; i++) {
        //    if (hour > time [i].hour || (hour >= time [i].hour && minute >= time [i].minute)) {
        //        for (int j = i+1; j >0; j--) {
        //            nodePoint [j-1].spriteName = "point_green";
        //            //正在进行则显示为黄色
        //            if(((hour >= time [i].hour && minute >= time [i].minute)&&(hour == time [i+1 < time.Count ? (i+1) : i].hour && minute < time [i+1 < time.Count ? (i+1) : i].minute))
        //               ||(hour >= time [i].hour && minute >= time [i].minute)&& hour < time [i+1 < time.Count ? (i+1) : i].hour)
        //                nodePoint[j-1].spriteName = "point-y";
        //            if (j-1 > 0)
        //                nodeLine [j - 2].gameObject.SetActive (true);
        //        }
        //    }
        //    timelabels [i].text = time [i].hour + ":" + (time [i].minute == 0 ? "00" : time [i].minute + "");
        //}
        int pos = 0;

        lblDes [pos++].text = LanguageConfigManager.Instance.getLanguage("godsWar_112");
        lblDes [pos++].text = LanguageConfigManager.Instance.getLanguage("godsWar_113");
        lblDes [pos++].text = LanguageConfigManager.Instance.getLanguage("godsWar_114");
        lblDes [pos++].text = LanguageConfigManager.Instance.getLanguage("godsWar_115");
    }
Ejemplo n.º 6
0
    public int getMaxCanBuyCount()
    {
        int addNum   = 0;
        int vipLevel = UserManager.Instance.self.vipLevel;
        Vip vip      = VipManagerment.Instance.getVipbyLevel(vipLevel);

        if (vip != null)
        {
//			addNum = vip.privilege.godsWarCountBuyAdd;
        }
        return(GodsWarInfoConfigManager.Instance().getSampleBySid(1001).num[0] + addNum);
    }
Ejemplo n.º 7
0
    /// <summary>
    /// 初始化UI
    /// </summary>
    public void initUI()
    {
        lblName.text = user.name;
        int a = GodsWarManagerment.Instance.getTypeByLocalId(localID);

        int[] costM = GodsWarInfoConfigManager.Instance().getSampleBySid(5001).num;
        int   coost = costM[a >= costM.Length ? costM.Length - 1 : a - 1];

        lblCostRmb.text   = coost.ToString();
        lblPower.text     = LanguageConfigManager.Instance.getLanguage("godsWar_59", user.power.ToString());
        lblLevel.text     = "Lv." + user.level;
        lblSuportNum.text = LanguageConfigManager.Instance.getLanguage("godsWar_60", user.suportPlayerNum.ToString());
        ResourcesManager.Instance.LoadAssetBundleTexture(UserManager.Instance.getIconPath(user.headIcon), icon);
    }
Ejemplo n.º 8
0
    /// <summary>
    /// 执行rmb支持按钮
    /// </summary>
    public void doRMBSuportEvent(GameObject obj)
    {
        int a = GodsWarManagerment.Instance.getTypeByLocalId(localID);

        int[] costM   = GodsWarInfoConfigManager.Instance().getSampleBySid(5001).num;
        int   costRmb = costM[a >= costM.Length ? costM.Length - 1 : a - 1];

        if (UserManager.Instance.self.getRMB() < costRmb)
        {
            UiManager.Instance.openDialogWindow <MessageWindow>((win) => {
                win.initWindow(2, LanguageConfigManager.Instance.getLanguage("s0094"), LanguageConfigManager.Instance.getLanguage("s0324"),
                               LanguageConfigManager.Instance.getLanguage("godsWar_105"), (msg) => {
                    if (msg.buttonID == MessageHandle.BUTTON_RIGHT)
                    {
                        // fatherWindow.finishWindow();
                        UiManager.Instance.openWindow <rechargeWindow> ();
                    }
                    else
                    {
                        MaskWindow.UnlockUI();
                    }
                });
            });
            fatherWindow.finishWindow();
        }
        else
        {
            UiManager.Instance.openDialogWindow <MessageWindow>((win) => {
                win.initWindow(2, LanguageConfigManager.Instance.getLanguage("s0094"), LanguageConfigManager.Instance.getLanguage("s0093"),
                               LanguageConfigManager.Instance.getLanguage("godsWar_106", costRmb.ToString(), user.name), (msg) => {
                    if (msg.buttonID == MessageHandle.BUTTON_RIGHT)
                    {
                        FPortManager.Instance.getFPort <GodsWarSendSuportFPort>().access(user.serverName, user.uid, type, index, localID, 1, updateUI);
                    }
                    else
                    {
                        MaskWindow.UnlockUI();
                    }
                });
            });
        }
    }
Ejemplo n.º 9
0
    /// <summary>
    /// 设置神魔大战开始时间
    /// </summary>
    private void setShenMoOpenTime()
    {
        System.DateTime serverDate = ServerTimeKit.getDateTime();
        int             day        = TimeKit.getWeekCHA(serverDate.DayOfWeek);

        if (day < 5)
        {
            lblTime.text = LanguageConfigManager.Instance.getLanguage("godsWar_126",
                                                                      getDateTime(ServerTimeKit.getSecondTime() + 86400 * (5 - day)),
                                                                      GodsWarInfoConfigManager.Instance().getSampleBySid(8001).times[0].hour + ":" +
                                                                      (GodsWarInfoConfigManager.Instance().getSampleBySid(8001).times[0].minute == 0
                        ? "00"
                        : GodsWarInfoConfigManager.Instance().getSampleBySid(8001).times[0].minute + ""));
        }
        else
        {
            int         currentTime = serverDate.Hour * 3600 + serverDate.Minute * 60 + serverDate.Second;
            godsWarTime gwt         = GodsWarInfoConfigManager.Instance().getSampleBySid(8001).times[0];
            if (day == 5)
            {
                if (currentTime < gwt.hour * 3600 + gwt.minute * 60)
                {
                    lblTime.text = LanguageConfigManager.Instance.getLanguage("godsWar_126",
                                                                              getDateTime(ServerTimeKit.getSecondTime() + 86400 * (5 - day)),
                                                                              GodsWarInfoConfigManager.Instance().getSampleBySid(8001).times[0].hour + ":" +
                                                                              (GodsWarInfoConfigManager.Instance().getSampleBySid(8001).times[0].minute == 0
                    ? "00"
                    : GodsWarInfoConfigManager.Instance().getSampleBySid(8001).times[0].minute + ""));
                }
                else if (currentTime > gwt.hour * 3600 + gwt.minute * 60 && currentTime < gwt.hour * 3600 + gwt.minute * 60 + 1261)
                {
                    lblTime.text = LanguageConfigManager.Instance.getLanguage("godsWar_1277");
                }
                else
                {
                    lblTime.text = LanguageConfigManager.Instance.getLanguage("godsWar_127");
                }
            }
        }

        // if (zhanOrReplay.gameObject.activeInHierarchy && zhanOrReplay.textLabel.text == LanguageConfigManager.Instance.getLanguage("godsWar_125")) lblTime.text = LanguageConfigManager.Instance.getLanguage("godsWar_127");
    }
Ejemplo n.º 10
0
    /// <summary>
    /// 半决赛预告是否开启(淘汰赛)
    /// </summary>
    public bool isTaoTaiOpen()
    {
        if (!GodsWarManagerment.Instance.getGodsWarStateInfo().EndsWith("_taotai"))
        {
            return(false);
        }
        System.DateTime    serverDate = ServerTimeKit.getDateTime();
        List <godsWarTime> goodsTime  = GodsWarInfoConfigManager.Instance().getSampleBySid(6001).times;
        int min = GodsWarInfoConfigManager.Instance().getSampleBySid(9001).num[0];

        if (goodsTime == null)
        {
            return(false);
        }

        if (serverDate.Hour * 60 + serverDate.Minute - (goodsTime [goodsTime.Count - 1].hour * 60 + goodsTime [goodsTime.Count - 1].minute) <= min)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
Ejemplo n.º 11
0
    /// <summary>
    /// 初始化界面
    /// </summary>
    private void initUI()
    {
        lblName.text = "[fff8e2]" + name + "[-]" + "[fff8e2]" + " Lv. " + lv.ToString() + "[-]";
        //lblLv.text = "Lv. "+lv.ToString();
        if (isBeated)
        {
            beated.gameObject.SetActive(true);
            buttomInfo.gameObject.SetActive(false);
            lblWinScore.gameObject.SetActive(false);
        }

        int stage_20    = GodsWarInfoConfigManager.Instance().getSampleBySid(4001).num[0];
        int stage_20_35 = GodsWarInfoConfigManager.Instance().getSampleBySid(4002).num[0];
        int stage_35_50 = GodsWarInfoConfigManager.Instance().getSampleBySid(4003).num[0];

        if (winScore < stage_20)
        {
            lblWinScore.text = Colors.RED + LanguageConfigManager.Instance.getLanguage("godsWar_100") + "+" + winScore.ToString();
        }
        else if (winScore < stage_20_35)
        {
            lblWinScore.text = Colors.WHITE + LanguageConfigManager.Instance.getLanguage("godsWar_100") + "+" + winScore.ToString();
        }
        else if (winScore < stage_35_50)
        {
            lblWinScore.text = Colors.GREEN + LanguageConfigManager.Instance.getLanguage("godsWar_100") + "+" + winScore.ToString();
        }
        else if (winScore >= stage_35_50)
        {
            lblWinScore.text = Colors.GREEN + LanguageConfigManager.Instance.getLanguage("godsWar_100") + "+" + winScore.ToString() + "(Max)";
        }
//		if(index==1||index==2)
//		{
//			buttomInfo.gameObject.transform.localPosition = new Vector3(0,150f,0);
//		}
//		if(index==3||index==4)
//		{
//			modelTextrue.width = 200;
//			modelTextrue.height = 200;
//		}
//		if(index ==5)
//		{
//			modelTextrue.width = 210;
//			modelTextrue.height = 210;
//		}

        if (index == 2 || index == 4)
        {
            buttomInfo.gameObject.transform.localPosition = new Vector3(0, 150f, 0);
        }
        if (index == 1 || index == 5)
        {
            modelTextrue.width  = 200;
            modelTextrue.height = 200;
        }
        if (index == 3)
        {
            modelTextrue.width  = 210;
            modelTextrue.height = 210;
        }
    }
Ejemplo n.º 12
0
    public override void read(ErlKVMessage message)
    {
        ErlArray array = message.getValue("msg") as ErlArray;

        if (array != null)
        {
            int             pos  = 0;
            GodsWarUserInfo user = new GodsWarUserInfo();
            user.bigTeam        = array.Value [pos++].getValueString();
            user.smallTeam      = changeTeamtype(StringKit.toInt(array.Value [pos++].getValueString()));
            user.rank           = StringKit.toInt(array.Value [pos++].getValueString());
            user.numOfWinning   = StringKit.toInt(array.Value [pos++].getValueString());
            user.usedChallgeNum = StringKit.toInt(array.Value [pos++].getValueString());
            user.todayIntegral  = StringKit.toInt(array.Value [pos++].getValueString());
            user.totalIntegral  = StringKit.toInt(array.Value [pos++].getValueString());
            GodsWarManagerment.Instance.challengeCount    = user.usedChallgeNum;                                             //已经挑战的次数
            GodsWarManagerment.Instance.maxChallengeCount = GodsWarInfoConfigManager.Instance().getSampleBySid(1001).num[0]; //最大挑战次数
            ErlType  tmp        = new ErlType();
            ErlArray enemyArray = array.Value [pos++] as ErlArray;
            if (enemyArray != null)
            {
                List <GodsWarUserInfo> list = new List <GodsWarUserInfo> ();
                list.Clear();
                for (int i = 0; i < enemyArray.Value.Length; i++)
                {
                    tmp = enemyArray.Value [i];
                    ErlArray        empArray = tmp as ErlArray;
                    GodsWarUserInfo enemy    = new GodsWarUserInfo();
                    enemy.massPosition = i;
                    if (empArray.Value.Length == 0)
                    {
                        enemy.uid = "-1";
                        list.Add(enemy); continue;
                    }                //如果为0表示该位置没有对手
                    int tmpPos = 0;
                    enemy.serverName    = empArray.Value [tmpPos++].getValueString();
                    enemy.uid           = empArray.Value [tmpPos++].getValueString();
                    enemy.name          = empArray.Value [tmpPos++].getValueString();
                    enemy.headIcon      = StringKit.toInt(empArray.Value [tmpPos++].getValueString());
                    enemy.level         = StringKit.toInt(empArray.Value [tmpPos++].getValueString());
                    enemy.winScore      = StringKit.toInt(empArray.Value [tmpPos++].getValueString());
                    enemy.challengedWin = StringKit.toInt(empArray.Value [tmpPos++].getValueString()) == 1;
                    list.Add(enemy);
                }
                GodsWarManagerment.Instance.setEnemyList(list);
                GodsWarManagerment.Instance.self = user;
            }
            List <int> scores = new List <int>();
            ErlArray   mpt    = array.Value[pos++] as ErlArray;
            if (mpt.Value.Length != 0)
            {
                for (int i = 0; i < mpt.Value.Length; i++)
                {
                    scores.Add(StringKit.toInt(mpt.Value[i].getValueString()));
                }
                GodsWarManagerment.Instance.currentScores = scores;
            }
            else
            {
                GodsWarManagerment.Instance.currentScores = null;
            }

            if (callback != null)
            {
                callback();
            }
        }
        else
        {
            MessageWindow.ShowAlert((message.getValue("msg") as ErlType).getValueString());
            if (callback != null)
            {
                callback = null;
            }
        }
    }