| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- using ET;
- using GFGGame;
- using System;
- using System.Collections.Generic;
- using cfg.GfgCfg;
- namespace ET
- {
- public static class CollegeSProxy
- {
- public static async ETTask<bool> ReqCollectUpgradeInfo()
- {
- var response = (M2C_GetDressUpSkillDes)await MessageHelper.SendToServer(new C2M_GetDressUpSkillDes());
- if (!(response is { Error: ErrorCode.ERR_Success })) return false;
- int Count = response.CollectPartInfos.Count;
- CollegeBoostCfg collectcfg;
- for (int i = 0; i < response.CollectPartInfos.Count; i++)
- {
- List<int> item = new List<int>()
- { response.CollectPartInfos[i].Stage, response.CollectPartInfos[i].Lvl };
- collectcfg =
- CollegeBoostCfgArray.Instance.GetCollegeBoostCfgListByTypePartsAndTypePhaseAndLayer(i, item[0],
- item[1]);
- if (collectcfg == null)
- {
- item.Add(0);
- }
- else
- {
- item.Add(collectcfg.Value);
- }
- if (CollectPartDataManager.Instance.CollectPartDataDic.ContainsKey(response.CollectPartInfos[i]
- .CollectPartType))
- {
- CollectPartDataManager.Instance.CollectPartDataDic[response.CollectPartInfos[i].CollectPartType] =
- item;
- }
- else
- {
- CollectPartDataManager.Instance.CollectPartDataDic.Add(response.CollectPartInfos[i].CollectPartType,
- item);
- }
- }
- return true;
- }
- public static async ETTask<bool> ReqCollectUpgrade(int partType, int stage, int lv)
- {
- var response = (M2C_UpDressUpSkill)await MessageHelper.SendToServer(new C2M_UpDressUpSkill()
- { CollectPartType = partType, Stage = stage, Lvl = lv });
- if (!(response is { Error: ErrorCode.ERR_Success })) return false;
- List<int> item = new List<int>() { response.CollectPartInfo.Stage, response.CollectPartInfo.Lvl };
- CollegeBoostCfg collectcfg =
- CollegeBoostCfgArray.Instance.GetCollegeBoostCfgListByTypePartsAndTypePhaseAndLayer(
- response.CollectPartInfo.CollectPartType, item[0], item[1]);
- if (collectcfg == null)
- {
- item.Add(0);
- }
- else
- {
- item.Add(collectcfg.Value);
- }
- if (CollectPartDataManager.Instance.CollectPartDataDic.ContainsKey(response.CollectPartInfo
- .CollectPartType))
- {
- CollectPartDataManager.Instance.CollectPartDataDic[response.CollectPartInfo.CollectPartType] = item;
- }
- else
- {
- CollectPartDataManager.Instance.CollectPartDataDic.Add(response.CollectPartInfo.CollectPartType, item);
- }
- EventAgent.DispatchEvent(ConstMessage.COLLEGE_UPGRADE);
- return true;
- }
- }
- }
|