DragonEggService.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using FL.Network;
  2. using System;
  3. using XGame.Framework.Data;
  4. using XGame.Framework.Network;
  5. namespace FL.Data
  6. {
  7. public class DragonEggService : DataSingleton<DragonEggService>, IDisposable
  8. {
  9. /// <summary>
  10. /// 请求(龙蛋)宝藏信息
  11. /// </summary>
  12. public void SendToTreasureInfo()
  13. {
  14. IMsgRequest msg = new LongdanIntoRequest()
  15. {
  16. };
  17. NetModule.Request(msg);
  18. }
  19. /// <summary>
  20. /// 请求开启龙蛋宝藏
  21. /// </summary>
  22. public void SendToOpenDragonTreasure(int itemId, int count)
  23. {
  24. // 向服务器发送开启龙蛋宝藏消息
  25. IMsgRequest msg = new LongdanOpenRequest()
  26. {
  27. itemid = itemId,
  28. count = count
  29. };
  30. NetModule.Request(msg);
  31. }
  32. /// <summary>
  33. /// 领取宝箱进度奖励
  34. /// </summary>
  35. public void SendToOpenTreasureBoxAward()
  36. {
  37. NetModule.Request(new LongdanRwdBoxRequest(){ });
  38. }
  39. /// <summary>
  40. /// 请求龙蛋升级
  41. /// </summary>
  42. public void SendToUpgrade()
  43. {
  44. NetModule.Request(new LongdanUpLevelRequest() { });
  45. }
  46. /// <summary>
  47. /// 请求加速宝箱升级
  48. /// </summary>
  49. /// <param name="type">1_加速 2_广告</param>
  50. /// <param name="useNum">使用数量type=1有效</param>
  51. public void SendToAcceleration(int type, int useNum)
  52. {
  53. var msg = new LongdanSubcdRequest()
  54. {
  55. type = type,
  56. count = useNum
  57. };
  58. NetModule.Request(msg);
  59. }
  60. /// <summary>
  61. /// 请求替换装备
  62. /// </summary>
  63. /// <param name="equipType"></param>
  64. /// <param name="equipData"></param>
  65. public void OnChangeEquip(long id)
  66. {
  67. var msg = new EquipTihuanRequest()
  68. {
  69. xhid = (int)id
  70. };
  71. NetModule.Request(msg);
  72. }
  73. /// <summary>
  74. /// 出售指定的装备
  75. /// </summary>
  76. /// <param name="equipData"></param>
  77. public void SellEquip(int[] sellIds)
  78. {
  79. var msg = new EquipDelEquipRequest()
  80. {
  81. xhids = sellIds
  82. };
  83. NetModule.Request(msg);
  84. }
  85. /// <summary>
  86. /// 一键出售装备背包中的所有装备
  87. /// </summary>
  88. public void SendToSellAllBagEquips()
  89. {
  90. NetModule.Request(new EquipDelEquipLsRequest() { });
  91. }
  92. /// <summary>
  93. /// 请求装备临时背包数据
  94. /// </summary>
  95. public void SendToOpenTemporaryEquipBag()
  96. {
  97. NetModule.Request(new EquipIntoLsRequest() { });
  98. }
  99. void IDisposable.Dispose()
  100. {
  101. }
  102. }
  103. }