hot fix:修正部分类型礼物连击后送礼异常问题
This commit is contained in:
@@ -35,6 +35,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (void)registerActions:(void(^ _Nullable)(ComboActionType type))action;
|
||||
|
||||
- (void)enableToCombo:(BOOL)enable;
|
||||
|
||||
- (void)saveSendGiftTo:(NSArray *)UIDs;
|
||||
- (void)saveGiftSourceType:(GiftSourceType)type;
|
||||
- (void)saveSendGiftInfo:(GiftInfoModel *)model;
|
||||
@@ -48,6 +50,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)resetCombo;
|
||||
- (void)sendGift;
|
||||
- (void)forceRemove;
|
||||
- (BOOL)loadEnable;
|
||||
|
||||
// 第一个 combo 由 send gift view 发起,需要手动 combo + 1
|
||||
- (NSInteger)loadComboCountFromSendGiftView;
|
||||
|
@@ -20,6 +20,8 @@
|
||||
|
||||
@interface GiftComboManager ()
|
||||
|
||||
@property (nonatomic, assign) BOOL enableCombo;
|
||||
|
||||
// 用来存储 GiftReceiveInfoModel 和 NSDictionary 的元数据队列
|
||||
@property (nonatomic, strong) NSMutableArray *giftComboQueue;
|
||||
|
||||
@@ -96,12 +98,11 @@
|
||||
- (void)resetCombo {
|
||||
_combo = 1;
|
||||
_errorMessage = @"";
|
||||
if (self.actionCallback) {
|
||||
if (self.actionCallback && self.enableCombo) {
|
||||
self.actionCallback(ComboAction_ShowPanel);
|
||||
}
|
||||
|
||||
self.isCombing = YES;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)registerActions:(void (^)(ComboActionType))action {
|
||||
self.actionCallback = action;
|
||||
@@ -115,6 +116,11 @@
|
||||
}
|
||||
|
||||
- (NSInteger)loadComboCountFromSendGiftView {
|
||||
|
||||
if (!self.enableCombo) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
NSInteger temp = self.combo;
|
||||
self.combo += 1;
|
||||
return temp;
|
||||
@@ -322,6 +328,15 @@
|
||||
}
|
||||
|
||||
#pragma mark - Gift meta data
|
||||
|
||||
- (void)enableToCombo:(BOOL)enable {
|
||||
self.enableCombo = enable;
|
||||
}
|
||||
|
||||
- (BOOL)loadEnable {
|
||||
return self.enableCombo;
|
||||
}
|
||||
|
||||
- (void)saveSendGiftTo:(NSArray *)UIDs
|
||||
{
|
||||
_sendGiftToUIDs = UIDs;
|
||||
@@ -435,9 +450,12 @@
|
||||
attachment.first = CustomMessageType_Gift;
|
||||
attachment.second = Custom_Message_Sub_Gift_Send;
|
||||
NSDictionary *targetUsers = ((NSArray *)[data objectForKey:@"targetUsers"]).firstObject;
|
||||
NSString *avatar = [targetUsers valueForKeyPath:@"avatar"];
|
||||
[data setObject:[targetUsers valueForKeyPath:@"uid"] forKey:@"targetUid"];
|
||||
[data setObject:[targetUsers valueForKeyPath:@"nick"] forKey:@"targetNick"];
|
||||
[data setObject:[targetUsers valueForKeyPath:@"avatar"] forKey:@"targetAvatar"];
|
||||
if (avatar.length > 0) {
|
||||
[data setObject:avatar forKey:@"targetAvatar"];
|
||||
}
|
||||
attachment.data = data;
|
||||
}
|
||||
break;
|
||||
|
@@ -22,8 +22,9 @@ typedef NS_ENUM(NSUInteger, GiftType) {
|
||||
GiftType_Anchor = 11, //个播礼物
|
||||
GiftType_Punish = 12, //惩罚礼物
|
||||
GiftType_Twelve_Star = 13, //星座礼物
|
||||
GiftType_super = 16, //超级礼物
|
||||
GiftType_super = 16, //幸运礼物
|
||||
GiftType_Country = 17, //国家礼物
|
||||
GiftType_Lucky24 = 18, //幸运24
|
||||
};
|
||||
|
||||
//礼物类型
|
||||
|
@@ -188,7 +188,8 @@
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GiftType_super:{
|
||||
case GiftType_super:
|
||||
case GiftType_Lucky24:{
|
||||
return self.superLuckyVC;
|
||||
}
|
||||
break;
|
||||
@@ -211,7 +212,7 @@
|
||||
return i;
|
||||
} else if (tabGiftType == GiftType_Lucky && self.segmentType == GiftSegmentType_Lucky) {
|
||||
return i;
|
||||
} else if (tabGiftType == GiftType_super && self.segmentType == GiftSegmentType_SuperLucky) {
|
||||
} else if ((tabGiftType == GiftType_super || tabGiftType == GiftType_Lucky24) && self.segmentType == GiftSegmentType_SuperLucky) {
|
||||
return i;
|
||||
} else if (tabGiftType == GiftType_WeekStar && self.segmentType == GiftSegmentType_WeekStar) {
|
||||
return i;
|
||||
|
@@ -467,15 +467,21 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
}
|
||||
|
||||
/// 初始化/重置 连击礼物功能状态
|
||||
- (void)readyForCombo:(XPGiftCountModel *)giftCount {
|
||||
if (self.segmentType == GiftSegmentType_Pack ||
|
||||
self.segmentType == GiftSegmentType_Lucky) {
|
||||
- (void)readyForCombo:(XPGiftCountModel *)giftCount
|
||||
gift:(GiftInfoModel *)giftInfo {
|
||||
if (self.segmentType == GiftSegmentType_Pack) {
|
||||
[[GiftComboManager sharedManager] enableToCombo:NO];
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *sessionID = self.usingplaceType == SendGiftType_User ? [NSString stringWithFormat:@"%ld", self.userArray.firstObject.uid] : [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].roomId];
|
||||
if (giftInfo.giftType != GiftType_Game && giftInfo.giftType != GiftType_super && giftInfo.giftType != GiftType_Lucky24) {
|
||||
[[GiftComboManager sharedManager] enableToCombo:NO];
|
||||
return;
|
||||
}
|
||||
|
||||
GiftInfoModel *giftInfo = self.giftInfoView.lastSelectGift;
|
||||
[[GiftComboManager sharedManager] enableToCombo:YES];
|
||||
|
||||
NSString *sessionID = self.usingplaceType == SendGiftType_User ? [NSString stringWithFormat:@"%ld", self.userArray.firstObject.uid] : [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].roomId];
|
||||
[[GiftComboManager sharedManager] saveSendGiftTo:[self.userView getSelectUserList]];
|
||||
[[GiftComboManager sharedManager] saveGiftSourceType:giftInfo.sourceType];
|
||||
[[GiftComboManager sharedManager] saveSendGiftInfo:giftInfo];
|
||||
@@ -495,7 +501,9 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
if (self.usingplaceType == SendGiftType_Room) {
|
||||
if (uids.count > 0) {
|
||||
|
||||
[self readyForCombo:giftCount];
|
||||
|
||||
[self readyForCombo:giftCount
|
||||
gift:giftInfo];
|
||||
|
||||
///送礼物的人
|
||||
NSString * uidString = [self dealSendGiftUids:uids];
|
||||
|
Reference in New Issue
Block a user