XYLiveRoomMessageInfo.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. //
  2. // XYLiveRoomChatInfo.h
  3. // Starbuds
  4. //
  5. // Created by pajia on 2020/1/2.
  6. // Copyright © 2020 翟玉磊. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "AWRichText.h"
  10. #import "XYHeadlineInfo.h"
  11. NS_ASSUME_NONNULL_BEGIN
  12. typedef NS_ENUM(NSInteger, XYPkBattlingStatus) {
  13. XYPkBattlingStatusLeftDefault = -2,//表示显示左边头像
  14. XYPkBattlingStatusRightDefault = -1,//表示显示右边新增邀请按钮
  15. XYPkBattlingStatusWait = 1,//等待加入
  16. XYPkBattlingStatusBattling = 2,//PK 中
  17. XYPkBattlingStatusPunish = 3,//惩罚
  18. XYPkBattlingStatusOver = 4,//结束
  19. };
  20. @class XYGiftTrajectoryModel;
  21. @interface XYLiveRoomMessageInfo : NSObject
  22. + (XYLiveRoomMessageInfo *)creat:(NSDictionary *)dataDict;
  23. /// 消息中的完整字典数据
  24. @property (nonatomic, strong) NSDictionary *dataDict;
  25. @property (nonatomic, strong) NSDictionary *msgDict;
  26. /// 消息类型
  27. @property (nonatomic, strong) NSString *type;
  28. /// 消息时间戳
  29. @property (nonatomic, strong) NSString *timestamp;
  30. /// 用户配置信息字符串 通过截取字段
  31. @property (nonatomic, strong) NSString *profileString;
  32. /// 发送者用户id
  33. @property (nonatomic, strong) NSString *senderId;
  34. /// 发送者用户名
  35. @property (nonatomic, strong) NSString *senderNickname;
  36. /// 发送者头像url
  37. @property (nonatomic, strong) NSString *senderAvatarUrl;
  38. /// 接收者用户id
  39. @property (nonatomic, strong) NSString *reciveId;
  40. /// 接收者用户id
  41. @property (nonatomic, strong) NSString *reciveNickname;
  42. /// 接收者的头像url
  43. @property (nonatomic, strong) NSString *reciveAvatarUrl;
  44. /// 主播的用户id
  45. @property (nonatomic, strong) NSString *anchorUserId;
  46. /// 勋章点亮状态dict
  47. @property (nonatomic, strong) NSDictionary *medalShinyStatus;
  48. /// 用户等级
  49. @property (nonatomic, assign) NSInteger grageNum;
  50. /// 用户等级勋章点亮状态 0:置灰;1:点亮
  51. @property (nonatomic, assign) NSInteger grageMedalStatus;
  52. /// 主播等级
  53. @property (nonatomic, assign) NSInteger anchorGrageNum;
  54. /// 贵族等级
  55. @property (nonatomic, assign) NSInteger nobility;
  56. /// 官方
  57. @property (nonatomic, assign) NSInteger isOfficial;
  58. /// 房主
  59. @property (nonatomic, assign) NSInteger isHouseOwer;
  60. /// 房管
  61. @property (nonatomic, assign) NSInteger isHouseManager;
  62. /// 主持人
  63. @property (nonatomic, assign) NSInteger isHost;
  64. /// 性别 1男 2女
  65. @property (nonatomic, assign) NSInteger userSex;
  66. /// 年龄
  67. @property (nonatomic, assign) NSString *userAge;
  68. ///聊天用户标签(等级、靓号、官方等)+ 用户名字AWRichText
  69. @property (nonatomic, strong) AWRichText *userMarkRichText;
  70. ///聊天、礼物文字
  71. @property (nonatomic, strong) AWRichText *textRichText;
  72. ///飘屏通知AWRichText
  73. @property (nonatomic, strong) AWRichText *noticeRichText;
  74. /// 内容标识
  75. @property (nonatomic, strong) NSString *contentText1;
  76. @property (nonatomic, strong) NSString *contentText2;
  77. @property (nonatomic, strong) NSString *contentText3;
  78. ///聊天列表总高度
  79. @property (nonatomic, assign) float cellHeight;
  80. ///聊天列表需要显示的宽度
  81. @property (nonatomic, assign) float cellShadowWidth;
  82. ///聊天列表用户标签高度
  83. @property (nonatomic, assign) float cellUserMarkHeight;
  84. /// 礼物对应的动画资源id
  85. @property (nonatomic, strong) NSString *giftAnimationId;
  86. /// 是否为贴纸
  87. @property (nonatomic, strong) NSString *giftIsSticker;
  88. /// 贴纸名字
  89. @property (nonatomic, strong) NSString *giftStickerName;
  90. /// 贴纸路径url
  91. @property (nonatomic, strong) NSString *giftStickerPath;
  92. /// 贴纸显示时间
  93. @property (nonatomic, strong) NSString *giftStickerDuration;
  94. /// 礼物id
  95. @property (nonatomic, strong) NSString *giftId;
  96. /// 礼物数量
  97. @property (nonatomic, strong) NSString *giftQuantity;
  98. /// 礼物价格
  99. @property (nonatomic, strong) NSString *giftPrice;
  100. /// 1 - 购买的 2 - 从背包送的 3 - 百变礼盒开出
  101. @property (nonatomic, strong) NSString *giftSourceType;
  102. /// 礼物连击次数
  103. @property (nonatomic, strong) NSString *giftCombo;
  104. /// 礼物连击标识
  105. @property (nonatomic, strong) NSString *comboKeyHash;
  106. /// 礼物图片url
  107. @property (nonatomic, strong) NSString *giftImageUrl;
  108. /// 是否聊天列表显示
  109. @property (nonatomic, assign) BOOL showInComment;
  110. /// 是否弹幕显示 isComboTimeout = true 时 标识这是一条连击结束的消息,只在弹幕中构造
  111. @property (nonatomic, assign) BOOL isComboTimeout;
  112. /// 是否连击banner显示
  113. @property (nonatomic, assign) BOOL isCombo;
  114. /// 礼物连击等级
  115. @property (nonatomic, assign) NSInteger comboValueLevel;
  116. /// 礼物连击倒计时秒数
  117. @property (nonatomic, assign) NSInteger comboPeriodSec;
  118. /// 礼物连击banner背景动画id
  119. @property (nonatomic, strong) NSString *giftBannerAnimationId;
  120. /// 礼物连击动效等级
  121. @property (nonatomic, assign) NSInteger comboAnimationLevel;
  122. /// 礼物连击时全区通知的背景动画id
  123. @property (nonatomic, strong) NSString *floatScreenAnimationId;
  124. /// 礼物连击时全区通知的停留的时间
  125. @property (nonatomic, assign) float floatScreenStayTime;
  126. /// 头饰动效id
  127. @property (nonatomic, strong) NSString *headWearAnimationId;
  128. /// 汽泡动效id
  129. @property (nonatomic, strong) NSString *bubbleId;
  130. /// 礼物名字
  131. @property (nonatomic, strong) NSString *giftName;
  132. /// 中奖金额
  133. @property (nonatomic, assign) NSString *winAmount;
  134. /// 中奖倍数
  135. @property (nonatomic, assign) NSString *winMultiple;
  136. /// 中奖最大倍数
  137. @property (nonatomic, assign) NSString *winMultipleMax;
  138. /// 热度
  139. @property (nonatomic, strong) NSString *heatNum;
  140. /// 观看人数
  141. @property (nonatomic, strong) NSString *watchNum;
  142. /// 直播状态
  143. @property (nonatomic, strong) NSString *liveStatus;
  144. /// 直播流状态
  145. @property (nonatomic, strong) NSString *streamStatus;
  146. /// 推流地址
  147. @property (nonatomic, strong) NSString *pullUrl;
  148. /// 房管
  149. @property (nonatomic, assign) int userMasterAction;
  150. /// 神秘人
  151. @property (nonatomic, strong) NSString *anonymousGift;
  152. /// 目标类型
  153. @property (nonatomic, strong) NSString *targetType;
  154. /// 用户角色
  155. @property (nonatomic, strong) NSString *userRole;
  156. /// 主播收入改变
  157. @property (nonatomic, strong) NSString *scoreValue;
  158. /// 官方
  159. @property (nonatomic, strong) NSString *offical;
  160. /// 11weath财富 21charm魅力
  161. @property (nonatomic, strong) NSString *scoreType;
  162. /// 主播魅力值
  163. @property (nonatomic, strong) NSString *glamorousNum;
  164. /// 主播收入
  165. @property (nonatomic, strong) NSString *incomeAmount;
  166. /// 是否为活动消息(太空旅行、幸运礼物/等)一排
  167. @property (nonatomic, assign) BOOL isActivity;
  168. /// 是否为房间通知(进房,上下麦,房间上锁等)一排
  169. @property (nonatomic, assign) BOOL isAlert;
  170. /// 是否为礼物或者聊天文字消,两排
  171. @property (nonatomic, assign) BOOL isTextOrGift;
  172. /// 活动图片url
  173. @property (nonatomic, strong) NSString *activityIcon;
  174. /// 活动跳转链接
  175. @property (nonatomic, strong) NSString *activityUrl;
  176. /// 靓号
  177. @property (nonatomic, strong) NSString *niceNo;
  178. /// 靓号等级
  179. @property (nonatomic, assign) NSInteger niceLevel;
  180. /// 坐骑id
  181. @property (nonatomic, strong) NSString *mountsId;
  182. /// 坐骑名字
  183. @property (nonatomic, strong) NSString *mountsName;
  184. /// 坐骑动画id
  185. @property (nonatomic, strong) NSString *mountsAnimationId;
  186. /// 勋章显示时间
  187. @property (nonatomic, assign) int nobleTime;
  188. /// 勋章等级
  189. @property (nonatomic, strong) NSString *nobleValue;
  190. /// vip等级
  191. @property (nonatomic, strong) NSString *vipValue;
  192. /// 星耀等级
  193. @property (nonatomic, strong) NSString *starLevel;
  194. /// 勋章ID
  195. @property (nonatomic, strong) NSString *medalId;
  196. /// 活动勋章数组
  197. @property (nonatomic, strong) NSArray *activityMedals;
  198. //1v1视频剩余可用时间
  199. @property (nonatomic, readwrite, copy) NSString *minutesRemain;
  200. //通话计费时长
  201. @property (nonatomic, readwrite, copy) NSString *hisMinutes;
  202. //通话费用
  203. @property (nonatomic, readwrite, copy) NSString *hisAmount;
  204. //pk
  205. @property (nonatomic, strong) NSString *pkToken;
  206. @property (nonatomic, strong) NSString *pkBattleId;
  207. ////0拒绝 1同意
  208. @property (nonatomic, strong) NSString *pkDecision;
  209. @property (nonatomic, assign) NSInteger pkProceedTime;
  210. @property (nonatomic, assign) NSInteger pkPunishTime;
  211. @property (nonatomic, assign) NSInteger pkChangeValue;
  212. @property (nonatomic, strong) NSString *pkUserId;
  213. @property (nonatomic, strong) NSMutableArray *pkTopGivers;
  214. ///battlingStatus 1等待加入 2PK中 3惩罚 4结束
  215. @property (nonatomic, assign) XYPkBattlingStatus pkBattlingStatus;
  216. ///battleRole 1 红方 2 蓝方
  217. @property (nonatomic, assign) NSInteger pkRole;
  218. ///battleResult 0 打平 1 红方胜 2 蓝方胜
  219. @property (nonatomic, assign) NSInteger pkResult;
  220. @property (nonatomic, assign) NSInteger pkRankIndex;
  221. ///battleResult 0 打平 1胜 2败
  222. @property (nonatomic, assign) NSInteger pkRankResult;
  223. ///临时类型标识
  224. @property (nonatomic, assign) NSInteger tempType;
  225. /// noticeType : 0 无消息 , 1 聊天框显示 , 2顶部显示 , 3都显示
  226. @property (nonatomic, assign) NSInteger noticeType;
  227. /// 语音房消息
  228. /// 聊天室房间id
  229. @property (nonatomic, copy) NSString *roomId;
  230. /// 麦位
  231. @property (nonatomic, assign) NSInteger seatNo;
  232. /// 上麦下麦用户id
  233. @property (nonatomic, copy) NSString *userId;
  234. /// 表情id
  235. @property (nonatomic, copy) NSString *expId;
  236. /// 表情url
  237. @property (nonatomic, copy) NSString *expUrl;
  238. /// 表情播放时间
  239. @property (nonatomic, assign) NSInteger playTimes;
  240. /// 表情最后帧数
  241. @property (nonatomic, assign) NSInteger finalFrame;
  242. /// 通知类型
  243. @property (nonatomic, copy) NSString *noticestyle;
  244. /// 时间
  245. @property (nonatomic, assign) NSInteger countTime;
  246. @property (nonatomic, assign) NSInteger countTime1;
  247. /// 快照id
  248. @property (nonatomic, copy) NSString *snapId;
  249. @property (nonatomic, strong) NSAttributedString *contentAttributedString;
  250. @property (nonatomic, strong) NSAttributedString *nameContentAttributedString;
  251. + (AWRTTextComponent *)getTextComponent:(NSString *)content color:(UIColor *)color font:(UIFont *)font padding:(NSInteger )padding;
  252. + (void)handleInfo:(XYLiveRoomMessageInfo *)info;
  253. /// 设置勋章点亮状态
  254. - (void)setupMedalShinyStatus:(NSDictionary *)dict;
  255. /// 用户信息实体 (主要做解析附加信息)
  256. /// "profileString": "00100000000000000000",
  257. @property (nonatomic, strong) XYLiveUserModel *userInfo;
  258. /// 头条房间消息实体
  259. @property (nonatomic, strong) XYHeadlineInfo *headlineInfo;
  260. /// 聊天室礼物运行轨迹
  261. @property (nonatomic, strong) NSMutableArray <XYGiftTrajectoryModel *>*giftTrajectorys;
  262. @end
  263. ///礼物运行轨迹
  264. @interface XYGiftTrajectoryModel : NSObject
  265. @property (nonatomic, copy) NSString *sendUserId;
  266. @property (nonatomic, copy) NSString *targetUserId;
  267. @property (nonatomic, copy) NSString *giftId;
  268. ///轨迹点数组 获取点 CGPoint point = CGPointFromString([points objectAtIndex:0]);
  269. @property (nonatomic, strong) NSMutableArray *points;
  270. - (instancetype)initWithSendUserId:(NSString *)sendUserId targetUserId:(NSString *)targetUserId giftId:(NSString *)giftId;
  271. @end
  272. NS_ASSUME_NONNULL_END