DragonEggService.cs 3.0 KB

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