1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- using System.Collections.Generic;
- using XGame.Database;
- using XGame.Framework.Network;
- using static FL.Network.ActArtifactFumo;
- namespace FL.Network
- {
- public class ActArtifactPushCtrl : MsgController<ActArtifactPush>
- {
- protected override void OnProcess(ActArtifactPush message, object context)
- {
- ArtifactData.Instance.ArtifactInfoId = message.id;
- ArtifactData.Instance.ArtifactExp = message.exp;
- ArtifactData.Instance.AppearanceId = message.use;
- ArtifactData.Instance.UsingAdvanceArtifactId = message.useSkill;
- if (message.artifactList != null)
- {
- // 已解锁的高级神器map数据
- var artifactMap = ArtifactData.Instance.AdvancedArtifactMap;
- foreach (var item in message.artifactList)
- {
- if (artifactMap.ContainsKey(item.artifactId))
- {
- artifactMap[item.artifactId] = item.star;
- }
- else
- {
- artifactMap.Add(item.artifactId, item.star);
- }
- }
- }
- if (message.fumo != null)
- {
- //神器上5种元素类型的附魔数据
- var enchantMap = ArtifactData.Instance.EnchantDataMap;
- foreach (var item in message.fumo)
- {
- if (enchantMap.ContainsKey((EElementType)item.type))
- {
- enchantMap[(EElementType)item.type] = GetEnchantDataList(item.type,item.buwei);
- }
- else
- {
- enchantMap.Add((EElementType)item.type, GetEnchantDataList(item.type, item.buwei));
- }
- }
- }
- if (message.elementList != null)
- {
- // 已解锁的元素数据
- var elementInfoMap = ArtifactData.Instance.UnlockElementMap;
- foreach (var item in message.elementList)
- {
- var elementInfo = new ElementInfoParam()
- {
- elementId = item.elementId,
- level = item.level,
- state = item.status
- };
- if (elementInfoMap.ContainsKey(item.elementId))
- {
- elementInfoMap[item.elementId] = elementInfo;
- }
- else
- {
- elementInfoMap.Add(item.elementId, elementInfo);
- }
- }
- }
- }
- private List<ArtifactEnchantParam> GetEnchantDataList(int elementType, List<ActArtifactBuWei> dataList)
- {
- var artifactEnchantList = new List<ArtifactEnchantParam>();
- foreach (var item in dataList)
- {
- var ArtifactEnchantParam = new ArtifactEnchantParam()
- {
- elementType = elementType,
- holePosition = item.bwId,
- elementId = item.elementId
- };
- artifactEnchantList.Add(ArtifactEnchantParam);
- }
- return artifactEnchantList;
- }
- }
- }
-
|