ActJobClassPushCtrl.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using FL.Data;
  2. using XGame.Framework.Network;
  3. namespace FL.Network
  4. {
  5. public class ActJobClassPushCtrl : MsgController<ActJobClassPush>
  6. {
  7. protected override void OnProcess(ActJobClassPush message, object context)
  8. {
  9. // 当前职业数据
  10. if (message.currentClass > 0)PlayerData.Instance.JobId = message.currentClass;
  11. // 最近重置过的职业id
  12. PlayerData.Instance.ResetJobId = message.resetClass;
  13. if (message.classHistory != null)
  14. {
  15. PlayerData.Instance.JobHistoryList.Clear();
  16. PlayerData.Instance.JobHistoryList.AddRange(message.classHistory);
  17. }
  18. // 方案列表
  19. if (message.runePlanName != null)
  20. {
  21. var runePlanNamesArray = PlayerData.Instance.RunePlanNamesArray;
  22. runePlanNamesArray.Clear();
  23. runePlanNamesArray.AddRange(message.runePlanName);
  24. }
  25. // 方案加点数据
  26. if (message.runePlan != null)
  27. {
  28. var runePlanMap = PlayerData.Instance.RunePlanMap;
  29. foreach (var item in message.runePlan)
  30. {
  31. if (runePlanMap.ContainsKey(item.id))
  32. {
  33. runePlanMap[item.id] = item;
  34. }
  35. else
  36. {
  37. runePlanMap.Add(item.id, item);
  38. }
  39. }
  40. }
  41. PlayerData.Instance.CurPlanIndex = message.currentPlan;
  42. PlayerData.Instance.AllPoint = message.allPoint;
  43. }
  44. }
  45. }