ActMountPushCtrl.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using XGame.Database;
  2. using XGame.Framework.Network;
  3. namespace FL.Network
  4. {
  5. public class ActMountPushCtrl : MsgController<ActMountPush>
  6. {
  7. protected override void OnProcess(ActMountPush message, object context)
  8. {
  9. MountData.Instance.UniversalId = message.id;
  10. MountData.Instance.UniversalExp = message.exp;
  11. MountData.Instance.MountModelId = message.use;
  12. MountData.Instance.UseSkillMountId = message.useSkill;
  13. MountData.Instance.MountPartExp = message.bwExp;
  14. // (已解锁)高级坐骑升星数据
  15. if (message.mountList != null)
  16. {
  17. var advancedMountsMap = MountData.Instance.AdvancedMountsMap;
  18. foreach (var item in message.mountList)
  19. {
  20. if (advancedMountsMap.ContainsKey(item.mountId))
  21. {
  22. advancedMountsMap[item.mountId] = item.star;
  23. }
  24. else
  25. {
  26. advancedMountsMap.Add(item.mountId, item.star);
  27. }
  28. }
  29. }
  30. // 通用部位驯养情况
  31. if (message.buwei != null)
  32. {
  33. var mountsPartsMap = MountData.Instance.MountsPartsMap;
  34. foreach (var item in message.buwei)
  35. {
  36. if (mountsPartsMap.ContainsKey(item.bwId))
  37. {
  38. mountsPartsMap[item.bwId] = item.level;
  39. }
  40. else
  41. {
  42. mountsPartsMap.Add(item.bwId, item.level);
  43. }
  44. }
  45. }
  46. }
  47. }
  48. }