Пример #1
0
        public void SendWarReward()
        {
            //遍历排名
            for (int i = 0; i < m_HeroScores.Count; i++)
            {
                int ranking = i + 1;
                //遍历Conf
                for (int j = 0; j < m_WarRewordConf.Count; j++)
                {
                    //最小功勋
                    if (m_LessScore && m_HeroScores[i].score <= m_LessScoreValue)
                    {
                        continue;
                    }
                    //最小讨敌
                    if (m_LessKill && m_HeroScores[i].num <= m_LessKillValue)
                    {
                        continue;
                    }
                    //是否排名内
                    if (m_WarRewordConf[j].start <= ranking && m_WarRewordConf[j].end >= ranking && m_WarRewordConf[j].flag == 0)
                    {
                        SendWarReward(m_HeroScores[i].name, m_WarRewordConf[j]);
                    }
                    //是否尾数
                    if (m_GoodLuck && m_WarRewordConf[j].flag == 0 && ranking % 10 == m_WarRewordConf[j].start && m_WarRewordConf[j].end >= ranking)
                    {
                        SendWarReward(m_HeroScores[i].name, m_WarRewordConf[i]);
                    }
                }
            }
            SGExHandle SGEx = new SGExHandle();

            SGEx.SendWorldWords("国战个人奖励已经发放,请到大鸿儒处领取虚宝奖励!");
        }
Пример #2
0
        public void SendStageReward()
        {
            StageCtrl.LoadStageDefInfo();
            //m_NoticeOrganizeRst;
            foreach (var it in m_NoticeOrganizeRst)
            {
                //遍历m_WarOrgRewordConf
                foreach (var RewordConf in m_WarOrgRewordConf)
                {
                    if (RewordConf.stage == StageCtrl.GetNameById(it.stage.ToString()) && RewordConf.type == "占城奖励")
                    {
                        WarRewordConf conf = new WarRewordConf();
                        conf.id1    = RewordConf.id1;
                        conf.count1 = RewordConf.count1;
                        conf.id2    = RewordConf.id2;
                        conf.count2 = RewordConf.count2;
                        conf.id3    = RewordConf.id3;
                        conf.count3 = RewordConf.count3;
                        conf.id4    = RewordConf.id4;
                        conf.count4 = RewordConf.count4;
                        conf.id5    = RewordConf.id5;
                        conf.count5 = RewordConf.count5;

                        SendWarReward(it.leader, conf);
                    }
                }
            }
            SGExHandle SGEx = new SGExHandle();

            SGEx.SendWorldWords("国战占城奖励已经发放,请军团长到大鸿儒处领取虚宝奖励!");
        }
Пример #3
0
        public void SendStageConstReward()
        {
            SGExHandle SGEx = new SGExHandle();

            SGEx.SendWorldWords("国战防守奖励已经发放,请军团长到大鸿儒处领取虚宝奖励!");
        }
Пример #4
0
        public List <HeroScore> GetHeroScore(bool sort)
        {
            m_HeroScores.Clear();
            //读取文件重建m_HeroScores
            FileStream   cwar_last_fs = new FileStream(m_BaseForlder + "\\Map\\history\\history_0351.txt", FileMode.Open, FileAccess.Read);
            StreamReader cwar_last_rd = new StreamReader(cwar_last_fs, Encoding.GetEncoding(950));

            string strLine = "";

            strLine = cwar_last_rd.ReadLine();
            int lastMode = -1;

            do
            {
                strLine = strLine.Split('/')[0];
                if (strLine.Contains("last_result"))
                {
                    lastMode = 1;
                }
                else if (strLine.Contains("register_list"))
                {
                    lastMode = 2;
                    m_HeroScores.Clear();
                }
                if (strLine.Contains("item") && lastMode == 1)
                {
                    //ToSimplified
                    HeroScore heroScore = new HeroScore();
                    strLine = CFormat.ToSimplified(strLine);
                    strLine = strLine.Split(new string[] { " = " }, StringSplitOptions.RemoveEmptyEntries)[1];
                    var heres = strLine.Split(',');
                    if (heres[0] != "")
                    {
                        heroScore.name    = heres[0];
                        heroScore.level   = 0;
                        heroScore.unkown1 = "";
                        heroScore.unkown2 = "";
                        heroScore.score   = int.Parse(heres[3]);
                        heroScore.num     = int.Parse(heres[5]);
                        heroScore.unkwon3 = "";
                        m_HeroScores.Add(heroScore);
                    }
                }
                strLine = "";
                strLine = cwar_last_rd.ReadLine();
            } while (strLine != null);

            if (m_HeroScores.Count == 0)
            {
                SGExHandle SGEx = new SGExHandle();
                SGEx.SendWorldWords("赤壁未分胜负,以讨敌数排名,自动发奖!");

                //查询数据库
            }

            if (sort)
            {
                m_HeroScores.Sort(new Comparison <HeroScore>(AnswerResultCompare));
            }


            cwar_last_rd.Close();
            cwar_last_fs.Close();

            return(m_HeroScores);
        }