public static void InitAllForgeLevelInfo()
 {
     lock (AllThingsCalcItem.QiangHuaFuJiaItemList)
     {
         SystemXmlItems xmlitems = new SystemXmlItems();
         xmlitems.LoadFromXMlFile("Config/QiangHuaFuJia.xml", "", "ID", 0);
         AllThingsCalcItem.QiangHuaFuJiaItemList.Clear();
         foreach (KeyValuePair <int, SystemXmlItem> kv in xmlitems.SystemXmlItemDict)
         {
             SystemXmlItem     item = kv.Value;
             QiangHuaFuJiaItem qiangHuaFuJiaItem = new QiangHuaFuJiaItem();
             qiangHuaFuJiaItem.Id    = item.GetIntValue("ID", -1);
             qiangHuaFuJiaItem.Level = item.GetIntValue("QiangHuaLevel", -1);
             qiangHuaFuJiaItem.Num   = item.GetIntValue("Num", -1);
             qiangHuaFuJiaItem.AddAttackInjurePercent = item.GetDoubleValue("AddAttackInjurePercent");
             qiangHuaFuJiaItem.MaxLifePercent         = item.GetDoubleValue("MaxLifePercent");
             AllThingsCalcItem.QiangHuaFuJiaItemList.Add(qiangHuaFuJiaItem);
         }
         AllThingsCalcItem.QiangHuaFuJiaItemList.Sort((QiangHuaFuJiaItem x, QiangHuaFuJiaItem y) => x.Id - y.Id);
         for (int i = 0; i < AllThingsCalcItem.QiangHuaFuJiaItemList.Count; i++)
         {
             AllThingsCalcItem.QiangHuaFuJiaItemList[i].Id = i + 1;
         }
     }
 }
示例#2
0
        /// <summary>
        /// 初始化套装强化加成信息
        /// </summary>
        public static void InitAllForgeLevelInfo()
        {
            lock (QiangHuaFuJiaItemList)
            {
                SystemXmlItems xmlitems = new SystemXmlItems();
                xmlitems.LoadFromXMlFile("Config/QiangHuaFuJia.xml", "", "ID");
                SystemXmlItem item = null;
                QiangHuaFuJiaItemList.Clear();
                foreach (var kv in xmlitems.SystemXmlItemDict)
                {
                    item = kv.Value;

                    QiangHuaFuJiaItem qiangHuaFuJiaItem = new QiangHuaFuJiaItem();
                    qiangHuaFuJiaItem.Id    = item.GetIntValue("ID");
                    qiangHuaFuJiaItem.Level = item.GetIntValue("QiangHuaLevel");
                    qiangHuaFuJiaItem.Num   = item.GetIntValue("Num");
                    qiangHuaFuJiaItem.AddAttackInjurePercent = item.GetDoubleValue("AddAttackInjurePercent");
                    qiangHuaFuJiaItem.MaxLifePercent         = item.GetDoubleValue("MaxLifePercent");
                    QiangHuaFuJiaItemList.Add(qiangHuaFuJiaItem);
                }

                QiangHuaFuJiaItemList.Sort((x, y) => { return(x.Id - y.Id); });
                for (int i = 0; i < QiangHuaFuJiaItemList.Count; i++)
                {
                    QiangHuaFuJiaItemList[i].Id = i + 1;
                }
            }
        }
示例#3
0
        /// <summary>
        /// 装入公告数据
        /// </summary>
        public static void LoadGongGaoData()
        {
            String fullPathFileName = Global.IsolateResPath("Config/Gonggao.xml");

            strGongGaoXML = File.ReadAllText(fullPathFileName);

            systemGongGaoMgr.LoadFromXMlFile("Config/Gonggao.xml", "", "ID", 1);
        }
示例#4
0
        //初始化静态数据
        public void Initialize()
        {
            //从BuJian.xml读取数据
            SystemXmlItems xml = new SystemXmlItems();

            xml.LoadFromXMlFile("Config/BuJian.xml", "", "ID");

            foreach (KeyValuePair <int, SystemXmlItem> item in xml.SystemXmlItemDict)
            {
                HolyPartInfo data = new HolyPartInfo();
                data.m_nCostBandJinBi = item.Value.GetIntValue("CostBandJinBi");
                //if (data.m_nCostBandJinBi < 0)
                //data.m_nCostBandJinBi = 0;
                data.m_sSuccessProbability = Convert.ToSByte(item.Value.GetDoubleValue("SuccessProbability") * 100);
                if (data.m_sSuccessProbability < 0)
                {
                    data.m_sSuccessProbability = -1;
                }

                string[] strfiled = item.Value.GetStringValue("NeedGoods").Split(',');
                if (strfiled.Length > 1)
                {
                    //data.m_nNeedGoodsID = Global.SafeConvertToInt32(strfiled[0]);
                    data.m_nNeedGoodsCount = Global.SafeConvertToInt32(strfiled[1]);
                }

                strfiled = item.Value.GetStringValue("FailCost").Split(',');
                if (strfiled.Length > 1)
                {
                    //data.m_nFailCostGoodsID = Global.SafeConvertToInt32(strfiled[0]);
                    data.m_nFailCostGoodsCount = Global.SafeConvertToInt32(strfiled[1]);
                }

                string strParam = item.Value.GetStringValue("Property");
                if (strParam != "-1")
                {
                    data.m_PropertyList = GameManager.SystemMagicActionMgr.ParseActionsOutUse(strParam);
                }

                data.m_nMaxFailCount = item.Value.GetIntValue("FailMaxNum");
                if (data.m_nMaxFailCount < 0)
                {
                    data.m_nMaxFailCount = 0;
                }

                _partDataDic.Add(item.Value.GetIntValue("ID"), data);
            }

            //从ShengWu.xml读取数据
            xml = new SystemXmlItems();
            xml.LoadFromXMlFile("Config/ShengWu.xml", "", "ID");

            foreach (KeyValuePair <int, SystemXmlItem> item in xml.SystemXmlItemDict)
            {
                HolyInfo data = new HolyInfo();

                string strParam = item.Value.GetStringValue("ExtraProperty");
                if (strParam != "-1")
                {
                    data.m_ExtraPropertyList = GameManager.SystemMagicActionMgr.ParseActionsOutUse(strParam);
                }

                _holyDataDic.Add(item.Value.GetIntValue("ID"), data);
            }

            TCPCmdDispatcher.getInstance().registerProcessorEx((int)TCPGameServerCmds.CMD_DB_UPDATE_HOLYITEM, 2, 2, getInstance());
        }
示例#5
0
 public void LoadFromXMlFile(string fullFileName, string rootName, string keyName, int resType = 0)
 {
     ClearAwardsByLevels();
     systemLevelAwardsXml.LoadFromXMlFile(fullFileName, rootName, keyName, resType);
 }
示例#6
0
        public static void initialize()
        {
            try
            {
                int[] nParams = GameManager.systemParamsList.GetParamValueIntArrayByName("LuoLanFaZhen");
                if (nParams.Length != 5)
                {
                    throw new Exception("systemParamsList.LuoLanFaZhen参数数量应该是5");
                }
                //特殊boss
                SpecialBossID = nParams[0];
                //特殊boss所在地图
                SpecialMapCode = nParams[1];
                //杀死特殊boss后的通关奖励倍数
                SpecialAwardRate = nParams[2];
                //罗兰法阵副本编号
                LuoLanFaZhenFubenID = nParams[3];
                //进入特殊地图的概率
                SpecialTeleRate = nParams[4];
                //通关BossID
                SystemXmlItem systemFuBenItem = null;
                if (GameManager.systemFuBenMgr.SystemXmlItemDict.TryGetValue(LuoLanFaZhenFubenID, out systemFuBenItem) && systemFuBenItem != null)
                {
                    FinalBossID = systemFuBenItem.GetIntValue("BossID");
                }

                //读LuoLanFaZhen.xml配置文件
                systemLuoLanFaZhen.LoadFromXMlFile("Config/LuoLanFaZhen.xml", "", "MapID");
                List <int> listMapCode = systemLuoLanFaZhen.SystemXmlItemDict.Keys.ToList();
                foreach (var mapcode in listMapCode)
                {
                    SystemXmlItem systemFazhenMap = null;
                    if (systemLuoLanFaZhen.SystemXmlItemDict.TryGetValue(mapcode, out systemFazhenMap) && systemFazhenMap != null)
                    {
                        SystemFazhenMapData sysMapData = new SystemFazhenMapData();
                        sysMapData.MapCode = mapcode;
                        int[] specailParams = systemFazhenMap.GetIntArrayValue("TeShuMapID", '|');
                        if (null != specailParams && specailParams.Length >= 3)
                        {
                            sysMapData.SpecialDestMapCode = specailParams[0];
                            sysMapData.SpecialDestX       = specailParams[1];
                            sysMapData.SpecialDestY       = specailParams[2];
                        }
                        else
                        {
                            sysMapData.SpecialDestMapCode = -1;
                            sysMapData.SpecialDestX       = -1;
                            sysMapData.SpecialDestY       = -1;
                        }

                        int[]    gateIds         = systemFazhenMap.GetIntArrayValue("ChuanSongMenID", '|');
                        string   strDestMapTemp  = systemFazhenMap.GetStringValue("MuDidiID");
                        string[] strDestMapTemp2 = strDestMapTemp.Split('|');

                        if (gateIds.Length != strDestMapTemp2.Length)
                        {
                            throw new Exception("LuoLanFaZhen.xml传送门数量和目标地图数量不一致");
                        }

                        for (int i = 0; i < gateIds.Length; i++)
                        {
                            sysMapData.listGateID.Add(gateIds[i]);
                        }

                        for (int i = 0; i < strDestMapTemp2.Length; i++)
                        {
                            string[] strDestMapTemp3 = strDestMapTemp2[i].Split(',');
                            sysMapData.listDestMapCode.Add(Convert.ToInt32(strDestMapTemp3[0]));
                        }

                        m_AllMapGatesStaticData[mapcode] = sysMapData;
                    }
                }
            }
            catch (Exception)
            {
                throw new Exception("罗兰法阵配置项出错");
            }
        }
示例#7
0
        public void Initialize()
        {
            SystemXmlItems xml = new SystemXmlItems();

            xml.LoadFromXMlFile("Config/BuJian.xml", "", "ID", 0);
            foreach (KeyValuePair <int, SystemXmlItem> item in xml.SystemXmlItemDict)
            {
                HolyPartInfo data = new HolyPartInfo();
                data.m_nCostBandJinBi      = item.Value.GetIntValue("CostBandJinBi", -1);
                data.m_sSuccessProbability = Convert.ToSByte(item.Value.GetDoubleValue("SuccessProbability") * 100.0);
                if (data.m_sSuccessProbability < 0)
                {
                    data.m_sSuccessProbability = -1;
                }
                string[] strfiled = item.Value.GetStringValue("NeedGoods").Split(new char[]
                {
                    ','
                });
                if (strfiled.Length > 1)
                {
                    data.m_nNeedGoodsCount = Global.SafeConvertToInt32(strfiled[1]);
                }
                strfiled = item.Value.GetStringValue("FailCost").Split(new char[]
                {
                    ','
                });
                if (strfiled.Length > 1)
                {
                    data.m_nFailCostGoodsCount = Global.SafeConvertToInt32(strfiled[1]);
                }
                string strParam = item.Value.GetStringValue("Property");
                if (strParam != "-1")
                {
                    data.m_PropertyList = GameManager.SystemMagicActionMgr.ParseActionsOutUse(strParam);
                }
                data.m_nMaxFailCount = item.Value.GetIntValue("FailMaxNum", -1);
                if (data.m_nMaxFailCount < 0)
                {
                    data.m_nMaxFailCount = 0;
                }
                data.NeedGoods      = ConfigParser.ParserIntArrayList(item.Value.GetStringValue("NeedItem"), true, '|', ',');
                data.FaildNeedGoods = ConfigParser.ParserIntArrayList(item.Value.GetStringValue("FailureConsumption"), true, '|', ',');
                this._partDataDic.Add(item.Value.GetIntValue("ID", -1), data);
                int suitID = item.Value.GetIntValue("SuitID", -1);
                HolyItemManager.MAX_HOLY_PART_LEVEL = Math.Max(HolyItemManager.MAX_HOLY_PART_LEVEL, Convert.ToSByte(suitID));
            }
            HolyItemManager.MAX_HOLY_PART_LEVEL = (sbyte)Global.GMin((int)HolyItemManager.MAX_HOLY_PART_LEVEL, (int)GameManager.systemParamsList.GetParamValueIntByName("ShengWuMax", 0));
            xml = new SystemXmlItems();
            xml.LoadFromXMlFile("Config/ShengWu.xml", "", "ID", 0);
            foreach (KeyValuePair <int, SystemXmlItem> item in xml.SystemXmlItemDict)
            {
                HolyInfo data2    = new HolyInfo();
                string   strParam = item.Value.GetStringValue("ExtraProperty");
                if (strParam != "-1")
                {
                    data2.m_ExtraPropertyList = GameManager.SystemMagicActionMgr.ParseActionsOutUse(strParam);
                }
                this._holyDataDic.Add(item.Value.GetIntValue("ID", -1), data2);
            }
            TCPCmdDispatcher.getInstance().registerProcessorEx(10206, 2, 2, HolyItemManager.getInstance(), TCPCmdFlags.IsStringArrayParams);
        }
示例#8
0
        /// <summary>
        /// 初始化管理器
        /// </summary>
        public void init()
        {
            //缓存献花需要的钻石
            try
            {
                dNeedGam = GameManager.systemParamsList.GetParamValueDoubleArrayByName("XianHuaCost");
            }
            catch (System.Exception ex)
            {
                DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic XianHuaCost", false);
            }

            //缓存婚戒最终属性系数
            try
            {
                dRingmodulus = GameManager.systemParamsList.GetParamValueDoubleByName("GoodWillXiShu");
            }
            catch (System.Exception ex)
            {
                DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic GoodWillXiShu", false);
            }

            //对方婚戒属性倍率参数
            try
            {
                dOtherRingmodulus = GameManager.systemParamsList.GetParamValueDoubleByName("BanLvXiShu");
            }
            catch (System.Exception ex)
            {
                DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic BanLvXiShu", false);
            }

            //加载婚戒数据
            try
            {
                WeddingRingDic.LoadFromXMlFile("Config/WeddingRing.xml", "", "GoodsID");
            }
            catch (System.Exception ex)
            {
                DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic WeddingRing.xml", false);
            }

            //加载玫瑰花数据
            try
            {
                SystemXmlItems RoseXmlItems = new SystemXmlItems();
                RoseXmlItems.LoadFromXMlFile("Config/GiveRose.xml", "", "GoodsID");

                foreach (KeyValuePair <int, SystemXmlItem> item in RoseXmlItems.SystemXmlItemDict)
                {
                    MarriageRoseData rosedata = new MarriageRoseData();
                    rosedata.nBaseAddGoodWill = item.Value.GetIntValue("GoodWill");

                    string[] strfiled = item.Value.GetStringValue("MultiplyingPower").Split('|');

                    int nAddRate = 0;

                    for (int i = 0; i < strfiled.Length; ++i)
                    {
                        string[] strfiled2 = strfiled[i].Split(',');

                        //预先计算一下几率
                        nAddRate += (int)(Convert.ToDouble(strfiled2[1]) * 100.0d);

                        rosedata.modulusList.Add(Convert.ToInt32(strfiled2[0]));
                        rosedata.rateList.Add(nAddRate);
                    }

                    RoseDataDic.Add(Convert.ToInt32(item.Value.GetIntValue("GoodsID")), rosedata);
                }
            }
            catch (System.Exception ex)
            {
                DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic GiveRose.xml", false);
            }

            //加载奉献数据
            try
            {
                SystemXmlItems XmlItems = new SystemXmlItems();
                XmlItems.LoadFromXMlFile("Config/GoodWill.xml", "", "Type");

                sbyte tmpStar = 0;
                int   nAddExp = 0;

                //预先把1阶0星加进去
                GoodwillAllExpList.Add(0);

                foreach (var item in XmlItems.SystemXmlItemDict)
                {
                    tmpStar = 0;

                    foreach (var xmlnode in item.Value.XMLNode.Descendants())
                    {
                        nAddExp += Convert.ToInt32(xmlnode.Attribute("NeedGoodWill").Value);
                        GoodwillAllExpList.Add(nAddExp);

                        tmpStar++;
                    }
                }

                //动态设置一下最大阶级
                byMaxGoodwillLv = (sbyte)((GoodwillAllExpList.Count - 1) / tmpStar);

                //动态设置一下最大星级
                byMaxGoodwillStar = tmpStar;
            }
            catch (System.Exception ex)
            {
                DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic GoodWill.xml", false);
            }

            //初始化协议列表
            TCPCmdDispatcher.getInstance().registerProcessorEx((int)TCPGameServerCmds.CMD_SPR_MARRY_ROSE, 1, 1, getInstance());
            TCPCmdDispatcher.getInstance().registerProcessorEx((int)TCPGameServerCmds.CMD_SPR_MARRY_RING, 1, 1, getInstance());
            TCPCmdDispatcher.getInstance().registerProcessorEx((int)TCPGameServerCmds.CMD_SPR_MARRY_MESSAGE, 1, 1, getInstance());

            //初始化消息监听器
            //GlobalEventSource.getInstance().registerListener((int)EventTypes.PlayerInitGame, getInstance());   //玩家登陆事件
        }
示例#9
0
 public void init()
 {
     try
     {
         this.dNeedGam = GameManager.systemParamsList.GetParamValueDoubleArrayByName("XianHuaCost", ',');
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic XianHuaCost", false, false);
     }
     try
     {
         this.dRingmodulus = GameManager.systemParamsList.GetParamValueDoubleByName("GoodWillXiShu", 0.0);
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic GoodWillXiShu", false, false);
     }
     try
     {
         this.dOtherRingmodulus = GameManager.systemParamsList.GetParamValueDoubleByName("BanLvXiShu", 0.0);
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic BanLvXiShu", false, false);
     }
     try
     {
         this.WeddingRingDic.LoadFromXMlFile("Config/WeddingRing.xml", "", "GoodsID", 0);
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic WeddingRing.xml", false, false);
     }
     try
     {
         SystemXmlItems RoseXmlItems = new SystemXmlItems();
         RoseXmlItems.LoadFromXMlFile("Config/GiveRose.xml", "", "GoodsID", 0);
         foreach (KeyValuePair <int, SystemXmlItem> item in RoseXmlItems.SystemXmlItemDict)
         {
             MarriageRoseData rosedata = new MarriageRoseData();
             rosedata.nBaseAddGoodWill = item.Value.GetIntValue("GoodWill", -1);
             string[] strfiled = item.Value.GetStringValue("MultiplyingPower").Split(new char[]
             {
                 '|'
             });
             int nAddRate = 0;
             for (int i = 0; i < strfiled.Length; i++)
             {
                 string[] strfiled2 = strfiled[i].Split(new char[]
                 {
                     ','
                 });
                 nAddRate += (int)(Convert.ToDouble(strfiled2[1]) * 100.0);
                 rosedata.modulusList.Add(Convert.ToInt32(strfiled2[0]));
                 rosedata.rateList.Add(nAddRate);
             }
             this.RoseDataDic.Add(Convert.ToInt32(item.Value.GetIntValue("GoodsID", -1)), rosedata);
         }
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic GiveRose.xml", false, false);
     }
     try
     {
         SystemXmlItems XmlItems = new SystemXmlItems();
         XmlItems.LoadFromXMlFile("Config/GoodWill.xml", "", "Type", 0);
         sbyte tmpStar = 0;
         int   nAddExp = 0;
         this.GoodwillAllExpList.Add(0);
         foreach (KeyValuePair <int, SystemXmlItem> item in XmlItems.SystemXmlItemDict)
         {
             tmpStar = 0;
             foreach (XElement xmlnode in item.Value.XMLNode.Descendants())
             {
                 nAddExp += Convert.ToInt32(xmlnode.Attribute("NeedGoodWill").Value);
                 this.GoodwillAllExpList.Add(nAddExp);
                 tmpStar += 1;
             }
         }
         this.byMaxGoodwillLv   = (sbyte)((this.GoodwillAllExpList.Count - 1) / (int)tmpStar);
         this.byMaxGoodwillStar = tmpStar;
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, "init marryotherlogic GoodWill.xml", false, false);
     }
     TCPCmdDispatcher.getInstance().registerProcessorEx(871, 1, 1, MarriageOtherLogic.getInstance(), TCPCmdFlags.IsStringArrayParams);
     TCPCmdDispatcher.getInstance().registerProcessorEx(872, 1, 1, MarriageOtherLogic.getInstance(), TCPCmdFlags.IsStringArrayParams);
     TCPCmdDispatcher.getInstance().registerProcessorEx(873, 1, 1, MarriageOtherLogic.getInstance(), TCPCmdFlags.IsStringArrayParams);
 }