Ejemplo n.º 1
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("国战占城奖励已经发放,请军团长到大鸿儒处领取虚宝奖励!");
        }
Ejemplo n.º 2
0
        public void InitRewordConf()
        {
            m_WarRewordConf.Clear();
            FileStream   fs = new FileStream(".\\Profile\\国战英雄奖励配置.xls", FileMode.OpenOrCreate, FileAccess.Read);
            StreamReader rd = new StreamReader(fs, Encoding.Default);

            string strLine = "";

            strLine = rd.ReadLine();
            while (strLine != null)
            {
                var details = strLine.Split('\t');
                if (details.Length >= 18)
                {
                    WarRewordConf _WarRewordConf = new WarRewordConf();
                    _WarRewordConf.flag   = uint.Parse(details[0]);
                    _WarRewordConf.start  = uint.Parse(details[1]);
                    _WarRewordConf.end    = uint.Parse(details[2]);
                    _WarRewordConf.id1    = uint.Parse(details[3] == ""?"0":details[3]);
                    _WarRewordConf.name1  = details[4].ToString();
                    _WarRewordConf.count1 = uint.Parse(details[5] == "" ? "0" : details[5]);
                    _WarRewordConf.id2    = uint.Parse(details[6] == "" ? "0" : details[6]);
                    _WarRewordConf.name2  = details[7].ToString();
                    _WarRewordConf.count2 = uint.Parse(details[8] == "" ? "0" : details[8]);
                    _WarRewordConf.id3    = uint.Parse(details[9] == "" ? "0" : details[9]);
                    _WarRewordConf.name3  = details[10].ToString();
                    _WarRewordConf.count3 = uint.Parse(details[11] == "" ? "0" : details[11]);
                    _WarRewordConf.id4    = uint.Parse(details[12] == "" ? "0" : details[12]);
                    _WarRewordConf.name4  = details[13].ToString();
                    _WarRewordConf.count4 = uint.Parse(details[14] == "" ? "0" : details[14]);
                    _WarRewordConf.id5    = uint.Parse(details[15] == "" ? "0" : details[15]);
                    _WarRewordConf.name5  = details[16].ToString();
                    _WarRewordConf.count5 = uint.Parse(details[17] == "" ? "0" : details[17]);

                    m_WarRewordConf.Add(_WarRewordConf);
                }
                strLine = "";
                strLine = rd.ReadLine();
            }

            rd.Close();
            fs.Close();

            //////////////////////////////////////////////////////////////////////////////////
            //   防守奖励 m_WarOrgRewordConf
            StageCtrl.LoadStageDefInfo();
            m_WarOrgRewordConf.Clear();
            FileStream   _fs = new FileStream(".\\Profile\\国战防守奖励配置.xls", FileMode.OpenOrCreate, FileAccess.Read);
            StreamReader _rd = new StreamReader(_fs, Encoding.Default);

            string _strLine = "";

            _strLine = _rd.ReadLine();
            while (_strLine != null)
            {
                var details = _strLine.Split('\t');
                if (details.Length >= 18)
                {
                    WarOrgRewordConf _WarOrgRewordConf = new WarOrgRewordConf();
                    _WarOrgRewordConf.stage  = details[0];
                    _WarOrgRewordConf.type   = details[1];
                    _WarOrgRewordConf.id1    = uint.Parse(details[2] == "" ? "0" : details[2]);
                    _WarOrgRewordConf.name1  = details[3].ToString();
                    _WarOrgRewordConf.count1 = uint.Parse(details[4] == "" ? "0" : details[4]);
                    _WarOrgRewordConf.id2    = uint.Parse(details[5] == "" ? "0" : details[5]);
                    _WarOrgRewordConf.name2  = details[6].ToString();
                    _WarOrgRewordConf.count2 = uint.Parse(details[7] == "" ? "0" : details[7]);
                    _WarOrgRewordConf.id3    = uint.Parse(details[8] == "" ? "0" : details[8]);
                    _WarOrgRewordConf.name3  = details[9].ToString();
                    _WarOrgRewordConf.count3 = uint.Parse(details[10] == "" ? "0" : details[10]);
                    _WarOrgRewordConf.id4    = uint.Parse(details[11] == "" ? "0" : details[11]);
                    _WarOrgRewordConf.name4  = details[12].ToString();
                    _WarOrgRewordConf.count4 = uint.Parse(details[13] == "" ? "0" : details[13]);
                    _WarOrgRewordConf.id5    = uint.Parse(details[14] == "" ? "0" : details[14]);
                    _WarOrgRewordConf.name5  = details[15].ToString();
                    _WarOrgRewordConf.count5 = uint.Parse(details[16] == "" ? "0" : details[16]);
                    _WarOrgRewordConf.flag   = uint.Parse(details[17]);

                    m_WarOrgRewordConf.Add(_WarOrgRewordConf);

                    if (_WarOrgRewordConf.type == "防守奖励")
                    {
                        m_NoticeConstStage.Add(int.Parse(StageCtrl.GetIdByName(_WarOrgRewordConf.stage)));
                    }
                    else if (_WarOrgRewordConf.type == "占城奖励")
                    {
                        m_NoticeStage.Add(int.Parse(StageCtrl.GetIdByName(_WarOrgRewordConf.stage)));
                    }
                }
                _strLine = "";
                _strLine = _rd.ReadLine();
            }

            _rd.Close();
            _fs.Close();
        }