public bool processCmdEx(GameClient client, int nID, byte[] bytes, string[] cmdParams) { bool result; if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System2Dot4)) { result = false; } else { switch (nID) { case 1816: result = this.ProcessShenQiInfoCmd(client, nID, bytes, cmdParams); break; case 1817: result = this.ProcessShenQiUpCmd(client, nID, bytes, cmdParams); break; default: result = true; break; } } return(result); }
public void GetHolyItemPart(GameClient client, sbyte sShengWu_slot, sbyte sBuJian_slot, int nNum) { if (!GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot7)) { Dictionary <sbyte, HolyItemData> holyitemdata = client.ClientData.MyHolyItemDataDic; HolyItemData tmpdata = null; HolyItemPartData tmppartdata = null; if (holyitemdata.TryGetValue(sShengWu_slot, out tmpdata)) { if (tmpdata.m_PartArray.TryGetValue(sBuJian_slot, out tmppartdata)) { tmppartdata.m_nSlice += nNum; this.UpdateHolyItemData2DB(client, sShengWu_slot, sBuJian_slot, tmppartdata); this.HolyItemSendToClient(client, sShengWu_slot, sBuJian_slot); string strHint = StringUtil.substitute(GLang.GetLang(384, new object[0]), new object[] { Global.GetLang(HolyItemManager.SliceNameSet[(int)sShengWu_slot, (int)sBuJian_slot]), nNum }); GameManager.ClientMgr.NotifyImportantMsg(client, strHint, GameInfoTypeIndexes.Normal, ShowGameInfoTypes.PiaoFuZi, 0); GameManager.logDBCmdMgr.AddDBLogInfo(-1, HolyItemManager.SliceNameSet[(int)sShengWu_slot, (int)sBuJian_slot], "圣物碎片", Global.GetMapName(client.ClientData.MapCode), client.ClientData.RoleName, "增加", nNum, client.ClientData.ZoneID, client.strUserID, tmppartdata.m_nSlice, client.ServerId, null); } } } }
public bool ProcessGetYongZheZhanChangAwardInfoCmd(GameClient client, int nID, byte[] bytes, string[] cmdParams) { try { // 如果1.7的功能没开放 if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot7)) { return(false); } string awardsInfo = Global.GetRoleParamByName(client, RoleParamName.YongZheZhanChangAwards); if (!string.IsNullOrEmpty(awardsInfo)) { int lastGroupId = 0; int score = 0; int success = 0; int sideScore1 = 0; int sideScore2 = 0; ConfigParser.ParseStrInt3(awardsInfo, ref lastGroupId, ref success, ref score); List <int> awardsParamList = Global.StringToIntList(awardsInfo, ','); lastGroupId = awardsParamList[0]; bool clear = true; if (awardsParamList.Count >= 5 && lastGroupId > 0) { success = awardsParamList[1]; score = awardsParamList[2]; sideScore1 = awardsParamList[3]; sideScore2 = awardsParamList[4]; YongZheZhanChangSceneInfo lastSceneItem = null; if (RuntimeData.SceneDataDict.TryGetValue(lastGroupId, out lastSceneItem)) { //只给一次,马上清掉记录 if (score >= RuntimeData.WarriorBattleLowestJiFen) { clear = false; } NtfCanGetAward(client, success, score, lastSceneItem, sideScore1, sideScore2); } } if (clear) { Global.SaveRoleParamsStringToDB(client, RoleParamName.YongZheZhanChangAwards, RuntimeData.RoleParamsAwardsDefaultString, true); } } return(true); } catch (Exception ex) { DataHelper.WriteFormatExceptionLog(ex, Global.GetDebugHelperInfo(client.ClientSocket), false); } client.sendCmd(nID, StdErrorCode.Error_Success_No_Info); return(false); }
/// <summary> /// 罗兰城战攻防竞价申请指令处理 /// </summary> /// <param name="client"></param> /// <param name="nID"></param> /// <param name="bytes"></param> /// <param name="cmdParams"></param> /// <returns></returns> public bool ProcessYongZheZhanChangJoinCmd(GameClient client, int nID, byte[] bytes, string[] cmdParams) { try { int result = StdErrorCode.Error_Success_No_Info; do { // 如果1.7的功能没开放 if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot7)) { break; } YongZheZhanChangSceneInfo sceneItem = null; YongZheZhanChangGameStates state = YongZheZhanChangGameStates.None; if (!CheckMap(client)) { result = StdErrorCode.Error_Denied_In_Current_Map; } else { result = CheckCondition(client, ref sceneItem, ref state); } if (state != YongZheZhanChangGameStates.SignUp) { result = StdErrorCode.Error_Not_In_valid_Time; //非报名时间 } else if (RuntimeData.RoleId2JoinGroup.ContainsKey(client.ClientData.RoleID)) { result = StdErrorCode.Error_Operation_Denied; // 已经报名了 } if (result >= 0) { int gropuId = sceneItem.Id; result = YongZheZhanChangClient.getInstance().YongZheZhanChangSignUp(client.strUserID, client.ClientData.RoleID, client.ClientData.ZoneID, (int)GameTypes.YongZheZhanChang, gropuId, client.ClientData.CombatForce); if (result > 0) { RuntimeData.RoleId2JoinGroup[client.ClientData.RoleID] = gropuId; client.ClientData.SignUpGameType = (int)GameTypes.YongZheZhanChang; } } } while (false); //发送结果给客户端 client.sendCmd(nID, result); return(true); } catch (Exception ex) { DataHelper.WriteFormatExceptionLog(ex, Global.GetDebugHelperInfo(client.ClientSocket), false); } return(false); }
/// <summary> /// 是否开放结婚系统 [bing] 2015.6.16 /// </summary> public static bool IsVersionSystemOpenOfMarriage() { // 如果1.5的功能没开放 if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot5)) { return(false); } return(GameManager.VersionSystemOpenMgr.IsVersionSystemOpen(VersionSystemOpenKey.Marriage)); }
//登陆时发送给客户端圣物数据 //发送格式为 string = 圣物数量:<圣物类型:圣物部件数:<部件位置:部件阶数:部件碎片数量:>> public void PlayGameAfterSend(GameClient client) { // 如果1.7的功能没开放 if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot7)) { return; } Dictionary <sbyte, HolyItemData> holyitemdata = client.ClientData.MyHolyItemDataDic; if (holyitemdata == null) { return; } HolyItemData tmpdata = null; HolyItemPartData tmppartdata = null; for (sbyte i = 1; i <= MAX_HOLY_NUM; ++i) { if (true == holyitemdata.TryGetValue(i, out tmpdata)) { for (sbyte j = 1; j <= MAX_HOLY_PART_NUM; ++j) { if (false == tmpdata.m_PartArray.TryGetValue(j, out tmppartdata)) { tmppartdata = new HolyItemPartData(); tmpdata.m_PartArray.Add(j, tmppartdata); } } } else { //即使数据库没有也要补全数据 tmpdata = new HolyItemData(); holyitemdata.Add(i, tmpdata); tmpdata.m_sType = i; for (sbyte j = 1; j <= MAX_HOLY_PART_NUM; ++j) { tmppartdata = new HolyItemPartData(); tmpdata.m_PartArray.Add(j, tmppartdata); } } } //byte[] sendbytes = DataHelper.ObjectToBytes<Dictionary<int, HolyItemData>>(holyitemdata); //client.sendCmd((int)TCPGameServerCmds.CMD_SPR_HOLYITEM_DATA, sendbytes); client.sendCmd <Dictionary <sbyte, HolyItemData> >((int)TCPGameServerCmds.CMD_SPR_HOLYITEM_DATA, holyitemdata); }
//得到圣物碎片 public void GetHolyItemPart(GameClient client, sbyte sShengWu_slot, sbyte sBuJian_slot, int nNum) { // 如果1.7的功能没开放 if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot7)) { return; } Dictionary <sbyte, HolyItemData> holyitemdata = client.ClientData.MyHolyItemDataDic; HolyItemData tmpdata = null; HolyItemPartData tmppartdata = null; //先取得当前圣物部件等级 if (false == holyitemdata.TryGetValue(sShengWu_slot, out tmpdata)) { return; } if (false == tmpdata.m_PartArray.TryGetValue(sBuJian_slot, out tmppartdata)) { return; } tmppartdata.m_nSlice += nNum; //更新DB UpdateHolyItemData2DB(client, sShengWu_slot, sBuJian_slot, tmppartdata); //发送给客户端更新数据 HolyItemSendToClient(client, sShengWu_slot, sBuJian_slot); //推送个hint告诉前端获得碎片 string strHint = StringUtil.substitute(Global.GetLang("获得【{0}】{1}个"), Global.GetLang(SliceNameSet[sShengWu_slot, sBuJian_slot]), nNum); GameManager.ClientMgr.NotifyImportantMsg(client, strHint, GameInfoTypeIndexes.Normal, ShowGameInfoTypes.PiaoFuZi); //写log做统计 GameManager.logDBCmdMgr.AddDBLogInfo( -1 , SliceNameSet[sShengWu_slot, sBuJian_slot] , /**/ "圣物碎片" , Global.GetMapName(client.ClientData.MapCode) , client.ClientData.RoleName, /**/ "增加" , nNum , client.ClientData.ZoneID , client.strUserID , tmppartdata.m_nSlice , client.ServerId); }
/// <summary> /// 判断功能是否开启 /// </summary> /// <param name="client"></param> /// <returns></returns> public bool IsGongNengOpened(GameClient client, bool hint = false) { // 如果1.8的功能没开放 if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot8)) { return(false); } if (!GameManager.VersionSystemOpenMgr.IsVersionSystemOpen(VersionSystemOpenKey.KuaFuMap)) { return(false); } return(true); //GlobalNew.IsGongNengOpened(client, GongNengIDs.KuaFuMap, hint); }
/// <summary> /// 判断功能是否开启 /// </summary> /// <param name="client"></param> /// <returns></returns> public bool IsGongNengOpened(GameClient client, bool hint = false) { if (!GameManager.VersionSystemOpenMgr.IsVersionSystemOpen(VersionSystemOpenKey.HuanYingSiYuan)) { return(false); } // 如果1.4.1的功能没开放 if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot4Dot1)) { return(false); } return(GlobalNew.IsGongNengOpened(client, GongNengIDs.HuanYingSiYuan, hint)); }
/// <summary> /// 判断功能是否开启 /// </summary> /// <param name="client"></param> /// <returns></returns> public bool IsGongNengOpened(GameClient client, bool hint = false) { // 如果1.7的功能没开放 if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot7)) { return(false); } if (!GameManager.VersionSystemOpenMgr.IsVersionSystemOpen(VersionSystemOpenKey.YongZheZhanChang)) { return(false); } return(GlobalNew.IsGongNengOpened(client, GongNengIDs.YongZheZhanChang, hint)); }
/// <summary> /// 判断功能是否开启 /// </summary> /// <param name="client"></param> /// <returns></returns> public bool IsGongNengOpened(GameClient client, bool hint = false) { if (!GameManager.VersionSystemOpenMgr.IsVersionSystemOpen(VersionSystemOpenKey.TianTi)) { return(false); } // 如果1.6的功能没开放 if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot6)) { return(false); } return(GlobalNew.IsGongNengOpened(client, GongNengIDs.TianTi, hint)); }
public void PlayGameAfterSend(GameClient client) { if (!GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot7)) { Dictionary <sbyte, HolyItemData> holyitemdata = client.ClientData.MyHolyItemDataDic; if (holyitemdata != null) { HolyItemData tmpdata = null; HolyItemPartData tmppartdata = null; for (sbyte i = 1; i <= HolyItemManager.MAX_HOLY_NUM; i += 1) { if (holyitemdata.TryGetValue(i, out tmpdata)) { for (sbyte j = 1; j <= HolyItemManager.MAX_HOLY_PART_NUM; j += 1) { if (!tmpdata.m_PartArray.TryGetValue(j, out tmppartdata)) { tmppartdata = new HolyItemPartData(); tmpdata.m_PartArray.Add(j, tmppartdata); } } } else { tmpdata = new HolyItemData(); holyitemdata.Add(i, tmpdata); tmpdata.m_sType = i; for (sbyte j = 1; j <= HolyItemManager.MAX_HOLY_PART_NUM; j += 1) { tmppartdata = new HolyItemPartData(); tmpdata.m_PartArray.Add(j, tmppartdata); } } } client.sendCmd <Dictionary <sbyte, HolyItemData> >(1200, holyitemdata, false); } } }
public static bool IsVersionSystemOpenOfMarriage() { return(!GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot5) && GameManager.VersionSystemOpenMgr.IsVersionSystemOpen("Marriage")); }
public void RefreshProps(GameClient client, bool notifyPorpsChangeInfo = true) { if (!GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot5)) { int sumPetLevel = 0; int findPetLevel = 0; int sumPetTianFuNum = 0; int findPetTianFuNum = 0; int sumPetSkillLevel = 0; int findPetSkillLevel = 0; List <PetSkillInfo> petSkillList = new List <PetSkillInfo>(); EquipPropItem petLevelAwardItem = null; EquipPropItem petTianFuAwardItem = null; EquipPropItem petSkillAwardItem = null; EquipPropItem petSkillLevelAwardItem = null; Dictionary <int, GoodsData> havingPetDict = new Dictionary <int, GoodsData>(); Dictionary <int, EquipPropItem> groupPropItemDict = new Dictionary <int, EquipPropItem>(); List <GoodsData> demonGoodsList = DamonMgr.GetDemonGoodsDataList(client); foreach (GoodsData goodsData in demonGoodsList) { GoodsData existGoodsData; if (!havingPetDict.TryGetValue(goodsData.GoodsID, out existGoodsData)) { existGoodsData = new GoodsData(); existGoodsData.GoodsID = goodsData.GoodsID; existGoodsData.GCount = 0; havingPetDict[existGoodsData.GoodsID] = existGoodsData; } existGoodsData.GCount++; sumPetLevel += goodsData.Forge_level + 1; sumPetTianFuNum += Global.GetEquipExcellencePropNum(goodsData); petSkillList.AddRange(PetSkillManager.GetPetSkillInfo(goodsData)); } foreach (PetSkillInfo item in petSkillList) { sumPetSkillLevel += (item.PitIsOpen ? item.Level : 0); } lock (this.RuntimeData.Mutex) { foreach (PetLevelAwardItem item2 in this.RuntimeData.PetLevelAwardList) { if (sumPetLevel >= item2.Level && item2.Level > findPetLevel) { findPetLevel = item2.Level; petLevelAwardItem = item2.PropItem; } } foreach (PetTianFuAwardItem item3 in this.RuntimeData.PetTianFuAwardList) { if (sumPetTianFuNum >= item3.TianFuNum && item3.TianFuNum > findPetTianFuNum) { findPetTianFuNum = item3.TianFuNum; petTianFuAwardItem = item3.PropItem; } } foreach (PetGroupPropertyItem item4 in this.RuntimeData.PetGroupPropertyList) { groupPropItemDict[item4.Id] = null; bool avalid = true; foreach (List <int> list in item4.PetGoodsList) { GoodsData existGoodsData; if (!havingPetDict.TryGetValue(list[0], out existGoodsData) || existGoodsData.GCount < list[1]) { avalid = false; break; } } if (avalid) { groupPropItemDict[item4.Id] = item4.PropItem; } } foreach (PetSkillGroupInfo item5 in this.RuntimeData.PetSkillAwardList) { int sum = 0; using (List <int> .Enumerator enumerator8 = item5.SkillList.GetEnumerator()) { while (enumerator8.MoveNext()) { int p = enumerator8.Current; IEnumerable <PetSkillInfo> temp = from info in petSkillList where info.PitIsOpen && info.SkillID > 0 && info.SkillID == p select info; if (temp.Any <PetSkillInfo>()) { sum += temp.Count <PetSkillInfo>(); } } } if (sum < item5.SkillNum) { break; } petSkillAwardItem = item5.GroupProp; } foreach (PetSkillLevelAwardItem item6 in this.RuntimeData.PetSkillLevelAwardList) { if (sumPetSkillLevel >= item6.Level && item6.Level > findPetSkillLevel) { findPetSkillLevel = item6.Level; petSkillLevelAwardItem = item6.PropItem; } } } client.ClientData.PropsCacheManager.SetExtProps(new object[] { PropsSystemTypes.JingLingQiYuan, 0, petLevelAwardItem }); client.ClientData.PropsCacheManager.SetExtProps(new object[] { PropsSystemTypes.JingLingQiYuan, 1, petTianFuAwardItem }); foreach (KeyValuePair <int, EquipPropItem> groupPropItem in groupPropItemDict) { client.ClientData.PropsCacheManager.SetExtProps(new object[] { PropsSystemTypes.JingLingQiYuan, 2, groupPropItem.Key, groupPropItem.Value }); } client.ClientData.PropsCacheManager.SetExtProps(new object[] { PropsSystemTypes.JingLingQiYuan, 3, petSkillAwardItem }); client.ClientData.PropsCacheManager.SetExtProps(new object[] { PropsSystemTypes.JingLingQiYuan, 4, petSkillLevelAwardItem }); if (notifyPorpsChangeInfo) { GameManager.ClientMgr.NotifyUpdateEquipProps(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client); GameManager.ClientMgr.NotifyOthersLifeChanged(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client, true, false, 7); } } }
public bool InitConfig() { bool success = true; string fileName = ""; lock (this.RuntimeData.Mutex) { try { this.RuntimeData.IsGongNengOpend = false; this.RuntimeData.EmblemFull = GameManager.systemParamsList.GetParamValueIntArrayByName("EmblemFull", ','); this.RuntimeData.EmblemShengXing = GameManager.systemParamsList.GetParamValueDoubleArrayByName("EmblemShengXing", ','); int platformId = (int)GameCoreInterface.getinstance().GetPlatformType(); List <string> emblemOpenStrs = GameManager.systemParamsList.GetParamValueStringListByName("EmblemOpen", '|'); foreach (string str in emblemOpenStrs) { List <int> args = Global.StringToIntList(str, ','); if (args != null && args[0] == platformId && args[1] > 0) { this.RuntimeData.IsGongNengOpend = true; } } this.RuntimeData.IsGongNengOpend &= !GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System2Dot5); fileName = "Config/EmblemUp.xml"; string fullPathFileName = Global.GameResPath(fileName); this.RuntimeData.EmblemUpDict.Load(fullPathFileName, null); foreach (EmblemUpInfo info in this.RuntimeData.EmblemUpDict.Value.Values) { info.ExtPropTempValues[24] = info.SubAttackInjurePercent; info.ExtPropTempValues[102] = info.SPAttackInjurePercent; info.ExtPropTempValues[103] = info.AttackInjurePercent; info.ExtPropTempValues[104] = info.ElementAttackInjurePercent; } fileName = "Config/EmblemStar.xml"; fullPathFileName = Global.GameResPath(fileName); this.RuntimeData.EmblemStarDict.Load(fullPathFileName, null); foreach (EmblemStarInfo starInfo in this.RuntimeData.EmblemStarDict.Value.Values) { EmblemUpInfo emblemUpInfo; if (this.RuntimeData.EmblemUpDict.Value.TryGetValue(starInfo.EmblemLevel, out emblemUpInfo)) { starInfo.EmblemUpInfo = emblemUpInfo; emblemUpInfo.MaxStarLevel = Math.Max(emblemUpInfo.MaxStarLevel, starInfo.EmblemStar); starInfo.LifeV += emblemUpInfo.LifeV; starInfo.AddAttack += emblemUpInfo.AddAttack; starInfo.AddDefense += emblemUpInfo.AddDefense; starInfo.DecreaseInjureValue += emblemUpInfo.DecreaseInjureValue; starInfo.ExtPropValues[13] = (double)starInfo.LifeV; starInfo.ExtPropValues[45] = (double)starInfo.AddAttack; starInfo.ExtPropValues[46] = (double)starInfo.AddDefense; starInfo.ExtPropValues[38] = (double)starInfo.DecreaseInjureValue; } } } catch (Exception ex) { success = false; LogManager.WriteLog(LogTypes.Fatal, string.Format("加载xml配置文件:{0}, 失败。", fileName), ex, true); } } return(success); }
public int _CanUsingEquip(GameClient client, GoodsData goodsData, int toBagIndex, SystemXmlItem systemGoods = null) { if (null == systemGoods) { if (!GameManager.SystemGoods.SystemXmlItemDict.TryGetValue(goodsData.GoodsID, out systemGoods)) { return(-1); } } int categoriy = systemGoods.GetIntValue("Categoriy", -1); if (!RebornEquip.IsRebornEquip(goodsData.GoodsID)) { if ((categoriy < 0 || categoriy >= 49) && categoriy != 340) { return(-2); } } else { if (categoriy < 30 || categoriy > 38) { return(-2); } int Suit = systemGoods.GetIntValue("ToReborn", -1); int Level = systemGoods.GetIntValue("ToRebornLevel", -1); if (client.ClientData.RebornCount < Suit && client.ClientData.RebornLevel < Level) { return(-4); } if (goodsData.GCount <= 0) { return(-5); } } int nHandType = systemGoods.GetIntValue("HandType", -1); if (categoriy < 22 && categoriy >= 11) { int nActionType = systemGoods.GetIntValue("ActionType", -1); int nRet = WeaponAdornManager.VerifyWeaponCanEquip(Global.CalcOriginalOccupationID(client), nHandType, nActionType, this.EquipDict); if (nRet < 0) { return(nRet); } } if (categoriy <= 38 && categoriy >= 37) { int nRet = RebornEquip.VerifyWeaponCanEquip(client.UsingEquipMgr.EquipDict); if (nRet < 0) { return(nRet); } } bool is2Dot2Disable = GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System2Dot2); List <GoodsData> list = null; int result; if (!this.EquipDict.TryGetValue(categoriy, out list)) { if (categoriy == 23 && !is2Dot2Disable) { result = OrnamentManager.getInstance()._CanUsingOrnament(client, toBagIndex, list); } else if (categoriy == 9 || categoriy == 10) { result = this._CanUsingChongWu(categoriy); } else if (GoodsUtil.CanEquip(categoriy, goodsData.Site)) { result = 0; } else { result = 0; } } else { int nCount = list.Count; if (categoriy < 22 && categoriy >= 11) { if (nHandType == 2 || GameManager.MagicSwordMgr.IsMagicSword(client)) { if (nCount >= 2) { return(-3); } return(0); } } else if (categoriy == 6) { if (nCount >= 2) { return(-3); } return(0); } else if (categoriy == 36) { if (nCount >= 2) { return(-3); } return(0); } else if (categoriy == 9 || categoriy == 10) { int nRet = this._CanUsingChongWu(categoriy); if (nRet < 0) { return(nRet); } } else if (categoriy == 23 && !is2Dot2Disable) { return(OrnamentManager.getInstance()._CanUsingOrnament(client, toBagIndex, list)); } result = ((list.Count < 1) ? 0 : -3); } return(result); }
/// <summary> /// 重新计算和设置角色从精灵奇缘系统活动的属性 /// </summary> /// <param name="client"></param> /// <param name="notifyPorpsChangeInfo"></param> public void RefreshProps(GameClient client, bool notifyPorpsChangeInfo = true) { // 如果1.5的功能没开放 if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot5)) { return; } int sumPetLevel = 0; int findPetLevel = 0; int sumPetTianFuNum = 0; int findPetTianFuNum = 0; List <PetSkillInfo> petSkillList = new List <PetSkillInfo>(); EquipPropItem petLevelAwardItem = null; EquipPropItem petTianFuAwardItem = null; EquipPropItem petSkillAwardItem = null; Dictionary <int, GoodsData> havingPetDict = new Dictionary <int, GoodsData>(); Dictionary <int, EquipPropItem> groupPropItemDict = new Dictionary <int, EquipPropItem>(); List <GoodsData> demonGoodsList = DamonMgr.GetDemonGoodsDataList(client); foreach (var goodsData in demonGoodsList) { GoodsData existGoodsData; if (!havingPetDict.TryGetValue(goodsData.GoodsID, out existGoodsData)) { existGoodsData = new GoodsData(); existGoodsData.GoodsID = goodsData.GoodsID; existGoodsData.GCount = 0; havingPetDict[existGoodsData.GoodsID] = existGoodsData; } existGoodsData.GCount++; sumPetLevel += goodsData.Forge_level + 1; //潜规则,客户端显示的是这个值+1 sumPetTianFuNum += Global.GetEquipExcellencePropNum(goodsData); petSkillList.AddRange(PetSkillManager.GetPetSkillInfo(goodsData)); } lock (RuntimeData.Mutex) { //等级奇缘 foreach (var item in RuntimeData.PetLevelAwardList) { if (sumPetLevel >= item.Level && item.Level > findPetLevel) { findPetLevel = item.Level; petLevelAwardItem = item.PropItem; } } //天赋奇缘 foreach (var item in RuntimeData.PetTianFuAwardList) { if (sumPetTianFuNum >= item.TianFuNum && item.TianFuNum > findPetTianFuNum) { findPetTianFuNum = item.TianFuNum; petTianFuAwardItem = item.PropItem; } } //精灵组合 foreach (var item in RuntimeData.PetGroupPropertyList) { groupPropItemDict[item.Id] = null; bool avalid = true; foreach (var list in item.PetGoodsList) { GoodsData existGoodsData; if (!havingPetDict.TryGetValue(list[0], out existGoodsData) || existGoodsData.GCount < list[1]) { avalid = false; break; } } if (avalid) { groupPropItemDict[item.Id] = item.PropItem; } } //精灵技能 foreach (var item in RuntimeData.PetSkillAwardList) { int sum = 0; foreach (var p in item.SkillList) { var temp = from info in petSkillList where info.PitIsOpen && info.SkillID > 0 && info.SkillID == p select info; if (temp.Any()) { sum += temp.Count(); } } if (sum < item.SkillNum) { break; } petSkillAwardItem = item.GroupProp; } } client.ClientData.PropsCacheManager.SetExtProps(PropsSystemTypes.JingLingQiYuan, SubPropsTypes.Level, petLevelAwardItem); client.ClientData.PropsCacheManager.SetExtProps(PropsSystemTypes.JingLingQiYuan, SubPropsTypes.TianFuNum, petTianFuAwardItem); foreach (var groupPropItem in groupPropItemDict) { client.ClientData.PropsCacheManager.SetExtProps(PropsSystemTypes.JingLingQiYuan, SubPropsTypes.PetGroup, groupPropItem.Key, groupPropItem.Value); } client.ClientData.PropsCacheManager.SetExtProps(PropsSystemTypes.JingLingQiYuan, SubPropsTypes.PetSkill, petSkillAwardItem); if (notifyPorpsChangeInfo) { //通知客户端属性变化 GameManager.ClientMgr.NotifyUpdateEquipProps(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client); // 总生命值和魔法值变化通知(同一个地图才需要通知) GameManager.ClientMgr.NotifyOthersLifeChanged(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client); } }
private EHolyResult HolyItem_Suit_Up(GameClient client, sbyte sShengWu_slot, sbyte sBuJian_slot) { EHolyResult result; if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot7)) { result = EHolyResult.NotOpen; } else if (!GameManager.VersionSystemOpenMgr.IsVersionSystemOpen("HolyItem")) { result = EHolyResult.NotOpen; } else if (!GlobalNew.IsGongNengOpened(client, GongNengIDs.HolyItem, true)) { result = EHolyResult.NotOpen; } else if (null == client.ClientData.MyHolyItemDataDic) { result = EHolyResult.Error; } else { Dictionary <sbyte, HolyItemData> holyitemdata = client.ClientData.MyHolyItemDataDic; HolyItemData tmpdata = null; HolyItemPartData tmppartdata = null; HolyPartInfo xmlData = null; if (!holyitemdata.TryGetValue(sShengWu_slot, out tmpdata)) { result = EHolyResult.Error; } else if (!tmpdata.m_PartArray.TryGetValue(sBuJian_slot, out tmppartdata)) { result = EHolyResult.Error; } else if (tmppartdata.m_sSuit >= HolyItemManager.MAX_HOLY_PART_LEVEL) { result = EHolyResult.PartSuitIsMax; } else { int nDataID = HolyPartInfo.GetBujianID(sShengWu_slot, sBuJian_slot, tmppartdata.m_sSuit); if (!this._partDataDic.TryGetValue(nDataID, out xmlData)) { result = EHolyResult.Error; } else if (-1 != xmlData.m_nCostBandJinBi && xmlData.m_nCostBandJinBi > Global.GetTotalBindTongQianAndTongQianVal(client)) { result = EHolyResult.NeedGold; } else if (-1 != xmlData.m_nNeedGoodsCount && xmlData.m_nNeedGoodsCount > tmppartdata.m_nSlice) { result = EHolyResult.NeedHolyItemPart; } else { bool bSuccess = false; int nRank = Global.GetRandomNumber(0, 100); if (-1 == xmlData.m_sSuccessProbability || tmppartdata.m_nFailCount >= xmlData.m_nMaxFailCount || nRank < (int)xmlData.m_sSuccessProbability) { bSuccess = true; for (int i = 0; i < xmlData.NeedGoods.Count; i++) { int goodsId = xmlData.NeedGoods[i][0]; int costCount = xmlData.NeedGoods[i][1]; int haveGoodsCnt = Global.GetTotalGoodsCountByID(client, goodsId); if (haveGoodsCnt < costCount) { return(EHolyResult.NeedGoods); } } if (-1 != xmlData.m_nCostBandJinBi) { if (!Global.SubBindTongQianAndTongQian(client, xmlData.m_nCostBandJinBi, "圣物部件升级消耗")) { return(EHolyResult.Error); } } if (-1 != xmlData.m_nNeedGoodsCount) { tmppartdata.m_nSlice -= xmlData.m_nNeedGoodsCount; } if (tmppartdata.m_nSlice < 0) { tmppartdata.m_nSlice = 0; return(EHolyResult.Error); } bool bUsedBinding_just_placeholder = false; bool bUsedTimeLimited_just_placeholder = false; for (int i = 0; i < xmlData.NeedGoods.Count; i++) { int goodsId = xmlData.NeedGoods[i][0]; int costCount = xmlData.NeedGoods[i][1]; if (!GameManager.ClientMgr.NotifyUseGoods(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, client, goodsId, costCount, false, out bUsedBinding_just_placeholder, out bUsedTimeLimited_just_placeholder, false)) { LogManager.WriteLog(LogTypes.Error, string.Format("圣物部件升级时,消耗{1}个GoodsID={0}的物品失败,但是已设置为升阶成功", goodsId, costCount), null, true); } GoodsData goodsData = new GoodsData(); goodsData.GoodsID = goodsId; goodsData.GCount = costCount; } HolyItemPartData holyItemPartData = tmppartdata; holyItemPartData.m_sSuit += 1; tmppartdata.m_nFailCount = 0; } else { for (int i = 0; i < xmlData.FaildNeedGoods.Count; i++) { int goodsId = xmlData.FaildNeedGoods[i][0]; int costCount = xmlData.FaildNeedGoods[i][1]; int haveGoodsCnt = Global.GetTotalGoodsCountByID(client, goodsId); if (haveGoodsCnt < costCount) { return(EHolyResult.NeedGoods); } } if (-1 != xmlData.m_nCostBandJinBi) { if (!Global.SubBindTongQianAndTongQian(client, xmlData.m_nCostBandJinBi, "圣物部件升级消耗")) { return(EHolyResult.Error); } } bool bUsedBinding_just_placeholder = false; bool bUsedTimeLimited_just_placeholder = false; for (int i = 0; i < xmlData.FaildNeedGoods.Count; i++) { int goodsId = xmlData.FaildNeedGoods[i][0]; int costCount = xmlData.FaildNeedGoods[i][1]; if (!GameManager.ClientMgr.NotifyUseGoods(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, client, goodsId, costCount, false, out bUsedBinding_just_placeholder, out bUsedTimeLimited_just_placeholder, false)) { LogManager.WriteLog(LogTypes.Error, string.Format("圣物部件升级时,消耗{1}个GoodsID={0}的物品失败", goodsId, costCount), null, true); } GoodsData goodsData2 = new GoodsData(); goodsData2.GoodsID = goodsId; goodsData2.GCount = costCount; } if (-1 != xmlData.m_nFailCostGoodsCount) { tmppartdata.m_nSlice -= xmlData.m_nFailCostGoodsCount; } if (tmppartdata.m_nSlice < 0) { tmppartdata.m_nSlice = 0; return(EHolyResult.Error); } tmppartdata.m_nFailCount++; } if (bSuccess) { this.UpdateHolyItemBuJianAttr(client, sShengWu_slot, sBuJian_slot); this.UpdataHolyItemExAttr(client, sShengWu_slot); GameManager.ClientMgr.NotifyUpdateEquipProps(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client); GameManager.ClientMgr.NotifyOthersLifeChanged(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client, true, false, 7); } this.UpdateHolyItemData2DB(client, sShengWu_slot, sBuJian_slot, tmppartdata); this.HolyItemSendToClient(client, sShengWu_slot, sBuJian_slot); GameManager.logDBCmdMgr.AddDBLogInfo(-1, HolyItemManager.SliceNameSet[(int)sShengWu_slot, (int)sBuJian_slot], "圣物进阶", "系统", client.ClientData.RoleName, bSuccess ? "成功" : "失败", (xmlData.m_nCostBandJinBi != -1) ? xmlData.m_nCostBandJinBi : 0, client.ClientData.ZoneID, client.strUserID, tmppartdata.m_nSlice, client.ServerId, null); if (client._IconStateMgr.CheckSpecialActivity(client) || client._IconStateMgr.CheckEverydayActivity(client)) { client._IconStateMgr.SendIconStateToClient(client); } result = (bSuccess ? EHolyResult.Success : EHolyResult.Fail); } } } return(result); }
public bool ProcessYongZheZhanChangEnterCmd(GameClient client, int nID, byte[] bytes, string[] cmdParams) { try { int result = StdErrorCode.Error_Success_No_Info; // 如果1.7的功能没开放 if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot7)) { client.sendCmd(nID, result); return(true); } YongZheZhanChangSceneInfo sceneItem = null; YongZheZhanChangGameStates state = YongZheZhanChangGameStates.None; if (!CheckMap(client)) { result = StdErrorCode.Error_Denied_In_Current_Map; } else { result = CheckCondition(client, ref sceneItem, ref state); } if (state == YongZheZhanChangGameStates.Start) { KuaFuServerLoginData kuaFuServerLoginData = null; lock (RuntimeData.Mutex) { if (RuntimeData.RoleIdKuaFuLoginDataDict.TryGetValue(client.ClientData.RoleID, out kuaFuServerLoginData)) { KuaFuServerLoginData clientKuaFuServerLoginData = Global.GetClientKuaFuServerLoginData(client); if (null != clientKuaFuServerLoginData) { clientKuaFuServerLoginData.RoleId = kuaFuServerLoginData.RoleId; clientKuaFuServerLoginData.GameId = kuaFuServerLoginData.GameId; clientKuaFuServerLoginData.GameType = kuaFuServerLoginData.GameType; clientKuaFuServerLoginData.EndTicks = kuaFuServerLoginData.EndTicks; clientKuaFuServerLoginData.ServerId = kuaFuServerLoginData.ServerId; clientKuaFuServerLoginData.ServerIp = kuaFuServerLoginData.ServerIp; clientKuaFuServerLoginData.ServerPort = kuaFuServerLoginData.ServerPort; clientKuaFuServerLoginData.FuBenSeqId = kuaFuServerLoginData.FuBenSeqId; } } else { result = StdErrorCode.Error_Server_Busy; } } if (result >= 0) { result = YongZheZhanChangClient.getInstance().ChangeRoleState(client.ClientData.RoleID, KuaFuRoleStates.EnterGame); if (result >= 0) { GlobalNew.RecordSwitchKuaFuServerLog(client); client.sendCmd((int)TCPGameServerCmds.CMD_SPR_KF_SWITCH_SERVER, Global.GetClientKuaFuServerLoginData(client)); } else { Global.GetClientKuaFuServerLoginData(client).RoleId = 0; } } } else { result = StdErrorCode.Error_Not_In_valid_Time; } client.sendCmd(nID, result); return(true); } catch (Exception ex) { DataHelper.WriteFormatExceptionLog(ex, Global.GetDebugHelperInfo(client.ClientSocket), false); } return(false); }
public bool IsGongNengOpen(GameClient client, bool hint = false) { return(!GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System2Dot7) && GlobalNew.IsGongNengOpened(client, GongNengIDs.JingLingJueXing, hint)); }
public bool IsGongNengOpened(GameClient client, bool hint = false) { return(!GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot8) && GameManager.VersionSystemOpenMgr.IsVersionSystemOpen("KuaFuMap")); }
public bool IsGongNengOpened(GameClient client, bool hint = false) { return(GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System2Dot6) || Global.GetUnionLevel(client, false) >= Global.GetUnionLevel(this.RuntimeData.VoiceMessage[0], this.RuntimeData.VoiceMessage[1], false) || client.ClientData.VipLevel >= this.RuntimeData.VoiceMessage[2]); }
/// <summary> /// 基金——购买 /// </summary> private static FundData FundBuy(GameClient client, int fundType) { FundData myData = GetFundData(client); if (!myData.IsOpen) { return(myData); } myData.FundType = fundType; // 如果1.9的功能没开放 if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot9)) { myData.State = (int)EFundError.ENoOpen; return(myData); } //类型错误 if (!myData.FundDic.ContainsKey(fundType)) { myData.State = (int)EFundError.Error; return(myData); } //已购买 FundItem myItem = myData.FundDic[fundType]; if (myItem.BuyType == (int)EFundBuy.Have) { myData.State = (int)EFundError.EIsBuy; return(myData); } //vip限制 if (myItem.BuyType == (int)EFundBuy.Limit) { myData.State = (int)EFundError.EVipLimit; return(myData); } //购买钻石不足 FundInfo fundInfo = _fundDic[myItem.FundID]; if (fundInfo.Price > client.ClientData.UserMoney) { myData.State = (int)EFundError.ENoMoney; return(myData); } //扣钱 bool result = GameManager.ClientMgr.SubUserMoney(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, client, fundInfo.Price, "基金购买", true, 1, false); if (!result) { myData.State = (int)EFundError.Error; return(myData); } //数据库保存 DateTime buyTime = DateTime.Now; FundDBItem dbItem = new FundDBItem(); dbItem.zoneID = client.ClientData.ZoneID; dbItem.UserID = client.strUserID; dbItem.RoleID = client.ClientData.RoleID; dbItem.FundType = myData.FundType; dbItem.FundID = myItem.FundID; dbItem.BuyTime = buyTime; dbItem.State = (int)EFundState.Now; if (!DBFundBuy(client, dbItem)) { myData.State = (int)EFundError.Error; return(myData); } myItem.BuyType = (int)EFundBuy.Have; myItem.BuyTime = buyTime; if (myItem.FundType == (int)EFund.Login) { myItem.Value1 = Global.GetOffsetDay(DateTime.Now) - Global.GetOffsetDay(myItem.BuyTime) + 1; } //检查奖励 FundAwardInfo awardInfo = _fundAwardDic[myItem.AwardID]; if (myItem.Value1 >= awardInfo.Value1 && myItem.Value2 >= awardInfo.Value2) { myItem.AwardType = (int)EFundAward.Can; } else { myItem.AwardType = (int)EFundAward.Limit; } myData.State = (int)EFundError.Succ; myData.FundType = fundType; CheckActivityTip(client); return(myData); }
//圣物进阶 private EHolyResult HolyItem_Suit_Up(GameClient client, sbyte sShengWu_slot, sbyte sBuJian_slot) { // 如果1.7的功能没开放 if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot7)) { return(EHolyResult.NotOpen); } //增加系统开启判断 if (false == GameManager.VersionSystemOpenMgr.IsVersionSystemOpen(VersionSystemOpenKey.HolyItem)) { return(EHolyResult.NotOpen); } //不满足任务条件 if (GlobalNew.IsGongNengOpened(client, GongNengIDs.HolyItem, true) == false) { return(EHolyResult.NotOpen); } if (null == client.ClientData.MyHolyItemDataDic) { return(EHolyResult.Error); } Dictionary <sbyte, HolyItemData> holyitemdata = client.ClientData.MyHolyItemDataDic; HolyItemData tmpdata = null; HolyItemPartData tmppartdata = null; HolyPartInfo xmlData = null; //先取得当前圣物部件等级 if (false == holyitemdata.TryGetValue(sShengWu_slot, out tmpdata)) { return(EHolyResult.Error); } if (false == tmpdata.m_PartArray.TryGetValue(sBuJian_slot, out tmppartdata)) { return(EHolyResult.Error); } //0 看看要升级的部件阶级是不是已经满级了 if (tmppartdata.m_sSuit >= MAX_HOLY_PART_LEVEL) { return(EHolyResult.PartSuitIsMax); } int nDataID = HolyPartInfo.GetBujianID(sShengWu_slot, sBuJian_slot, (sbyte)tmppartdata.m_sSuit); if (false == _partDataDic.TryGetValue(nDataID, out xmlData)) { return(EHolyResult.Error); } //1 绑金+金币是否足够 if (-1 != xmlData.m_nCostBandJinBi && xmlData.m_nCostBandJinBi > Global.GetTotalBindTongQianAndTongQianVal(client)) { return(EHolyResult.NeedGold); } //2 部件碎片是否足够 if (-1 != xmlData.m_nNeedGoodsCount && xmlData.m_nNeedGoodsCount > tmppartdata.m_nSlice) { return(EHolyResult.NeedHolyItemPart); } //3 以上均满足,判断成功率 bool bSuccess = false; int nRank = Global.GetRandomNumber(0, 100); if (-1 == xmlData.m_sSuccessProbability || tmppartdata.m_nFailCount >= xmlData.m_nMaxFailCount || //[bing] 2015,8,12 达到连续失败最大次数必成功 nRank < (int)(xmlData.m_sSuccessProbability)) { //4 合成成功:消耗金币、消耗部件碎片,阶数+1 bSuccess = true; //扣除金币 if (-1 != xmlData.m_nCostBandJinBi) { if (!Global.SubBindTongQianAndTongQian(client, xmlData.m_nCostBandJinBi, "圣物部件升级消耗")) { return(EHolyResult.Error); } } //扣除部件碎片 if (-1 != xmlData.m_nNeedGoodsCount) { tmppartdata.m_nSlice -= xmlData.m_nNeedGoodsCount; } if (tmppartdata.m_nSlice < 0) { tmppartdata.m_nSlice = 0; return(EHolyResult.Error); } //部件阶级提升 tmppartdata.m_sSuit += 1; //重置失败次数 tmppartdata.m_nFailCount = 0; } else { //5 合成失败:消耗金币、消耗部分部件碎片 //扣除金币 if (-1 != xmlData.m_nCostBandJinBi) { if (!Global.SubBindTongQianAndTongQian(client, xmlData.m_nCostBandJinBi, "圣物部件升级消耗")) { return(EHolyResult.Error); } } //扣除失败时的部件碎片 if (-1 != xmlData.m_nFailCostGoodsCount) { tmppartdata.m_nSlice -= xmlData.m_nFailCostGoodsCount; } if (tmppartdata.m_nSlice < 0) { tmppartdata.m_nSlice = 0; return(EHolyResult.Error); } //失败次数增加1 tmppartdata.m_nFailCount += 1; } if (true == bSuccess) { //计算部件属性 UpdateHolyItemBuJianAttr(client, sShengWu_slot, sBuJian_slot); //计算圣物额外属性 UpdataHolyItemExAttr(client, sShengWu_slot); // 通知客户端属性变化 GameManager.ClientMgr.NotifyUpdateEquipProps(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client); // 总生命值和魔法值变化通知(同一个地图才需要通知) GameManager.ClientMgr.NotifyOthersLifeChanged(Global._TCPManager.MySocketListener, Global._TCPManager.TcpOutPacketPool, client); } //更新db UpdateHolyItemData2DB(client, sShengWu_slot, sBuJian_slot, tmppartdata); //发送给客户端更新数据 HolyItemSendToClient(client, sShengWu_slot, sBuJian_slot); //写log做进阶统计 GameManager.logDBCmdMgr.AddDBLogInfo( -1 , SliceNameSet[sShengWu_slot, sBuJian_slot] , /**/ "圣物进阶" , /**/ "系统" , client.ClientData.RoleName , bSuccess == true ? /**/ "成功" : /**/ "失败" , xmlData.m_nCostBandJinBi != -1 ? xmlData.m_nCostBandJinBi : 0 //消耗的金币数 , client.ClientData.ZoneID , client.strUserID , tmppartdata.m_nSlice , client.ServerId); if (client._IconStateMgr.CheckSpecialActivity(client)) { client._IconStateMgr.SendIconStateToClient(client); } return(bSuccess == true ? EHolyResult.Success : EHolyResult.Fail); }
public bool InitConfig() { bool success = true; string fileName = ""; lock (this.RuntimeData.Mutex) { try { for (int i = 0; i < this.RuntimeData.DeControlItemListArray.Length; i++) { List <DeControlItem> list = this.RuntimeData.DeControlItemListArray[i]; if (null != list) { foreach (DeControlItem item in list) { item.Next = null; item.Head = null; } this.RuntimeData.DeControlItemListArray[i] = null; } } this.RuntimeData.IsGongNengOpend = false; int platformId = (int)GameCoreInterface.getinstance().GetPlatformType(); List <string> emblemOpenStrs = GameManager.systemParamsList.GetParamValueStringListByName("DeControlOpen", '|'); foreach (string str in emblemOpenStrs) { List <int> args = Global.StringToIntList(str, ','); if (args != null && args[0] == platformId && args[1] > 0) { this.RuntimeData.IsGongNengOpend = true; } } this.RuntimeData.IsGongNengOpend &= !GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System2Dot5); if (this.RuntimeData.IsGongNengOpend) { fileName = "Config\\DeControl.xml"; string fullPathFileName = Global.GameResPath(fileName); XElement xml = XElement.Load(fullPathFileName); IEnumerable <XElement> nodes = xml.Elements(); foreach (XElement node in nodes) { int extPropID = (int)Global.GetSafeAttributeLong(node, "ExtPropID"); int count = (int)Global.GetSafeAttributeLong(node, "MaxFlood"); double[] deControlPercent = Global.GetSafeAttributeDoubleArray(node, "DeControlPercent", -1, ','); double[] deControlTime = Global.GetSafeAttributeDoubleArray(node, "DeControlTime", -1, ','); double[] durationTime = Global.GetSafeAttributeDoubleArray(node, "DurationTime", -1, ','); if (deControlPercent.Length < count || deControlTime.Length < count || durationTime.Length < count) { LogManager.WriteLog(LogTypes.Fatal, string.Format("解析文件{0}的BaoMingTime出错", fileName), null, true); } List <DeControlItem> list = this.RuntimeData.DeControlItemListArray[extPropID]; if (list == null) { list = (this.RuntimeData.DeControlItemListArray[extPropID] = new List <DeControlItem>()); } DeControlItem headItem = null; DeControlItem pre = null; for (int i = 0; i < count; i++) { DeControlItem item = new DeControlItem(); item.ExtPropIndex = extPropID; item.DeControlPercent = deControlPercent[i]; item.DeControlTime = deControlTime[i]; item.DurationTime = durationTime[i]; if (pre == null) { headItem = item; } else { pre.Next = item; } item.Head = headItem; pre = item; list.Add(item); } } } this.OnReload(); } catch (Exception ex) { LogManager.WriteLog(LogTypes.Fatal, string.Format("加载xml配置文件:{0}, 失败。", fileName), ex, true); } } return(success); }
private static FundData FundBuy(GameClient client, int fundType) { FundData myData = FundManager.GetFundData(client); FundData result; if (!myData.IsOpen) { result = myData; } else { myData.FundType = fundType; if (GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot9)) { myData.State = -2; result = myData; } else if (!myData.FundDic.ContainsKey(fundType)) { myData.State = -1; result = myData; } else { FundItem myItem = myData.FundDic[fundType]; if (myItem.BuyType == 1) { myData.State = -4; result = myData; } else if (myItem.BuyType == 3) { myData.State = -5; result = myData; } else { FundInfo fundInfo = FundManager._fundDic[myItem.FundID]; if (fundInfo.Price > client.ClientData.UserMoney) { myData.State = -3; result = myData; } else if (!GameManager.ClientMgr.SubUserMoney(Global._TCPManager.MySocketListener, Global._TCPManager.tcpClientPool, Global._TCPManager.TcpOutPacketPool, client, fundInfo.Price, "基金购买", true, false, false, DaiBiSySType.None)) { myData.State = -1; result = myData; } else { DateTime buyTime = TimeUtil.NowDateTime(); if (!FundManager.DBFundBuy(client, new FundDBItem { zoneID = client.ClientData.ZoneID, UserID = client.strUserID, RoleID = client.ClientData.RoleID, FundType = myData.FundType, FundID = myItem.FundID, BuyTime = buyTime, State = 1 })) { myData.State = -1; result = myData; } else { myItem.BuyType = 1; myItem.BuyTime = buyTime; if (myItem.FundType == 2) { myItem.Value1 = Global.GetOffsetDay(TimeUtil.NowDateTime()) - Global.GetOffsetDay(myItem.BuyTime) + 1; } FundAwardInfo awardInfo = FundManager._fundAwardDic[myItem.AwardID]; if (myItem.Value1 >= awardInfo.Value1 && myItem.Value2 >= awardInfo.Value2) { myItem.AwardType = 2; } else { myItem.AwardType = 3; } myData.State = 1; myData.FundType = fundType; FundManager.CheckActivityTip(client); result = myData; } } } } } return(result); }
private bool IsGongNengOpened(GameClient client) { return(!GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System2Dot3) && GlobalNew.IsGongNengOpened(client, GongNengIDs.ZhuanZhi, false)); }
public bool IsGongNengOpened(GameClient client, bool hint = false) { return(!GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot8) && GameManager.VersionSystemOpenMgr.IsVersionSystemOpen("KuaFuBoss") && GlobalNew.IsGongNengOpened(client, GongNengIDs.KuaFuBoss, hint)); }
public bool IsGongNengOpened(GameClient client, bool hint = false) { return(!GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot7) && !GameFuncControlManager.IsGameFuncDisabled(GameFuncType.System1Dot8) && JunTuanManager.getInstance().IsGongNengOpened(client, hint)); }