RoleInfoSProxy.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. using System.Collections.Generic;
  2. using ET;
  3. namespace GFGGame
  4. {
  5. public static class RoleInfoSProxy
  6. {
  7. //请求个人信息
  8. public static async ETTask<bool> ReqPersonalInfo()
  9. {
  10. S2C_GetPersonalInfo response = null;
  11. response = (S2C_GetPersonalInfo)await MessageHelper.SendToServer(new C2S_GetPersonalInfo());
  12. if (response != null)
  13. {
  14. if (response.Error == ErrorCode.ERR_Success)
  15. {
  16. RoleDataManager.slogan = response.Signature;
  17. RoleDataManager.headId = response.HeadPortraitItemId;
  18. RoleDataManager.headBorderId = response.HeadPortraitBoxItemId;
  19. // RoleInfoManager.Instance.photoDatas=response.OpenAlbumList;
  20. return true;
  21. }
  22. }
  23. return false;
  24. }
  25. //请求其他玩家详细信息
  26. public static async ETTask<OtherRoleInfoDetailData> ReqOtherRoleDetailInfo(long friendId)
  27. {
  28. S2C_GetOtherRoleDetailInfo response = null;
  29. response = (S2C_GetOtherRoleDetailInfo)await MessageHelper.SendToServer(new C2S_GetOtherRoleDetailInfo() { RoleId = friendId });
  30. if (response != null)
  31. {
  32. if (response.Error == ErrorCode.ERR_Success)
  33. {
  34. OtherRoleInfoDetailData roleInfoDetail = new OtherRoleInfoDetailData();
  35. roleInfoDetail.slogan = response.Signature;
  36. roleInfoDetail.RoleLvl = response.RoleLvl;
  37. if (response.CustomSuit != null)
  38. {
  39. roleInfoDetail.customSuitData = new CustomSuitData(response.CustomSuit.Pos);
  40. roleInfoDetail.customSuitData.bg = response.CustomSuit.BgId;
  41. roleInfoDetail.customSuitData.suitId = response.CustomSuit.SuitId;
  42. roleInfoDetail.customSuitData.equipDatas = response.CustomSuit.EquipIds;
  43. roleInfoDetail.customSuitData.pic = response.CustomSuit.Pic;
  44. }
  45. return roleInfoDetail;
  46. }
  47. }
  48. return null;
  49. }
  50. //修改个人签名
  51. public static async ETTask<string> ReqModifySlogan(string slogan)
  52. {
  53. S2C_ModifySignature response = null;
  54. response = (S2C_ModifySignature)await MessageHelper.SendToServer(new C2S_ModifySignature() { Signature = slogan });
  55. if (response != null)
  56. {
  57. if (response.Error == ErrorCode.ERR_Success)
  58. {
  59. RoleDataManager.slogan = response.Signature;
  60. return RoleDataManager.slogan;
  61. }
  62. }
  63. return RoleDataManager.slogan;
  64. }
  65. //修改角色名称
  66. public static async ETTask<bool> ReqModifyRoleName(string name)
  67. {
  68. S2C_ModifyRoleName response = null;
  69. response = (S2C_ModifyRoleName)await MessageHelper.SendToServer(new C2S_ModifyRoleName() { Name = name });
  70. if (response != null)
  71. {
  72. if (response.Error == ErrorCode.ERR_Success)
  73. {
  74. RoleDataManager.roleName = response.Name;
  75. EventAgent.DispatchEvent(ConstMessage.CHANGE_ROLE_NAME);
  76. return true;
  77. }
  78. }
  79. return false;
  80. }
  81. //修改角色头像
  82. public static async ETTask<bool> ReqModifyRoleHead(int headId)
  83. {
  84. S2C_ModifyRoleName response = null;
  85. response = (S2C_ModifyRoleName)await MessageHelper.SendToServer(new C2S_ModifyRoleName() { });
  86. if (response != null)
  87. {
  88. if (response.Error == ErrorCode.ERR_Success)
  89. {
  90. RoleDataManager.roleName = response.Name;
  91. EventAgent.DispatchEvent(ConstMessage.CHANGE_ROLE_NAME);
  92. return true;
  93. }
  94. }
  95. return false;
  96. }
  97. //修改角色头像框
  98. public static async ETTask<bool> ReqModifyRoleHeadBorder(int HeadBorder)
  99. {
  100. S2C_ModifyRoleName response = null;
  101. response = (S2C_ModifyRoleName)await MessageHelper.SendToServer(new C2S_ModifyRoleName() { });
  102. if (response != null)
  103. {
  104. if (response.Error == ErrorCode.ERR_Success)
  105. {
  106. RoleDataManager.roleName = response.Name;
  107. EventAgent.DispatchEvent(ConstMessage.CHANGE_ROLE_NAME);
  108. return true;
  109. }
  110. }
  111. return false;
  112. }
  113. }
  114. }