RoleInfoSProxy.cs 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. }