PlayerService.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using FL.Network;
  2. using XGame.Framework.Data;
  3. using XGame.Framework.Network;
  4. namespace FL.Data
  5. {
  6. public class PlayerService : DataSingleton<PlayerService>
  7. {
  8. /// <summary>
  9. /// 请求身上穿戴的装备信息
  10. /// </summary>
  11. public void SendToEquipInto()
  12. {
  13. if (EquipData.Instance.IsWearEquipEmpty())
  14. {
  15. NetModule.Request(new EquipIntoEquipRequest() { });
  16. }
  17. }
  18. /// <summary>
  19. /// 请求转职
  20. /// </summary>
  21. /// <param name="jobId"></param>
  22. public void SendToTransfer(int jobId)
  23. {
  24. var msg = new JobClassChangeRequest()
  25. {
  26. classId = jobId
  27. };
  28. NetModule.Request(msg);
  29. }
  30. /// <summary>
  31. /// 请求重置转职
  32. /// </summary>
  33. public void SendToResetJob()
  34. {
  35. NetModule.Request(new JobClassResetRequest() { });
  36. }
  37. /// <summary>
  38. /// 请求随机觉醒(激活)符文
  39. /// </summary>
  40. public void SendToWakeupRune()
  41. {
  42. NetModule.Request(new JobClassRuneActivateRequest() { });
  43. }
  44. /// <summary>
  45. /// 请求提升某个符文的等级
  46. /// </summary>
  47. /// <param name="runeId"></param>
  48. /// <param name="addLv"></param>
  49. public void SendToUpgradeRune(int runeId, int addLv)
  50. {
  51. var msg = new JobClassSlotLvUpRequest()
  52. {
  53. id = runeId,
  54. addLv = addLv
  55. };
  56. NetModule.Request(msg);
  57. }
  58. /// <summary>
  59. /// 请求更换印记符文类型
  60. /// </summary>
  61. /// <param name="runeType"></param>
  62. public void SendToChangeRuneType(int planIndex, int slotId, int runeType)
  63. {
  64. var msg = new JobClassRuneChangeRequest()
  65. {
  66. planId = planIndex,
  67. slotId = slotId,
  68. type = runeType
  69. };
  70. NetModule.Request(msg);
  71. }
  72. /// <summary>
  73. /// 请求更换符文方案
  74. /// </summary>
  75. /// <param name="planIndex"></param>
  76. public void SendToChangePlanIndex(int planIndex)
  77. {
  78. var msg = new JobClassChangePlanRequest()
  79. {
  80. planId = planIndex.ToString(),
  81. };
  82. NetModule.Request(msg);
  83. }
  84. /// <summary>
  85. /// 请求重置当前方案
  86. /// </summary>
  87. public void SendToResetPlan()
  88. {
  89. NetModule.Request(new JobClassResetPlanRequest() { });
  90. }
  91. /// <summary>
  92. /// 请求修改符文方案名字
  93. /// </summary>
  94. /// <param name="name"></param>
  95. /// <param name="planIndex"></param>
  96. public void SendToAlterPlanName(string name, int planIndex)
  97. {
  98. var msg = new JobClassRunePlanNameRequest()
  99. {
  100. str = name,
  101. planId = planIndex.ToString(),
  102. };
  103. NetModule.Request(msg);
  104. }
  105. }
  106. }