RoleInfoSProxy.cs 4.4 KB

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