CustomSuitSProxy.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.InteropServices.ComTypes;
  5. using System.Text;
  6. using ET;
  7. namespace GFGGame
  8. {
  9. public class CustomSuitSProxy
  10. {
  11. public static async ETTask UpdateCustomSuit(int index, List<int> arrayList, int bgID = 0, int suitId = 0, bool pic = false)
  12. {
  13. CustomSuitProto suitProto = new CustomSuitProto();
  14. suitProto.Pos = index;
  15. suitProto.BgId = bgID;
  16. suitProto.SuitId = suitId;
  17. suitProto.Pic = pic;
  18. foreach (var equipId in arrayList)
  19. {
  20. suitProto.EquipIds.Add(equipId);
  21. }
  22. M2C_SaveCustomSuit response = (M2C_SaveCustomSuit) await MessageHelper.SendToServer(new C2M_SaveCustomSuit()
  23. {
  24. suit = suitProto
  25. });
  26. if (response != null)
  27. {
  28. if (response.Error == ErrorCode.ERR_Success)
  29. {
  30. CustomSuitDataManager.SaveSuit(index, arrayList, bgID, suitId, pic);
  31. }
  32. }
  33. }
  34. }
  35. }