CreateRoomMessage.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. /********************************************************************************
  5. ** Company: YC
  6. ** auth: CaoTing
  7. ** date: 2021\5
  8. ** desc: 删除房间
  9. *******************************************************************************/
  10. namespace Studio.Scripts.HttpMessage
  11. {
  12. public class CreateRoomMessage : BaseHttpMessage
  13. {
  14. public CreateRoomBody body;
  15. public string token
  16. {
  17. set
  18. {
  19. headers["token"] = value;
  20. }
  21. }
  22. public CreateRoomMessage()
  23. {
  24. messageModuleType = MessageModuleType.Room;
  25. methodType = HttpMethodType.Post;
  26. _path = "v1/createRoom";
  27. headers = new Dictionary<string, string>();
  28. headers.Add("Content-Type", "application/json");
  29. headers.Add("token", "");
  30. _wwwForm = null;
  31. }
  32. public override WWWForm wwwForm
  33. {
  34. get
  35. {
  36. if (_wwwForm == null)
  37. {
  38. _wwwForm = GetWWWFrom<CreateRoomBody>(body);
  39. }
  40. return _wwwForm;
  41. }
  42. }
  43. public override string ToBodyString()
  44. {
  45. return Newtonsoft.Json.JsonConvert.SerializeObject(body);
  46. }
  47. }
  48. public struct CreateRoomBody
  49. {
  50. /// <summary>
  51. /// 房间类型1 是个人房间 2是公共房间
  52. /// </summary>
  53. public int type;
  54. /// <summary>
  55. /// 房间名称
  56. /// </summary>
  57. public string roomName;
  58. /// <summary>
  59. /// 房间信息说明
  60. /// </summary>
  61. public string roomExplain;
  62. /// <summary>
  63. /// 房间密码
  64. /// </summary>
  65. public string roomPassword;
  66. /// <summary>
  67. /// 公开房间类型 1 是只能浏览 2是 全功能
  68. /// </summary>
  69. public int roomType;
  70. /// <summary>
  71. /// 人数上限
  72. /// </summary>
  73. public int maxMember;
  74. }
  75. }