RoleInfoSProxy.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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<string> ReqModifySlogan(string slogan)
  24. {
  25. S2C_ModifySignature response = null;
  26. response = (S2C_ModifySignature)await MessageHelper.SendToServer(new C2S_ModifySignature() { Signature = slogan });
  27. if (response != null)
  28. {
  29. if (response.Error == ErrorCode.ERR_Success)
  30. {
  31. RoleDataManager.slogan = response.Signature;
  32. return RoleDataManager.slogan;
  33. }
  34. }
  35. return RoleDataManager.slogan;
  36. }
  37. //修改角色名称
  38. public static async ETTask<bool> ReqModifyRoleName(string name)
  39. {
  40. S2C_ModifyRoleName response = null;
  41. response = (S2C_ModifyRoleName)await MessageHelper.SendToServer(new C2S_ModifyRoleName() { Name = name });
  42. if (response != null)
  43. {
  44. if (response.Error == ErrorCode.ERR_Success)
  45. {
  46. RoleDataManager.roleName = response.Name;
  47. EventAgent.DispatchEvent(ConstMessage.CHANGE_ROLE_NAME);
  48. return true;
  49. }
  50. }
  51. return false;
  52. }
  53. }
  54. }