temp save

This commit is contained in:
eggmanQQQ
2024-10-10 20:16:23 +08:00
parent 94c11e5148
commit 5c87f850e7
54 changed files with 2674 additions and 123 deletions

View File

@@ -520,6 +520,7 @@
545888362C1C306B00897585 /* XPRoomPKPaneAvatarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 545888352C1C306B00897585 /* XPRoomPKPaneAvatarView.m */; }; 545888362C1C306B00897585 /* XPRoomPKPaneAvatarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 545888352C1C306B00897585 /* XPRoomPKPaneAvatarView.m */; };
5468995D2C8AFE4C0049136A /* GiftComboFlagView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5468995C2C8AFE4C0049136A /* GiftComboFlagView.m */; }; 5468995D2C8AFE4C0049136A /* GiftComboFlagView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5468995C2C8AFE4C0049136A /* GiftComboFlagView.m */; };
547853A12C258F2A00F45E60 /* XPMineUserViewHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 547853A02C258F2A00F45E60 /* XPMineUserViewHeader.m */; }; 547853A12C258F2A00F45E60 /* XPMineUserViewHeader.m in Sources */ = {isa = PBXBuildFile; fileRef = 547853A02C258F2A00F45E60 /* XPMineUserViewHeader.m */; };
547B30F92CB511700041E962 /* RoomBoomEntryView.m in Sources */ = {isa = PBXBuildFile; fileRef = 547B30F82CB511700041E962 /* RoomBoomEntryView.m */; };
5484E1FD2CA2897B008E8754 /* IAPManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5484E1FC2CA2897B008E8754 /* IAPManager.m */; }; 5484E1FD2CA2897B008E8754 /* IAPManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5484E1FC2CA2897B008E8754 /* IAPManager.m */; };
548E01C52C3F78360071C83D /* FeedBackViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 548E01C22C3F78360071C83D /* FeedBackViewController.xib */; }; 548E01C52C3F78360071C83D /* FeedBackViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 548E01C22C3F78360071C83D /* FeedBackViewController.xib */; };
548E01C62C3F78360071C83D /* FeedBackViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 548E01C42C3F78360071C83D /* FeedBackViewController.m */; }; 548E01C62C3F78360071C83D /* FeedBackViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 548E01C42C3F78360071C83D /* FeedBackViewController.m */; };
@@ -551,7 +552,7 @@
54E4D5332C90658C009E1FEA /* LuckyGiftWinningBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E4D5322C90658C009E1FEA /* LuckyGiftWinningBannerView.m */; }; 54E4D5332C90658C009E1FEA /* LuckyGiftWinningBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E4D5322C90658C009E1FEA /* LuckyGiftWinningBannerView.m */; };
54E82E9F2CA6876300C931D9 /* RoomBoomManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82E9E2CA6876300C931D9 /* RoomBoomManager.m */; }; 54E82E9F2CA6876300C931D9 /* RoomBoomManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82E9E2CA6876300C931D9 /* RoomBoomManager.m */; };
54E82EA22CA6886700C931D9 /* RoomBoomBannerAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EA12CA6886700C931D9 /* RoomBoomBannerAnimation.m */; }; 54E82EA22CA6886700C931D9 /* RoomBoomBannerAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EA12CA6886700C931D9 /* RoomBoomBannerAnimation.m */; };
54E82EA52CA693FA00C931D9 /* RoomBoomProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EA42CA693FA00C931D9 /* RoomBoomProgressView.m */; }; 54E82EA52CA693FA00C931D9 /* RoomBoomExplosionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EA42CA693FA00C931D9 /* RoomBoomExplosionView.m */; };
54E82EA82CA6940900C931D9 /* RoomBoomResultView.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EA72CA6940900C931D9 /* RoomBoomResultView.m */; }; 54E82EA82CA6940900C931D9 /* RoomBoomResultView.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EA72CA6940900C931D9 /* RoomBoomResultView.m */; };
54E82EAB2CA9261000C931D9 /* Api+Boom.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EAA2CA9261000C931D9 /* Api+Boom.m */; }; 54E82EAB2CA9261000C931D9 /* Api+Boom.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EAA2CA9261000C931D9 /* Api+Boom.m */; };
54E82EAE2CA9293C00C931D9 /* BoomInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EAD2CA9293C00C931D9 /* BoomInfoModel.m */; }; 54E82EAE2CA9293C00C931D9 /* BoomInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 54E82EAD2CA9293C00C931D9 /* BoomInfoModel.m */; };
@@ -2601,6 +2602,8 @@
5468995C2C8AFE4C0049136A /* GiftComboFlagView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiftComboFlagView.m; sourceTree = "<group>"; }; 5468995C2C8AFE4C0049136A /* GiftComboFlagView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiftComboFlagView.m; sourceTree = "<group>"; };
5478539F2C258F2A00F45E60 /* XPMineUserViewHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserViewHeader.h; sourceTree = "<group>"; }; 5478539F2C258F2A00F45E60 /* XPMineUserViewHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserViewHeader.h; sourceTree = "<group>"; };
547853A02C258F2A00F45E60 /* XPMineUserViewHeader.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserViewHeader.m; sourceTree = "<group>"; }; 547853A02C258F2A00F45E60 /* XPMineUserViewHeader.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserViewHeader.m; sourceTree = "<group>"; };
547B30F72CB511700041E962 /* RoomBoomEntryView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomBoomEntryView.h; sourceTree = "<group>"; };
547B30F82CB511700041E962 /* RoomBoomEntryView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBoomEntryView.m; sourceTree = "<group>"; };
5484E1FB2CA2897B008E8754 /* IAPManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IAPManager.h; sourceTree = "<group>"; }; 5484E1FB2CA2897B008E8754 /* IAPManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IAPManager.h; sourceTree = "<group>"; };
5484E1FC2CA2897B008E8754 /* IAPManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IAPManager.m; sourceTree = "<group>"; }; 5484E1FC2CA2897B008E8754 /* IAPManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IAPManager.m; sourceTree = "<group>"; };
548E01C22C3F78360071C83D /* FeedBackViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FeedBackViewController.xib; sourceTree = "<group>"; }; 548E01C22C3F78360071C83D /* FeedBackViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FeedBackViewController.xib; sourceTree = "<group>"; };
@@ -2659,8 +2662,8 @@
54E82E9E2CA6876300C931D9 /* RoomBoomManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBoomManager.m; sourceTree = "<group>"; }; 54E82E9E2CA6876300C931D9 /* RoomBoomManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBoomManager.m; sourceTree = "<group>"; };
54E82EA02CA6886700C931D9 /* RoomBoomBannerAnimation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomBoomBannerAnimation.h; sourceTree = "<group>"; }; 54E82EA02CA6886700C931D9 /* RoomBoomBannerAnimation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomBoomBannerAnimation.h; sourceTree = "<group>"; };
54E82EA12CA6886700C931D9 /* RoomBoomBannerAnimation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBoomBannerAnimation.m; sourceTree = "<group>"; }; 54E82EA12CA6886700C931D9 /* RoomBoomBannerAnimation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBoomBannerAnimation.m; sourceTree = "<group>"; };
54E82EA32CA693FA00C931D9 /* RoomBoomProgressView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomBoomProgressView.h; sourceTree = "<group>"; }; 54E82EA32CA693FA00C931D9 /* RoomBoomExplosionView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomBoomExplosionView.h; sourceTree = "<group>"; };
54E82EA42CA693FA00C931D9 /* RoomBoomProgressView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBoomProgressView.m; sourceTree = "<group>"; }; 54E82EA42CA693FA00C931D9 /* RoomBoomExplosionView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBoomExplosionView.m; sourceTree = "<group>"; };
54E82EA62CA6940900C931D9 /* RoomBoomResultView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomBoomResultView.h; sourceTree = "<group>"; }; 54E82EA62CA6940900C931D9 /* RoomBoomResultView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomBoomResultView.h; sourceTree = "<group>"; };
54E82EA72CA6940900C931D9 /* RoomBoomResultView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBoomResultView.m; sourceTree = "<group>"; }; 54E82EA72CA6940900C931D9 /* RoomBoomResultView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBoomResultView.m; sourceTree = "<group>"; };
54E82EA92CA9261000C931D9 /* Api+Boom.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+Boom.h"; sourceTree = "<group>"; }; 54E82EA92CA9261000C931D9 /* Api+Boom.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+Boom.h"; sourceTree = "<group>"; };
@@ -6542,12 +6545,14 @@
54E82E9E2CA6876300C931D9 /* RoomBoomManager.m */, 54E82E9E2CA6876300C931D9 /* RoomBoomManager.m */,
54E82EA02CA6886700C931D9 /* RoomBoomBannerAnimation.h */, 54E82EA02CA6886700C931D9 /* RoomBoomBannerAnimation.h */,
54E82EA12CA6886700C931D9 /* RoomBoomBannerAnimation.m */, 54E82EA12CA6886700C931D9 /* RoomBoomBannerAnimation.m */,
54E82EA32CA693FA00C931D9 /* RoomBoomProgressView.h */, 54E82EA32CA693FA00C931D9 /* RoomBoomExplosionView.h */,
54E82EA42CA693FA00C931D9 /* RoomBoomProgressView.m */, 54E82EA42CA693FA00C931D9 /* RoomBoomExplosionView.m */,
54E82EA62CA6940900C931D9 /* RoomBoomResultView.h */, 54E82EA62CA6940900C931D9 /* RoomBoomResultView.h */,
54E82EA72CA6940900C931D9 /* RoomBoomResultView.m */, 54E82EA72CA6940900C931D9 /* RoomBoomResultView.m */,
54E82EAF2CA93BE200C931D9 /* BoomInfoViewController.h */, 54E82EAF2CA93BE200C931D9 /* BoomInfoViewController.h */,
54E82EB02CA93BE200C931D9 /* BoomInfoViewController.m */, 54E82EB02CA93BE200C931D9 /* BoomInfoViewController.m */,
547B30F72CB511700041E962 /* RoomBoomEntryView.h */,
547B30F82CB511700041E962 /* RoomBoomEntryView.m */,
); );
path = Boom; path = Boom;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -11693,7 +11698,7 @@
23FF25762ABD66B90064E904 /* XPFreeGiftsObtainView.m in Sources */, 23FF25762ABD66B90064E904 /* XPFreeGiftsObtainView.m in Sources */,
E81C27A226EF23490031E639 /* YUMINNNN.h in Sources */, E81C27A226EF23490031E639 /* YUMINNNN.h in Sources */,
E80E900C27E0358900434B90 /* XPRoomTopicAlertView.m in Sources */, E80E900C27E0358900434B90 /* XPRoomTopicAlertView.m in Sources */,
54E82EA52CA693FA00C931D9 /* RoomBoomProgressView.m in Sources */, 54E82EA52CA693FA00C931D9 /* RoomBoomExplosionView.m in Sources */,
9BDA3E7A27FD43EF00517FE6 /* XPAnchorFansTeamEntranceView.m in Sources */, 9BDA3E7A27FD43EF00517FE6 /* XPAnchorFansTeamEntranceView.m in Sources */,
E81C279826EB3AC40031E639 /* LoginForgetPasswordProtocol.h in Sources */, E81C279826EB3AC40031E639 /* LoginForgetPasswordProtocol.h in Sources */,
9BD8D4E328911E9900AE03FF /* XPMineCollectRoomListViewController.m in Sources */, 9BD8D4E328911E9900AE03FF /* XPMineCollectRoomListViewController.m in Sources */,
@@ -12530,6 +12535,7 @@
E8AB630D28ADD8C60023B0D2 /* XPMomentTopicContainerViewController.m in Sources */, E8AB630D28ADD8C60023B0D2 /* XPMomentTopicContainerViewController.m in Sources */,
23E9EA7C2A83977400B792F2 /* MessageContentTreasureFairyView.m in Sources */, 23E9EA7C2A83977400B792F2 /* MessageContentTreasureFairyView.m in Sources */,
E8D4DE472940473500EC788D /* GiftTwelveStarFirstModel.m in Sources */, E8D4DE472940473500EC788D /* GiftTwelveStarFirstModel.m in Sources */,
547B30F92CB511700041E962 /* RoomBoomEntryView.m in Sources */,
E87DF4FB2A42CCDE009C1185 /* XPHomeRedommendCollectionViewCell.m in Sources */, E87DF4FB2A42CCDE009C1185 /* XPHomeRedommendCollectionViewCell.m in Sources */,
2368ECDA2BC3C02800EDF4C9 /* XPMineSwitchLanguageVC.m in Sources */, 2368ECDA2BC3C02800EDF4C9 /* XPMineSwitchLanguageVC.m in Sources */,
187EEEF026E89FE8002833B2 /* AccountInfoStorage.m in Sources */, 187EEEF026E89FE8002833B2 /* AccountInfoStorage.m in Sources */,

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "蒙版组 64@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "进度条空@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "图层 18 拷贝 3.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "组 10@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "色相/饱和度 9@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@@ -38,6 +38,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns
#define kImage(image) [UIImage imageNamed:image] #define kImage(image) [UIImage imageNamed:image]
///UIFont ///UIFont
#define kFontLight(font) [UIFont systemFontOfSize:kGetScaleWidth(font) weight:UIFontWeightLight]
#define kFontRegular(font) [UIFont systemFontOfSize:kGetScaleWidth(font) weight:UIFontWeightRegular] #define kFontRegular(font) [UIFont systemFontOfSize:kGetScaleWidth(font) weight:UIFontWeightRegular]
#define kFontMedium(font) [UIFont systemFontOfSize:kGetScaleWidth(font) weight:UIFontWeightMedium] #define kFontMedium(font) [UIFont systemFontOfSize:kGetScaleWidth(font) weight:UIFontWeightMedium]
#define kFontSemibold(font) [UIFont systemFontOfSize:kGetScaleWidth(font) weight:UIFontWeightSemibold] #define kFontSemibold(font) [UIFont systemFontOfSize:kGetScaleWidth(font) weight:UIFontWeightSemibold]

View File

@@ -64,6 +64,8 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) {
CustomMessageType_LuckyBag = 61, CustomMessageType_LuckyBag = 61,
///发现萌新 ///发现萌新
CustomMessageType_FindNew = 62, CustomMessageType_FindNew = 62,
///房间火箭
CustomMessageType_RoomBoom = 63,
/// CP 礼物 /// CP 礼物
CustomMessageType_CP = 64, CustomMessageType_CP = 64,
///塔罗 ///塔罗
@@ -388,6 +390,15 @@ typedef NS_ENUM(NSUInteger, CustomMessageFindNewUserGreet) {
/// 打招呼 /// 打招呼
Custom_Message_Find_New_Greet_New_User = 621, Custom_Message_Find_New_Greet_New_User = 621,
}; };
///first == CustomMessageType_RoomBoom 房间火箭
typedef NS_ENUM(NSUInteger, CustomMessageRoomBoom) {
/// 经验值更新
Custom_Message_Room_Boom_EXP = 631,
/// 升级
Custom_Message_Room_Boom_LevelUp = 632,
/// 奖励
Custom_Message_Room_Boom_Award = 633,
};
///跳转类型 ///跳转类型
typedef NS_ENUM(NSUInteger, CustomMessageRouter) { typedef NS_ENUM(NSUInteger, CustomMessageRouter) {
/// 跳转H5 /// 跳转H5

View File

@@ -232,11 +232,10 @@
- (void)didTapCPAvatar { - (void)didTapCPAvatar {
if (self.relationUser.cpUid > 0) { if (self.relationUser.cpUid > 0) {
XPMineUserInfoViewController * infoVC = [[XPMineUserInfoViewController alloc] init];
infoVC.uid = self.relationUser.cpUid;
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:infoVC animated:YES];
} }
XPMineUserInfoViewController * infoVC = [[XPMineUserInfoViewController alloc] init];
infoVC.uid = self.relationUser.cpUid;
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:infoVC animated:YES];
} }
#pragma mark - #pragma mark -

View File

@@ -160,7 +160,7 @@ return view;\
numberOfLines = ceil(textRect.size.height / lineHeight); numberOfLines = ceil(textRect.size.height / lineHeight);
} }
height = kGetScaleWidth(530) + lineHeight * numberOfLines; height = kGetScaleWidth(540) + lineHeight * numberOfLines;
return height; return height;
} }

View File

@@ -9,8 +9,12 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface Api_Boom : Api @interface Api(Boom)
+ (void)getBoomRocketAnimationInfo:(HttpRequestHelperCompletion)completion
roomUid:(NSString *)roomUid;
+ (void)getBoomDetailInfo:(HttpRequestHelperCompletion)completion
roomUid:(NSString *)roomUid;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -7,6 +7,19 @@
#import "Api+Boom.h" #import "Api+Boom.h"
@implementation Api_Boom @implementation Api(Boom)
+ (void)getBoomRocketAnimationInfo:(HttpRequestHelperCompletion)completion
roomUid:(NSString *)roomUid {
[self makeRequest:@"room/boom/draw/info"
method:HttpRequestHelperMethodGET
completion:completion, __FUNCTION__, roomUid, nil];
}
+ (void)getBoomDetailInfo:(HttpRequestHelperCompletion)completion
roomUid:(NSString *)roomUid {
[self makeRequest:@"room/boom/level/info"
method:HttpRequestHelperMethodGET
completion:completion, __FUNCTION__, roomUid, nil];
}
@end @end

View File

@@ -105,7 +105,6 @@
/// @param roomId id /// @param roomId id
+ (void)roomActivityList:(HttpRequestHelperCompletion)completion roomId:(NSString *)roomId { + (void)roomActivityList:(HttpRequestHelperCompletion)completion roomId:(NSString *)roomId {
[self makeRequest:@"resource/list" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, roomId, nil]; [self makeRequest:@"resource/list" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, roomId, nil];
} }
+(void)getPlayList:(HttpRequestHelperCompletion)completion roomId:(NSString *)roomId{ +(void)getPlayList:(HttpRequestHelperCompletion)completion roomId:(NSString *)roomId{

View File

@@ -7,10 +7,14 @@
#import "MvpViewController.h" #import "MvpViewController.h"
//@class BoomDetailModel;
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface BoomInfoViewController : MvpViewController @interface BoomInfoViewController : MvpViewController
//+ (BoomInfoViewController *)vcFromBoomProgress:(NSArray <BoomDetailModel *>*)models;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

File diff suppressed because it is too large Load Diff

View File

@@ -7,10 +7,24 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@class AttachmentModel;
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface RoomBoomBannerAnimation : UIView @interface RoomBoomBannerAnimation : UIView
/// 播放房间特效的方法,后续有机会重构,所有对象按此方法进行
/// - Parameters:
/// - superView: 加载特效的视图
/// - attachment: 构建视图内容的数据
/// - handleTapToRoom: 是否响应点击事件,点击后在内部处理逻辑
/// - complete: 播放完成回调
+ (void)display:(UIView *)superView
with:(AttachmentModel *)attachment
tapToRoom:(BOOL)handleTapToRoom
complete:(void(^)(void))complete;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -7,14 +7,233 @@
#import "RoomBoomBannerAnimation.h" #import "RoomBoomBannerAnimation.h"
@implementation RoomBoomBannerAnimation #import "RoomBoomManager.h"
/* #import "RoomInfoModel.h"
// Only override drawRect: if you perform custom drawing. #import "BoomInfoModel.h"
// An empty implementation adversely affects performance during animation. #import "AttachmentModel.h"
- (void)drawRect:(CGRect)rect { #import "RoomHostDelegate.h"
// Drawing code #import "XPRoomViewController.h"
} #import "XCCurrentVCStackManager.h"
*/
@interface RoomBoomBannerAnimation ()
@property (nonatomic, strong) NetImageView *avatar;
@property (nonatomic, strong) NetImageView *rocket;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *contentLabel;
@property (nonatomic, strong) Boom632Model *model;
//@property (nonatomic, copy) void(^didTapGo)(void);
@property (nonatomic, assign) BOOL needHandleTap;
@end
@implementation RoomBoomBannerAnimation
+ (void)display:(UIView *)superView
with:(AttachmentModel *)attachment
tapToRoom:(BOOL)handleTapToRoom
complete:(nonnull void (^)(void))complete {
if (!attachment) {
return;
}
Boom632Model *m = [Boom632Model modelWithJSON:attachment.data];
CGFloat width = KScreenWidth-32;
CGFloat height = kGetScaleWidth(90);
RoomBoomBannerAnimation *bannerView = [[RoomBoomBannerAnimation alloc] initWithFrame:CGRectMake(KScreenWidth, 80, width, height)];
bannerView.model = m;
bannerView.needHandleTap = handleTapToRoom;
[superView addSubview:bannerView];
@kWeakify(bannerView);
[UIView animateWithDuration:0.25 animations:^{
bannerView.center = CGPointMake(superView.center.x, height/2 + 80);
} completion:^(BOOL finished) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
bannerView.frame = CGRectMake(-KScreenWidth, 80, width, height);
} completion:^(BOOL finished) {
@kStrongify(bannerView);
[bannerView removeFromSuperview];
[[RoomBoomManager sharedManager] bannerDisplayEnd];
}];
});
}];
}
- (void)setModel:(Boom632Model *)model {
_model = model;
self.avatar.imageUrl = model.avatar;
self.rocket.imageUrl = model.pic;
self.titleLabel.text = [NSString stringWithFormat:@"%@%@", YMLocalizedString(@"RoomBoom_5"), model.roomTitle];
}
- (void)handleTapGo {
if (self.needHandleTap) {
//
UIViewController * controllerView = [XCCurrentVCStackManager shareManager].getCurrentVC;
__block XPRoomViewController<RoomHostDelegate> *roomVC = nil;
[controllerView.navigationController.viewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if ([obj isKindOfClass:[XPRoomViewController class]]) {
[controllerView.navigationController popToRootViewControllerAnimated:NO];
roomVC = obj;
*stop = YES;
}
}];
if (roomVC) {
//
if ([roomVC getRoomInfo].uid == self.model.roomUid) {
return;
}
@kWeakify(self);
[TTPopup alertWithMessage:YMLocalizedString(@"Combo_10") confirmHandler:^{
@kStrongify(self);
[roomVC exitRoom];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[XPRoomViewController openRoom:@(self.model.roomUid).stringValue
viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
});
} cancelHandler:^{}];
} else {
[XPRoomViewController openRoom:@(self.model.roomUid).stringValue
viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
}
}
}
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.backgroundColor = [UIColor yellowColor];
UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage:kImage(@"boom_banner_bg")];
backgroundImageView.contentMode = UIViewContentModeScaleAspectFit;
[self addSubview:backgroundImageView];
[backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.right.bottom.mas_equalTo(self);
make.width.mas_equalTo(kGetScaleWidth(285));
}];
UIButton *goButton = [UIButton buttonWithType:UIButtonTypeCustom];
[goButton addTarget:self action:@selector(handleTapGo) forControlEvents:UIControlEventTouchUpInside];
[goButton setBackgroundImage:kImage(@"boom_banner_go") forState:UIControlStateNormal];
[self addSubview:goButton];
[goButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.right.bottom.mas_equalTo(self);
make.width.mas_equalTo(kGetScaleWidth(97));
}];
UIImageView *avatarWearImageView = [[UIImageView alloc] initWithImage:kImage(@"boom_banner_wear")];
avatarWearImageView.contentMode = UIViewContentModeScaleAspectFit;
[self addSubview:avatarWearImageView];
[avatarWearImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.bottom.mas_equalTo(self);
make.width.mas_equalTo(kGetScaleWidth(94));
}];
[self insertSubview:self.avatar belowSubview:avatarWearImageView];
[self.avatar mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(avatarWearImageView);
make.top.mas_equalTo(avatarWearImageView).offset(19);
make.width.height.mas_equalTo(kGetScaleWidth(57));
}];
[self addSubview:self.rocket];
[self.rocket mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(avatarWearImageView.mas_right);
make.centerY.mas_equalTo(avatarWearImageView);
make.width.height.mas_equalTo(kGetScaleWidth(35));
}];
[self addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(38));
make.left.mas_equalTo(self.rocket.mas_right).offset(4);
make.right.mas_equalTo(goButton.mas_left);
make.height.mas_offset(17);
}];
[self addSubview:self.contentLabel];
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.titleLabel.mas_bottom);
make.left.mas_equalTo(self.rocket.mas_right).offset(4);
make.right.mas_equalTo(goButton.mas_left);
make.height.mas_offset(17);
}];
}
return self;
}
- (NetImageConfig *)avatarConfig {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.imageType = ImageTypeUserIcon;
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
return config;
}
- (NetImageView *)avatar {
if (!_avatar) {
_avatar = [[NetImageView alloc] initWithConfig:[self avatarConfig]];
_avatar.layer.masksToBounds = YES;
_avatar.layer.cornerRadius = 56/2;
_avatar.layer.borderColor = [UIColor whiteColor].CGColor;
_avatar.layer.borderWidth = 1;
}
return _avatar;
}
- (NetImageView *)rocket {
if (!_rocket) {
_rocket = [[NetImageView alloc] init];
_rocket.backgroundColor = [UIColor purpleColor];
}
return _rocket;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [UILabel labelInitWithText:@""
font:kFontMedium(12)
textColor:[UIColor whiteColor]];
//
_titleLabel.shadowColor = [UIColor redColor];
// (width, height)
_titleLabel.shadowOffset = CGSizeMake(2, 2);
}
return _titleLabel;
}
- (UILabel *)contentLabel {
if (!_contentLabel) {
_contentLabel = [UILabel labelInitWithText:@"触发了BOOM,前去围观"
font:kFontMedium(10)
textColor:[UIColor whiteColor]];
NSAttributedString *as_2 = [[NSAttributedString alloc] initWithString:@"Boom"
attributes:@{NSFontAttributeName: kFontMedium(10),
NSForegroundColorAttributeName: UIColorFromRGB(0xFFE018)}];
NSAttributedString *as_3 = [[NSAttributedString alloc] initWithString:YMLocalizedString(@"RoomBoom_4")
attributes:@{NSFontAttributeName: kFontMedium(10),
NSForegroundColorAttributeName: [UIColor whiteColor]}];
NSMutableAttributedString *content = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"RoomBoom_3") attributes:@{NSFontAttributeName: kFontMedium(10), NSForegroundColorAttributeName: [UIColor whiteColor]}];
[content appendAttributedString:as_2];
[content appendAttributedString:as_3];
_contentLabel.attributedText = content;
}
return _contentLabel;
}
@end @end

View File

@@ -0,0 +1,20 @@
//
// RoomBoomEntryView.h
// YuMi
//
// Created by P on 2024/10/8.
//
#import <UIKit/UIKit.h>
@class BoomDetailModel;
NS_ASSUME_NONNULL_BEGIN
@interface RoomBoomEntryView : UIView
@property (nonatomic, strong) BoomDetailModel *boomModel;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,99 @@
//
// RoomBoomEntryView.m
// YuMi
//
// Created by P on 2024/10/8.
//
#import "RoomBoomEntryView.h"
#import "BoomInfoModel.h"
@interface RoomBoomEntryView()
@property (nonatomic, strong) NetImageView *icon;
@property (nonatomic, strong) UIImageView *progress;
@property (nonatomic, strong) UIImageView *progressBG;
@end
@implementation RoomBoomEntryView
- (void)setBoomModel:(BoomDetailModel *)boomModel {
_boomModel = boomModel;
@kWeakify(self);
dispatch_async(dispatch_get_main_queue(), ^{
@kStrongify(self);
self.icon.imageUrl = boomModel.pic;
CGFloat progress = boomModel.speed * 1.0 / 100.0;
if (progress == 0) {
self.progress.hidden = YES;
} else {
self.progress.hidden = NO;
[UIView animateWithDuration:0.3 animations:^{
[self.progress mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(32) * progress);
}];
//
[self layoutIfNeeded];
}];
}
});
}
- (instancetype)init {
if (self = [super init]) {
[self addSubview:self.icon];
[self.icon mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self);
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(40), kGetScaleWidth(40)));
}];
[self addSubview:self.progressBG];
[self.progressBG mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.icon).offset(3);
make.leading.mas_equalTo(self.icon).offset(3);
make.trailing.mas_equalTo(self.icon).offset(-3);
make.height.mas_equalTo(7);
}];
[self addSubview:self.progress];
[self.progress mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.progressBG);
make.leading.mas_equalTo(self.icon).offset(4);
make.width.mas_equalTo(0);
make.height.mas_equalTo(5);
}];
}
return self;
}
- (UIImageView *)icon {
if (!_icon) {
_icon = [[NetImageView alloc] init];
_icon.userInteractionEnabled = YES;
_icon.contentMode = UIViewContentModeScaleAspectFit;
_icon.transform = CGAffineTransformMakeRotation(-M_PI / 6);
}
return _icon;
}
- (UIImageView *)progress {
if (!_progress) {
UIImage *progressImage = [kImage(@"room_boom_entry_progress_bar") resizableImageWithCapInsets:UIEdgeInsetsMake(0, 3, 0, 3) resizingMode:UIImageResizingModeStretch];
_progress = [[UIImageView alloc] initWithImage:progressImage];
_progress.userInteractionEnabled = YES;
_progress.hidden = NO;
}
return _progress;
}
- (UIImageView *)progressBG {
if (!_progressBG) {
_progressBG = [[UIImageView alloc] initWithImage:kImage(@"room_boom_entry_progress_bar_bg")];
_progressBG.userInteractionEnabled = YES;
}
return _progressBG;
}
@end

View File

@@ -0,0 +1,32 @@
//
// RoomBoomProgressView.h
// YuMi
//
// Created by P on 2024/9/27.
//
#import <UIKit/UIKit.h>
@class AttachmentModel, BoomInfoModel;
NS_ASSUME_NONNULL_BEGIN
@interface RoomBoomExplosionView : UIView
+ (void)display:(UIView *)superView
with:(NSArray *)vapSources
complete:(void(^)(void))complete;
//+ (void)display:(UIView *)superView
// with:(AttachmentModel *)attachment
// complete:(void(^)(void))complete;
//
//+ (void)displayWhenEnter:(UIView *)superView
// with:(BoomInfoModel *)model
// complete:(void(^)(void))complete;
- (void)saveCurrenRoomUID:(NSInteger)room;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,211 @@
//
// RoomBoomProgressView.m
// YuMi
//
// Created by P on 2024/9/27.
//
#import "RoomBoomExplosionView.h"
#import <QGVAPWrapView.h>
#import "BoomInfoModel.h"
#import "AttachmentModel.h"
#import "RoomBoomManager.h"
#import "XPRoomGiftAnimationParser.h"
@interface RoomBoomExplosionView() <HWDMP4PlayDelegate>
@property (nonatomic, strong) VAPView *vapView;
@property (nonatomic, strong) XPRoomGiftAnimationParser *vapParser;
//@property (nonatomic, strong) Boom632Model *model;
//@property (nonatomic, strong) BoomInfoModel *boomInfo;
@property (nonatomic, assign) NSInteger seq;
@property (nonatomic, copy) NSString *countDownURLString;
@property (nonatomic, copy) NSString *endURLString;
@property (nonatomic, copy) void(^completeDisplay)(void);
@end
@implementation RoomBoomExplosionView
+ (void)display:(UIView *)superView
with:(NSArray *)vapSources
complete:(void(^)(void))complete {
if (vapSources.count < 2) {
return;
}
RoomBoomExplosionView *explosionView = [[RoomBoomExplosionView alloc] initWithFrame:CGRectMake(0, 0, superView.bounds.size.width, superView.bounds.size.height)];
explosionView.userInteractionEnabled = NO;
explosionView.completeDisplay = complete;
[superView addSubview:explosionView];
explosionView.countDownURLString = [vapSources firstObject];
explosionView.endURLString = [vapSources lastObject];
[explosionView play_count];
}
- (void)saveCurrenRoomUID:(NSInteger)room {
}
//+ (void)display:(UIView *)superView
// with:(AttachmentModel *)attachment
// complete:(void(^)(void))complete {
//
// if (!attachment) {
// return;
// }
//
// Boom632Model *m = [Boom632Model modelWithJSON:attachment.data];
//
// RoomBoomExplosionView *explosionView = [[RoomBoomExplosionView alloc] initWithFrame:CGRectMake(0, 0, superView.bounds.size.width, superView.bounds.size.height)];
// explosionView.userInteractionEnabled = NO;
// explosionView.completeDisplay = complete;
// [superView addSubview:explosionView];
// explosionView.model = m;
//}
//
//+ (void)displayWhenEnter:(UIView *)superView
// with:(BoomInfoModel *)model
// complete:(void(^)(void))complete {
// if (!model) {
// return;
// }
//
// RoomBoomExplosionView *explosionView = [[RoomBoomExplosionView alloc] initWithFrame:CGRectMake(0, 0, superView.bounds.size.width, superView.bounds.size.height)];
// explosionView.userInteractionEnabled = NO;
// explosionView.completeDisplay = complete;
// [superView addSubview:explosionView];
// explosionView.boomInfo = model;
//}
- (void)dealloc
{
[self.vapView stopHWDMP4];
[self.vapView removeFromSuperview];
self.vapView = nil;
}
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.seq = 0;
self.backgroundColor = [UIColor colorWithWhite:0.6 alpha:0.3];
[self addSubview:self.vapView];
[self.vapView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self);
}];
}
return self;
}
//- (void)setModel:(Boom632Model *)model {
// _model = model;
// self.countDownURLString = model.countDownVapUrl;
// self.endURLString = model.endVapUrl;
// [self play_count];
//}
//
//- (void)setBoomInfo:(BoomInfoModel *)boomInfo {
// _boomInfo = boomInfo;
//}
- (void)play_count {
self.seq = 1;
NSString *path = [self.countDownURLString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if (path.length == 0) {
return;
}
NSString *encodingUrl = [path stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet];
@kWeakify(self);
[self.vapParser parseWithURL:encodingUrl completionBlock:^(NSString * _Nullable videoUrl) {
@kStrongify(self);
if (videoUrl.length) {
[self.vapView setMute:NO];
[self.vapView playHWDMP4:videoUrl repeatCount:0 delegate:self];
}
} failureBlock:^(NSError * _Nullable error) {
}];
}
- (void)play_boom {
self.seq = 2;
NSString *path = [self.endURLString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if (path.length == 0) {
return;
}
NSString *encodingUrl = [path stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet];
@kWeakify(self);
[self.vapParser parseWithURL:encodingUrl completionBlock:^(NSString * _Nullable videoUrl) {
@kStrongify(self);
if (videoUrl.length) {
[self.vapView setMute:NO];
[self.vapView playHWDMP4:videoUrl repeatCount:0 delegate:self];
}
} failureBlock:^(NSError * _Nullable error) {
}];
}
#pragma mark - HWDMP4PlayDelegate
//truefalse
- (BOOL)shouldStartPlayMP4:(VAPView *)container config:(QGVAPConfigModel *)config {
return YES;
}
- (void)viewDidFinishPlayMP4:(NSInteger)totalFrameCount view:(VAPView *)container {
if (self.seq == 1) {
[self play_boom];
} else if (self.seq == 2) {
self.seq = 0;
@kWeakify(self);
dispatch_async(dispatch_get_main_queue(), ^{
@kStrongify(self);
[[RoomBoomManager sharedManager] explosionEnd];
[self removeFromSuperview];
// if (self.completeDisplay) {
// self.completeDisplay();
//
// }
});
}
}
- (void)viewDidStopPlayMP4:(NSInteger)lastFrameIndex view:(VAPView *)container {
}
- (void)viewDidFailPlayMP4:(NSError *)error{
@kWeakify(self);
dispatch_async(dispatch_get_main_queue(), ^{
@kStrongify(self);
[[RoomBoomManager sharedManager] explosionEnd];
[self removeFromSuperview];
});
}
#pragma mark -
- (VAPView *)vapView {
if (!_vapView) {
_vapView = [[VAPView alloc] init];
_vapView.contentMode = UIViewContentModeScaleAspectFill;
}
return _vapView;
}
- (XPRoomGiftAnimationParser *)vapParser {
if (!_vapParser) {
_vapParser = [[XPRoomGiftAnimationParser alloc] init];
}
return _vapParser;
}
@end

View File

@@ -7,10 +7,39 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@class AttachmentModel, BoomInfoModel, BoomDetailModel;
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
typedef void(^BoomEventBlock)(id sth);
@interface RoomBoomManager : NSObject @interface RoomBoomManager : NSObject
+ (instancetype)sharedManager;
- (NSArray *)loadBoomDetails;
- (void)updateBoomDetailArray:(NSArray <BoomDetailModel *> *)array;
- (void)updateBoomDetail:(BoomDetailModel *)boomDetail;
- (void)cleanBoomDetail;
/// 视图注册监听对应的火箭事件,通过 block 回调
- (void)registerBoomBanner:(BoomEventBlock)block target:(id)target;
- (void)registerBoomExplosion:(BoomEventBlock)block target:(id)target;
- (void)registerBoomEnterRoomExplosion:(BoomEventBlock)block target:(id)target;
- (void)registerBoomProgressUpdate:(BoomEventBlock)block target:(id)target;
- (void)registerBoomGiftDisplay:(BoomEventBlock)block target:(id)target;
- (void)explosionEnd;
- (void)giftDisplayEnd;
- (void)bannerDisplayEnd;
- (void)removeEventListenerForTarget:(id)target;
- (void)receiveEnterRoomBoom:(BoomInfoModel *)model;
- (void)receiveNIMResponse:(AttachmentModel *)attachment;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -7,6 +7,337 @@
#import "RoomBoomManager.h" #import "RoomBoomManager.h"
@implementation RoomBoomManager #import "BoomInfoModel.h"
#import "AttachmentModel.h"
@interface RoomBoomManager () <NIMChatManagerDelegate, NIMBroadcastManagerDelegate>
@property (nonatomic, strong) NSMutableArray <NSDictionary *> *bannerListeners;
@property (nonatomic, strong) NSMutableArray <NSDictionary *> *ExplosionListeners;
@property (nonatomic, strong) NSMutableArray <NSDictionary *> *enterRoomExplosionListeners;
@property (nonatomic, strong) NSMutableArray <NSDictionary *> *progressUpdateListeners;
@property (nonatomic, strong) NSMutableArray <NSDictionary *> *boomGiftsListeners;
@property (nonatomic, strong) NSMutableArray <BoomDetailModel *> *boomDetailArray;
@property (nonatomic, strong) NSMutableArray *boomEventsQueue;
@property (nonatomic, strong) NSMutableArray *giftEventsQueue;
@property (nonatomic, strong) NSMutableArray *bannerEventsQueue;
@property (nonatomic, assign) BOOL isBooming;
@property (nonatomic, assign) BOOL isGitfing;
@property (nonatomic, assign) BOOL isBannering;
@end
@implementation RoomBoomManager
+ (instancetype)sharedManager {
static RoomBoomManager *instance;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
instance = [[self alloc] init];
instance.bannerListeners = @[].mutableCopy;
instance.ExplosionListeners = @[].mutableCopy;
instance.enterRoomExplosionListeners = @[].mutableCopy;
instance.progressUpdateListeners = @[].mutableCopy;
instance.boomGiftsListeners = @[].mutableCopy;
instance.boomDetailArray = @[].mutableCopy;
instance.boomEventsQueue = @[].mutableCopy;
instance.giftEventsQueue = @[].mutableCopy;
instance.bannerEventsQueue = @[].mutableCopy;
// [[NIMSDK sharedSDK].chatManager addDelegate:instance];
[[NIMSDK sharedSDK].broadcastManager addDelegate:instance];
});
return instance;
}
- (void)test {
[self handleBannerUpdate:nil];
[self handleExplosionUpdate:nil];
}
- (NSArray *)loadBoomDetails {
return self.boomDetailArray;
}
- (void)updateBoomDetailArray:(NSArray <BoomDetailModel *> *)array {
self.boomDetailArray = array.mutableCopy;
}
- (void)updateBoomDetail:(BoomDetailModel *)boomDetail {
for (int i = 0; i < self.boomDetailArray.count; i++) {
BoomDetailModel *detail = [self.boomDetailArray xpSafeObjectAtIndex:i];
if (detail.level == boomDetail.level) {
detail.exp = boomDetail.exp;
detail.speed = boomDetail.speed;
break;
}
}
}
- (void)cleanBoomDetail {
}
- (void)registerBoomBanner:(BoomEventBlock)block target:(id)target {
@synchronized (self.bannerListeners) {
[self.bannerListeners addObject:@{NSStringFromClass([target class]) : block}];
}
}
- (void)registerBoomExplosion:(BoomEventBlock)block target:(id)target {
@synchronized (self.ExplosionListeners) {
[self.ExplosionListeners addObject:@{NSStringFromClass([target class]) : block}];
}
}
- (void)registerBoomEnterRoomExplosion:(BoomEventBlock)block target:(id)target {
@synchronized (self.enterRoomExplosionListeners) {
[self.enterRoomExplosionListeners addObject:@{NSStringFromClass([target class]) : block}];
}
}
- (void)registerBoomProgressUpdate:(BoomEventBlock)block target:(id)target {
@synchronized (self.progressUpdateListeners) {
[self.progressUpdateListeners addObject:@{NSStringFromClass([target class]) : block}];
}
}
- (void)registerBoomGiftDisplay:(BoomEventBlock)block target:(id)target {
@synchronized (self.boomGiftsListeners) {
[self.boomGiftsListeners addObject:@{NSStringFromClass([target class]) : block}];
}
}
- (void)checkAndStartBoomEvent {
if (self.isBooming) {
return;
}
if (self.boomEventsQueue.count > 0) {
id obj = self.boomEventsQueue.firstObject;
NSString *url_1 = @"";
NSString *url_2 = @"";
if ([obj isKindOfClass:[AttachmentModel class]]) {
Boom632Model *m = [Boom632Model modelWithJSON:[(AttachmentModel *)obj data]];
url_1 = m.countDownVapUrl;
url_2 = m.endVapUrl;
} else if ([obj isKindOfClass:[RoomBoomSignVo class]]) {
url_1 = [(RoomBoomSignVo *)obj countDownVapUrl];
url_1 = [(RoomBoomSignVo *)obj endVapUrl];
}
if (url_1.length > 0 && url_2.length > 0) {
self.isBooming = YES;
[self handleExplosionUpdate:@[url_1, url_2]];
}
[self.boomEventsQueue removeObjectAtIndex:0];
}
}
- (void)checkAndStartBannerEvent {
if (self.isBannering) {
return;
}
if (self.bannerEventsQueue.count > 0) {
self.isBannering = YES;
id obj = self.bannerEventsQueue.firstObject;
[self handleBannerUpdate:obj];
[self.bannerEventsQueue removeObjectAtIndex:0];
}
}
- (void)explosionEnd {
self.isBooming = NO;
if (self.giftEventsQueue.count > 0) {
id obj = self.giftEventsQueue.firstObject;
[self handleBoomGiftUpdate:obj];
[self.giftEventsQueue removeObjectAtIndex:0];
} else {
[self checkAndStartBoomEvent];
}
}
- (void)giftDisplayEnd {
[self checkAndStartBoomEvent];
}
- (void)bannerDisplayEnd {
self.isBannering = NO;
[self checkAndStartBannerEvent];
}
- (void)removeEventListenerForTarget:(id)target {
@synchronized (self.progressUpdateListeners) {
NSString *key = NSStringFromClass([target class]);
for (NSDictionary *dic in self.progressUpdateListeners) {
if ([[dic allKeys] containsObject:key]) {
[self.progressUpdateListeners removeObject:dic];
break;
}
}
}
@synchronized (self.ExplosionListeners) {
NSString *key = NSStringFromClass([target class]);
for (NSDictionary *dic in self.ExplosionListeners) {
if ([[dic allKeys] containsObject:key]) {
[self.ExplosionListeners removeObject:dic];
break;
}
}
}
@synchronized (self.bannerListeners) {
NSString *key = NSStringFromClass([target class]);
for (NSDictionary *dic in self.bannerListeners) {
if ([[dic allKeys] containsObject:key]) {
[self.bannerListeners removeObject:dic];
break;
}
}
}
@synchronized (self.boomGiftsListeners) {
NSString *key = NSStringFromClass([target class]);
for (NSDictionary *dic in self.boomGiftsListeners) {
if ([[dic allKeys] containsObject:key]) {
[self.boomGiftsListeners removeObject:dic];
break;
}
}
}
@synchronized (self.enterRoomExplosionListeners) {
NSString *key = NSStringFromClass([target class]);
for (NSDictionary *dic in self.enterRoomExplosionListeners) {
if ([[dic allKeys] containsObject:key]) {
[self.enterRoomExplosionListeners removeObject:dic];
break;
}
}
}
}
- (void)receiveEnterRoomBoom:(BoomInfoModel *)model {
[self.boomEventsQueue addObjectsFromArray:model.roomBoomSignVoList];
[self checkAndStartBoomEvent];
}
- (void)receiveNIMResponse:(AttachmentModel *)attachment {
// TODO:
switch (attachment.second) {
case Custom_Message_Room_Boom_EXP: {
NSLog(@" -------- 631 : %@", attachment.data);
BoomDetailModel *boomDetail = [BoomDetailModel modelWithJSON:attachment.data];
[self handleProgressUpdate:boomDetail];
}
break;
case Custom_Message_Room_Boom_LevelUp: {
NSLog(@" 火箭 -------- 632 : %@", attachment.data);
[self.boomEventsQueue addObject:attachment];
// [self handleExplosionUpdate:attachment];
// [self handleBannerUpdate:attachment];
[self.bannerEventsQueue addObject:attachment];
[self checkAndStartBoomEvent];
[self checkAndStartBannerEvent];
}
break;
case Custom_Message_Room_Boom_Award:
NSLog(@" 火箭 -------- 633 : %@", attachment.data);
[self.giftEventsQueue addObject:attachment];
// [self handleBoomGiftUpdate:attachment];
break;
default:
break;
}
}
- (void)handleProgressUpdate:(BoomDetailModel *)model {
[self updateBoomDetail:model];
@synchronized (self.progressUpdateListeners) {
for (NSDictionary *dic in self.progressUpdateListeners) {
BoomEventBlock listener = [dic allValues].firstObject;
if (listener) {
listener(model);
}
}
}
}
- (void)handleExplosionUpdate:(id)model {
@synchronized (self.ExplosionListeners) {
for (NSDictionary *dic in self.ExplosionListeners) {
BoomEventBlock listener = [dic allValues].firstObject;
if (listener) {
listener(model);
}
}
}
}
- (void)handleBannerUpdate:(id)model {
@synchronized (self.bannerListeners) {
for (NSDictionary *dic in self.bannerListeners) {
BoomEventBlock listener = [dic allValues].firstObject;
if (listener) {
listener(model);
}
}
}
}
- (void)handleBoomGiftUpdate:(id)model {
@synchronized (self.boomGiftsListeners) {
for (NSDictionary *dic in self.boomGiftsListeners) {
BoomEventBlock listener = [dic allValues].firstObject;
if (listener) {
listener(model);
}
}
}
}
#pragma mark -
- (void)onRecvMessages:(NSArray *)messages
{
// for (NIMMessage * message in messages) {
// if (message.messageType == NIMMessageTypeCustom) {
// NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
// if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) {
// AttachmentModel * attachment = (AttachmentModel *)obj.attachment;
// if (attachment.first == CustomMessageType_RoomBoom) {
// [self receiveNIMResponse:attachment];
// }
// }
// }
// }
}
- (void)onReceiveBroadcastMessage:(NIMBroadcastMessage *)broadcastMessage {
if ([AccountInfoStorage instance].getUid.length == 0) {
return;
}
if (broadcastMessage.content) {
NSDictionary *msgDictionary = [broadcastMessage.content toJSONObject];
AttachmentModel *attachment = [AttachmentModel modelWithJSON:msgDictionary[@"body"]];
if (attachment.first == CustomMessageType_RoomBoom) {
[self receiveNIMResponse:attachment];
}
}
}
@end @end

View File

@@ -1,16 +0,0 @@
//
// RoomBoomProgressView.h
// YuMi
//
// Created by P on 2024/9/27.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface RoomBoomProgressView : UIView
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,20 +0,0 @@
//
// RoomBoomProgressView.m
// YuMi
//
// Created by P on 2024/9/27.
//
#import "RoomBoomProgressView.h"
@implementation RoomBoomProgressView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end

View File

@@ -11,6 +11,11 @@ NS_ASSUME_NONNULL_BEGIN
@interface RoomBoomResultView : UIView @interface RoomBoomResultView : UIView
+ (void)displayEmptyView:(UIView *)superView;
+ (void)display:(UIView *)superView gifts:(NSArray *)giftsArray;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -7,14 +7,232 @@
#import "RoomBoomResultView.h" #import "RoomBoomResultView.h"
@implementation RoomBoomResultView @interface RoomBoomResultCollectionViewCell : UICollectionViewCell
@property (nonatomic, strong) NetImageView *giftPic;
@end
@implementation RoomBoomResultCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.backgroundColor = [UIColor clearColor];
self.contentView.backgroundColor = [UIColor clearColor];
UIImageView *bg = [self bgView];
[self.contentView addSubview:bg];
[bg mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView);
}];
[self.contentView addSubview:self.giftPic];
[self.giftPic mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(bg).insets(UIEdgeInsetsMake(10, 10, 10, 10));
}];
}
return self;
}
- (UIImageView *)bgView {
UIImageView *bg = [[UIImageView alloc] initWithImage:kImage(@"room_boom_result_gift_cell_bg")];
return bg;
}
- (NetImageView *)giftPic {
if (!_giftPic) {
_giftPic = [[NetImageView alloc] init];
}
return _giftPic;
}
@end
@interface RoomBoomResultView() <UICollectionViewDelegateFlowLayout, UICollectionViewDataSource>
@property (nonatomic, strong) UIImageView *backgroundImageView;
@property (nonatomic, strong) UILabel *contentLabel;
@property (nonatomic, strong) UIButton *bottomButton;
@property (nonatomic, strong) UICollectionView *giftsCollectionView;
@end
@implementation RoomBoomResultView
+ (void)displayEmptyView:(UIView *)superView {
RoomBoomResultView *resultView = [[RoomBoomResultView alloc] init];
resultView.alpha = 0;
[superView addSubview:resultView];
[resultView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(190));
make.leading.mas_equalTo(10);
make.trailing.mas_equalTo(-10);
make.height.mas_equalTo(kGetScaleWidth(198));
}];
[resultView setupForEmpty];
[UIView animateWithDuration:0.2 animations:^{
resultView.alpha = 1;
}];
}
+ (void)display:(UIView *)superView gifts:(NSArray *)giftsArray {
RoomBoomResultView *resultView = [[RoomBoomResultView alloc] init];
resultView.alpha = 0;
[superView addSubview:resultView];
[resultView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(190));
make.leading.mas_equalTo(10);
make.trailing.mas_equalTo(-10);
make.height.mas_equalTo(kGetScaleWidth(394));
}];
[resultView setupFroGifts:giftsArray.count];
[UIView animateWithDuration:0.2 animations:^{
resultView.alpha = 1;
}];
}
- (instancetype)init {
if (self = [super init]) {}
return self;
}
- (void)setupForEmpty {
self.backgroundImageView.image = kImage(@"room_boom_empty_result_bg");
[self addSubview:self.backgroundImageView];
[self.backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self);
}];
self.contentLabel.text = YMLocalizedString(@"RoomBoom_0");
[self addSubview:self.contentLabel];
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self).offset(kGetScaleWidth(68));
make.leading.mas_equalTo(24);
make.trailing.mas_equalTo(-24);
}];
[self.bottomButton setTitle:@"OK" forState:UIControlStateNormal];
[self.bottomButton setBackgroundImage:kImage(@"room_boom_result_button_bg_1") forState:UIControlStateNormal];
[self addSubview:self.bottomButton];
[self.bottomButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self).offset(kGetScaleWidth(-24));
make.centerX.mas_equalTo(self);
make.size.mas_equalTo(CGSizeMake(176, 44));
}];
}
- (void)setupFroGifts:(NSInteger)giftsCount {
self.backgroundImageView.image = kImage(@"room_boom_gifts_result_bg");
[self addSubview:self.backgroundImageView];
[self.backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self);
}];
UIImageView *topContentImageView = [[UIImageView alloc] initWithImage:kImage(@"room_boom_result_top_bg")];
[self addSubview:topContentImageView];
[topContentImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.backgroundImageView.mas_top);
make.centerX.mas_equalTo(self.backgroundImageView);
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(214.5), kGetScaleWidth(52.5)));
}];
UILabel *topContentLabel = [UILabel labelInitWithText:YMLocalizedString(@"Combo_6") font:kFontMedium(17.5) textColor:UIColorFromRGB(0xF0E7BA)];
[self addSubview:topContentLabel];
[topContentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(topContentImageView);
}];
self.contentLabel.text = YMLocalizedString(@"RoomBoom_1");
self.contentLabel.font = kFontRegular(10);
[self addSubview:self.contentLabel];
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(topContentImageView.mas_bottom).offset(kGetScaleWidth(14));
make.leading.mas_equalTo(50);
make.trailing.mas_equalTo(-50);
}];
[self.bottomButton setTitle:@"GREAT" forState:UIControlStateNormal];
[self.bottomButton setBackgroundImage:kImage(@"room_boom_result_button_bg_1") forState:UIControlStateNormal];
[self addSubview:self.bottomButton];
[self.bottomButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self).offset(kGetScaleWidth(-26));
make.centerX.mas_equalTo(self);
make.size.mas_equalTo(CGSizeMake(176, 44));
}];
[self addSubview:self.giftsCollectionView];
[self.giftsCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.contentLabel.mas_bottom).offset(16);
make.leading.mas_equalTo(kGetScaleWidth(35));
make.trailing.mas_equalTo(kGetScaleWidth(-35));
make.bottom.mas_equalTo(self.bottomButton.mas_top).offset(kGetScaleWidth(-30));
}];
}
- (void)didTapBottomButton {
[self removeFromSuperview];
}
#pragma mark - UICollectionView delegate & datasource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return arc4random()%30;
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
RoomBoomResultCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"GiftCell" forIndexPath:indexPath];
return cell;
}
#pragma mark -
- (UIImageView *)backgroundImageView {
if (!_backgroundImageView) {
_backgroundImageView = [[UIImageView alloc] init];
_backgroundImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _backgroundImageView;
}
- (UILabel *)contentLabel {
if (!_contentLabel) {
_contentLabel = [UILabel labelInitWithText:@"" font:kFontRegular(12) textColor:UIColorFromRGB(0xCBA1FF)];
_contentLabel.textAlignment = NSTextAlignmentCenter;
_contentLabel.numberOfLines = 0;
}
return _contentLabel;
}
- (UIButton *)bottomButton {
if (!_bottomButton) {
_bottomButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_bottomButton.titleLabel setFont:kFontMedium(15)];
[_bottomButton addTarget:self action:@selector(didTapBottomButton) forControlEvents:UIControlEventTouchUpInside];
}
return _bottomButton;
}
- (UICollectionView *)giftsCollectionView {
if (!_giftsCollectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = CGSizeMake(kGetScaleWidth(88), kGetScaleWidth(88)); // item
layout.minimumLineSpacing = 20; //
layout.minimumInteritemSpacing = 11.5; //
layout.scrollDirection = UICollectionViewScrollDirectionVertical; //
// layout.sectionInset = UIEdgeInsetsMake(10, 10, 10, 10); //
_giftsCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero
collectionViewLayout:layout];
_giftsCollectionView.dataSource = self;
_giftsCollectionView.delegate = self;
_giftsCollectionView.showsVerticalScrollIndicator = NO;
_giftsCollectionView.backgroundColor = [UIColor clearColor];
[_giftsCollectionView registerClass:[RoomBoomResultCollectionViewCell class] forCellWithReuseIdentifier:@"GiftCell"];
}
return _giftsCollectionView;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end @end

View File

@@ -9,8 +9,88 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface RoomBoomSignVo : PIBaseModel
@property (nonatomic, assign) NSInteger drawTime;
@property (nonatomic, copy) NSString *vapUrl;
@property (nonatomic, copy) NSString *pic;
@property (nonatomic, copy) NSString *countDownVapUrl;
@property (nonatomic, copy) NSString *endVapUrl;
@property (nonatomic, assign) NSInteger level;
@end
@interface BoomInfoModel : PIBaseModel @interface BoomInfoModel : PIBaseModel
@property (nonatomic, assign) NSInteger exp;
@property (nonatomic, assign) NSInteger level;
@property (nonatomic, assign) NSInteger goldNum;
@property (nonatomic, assign) NSInteger speed;
@property (nonatomic, copy) NSString *vapUrl;
@property (nonatomic, copy) NSString *pic;
@property (nonatomic, copy) NSArray <RoomBoomSignVo *>*roomBoomSignVoList;
@end
@interface roomBoomLevelAwardVo : PIBaseModel
@property (nonatomic, copy) NSString *awardName;
@property (nonatomic, copy) NSString *awardPic;
@property (nonatomic, assign) NSInteger awardType;
@property (nonatomic, assign) NSInteger isShow;
@property (nonatomic, assign) NSInteger seq;
@end
@interface roomBoomRankVo : PIBaseModel
@property (nonatomic, copy) NSString *avatar;
@property (nonatomic, copy) NSString *nick;
@property (nonatomic, assign) NSInteger exper;
@property (nonatomic, assign) NSInteger position;
@property (nonatomic, assign) NSInteger uid;
@end
@interface BoomDetailModel : PIBaseModel
@property (nonatomic, copy) NSString *countDownVapUrl;
@property (nonatomic, assign) NSInteger currLevel;
@property (nonatomic, copy) NSString *endVapUrl;
@property (nonatomic, assign) NSInteger exp;
@property (nonatomic, assign) NSInteger goldNum;
@property (nonatomic, assign) NSInteger hot;
@property (nonatomic, assign) NSInteger level;
@property (nonatomic, copy) NSString *pic;
@property (nonatomic, assign) NSInteger rank;
@property (nonatomic, copy) NSArray <roomBoomRankVo *>*roomBoomRankVos;
@property (nonatomic, copy) NSArray <roomBoomLevelAwardVo*> *roomBoomLevelAwardVos;
@property (nonatomic, assign) NSInteger speed;
@property (nonatomic, copy) NSString *vapUrl;
@property (nonatomic, assign) NSTimeInterval messTime;
@end
@interface Boom632Model : PIBaseModel
@property (nonatomic, assign) NSInteger status;
@property (nonatomic, assign) NSInteger notifyStaySecond;
@property (nonatomic, copy) NSString *floatingScreenPic;
@property (nonatomic, copy) NSString *countDownVapUrl;
@property (nonatomic, assign) NSInteger erbanNo;
@property (nonatomic, copy) NSString *roomTitle;
@property (nonatomic, copy) NSString *endVapUrl;
@property (nonatomic, assign) NSInteger partitionId;
@property (nonatomic, copy) NSString *roomAvatar;
@property (nonatomic, assign) NSTimeInterval drawTime;
@property (nonatomic, assign) NSInteger id;
@property (nonatomic, copy) NSString *vapUrl;
@property (nonatomic, assign) NSInteger level;
@property (nonatomic, assign) NSInteger uid;
@property (nonatomic, copy) NSString *pic;
@property (nonatomic, assign) NSTimeInterval drawTimeLong;
@property (nonatomic, copy) NSString *nick;
@property (nonatomic, copy) NSString *avatar;
@property (nonatomic, assign) NSInteger roomUid;
@property (nonatomic, copy) NSString *targetIcon;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -7,6 +7,43 @@
#import "BoomInfoModel.h" #import "BoomInfoModel.h"
@implementation BoomInfoModel @implementation RoomBoomSignVo
@end
@implementation BoomInfoModel
+ (NSDictionary *)objectClassInArray {
return @{
@"roomBoomSignVoList":RoomBoomSignVo.class
};
}
@end
@implementation roomBoomLevelAwardVo
@end
@implementation roomBoomRankVo
@end
@implementation BoomDetailModel
+ (NSDictionary *)objectClassInArray {
return @{
@"roomBoomRankVos":roomBoomRankVo.class,
@"roomBoomLevelAwardVos":roomBoomLevelAwardVo.class
};
}
@end
@implementation Boom632Model
@end @end

View File

@@ -78,6 +78,13 @@ NS_ASSUME_NONNULL_BEGIN
///得到踢人名单 ///得到踢人名单
/// @param roomUid 房间id /// @param roomUid 房间id
-(void)getKickUserListWithRoomUid:(NSString *)roomUid; -(void)getKickUserListWithRoomUid:(NSString *)roomUid;
// TODO: 转移到 Manager 管理逻辑
- (void)getBoomRocketAnimationInfo:(NSString *)roomUid;
- (void)getBoomDetail:(NSString *)roomUid;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -10,6 +10,7 @@
///API ///API
#import "Api+Room.h" #import "Api+Room.h"
#import "Api+Gift.h" #import "Api+Gift.h"
#import "Api+Boom.h"
#import "UserInfoModel.h" #import "UserInfoModel.h"
#import "GuildSuperAdminInfoModel.h" #import "GuildSuperAdminInfoModel.h"
///Tool ///Tool
@@ -24,6 +25,7 @@
#import "XPRedPacketModel.h" #import "XPRedPacketModel.h"
#import "FirstChargeRoomWindowModel.h" #import "FirstChargeRoomWindowModel.h"
#import "XPFreeGiftModel.h" #import "XPFreeGiftModel.h"
#import "BoomInfoModel.h"
///P ///P
#import "XPRoomProtocol.h" #import "XPRoomProtocol.h"
@@ -320,4 +322,34 @@
} fail:^(NSInteger code, NSString * _Nullable msg) { } fail:^(NSInteger code, NSString * _Nullable msg) {
} showLoading:NO errorToast:NO] roomUid:roomUid]; } showLoading:NO errorToast:NO] roomUid:roomUid];
} }
- (void)getBoomRocketAnimationInfo:(NSString *)roomUid {
@kWeakify(self);
[Api getBoomRocketAnimationInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
@kStrongify(self);
BoomInfoModel *model = [BoomInfoModel modelWithJSON:data.data];
[[self getView] getRoomBoomExplosionSuccess:model];
}
fail:^(NSInteger code, NSString * _Nullable msg) {
}
showLoading:NO]
roomUid:roomUid];
}
- (void)getBoomDetail:(NSString *)roomUid {
@kWeakify(self);
[Api getBoomDetailInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
@kStrongify(self);
NSArray *array = [BoomDetailModel modelsWithArray:data.data];
[[self getView] getRoomBoomInfoSuccess:array];
}
fail:^(NSInteger code, NSString * _Nullable msg) {
}
showLoading:NO]
roomUid:roomUid];
}
@end @end

View File

@@ -9,8 +9,8 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@class RoomInfoModel;
@class UserInfoModel, NIMChatroom, FirstChargeRoomWindowModel,XPRedPacketModel; @class RoomInfoModel, UserInfoModel, NIMChatroom, FirstChargeRoomWindowModel, XPRedPacketModel, BoomInfoModel, BoomDetailModel;
@protocol XPRoomProtocol <NSObject> @protocol XPRoomProtocol <NSObject>
@@ -41,6 +41,9 @@ NS_ASSUME_NONNULL_BEGIN
-(void)getUnlockRoomAlbumPhotoListSuccessWithList:(NSArray *)list; -(void)getUnlockRoomAlbumPhotoListSuccessWithList:(NSArray *)list;
///获取踢人房间列表 ///获取踢人房间列表
-(void)getKickUserListSuccessWithList:(NSArray *)list; -(void)getKickUserListSuccessWithList:(NSArray *)list;
- (void)getRoomBoomInfoSuccess:(NSArray <BoomDetailModel*> *)models;
- (void)getRoomBoomExplosionSuccess:(BoomInfoModel *)model;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -13,6 +13,8 @@
#import "ActivityInfoModel.h" #import "ActivityInfoModel.h"
#import "LittleGameInfoModel.h" #import "LittleGameInfoModel.h"
@class BoomDetailModel;
typedef void(^OpenRedPacketHandle)(XPRedPacketModel *_Nullable,RoomType type ,BOOL isChangeRoom); typedef void(^OpenRedPacketHandle)(XPRedPacketModel *_Nullable,RoomType type ,BOOL isChangeRoom);
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@@ -24,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,strong) NSMutableArray<LittleGameInfoModel *> *littleGameList; @property(nonatomic,strong) NSMutableArray<LittleGameInfoModel *> *littleGameList;
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate; - (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate;
- (void)updateView; - (void)updateView;
- (void)updateForBoomDetailArray:(NSArray <BoomDetailModel*> *)models;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -47,8 +47,11 @@
#import "MSRoomMenuGameVC.h" #import "MSRoomMenuGameVC.h"
#import "BoomInfoModel.h" #import "BoomInfoModel.h"
#import "RoomBoomManager.h"
#import "RoomBoomEntryView.h"
#import "BoomInfoViewController.h" #import "BoomInfoViewController.h"
UIKIT_EXTERN NSString *kShowFirstRechargeView; UIKIT_EXTERN NSString *kShowFirstRechargeView;
@interface XPRoomActivityContainerView ()<SDCycleScrollViewDelegate,PIRoomEnterRedPacketViewDelegate> @interface XPRoomActivityContainerView ()<SDCycleScrollViewDelegate,PIRoomEnterRedPacketViewDelegate>
/// ///
@@ -72,8 +75,9 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
/// ///
@property (nonatomic,assign) BOOL isLoadActivity; @property (nonatomic,assign) BOOL isLoadActivity;
@property (nonatomic, strong) UIView *boomView; @property (nonatomic, strong) RoomBoomEntryView *boomView;
@property (nonatomic, strong) BoomInfoModel *boomModel; @property (nonatomic, copy) NSArray <BoomDetailModel *> *boomModels;
@property (nonatomic, strong) BoomDetailModel *currentLevelBoomModel;
@property (nonatomic, strong) NetImageView *loader_url_1; @property (nonatomic, strong) NetImageView *loader_url_1;
@property (nonatomic, strong) NetImageView *loader_url_2; @property (nonatomic, strong) NetImageView *loader_url_2;
@@ -83,13 +87,17 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
@implementation XPRoomActivityContainerView @implementation XPRoomActivityContainerView
-(void)dealloc{ -(void)dealloc{
[[NSNotificationCenter defaultCenter]removeObserver:self]; [[NSNotificationCenter defaultCenter]removeObserver:self];
[[RoomBoomManager sharedManager] removeEventListenerForTarget:self];
} }
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate { - (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate {
self = [super init]; self = [super init];
if (self) { if (self) {
self.hostDelegate = delegate; self.hostDelegate = delegate;
[self initSubViews]; [self initSubViews];
[self initSubViewConstraints]; [self initSubViewConstraints];
[self setupBoomManager];
} }
return self; return self;
} }
@@ -102,13 +110,31 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
} }
} }
- (void)updateForBoom:(BoomInfoModel *)model { - (void)updateForBoomDetailArray:(NSArray <BoomDetailModel*> *)models {
_boomModel = model; _boomModels = models;
if (model) {
self.boomView.hidden = NO; self.boomView.hidden = NO;
if (models) {
for (BoomDetailModel *boom in models) {
if (boom.currLevel == 1) {
self.boomView.boomModel = boom;
self.boomView.hidden = NO;
break;
}
}
} }
} }
- (void)setupBoomManager {
@kWeakify(self);
[[RoomBoomManager sharedManager] registerBoomProgressUpdate:^(id _Nonnull sth) {
@kStrongify(self);
if ([sth isKindOfClass:[BoomDetailModel class]]) {
self.boomView.boomModel = (BoomDetailModel *)sth;
}
} target:self];
}
#pragma mark - Private Method #pragma mark - Private Method
- (void)initSubViews { - (void)initSubViews {
[self addSubview:self.stackView]; [self addSubview:self.stackView];
@@ -614,7 +640,7 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
} }
- (void)displayBoomInfoProgress { - (void)displayBoomInfoProgress {
BoomInfoViewController *vc = [BoomInfoViewController vcFromBoomProgress:self.boomModel]; BoomInfoViewController *vc = [[BoomInfoViewController alloc] init];
vc.modalPresentationStyle = UIModalPresentationOverFullScreen; vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
[self.hostDelegate.getCurrentNav presentViewController:vc animated:YES completion:nil]; [self.hostDelegate.getCurrentNav presentViewController:vc animated:YES completion:nil];
} }
@@ -822,12 +848,11 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
return _pkMenuButton; return _pkMenuButton;
} }
- (UIView *)boomView { - (RoomBoomEntryView *)boomView {
if (!_boomView) { if (!_boomView) {
_boomView = [[UIView alloc] init]; _boomView = [[RoomBoomEntryView alloc] init];
_boomView.hidden = YES; _boomView.hidden = YES;
_boomView.userInteractionEnabled = YES; _boomView.userInteractionEnabled = YES;
_boomView.backgroundColor = [UIColor systemYellowColor];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(displayBoomInfoProgress)]; UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(displayBoomInfoProgress)];
[_boomView addGestureRecognizer:tap]; [_boomView addGestureRecognizer:tap];
} }

View File

@@ -2881,10 +2881,6 @@ HWDMP4PlayDelegate>
return _giftVisibleArray; return _giftVisibleArray;
} }
- (NSMutableArray<NSDictionary *> *)carEffectQueue { - (NSMutableArray<NSDictionary *> *)carEffectQueue {
if (_carEffectQueue == nil) { if (_carEffectQueue == nil) {
_carEffectQueue = [NSMutableArray array]; _carEffectQueue = [NSMutableArray array];

View File

@@ -22,7 +22,6 @@
#import "StatisticsServiceHelper.h" #import "StatisticsServiceHelper.h"
#import "NSArray+Safe.h" #import "NSArray+Safe.h"
#import "NSMutableDictionary+Saft.h" #import "NSMutableDictionary+Saft.h"
#import "XPSkillCardPlayerManager.h"
#import "XCCurrentVCStackManager.h" #import "XCCurrentVCStackManager.h"
#import "CountDownHelper.h" #import "CountDownHelper.h"
///Model ///Model
@@ -64,7 +63,6 @@
#import "XPWebViewController.h" #import "XPWebViewController.h"
#import "SessionViewController.h" #import "SessionViewController.h"
#import "XPFreeGiftsObtainView.h" #import "XPFreeGiftsObtainView.h"
#import "MSRoomMenuGameVC.h"
///P ///P
#import "XPRoomPresenter.h" #import "XPRoomPresenter.h"
@@ -86,6 +84,11 @@
#import "GiftComboManager.h" #import "GiftComboManager.h"
#import "LuckyGiftWinningFlagView.h" #import "LuckyGiftWinningFlagView.h"
#import "RoomBoomResultView.h"
#import "RoomBoomManager.h"
#import "RoomBoomExplosionView.h"
#import "RoomBoomResultView.h"
UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey;
UIKIT_EXTERN NSString * const kRoomMiniNotificationKey; UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
UIKIT_EXTERN NSString * kNewUserRechargeKey; UIKIT_EXTERN NSString * kNewUserRechargeKey;
@@ -94,7 +97,22 @@ UIKIT_EXTERN NSString * const kFreeGiftCountdownNotification;
NSString * const kHadShowAnchorRoomTipKey = @"kHadShowAnchorRoomTipKey";// NSString * const kHadShowAnchorRoomTipKey = @"kHadShowAnchorRoomTipKey";//
NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//退 NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//退
@interface XPRoomViewController ()<XPRoomProtocol, RoomHostDelegate, NIMChatroomManagerDelegate, NIMChatManagerDelegate, NIMConversationManagerDelegate, NIMLoginManagerDelegate, XPRoomSettingInputViewDelegate, AnchorRoomScrollViewDelegate, XPFirstRechargeViewDelegate,NIMBroadcastManagerDelegate,XPRoomLittleGameContainerViewDelegate,CountDownHelperDelegate,PIRoomEnterRedPacketViewDelegate,XPReceiveRedPacketViewDelegate, XPCandyTreeInsufficientBalanceViewDelegate> @interface XPRoomViewController ()<
XPRoomProtocol,
RoomHostDelegate,
NIMChatroomManagerDelegate,
NIMChatManagerDelegate,
NIMConversationManagerDelegate,
NIMLoginManagerDelegate,
XPRoomSettingInputViewDelegate,
AnchorRoomScrollViewDelegate,
XPFirstRechargeViewDelegate,
NIMBroadcastManagerDelegate,
XPRoomLittleGameContainerViewDelegate,
CountDownHelperDelegate,
PIRoomEnterRedPacketViewDelegate,
XPReceiveRedPacketViewDelegate,
XPCandyTreeInsufficientBalanceViewDelegate>
{ {
NSTimer * timer; NSTimer * timer;
} }
@@ -191,7 +209,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[viewController presentViewController:baseNav animated:YES completion:nil]; [viewController presentViewController:baseNav animated:YES completion:nil];
return YES; return YES;
} }
+ (BOOL) openRoom:(NSString*)roomUid fromNick:(NSString * __nullable)fromNick fromType:(UserEnterRoomFromType)fromType fromUid:(NSString * __nullable)fromUid viewController:(UIViewController*)viewController { + (BOOL)openRoom:(NSString*)roomUid fromNick:(NSString * __nullable)fromNick fromType:(UserEnterRoomFromType)fromType fromUid:(NSString * __nullable)fromUid viewController:(UIViewController*)viewController {
XPRoomViewController * roomVC = [[self alloc] init]; XPRoomViewController * roomVC = [[self alloc] init];
roomVC.roomUid = roomUid; roomVC.roomUid = roomUid;
roomVC.fromUid = fromUid; roomVC.fromUid = fromUid;
@@ -267,15 +285,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[timer fire]; [timer fire];
timer = nil; timer = nil;
} }
[XPSkillCardPlayerManager shareInstance].photoIdList = nil;
[XPSkillCardPlayerManager shareInstance].isInRoomVC = NO;
[XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge = NO;
[XPSkillCardPlayerManager shareInstance].isInRoom = NO;
[XPSkillCardPlayerManager shareInstance].roomUid = @"";
if([[XPRoomMiniManager shareManager] getRoomInfo]==nil){
[XPSkillCardPlayerManager shareInstance].isMineInMic = NO;
}
[[CountDownHelper shareHelper] stopCountDown]; [[CountDownHelper shareHelper] stopCountDown];
[CountDownHelper shareHelper].delegate = nil; [CountDownHelper shareHelper].delegate = nil;
[[NIMSDK sharedSDK].chatroomManager removeDelegate:self]; [[NIMSDK sharedSDK].chatroomManager removeDelegate:self];
@@ -284,6 +294,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[[NIMSDK sharedSDK].conversationManager removeDelegate:self]; [[NIMSDK sharedSDK].conversationManager removeDelegate:self];
[[NIMSDK sharedSDK].broadcastManager removeDelegate:self]; [[NIMSDK sharedSDK].broadcastManager removeDelegate:self];
[[RoomBoomManager sharedManager] removeEventListenerForTarget:self];
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
} }
@@ -298,10 +310,10 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
[self preLoadGifts];
[self exitOldRoom]; [self exitOldRoom];
[self preLoadGifts];
[self initSubViews]; [self initSubViews];
[self initSubViewConstraints]; [self initSubViewConstraints];
@@ -319,14 +331,59 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self startCheckOnlineCountTimer]; [self startCheckOnlineCountTimer];
[CountDownHelper shareHelper].delegate = self; [CountDownHelper shareHelper].delegate = self;
[XPSkillCardPlayerManager shareInstance].isInRoom = YES;
[self setupFroBoom];
//#if DEBUG
// UIButton *b = [UIButton buttonWithType:UIButtonTypeInfoLight];
// b.frame = CGRectMake(100, 100, 100, 100);
// [self.view addSubview:b];
// [b addTarget:self action:@selector(test) forControlEvents:UIControlEventTouchUpInside];
//#endif
} }
- (void)setupFroBoom {
@kWeakify(self);
[[RoomBoomManager sharedManager] registerBoomExplosion:^(id _Nonnull sth) {
@kStrongify(self);
dispatch_async(dispatch_get_main_queue(), ^{
[RoomBoomExplosionView display:self.view with:sth complete:^{
}];
});
} target:self];
[[RoomBoomManager sharedManager] registerBoomGiftDisplay:^(id _Nonnull sth) {
@kStrongify(self);
dispatch_async(dispatch_get_main_queue(), ^{
[RoomBoomResultView displayEmptyView:self.view];
});
} target:self];
[[RoomBoomManager sharedManager] registerBoomEnterRoomExplosion:^(id _Nonnull sth) {
@kStrongify(self);
dispatch_async(dispatch_get_main_queue(), ^{
[RoomBoomExplosionView display:self.view with:sth complete:^{
}];
});
} target:self];
}
//- (void)test {
//
//}
- (void)loadRoomDataAndUsers { - (void)loadRoomDataAndUsers {
[XNDJTDDLoadingTool showAnchorLoading:self.navigationController.view]; [XNDJTDDLoadingTool showAnchorLoading:self.navigationController.view];
[self.presenter initEnterRoom:self.roomUid user:[AccountInfoStorage instance].getUid]; [self.presenter initEnterRoom:self.roomUid user:[AccountInfoStorage instance].getUid];
} }
- (void)loadRoomBoom {
// [self.presenter getBoomInfo:s];
}
- (void)setupNotifications { - (void)setupNotifications {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myGiftEffectUpdate:) name:kRoomGiftEffectUpdateNotificationKey object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myGiftEffectUpdate:) name:kRoomGiftEffectUpdateNotificationKey object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showRoomFirstChargeWindowFormNot:) name:kShowFirstRechargeView object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showRoomFirstChargeWindowFormNot:) name:kShowFirstRechargeView object:nil];
@@ -424,13 +481,11 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
- (void)viewDidDisappear:(BOOL)animated{ - (void)viewDidDisappear:(BOOL)animated{
[super viewDidDisappear:animated]; [super viewDidDisappear:animated];
self.navigationController.interactivePopGestureRecognizer.enabled = YES; self.navigationController.interactivePopGestureRecognizer.enabled = YES;
[XPSkillCardPlayerManager shareInstance].isInRoomVC = NO;
} }
- (void)viewDidAppear:(BOOL)animated { - (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated]; [super viewDidAppear:animated];
self.freeView.hidden = NO; self.freeView.hidden = NO;
self.navigationController.interactivePopGestureRecognizer.enabled = NO; self.navigationController.interactivePopGestureRecognizer.enabled = NO;
[XPSkillCardPlayerManager shareInstance].isInRoomVC = YES;
} }
#pragma mark - Private Method #pragma mark - Private Method
@@ -1220,8 +1275,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
- (void)initEnterRoomSuccess:(RoomInfoModel *)roomInfo user:(UserInfoModel *)userInfo { - (void)initEnterRoomSuccess:(RoomInfoModel *)roomInfo user:(UserInfoModel *)userInfo {
[XNDJTDDLoadingTool hideHUDInView:self.navigationController.view]; [XNDJTDDLoadingTool hideHUDInView:self.navigationController.view];
[XPSkillCardPlayerManager shareInstance].roomUid = @(roomInfo.uid).stringValue;
userInfo.fromUid = self.fromUid; userInfo.fromUid = self.fromUid;
userInfo.fromType = self.fromType; userInfo.fromType = self.fromType;
userInfo.fromNick = self.fromNick; userInfo.fromNick = self.fromNick;
@@ -1230,6 +1283,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
self.roomInfo = roomInfo; self.roomInfo = roomInfo;
self.userInfo = userInfo; self.userInfo = userInfo;
[self.presenter getBoomRocketAnimationInfo:@(roomInfo.uid).stringValue];
[self.presenter getBoomDetail:@(roomInfo.uid).stringValue];
@kWeakify(self); @kWeakify(self);
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{
@@ -1625,7 +1680,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
continue; continue;
} }
NSLog(@" --- Message Raw Attach Content: %@", message.rawAttachContent); NSLog(@" --- Message Raw Attach Content: %@, %ld", message.rawAttachContent, (long)message.messageType);
if (message.messageType == NIMMessageTypeNotification) { if (message.messageType == NIMMessageTypeNotification) {
NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject; NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject;
@@ -1763,13 +1818,11 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.menuContainerView handleNIMNotificationMessage:message]; [self.menuContainerView handleNIMNotificationMessage:message];
[self.functionView handleNIMNotificationMessage:message]; [self.functionView handleNIMNotificationMessage:message];
[self.littleGameView handleNIMNotificationMessage:message]; [self.littleGameView handleNIMNotificationMessage:message];
if([self.stageView findMicroViewByUid:@(self.userInfo.uid).stringValue] != nil){
[XPSkillCardPlayerManager shareInstance].isMineInMic = YES;
}else{
[XPSkillCardPlayerManager shareInstance].isMineInMic = NO;
};
} else if (message.messageType == NIMMessageTypeCustom) { } else if (message.messageType == NIMMessageTypeCustom) {
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject; NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
633 attachment nil data
if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) { if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) {
AttachmentModel * attachment = (AttachmentModel *)obj.attachment; AttachmentModel * attachment = (AttachmentModel *)obj.attachment;
[self.stageView handleNIMCustomMessage:message]; [self.stageView handleNIMCustomMessage:message];
@@ -1778,6 +1831,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.activityContainerView handleNIMCustomMessage:message]; [self.activityContainerView handleNIMCustomMessage:message];
[self.functionView handleNIMCustomMessage:message]; [self.functionView handleNIMCustomMessage:message];
[self.littleGameView handleNIMCustomMessage:message]; [self.littleGameView handleNIMCustomMessage:message];
if (attachment.first == CustomMessageType_First_Recharge_Reward && attachment.second == Custom_Message_Sub_Room_First_Recharge_Reward) { if (attachment.first == CustomMessageType_First_Recharge_Reward && attachment.second == Custom_Message_Sub_Room_First_Recharge_Reward) {
self.userInfo.isFirstCharge = NO; self.userInfo.isFirstCharge = NO;
[self.menuContainerView onRoomUpdate]; [self.menuContainerView onRoomUpdate];
@@ -1881,9 +1935,14 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
[self.presenter getFreeGiftData]; [self.presenter getFreeGiftData];
[[NSNotificationCenter defaultCenter]postNotificationName:kFreeGiftCountdownNotification object:nil userInfo:@{@"updateGiftInfo":attachment.data ?: @""}]; [[NSNotificationCenter defaultCenter]postNotificationName:kFreeGiftCountdownNotification object:nil userInfo:@{@"updateGiftInfo":attachment.data ?: @""}];
} }
} else if (attachment.first == CustomMessageType_RoomBoom) {
if (attachment.second == 631) {
[[RoomBoomManager sharedManager] receiveNIMResponse:attachment];
} else if (attachment.second == 633) {
[[RoomBoomManager sharedManager] receiveNIMResponse:attachment];
}
} }
[self.messageContainerView handleNIMCustomMessage:message]; [self.messageContainerView handleNIMCustomMessage:message];
} }
} else if(message.messageType == NIMMessageTypeText) { } else if(message.messageType == NIMMessageTypeText) {
@@ -2287,6 +2346,15 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
return [self.stageView animationPointAtStageViewByUid:uid]; return [self.stageView animationPointAtStageViewByUid:uid];
} }
- (void)getRoomBoomInfoSuccess:(NSArray <BoomDetailModel*> *)models {
[[RoomBoomManager sharedManager] updateBoomDetailArray:models];
[self.activityContainerView updateForBoomDetailArray:models];
}
- (void)getRoomBoomExplosionSuccess:(BoomInfoModel *)model {
// [[RoomBoomManager sharedManager] updateBoomDetailArray:models];
}
#pragma mark - 退 #pragma mark - 退
- (void)handleFirstOutRoom { - (void)handleFirstOutRoom {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

View File

@@ -91,6 +91,8 @@
#import "XPHomePagingViewController.h" #import "XPHomePagingViewController.h"
#import "IAPManager.h" #import "IAPManager.h"
#import "RoomBoomManager.h"
#import "RoomBoomBannerAnimation.h"
NSString * const kUserFirstLoginKey = @"kUserFirstLoginKey"; NSString * const kUserFirstLoginKey = @"kUserFirstLoginKey";
NSString * const kHadLaunchApp = @"kHadLaunchApp"; NSString * const kHadLaunchApp = @"kHadLaunchApp";
@@ -157,7 +159,8 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
[[NIMSDK sharedSDK].chatManager addDelegate:self]; [[NIMSDK sharedSDK].chatManager addDelegate:self];
[[NIMSDK sharedSDK].systemNotificationManager addDelegate:self]; [[NIMSDK sharedSDK].systemNotificationManager addDelegate:self];
[[NIMSDK sharedSDK].broadcastManager addDelegate:self]; [[NIMSDK sharedSDK].broadcastManager addDelegate:self];
[self networkReachability]; [self networkReachability];
[self.view addSubview:self.roomMineView]; [self.view addSubview:self.roomMineView];
@@ -177,6 +180,16 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showNewUserRecharge) name:kNewUserRechargeKey object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showNewUserRecharge) name:kNewUserRechargeKey object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showAnchorCardKey:) name:kTabShowAnchorCardKey object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showAnchorCardKey:) name:kTabShowAnchorCardKey object:nil];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(switchLanguage:) name:@"kSwitchLanguage" object:nil]; [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(switchLanguage:) name:@"kSwitchLanguage" object:nil];
[[RoomBoomManager sharedManager] registerBoomBanner:^(id _Nonnull sth) {
// @kStrongify(self);
dispatch_async(dispatch_get_main_queue(), ^{
[RoomBoomBannerAnimation display:[UIApplication sharedApplication].keyWindow with:sth tapToRoom:YES complete:^{
}];
});
} target:self];
} }
-(void)switchLanguage:(NSNotification *)not{ -(void)switchLanguage:(NSNotification *)not{
@@ -621,7 +634,9 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
if(![partitionId isEqualToString:self.userInfo.partitionId]){ if(![partitionId isEqualToString:self.userInfo.partitionId]){
return; return;
} }
NSLog(@" --- Broadcast Message Raw Attach Content: %@", msgDictionary);
// MARK: if else // MARK: if else
if (attachment.first == CustomMessageType_RedPacket) { if (attachment.first == CustomMessageType_RedPacket) {
[self receiveRedPacketDealWithData:attachment]; [self receiveRedPacketDealWithData:attachment];

View File

@@ -3930,3 +3930,11 @@ ineHeadView12" = "الحمل";
"RoomEffect_CP_lv_3" = "ثنائي الأحلام"; "RoomEffect_CP_lv_3" = "ثنائي الأحلام";
"RoomEffect_CP_lv_4" = "ثنائي مثالي"; "RoomEffect_CP_lv_4" = "ثنائي مثالي";
"RoomEffect_CP_lv_5" = "ثنائي رائع"; "RoomEffect_CP_lv_5" = "ثنائي رائع";
"RoomBoom_0" = "Unfortunately! You did not receive reward, please keep up the good work!";
"RoomBoom_1" = "Congratulations on being awarded the following prizes in this round of Boom";
"RoomBoom_2" = "Give gifts and win super prizes";
"RoomBoom_3" = "触发了";
"RoomBoom_4" = ",前去圍觀";
"RoomBoom_5" = "房間暱稱:";
"RoomBoom_6" = "Reset time: 0:00 (GMT+3) daily";

View File

@@ -3726,3 +3726,11 @@
"RoomEffect_CP_lv_3" = "Dream Duo"; "RoomEffect_CP_lv_3" = "Dream Duo";
"RoomEffect_CP_lv_4" = "Perfect Duo"; "RoomEffect_CP_lv_4" = "Perfect Duo";
"RoomEffect_CP_lv_5" = "Divine Couple"; "RoomEffect_CP_lv_5" = "Divine Couple";
"RoomBoom_0" = "Unfortunately! You did not receive reward, please keep up the good work!";
"RoomBoom_1" = "Congratulations on being awarded the following prizes in this round of Boom";
"RoomBoom_2" = "Give gifts and win super prizes";
"RoomBoom_3" = "触发了";
"RoomBoom_4" = ",前去圍觀";
"RoomBoom_5" = "房間暱稱:";
"RoomBoom_6" = "Reset time: 0:00 (GMT+3) daily";

View File

@@ -3390,3 +3390,11 @@
"RoomEffect_CP_lv_3" = "夢幻雙人組"; "RoomEffect_CP_lv_3" = "夢幻雙人組";
"RoomEffect_CP_lv_4" = "完美雙人組"; "RoomEffect_CP_lv_4" = "完美雙人組";
"RoomEffect_CP_lv_5" = "神仙眷侶"; "RoomEffect_CP_lv_5" = "神仙眷侶";
"RoomBoom_0" = "Unfortunately! You did not receive reward, please keep up the good work!";
"RoomBoom_1" = "Congratulations on being awarded the following prizes in this round of Boom";
"RoomBoom_2" = "Give gifts and win super prizes";
"RoomBoom_3" = "触发了";
"RoomBoom_4" = ",前去圍觀";
"RoomBoom_5" = "房間暱稱:";
"RoomBoom_6" = "Reset time: 0:00 (GMT+3) daily";

View File

@@ -3383,3 +3383,10 @@
"RoomEffect_CP_lv_4" = "完美雙人組"; "RoomEffect_CP_lv_4" = "完美雙人組";
"RoomEffect_CP_lv_5" = "神仙眷侶"; "RoomEffect_CP_lv_5" = "神仙眷侶";
"RoomBoom_0" = "Unfortunately! You did not receive reward, please keep up the good work!";
"RoomBoom_1" = "Congratulations on being awarded the following prizes in this round of Boom";
"RoomBoom_2" = "Give gifts and win super prizes";
"RoomBoom_3" = "触发了";
"RoomBoom_4" = ",前去圍觀";
"RoomBoom_5" = "房間暱稱:";
"RoomBoom_6" = "Reset time: 0:00 (GMT+3) daily";