商店包版本修改 此commit置顶 1.0.3
This commit is contained in:
@@ -332,50 +332,53 @@ extension RoomVC : NIMChatManagerDelegate, NIMChatroomManagerDelegate, NIMLoginM
|
||||
}else if msg.messageType == .custom{
|
||||
chatScreenView.dealWithCustomMsg(msg: msg)
|
||||
roomEffectView.dealWithCustomMsg(msg: msg)
|
||||
if let obj = msg.messageObject as? NIMCustomObject,let customObj = obj.attachment as? ChatCustomMsgModel{
|
||||
if customObj.first == 3 || customObj.first == 12{
|
||||
if let model = Deserialized<RectiveGiftModel>.toModel(with: customObj.data),let gift = model.gift == nil ? model.giftInfo : model.gift {
|
||||
var userList:[String] = []
|
||||
if userList.count <= 0 {
|
||||
for item in model.targetUsers {
|
||||
userList.append("\(item.uid)")
|
||||
}
|
||||
if userList.count <= 0{
|
||||
userList.append(model.targetUid)
|
||||
}
|
||||
}
|
||||
var starPoint = CGPoint(x: ScreenWidth/2, y: NavHeight)
|
||||
if let point = micSeatView.getPointWithCell(uid: model.uid){
|
||||
if point.x <= 0 || point.y <= 0{
|
||||
|
||||
}else{
|
||||
starPoint = point
|
||||
}
|
||||
}
|
||||
|
||||
var curPoint = CGPoint(x: ScreenWidth/2, y: NavHeight)
|
||||
for userUid in userList{
|
||||
|
||||
if let point = micSeatView.getPointWithCell(uid: userUid){
|
||||
if point.x <= 0 || point.y <= 0{
|
||||
|
||||
}else{
|
||||
curPoint = point
|
||||
}
|
||||
}
|
||||
|
||||
roomEffectView.startPlayAnimation(url: gift.giftUrl, start: starPoint, end: curPoint)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
startPlayAnimation(msg: msg)
|
||||
}
|
||||
micSeatView.dealWithNotMessage(msg: msg)
|
||||
menuView.dealWithNotMessage(msg: msg)
|
||||
|
||||
}
|
||||
}
|
||||
func startPlayAnimation(msg:NIMMessage){
|
||||
if let obj = msg.messageObject as? NIMCustomObject,let customObj = obj.attachment as? ChatCustomMsgModel{
|
||||
if customObj.first == 3 || customObj.first == 12{
|
||||
if let model = Deserialized<RectiveGiftModel>.toModel(with: customObj.data),let gift = model.gift == nil ? model.giftInfo : model.gift {
|
||||
var userList:[String] = []
|
||||
if userList.count <= 0 {
|
||||
for item in model.targetUsers {
|
||||
userList.append("\(item.uid)")
|
||||
}
|
||||
if userList.count <= 0{
|
||||
userList.append(model.targetUid)
|
||||
}
|
||||
}
|
||||
var starPoint = CGPoint(x: ScreenWidth/2, y: NavHeight)
|
||||
if let point = micSeatView.getPointWithCell(uid: model.uid){
|
||||
if point.x <= 0 || point.y <= 0{
|
||||
|
||||
}else{
|
||||
starPoint = point
|
||||
}
|
||||
}
|
||||
|
||||
var curPoint = CGPoint(x: ScreenWidth/2, y: NavHeight)
|
||||
for userUid in userList{
|
||||
|
||||
if let point = micSeatView.getPointWithCell(uid: userUid){
|
||||
if point.x <= 0 || point.y <= 0{
|
||||
|
||||
}else{
|
||||
curPoint = point
|
||||
}
|
||||
}
|
||||
|
||||
roomEffectView.startPlayAnimation(url: gift.giftUrl, start: starPoint, end: curPoint)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
func send(_ message: NIMMessage, didCompleteWithError error: Error?) {
|
||||
if let sessionId = message.session?.sessionId,let roomUid = self.roomInfo?.roomId,sessionId != roomUid{
|
||||
return
|
||||
@@ -385,6 +388,7 @@ extension RoomVC : NIMChatManagerDelegate, NIMChatroomManagerDelegate, NIMLoginM
|
||||
}else if message.messageType == .custom{
|
||||
chatScreenView.dealWithCustomMsg(msg: message)
|
||||
roomEffectView.dealWithCustomMsg(msg: message)
|
||||
startPlayAnimation(msg: message)
|
||||
}
|
||||
}
|
||||
func updateOnlineNum(num:Int){
|
||||
|
Reference in New Issue
Block a user