chore: 更新 .gitignore 文件,移除不必要的包文件类型;新增邮箱验证码登录流程和 OAuth/Ticket 认证系统 API 文档;更新勋章相关逻辑,优化用户信息获取失败处理;调整勋章展示逻辑,支持多等级高亮功能。

This commit is contained in:
edwinQQQ
2025-07-14 17:37:10 +08:00
parent 99db078b62
commit 16f9041ba9
33 changed files with 15384 additions and 60390 deletions

View File

@@ -353,4 +353,16 @@
return _goButton;
}
// 穿
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
if (!self.userInteractionEnabled || self.hidden || self.alpha <= 0.01) {
return nil;
}
CGPoint goButtonPoint = [self.goButton convertPoint:point fromView:self];
if ([self.goButton pointInside:goButtonPoint withEvent:event]) {
return self.goButton;
}
return nil;
}
@end

View File

@@ -401,4 +401,16 @@
return _goButton;
}
// ========== 穿 ==========
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
if (!self.userInteractionEnabled || self.hidden || self.alpha <= 0.01) {
return nil;
}
CGPoint goButtonPoint = [self.goButton convertPoint:point fromView:self];
if ([self.goButton pointInside:goButtonPoint withEvent:event]) {
return self.goButton;
}
return nil;
}
@end

View File

@@ -52,11 +52,13 @@ static const NSInteger kItemsPerRow = 5;
[self.blurEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.equalTo(self).inset(0);
make.bottom.equalTo(self).offset(12);
make.height.mas_equalTo(self.collectionView.mas_height).multipliedBy(1.05);
make.height.mas_equalTo(KScreenHeight*2/3);
}];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.leading.trailing.equalTo(self).inset(kGetScaleWidth(0));
make.height.mas_equalTo(kGetScaleWidth(246));
make.bottom.equalTo(self);
make.leading.trailing.equalTo(self).inset(16);
// make.height.mas_equalTo(kGetScaleWidth(246));
make.height.mas_equalTo(KScreenHeight*2/3 - 30);
}];
}
@@ -69,7 +71,6 @@ static const NSInteger kItemsPerRow = 5;
-(void)setPlayList:(NSMutableArray *)playList {
_playList = playList;
[self.dataSource addObjectsFromArray:playList];
[self updateViewHeightWithItemCount:self.dataSource.count];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.collectionView reloadData];
});
@@ -78,7 +79,6 @@ static const NSInteger kItemsPerRow = 5;
- (void)setLittleGameList:(NSMutableArray<LittleGameInfoModel *> *)littleGameList {
_littleGameList = littleGameList;
[self.dataSource addObjectsFromArray:littleGameList];
[self updateViewHeightWithItemCount:self.dataSource.count];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.collectionView reloadData];
});
@@ -90,39 +90,18 @@ static const NSInteger kItemsPerRow = 5;
self.dataSource = [NSMutableArray array];
[self.dataSource addObjectsFromArray:playList];
[self.dataSource addObjectsFromArray:littleGameList];
[self updateViewHeightWithItemCount:self.dataSource.count];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.collectionView reloadData];
});
}
- (void)updateViewHeightWithItemCount:(NSInteger)count {
if (count == 0) {
return;
}
NSInteger lineNum = (count + kItemsPerRow - 1)/kItemsPerRow;// MIN(3, (count + kItemsPerRow - 1)/kItemsPerRow);
CGFloat calHeight = self.itemHeight;
CGFloat height = 20 + 56 * lineNum + 44 * (lineNum - 1) + 70;
height = calHeight * lineNum;
// [self.ms_bgView mas_updateConstraints:^(MASConstraintMaker *make) {
// make.height.mas_equalTo(kGetScaleWidth(height + 12));
// }];
if (height > KScreenHeight*2/3) {
height = KScreenHeight*2/3;
}
[self.collectionView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(kGetScaleWidth(height));
}];
}
- (NSInteger)countOfCurrentType {
return self.dataSource.count;// self.littleGameList.count > 0 ? self.littleGameList.count : self.playList.count;
}
#pragma mark- UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
CGFloat width = (KScreenWidth-kGetScaleWidth(6))/4;
CGFloat width = (KScreenWidth - 64)/4;
return [self countOfCurrentType] > 0 ? CGSizeMake(width, self.itemHeight) : CGSizeMake(KScreenWidth, self.emptyHeight);
}
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section{
@@ -183,16 +162,16 @@ static const NSInteger kItemsPerRow = 5;
if (!_collectionView) {
MSBaseRTLFlowLayout *layout = [[MSBaseRTLFlowLayout alloc] init];
layout.minimumLineSpacing = 10;
layout.minimumInteritemSpacing = 0;
layout.minimumLineSpacing = 0;
layout.minimumInteritemSpacing = 8;
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
_collectionView.showsHorizontalScrollIndicator = NO;
_collectionView.showsVerticalScrollIndicator = NO;
_collectionView.dataSource = self;
_collectionView.delegate = self;
_collectionView.backgroundColor = [UIColor clearColor];
[_collectionView registerClass:[MSRoomMenuGameCell class] forCellWithReuseIdentifier:NSStringFromClass([MSRoomMenuGameCell class])];
[_collectionView registerClass:[MSRoomMenuGameEmptyCell class] forCellWithReuseIdentifier:NSStringFromClass([MSRoomMenuGameEmptyCell class])];
}
return _collectionView;
}

View File

@@ -70,7 +70,7 @@
}
- (void)gameSetUp {
// nslog(@"小游戏的版本号是:%@", [SudMGP getVersion]);
NSLog(@"小游戏的版本号是:%@", [SudMGP getVersion]);
BOOL isTestEnv = NO;
#ifdef DEBUG
isTestEnv = YES;
@@ -90,7 +90,7 @@
}
NSString * userId = [AccountInfoStorage instance].getUid;
NSString * roomId = self.gameModel.roomId;
// nslog(@"用户ID%@房间ID%@, 游戏ID%lld, code:%@", userId, roomId, self.currentmgId, self.code);
NSLog(@"用户ID%@房间ID%@, 游戏ID%lld, code:%@", userId, roomId, self.currentmgId, self.code);
NSString *language = [NSBundle getLanguageText];
if ([language hasPrefix:@"zh"]) {
@@ -105,7 +105,7 @@
self.fsmAPP2MG = [SudMGP loadMG:userId roomId:roomId code:self.code mgId:self.currentmgId language:language fsmMG:self rootView:self];
} else {
/// ,
// nslog(@"ISudFSMMG:initGameSDKWithAppID:初始化sdk失败 :%@",retMsg);
NSLog(@"ISudFSMMG:initGameSDKWithAppID:初始化sdk失败 :%@",retMsg);
}
}];
}
@@ -157,7 +157,7 @@
*
*/
-(void)onGameLog:(NSString*)dataJson {
// nslog(@"ISudFSMMG:onGameLog:%@", dataJson);
NSLog(@"ISudFSMMG:onGameLog:%@", dataJson);
NSDictionary * dic = [SudCommon turnStringToDictionary:dataJson];
NSString * msg_string = [dic objectForKey:@"msg"];
if (!msg_string) {
@@ -169,7 +169,7 @@
*
*/
-(void)onGameStarted {
// nslog(@"ISudFSMMG:onGameStarted:游戏开始");
NSLog(@"ISudFSMMG:onGameStarted:游戏开始");
[self notifySelfInState:YES seatIndex:-1];///
[self handleSelfReadyEvent];///
}
@@ -178,7 +178,7 @@
*
*/
-(void)onGameDestroyed {
// nslog(@"ISudFSMMG:onGameDestroyed:游戏销毁");
NSLog(@"ISudFSMMG:onGameDestroyed:游戏销毁");
}
/**
@@ -186,14 +186,14 @@
* @param dataJson {"code":"value"}
*/
-(void)onExpireCode:(id<ISudFSMStateHandle>)handle dataJson:(NSString*)dataJson {
// nslog(@"ISudFSMMG:onExpireCode:Code过期");
NSLog(@"ISudFSMMG:onExpireCode:Code过期");
//
[Api getSudGameCode:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
NSString * gameCode = data.data[@"code"];
self.code = gameCode;
[self.fsmAPP2MG updateCode:gameCode listener:^(int retCode, const NSString *retMsg, const NSString *dataJson) {
// nslog(@"ISudFSMMG:updateGameCode retCode=%@ retMsg=%@ dataJson=%@", @(retCode), retMsg, dataJson);
NSLog(@"ISudFSMMG:updateGameCode retCode=%@ retMsg=%@ dataJson=%@", @(retCode), retMsg, dataJson);
}];
//
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:@(0), @"ret_code", @"return form APP onExpireCode", @"ret_msg", nil];
@@ -251,15 +251,15 @@
//
if (error) {
// nslog(@"JSON 解析失败: %@", error.localizedDescription);
NSLog(@"JSON 解析失败: %@", error.localizedDescription);
} else {
// nslog(@"解析后的字典: %@", dictionary);
NSLog(@"解析后的字典: %@", dictionary);
//
NSMutableDictionary *ui = [[NSMutableDictionary alloc] initWithDictionary:dictionary[@"ui"]];
[ui setObject: @{@"hide" : @(YES)}
forKey:@"lobby_game_setting"];
[dictionary setObject:ui forKey:@"ui"];
// nslog(@"更新后的字典: %@", dictionary);
NSLog(@"更新后的字典: %@", dictionary);
}
// dict[@"ui"] = @{
@@ -290,11 +290,11 @@
* @param dataJson json
*/
-(void)onGameStateChange:(id<ISudFSMStateHandle>) handle state:(NSString*) state dataJson:(NSString*) dataJson {
// nslog(@"onGameStateChange 回调: %@ \n%@", state, dataJson);
NSLog(@"onGameStateChange 回调: %@ \n%@", state, dataJson);
if ([state isEqualToString:MG_COMMON_SELF_CLICK_READY_BTN]) {
// [self addAI];
} else if ([state isEqualToString:@"mg_common_game_add_ai_players"]) {
// nslog(@" ????????????????????????????????????????????? ");
NSLog(@" ????????????????????????????????????????????? ");
} else if([state isEqualToString:MG_COMMON_GAME_SETTLE]){
NSDictionary *data = @{@"value0":self.gameModel.data.matchRoundId ?: @""};
NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:[data mj_JSONString] , @"reportGameInfoExtras",@"value0" , @"reportGameInfoKey" ,nil];
@@ -308,7 +308,7 @@
[self.delegate getGameRsultsWithList:list];
}
}else if ([state isEqualToString:MG_COMMON_PUBLIC_MESSAGE]) {
// nslog(@"ISudFSMMG:onGameStateChange:游戏->APP:公屏消息");
NSLog(@"ISudFSMMG:onGameStateChange:游戏->APP:公屏消息");
} else if ([state isEqualToString:MG_COMMON_KEY_WORD_TO_HIT]) {
}else if ([state isEqualToString:MG_COMMON_SELF_CLICK_JOIN_BTN]) {//
@@ -318,9 +318,9 @@
seatIndex = [[dic objectForKey:@"seatIndex"] intValue];
}
if (seatIndex == -1) {
// nslog(@"来自加入按钮%d",seatIndex);
NSLog(@"来自加入按钮%d",seatIndex);
}else {
// nslog(@"来自麦位+入%d",seatIndex);
NSLog(@"来自麦位+入%d",seatIndex);
}
[self notifySelfInState:YES seatIndex:-1];
} else if([state isEqualToString:MG_COMMON_SELF_CLICK_START_BTN]) {//
@@ -330,7 +330,7 @@
[self handleSelfInExitEvent];
} else {
///
// nslog(@"ISudFSMMG:onGameStateChange:游戏->APP:state:%@",MG_COMMON_PUBLIC_MESSAGE);
NSLog(@"ISudFSMMG:onGameStateChange:游戏->APP:state:%@",MG_COMMON_PUBLIC_MESSAGE);
}
}
@@ -342,7 +342,7 @@
* @param dataJson JSON
*/
-(void)onPlayerStateChange:(nullable id<ISudFSMStateHandle>) handle userId:(NSString*) userId state:(NSString*) state dataJson:(NSString*) dataJson {
// nslog(@"ISudFSMMG:onPlayerStateChange:游戏->APP:游戏玩家状态变化:userId: %@ --state: %@ --dataJson: %@", userId, state, dataJson);
NSLog(@"ISudFSMMG:onPlayerStateChange:游戏->APP:游戏玩家状态变化:userId: %@ --state: %@ --dataJson: %@", userId, state, dataJson);
///
NSString *dataStr = @"";
if ([state isEqualToString:MG_COMMON_PLAYER_IN]) {
@@ -382,9 +382,9 @@
dataStr = YMLocalizedString(@"XPRoomLittleGameContainerView8");
[self handleState_MG_DG_SCORE_WithUserId:userId dataJson:dataJson];
}else {
// nslog(@"ISudFSMMG:onPlayerStateChange:未做解析状态:%@", MG_DG_SCORE);
NSLog(@"ISudFSMMG:onPlayerStateChange:未做解析状态:%@", MG_DG_SCORE);
}
// nslog(@"ISudFSMMG:onPlayerStateChange:dataStr:%@", dataStr);
NSLog(@"ISudFSMMG:onPlayerStateChange:dataStr:%@", dataStr);
///
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:@(0), @"ret_code", @"return form APP onPlayerStateChange", @"ret_msg", nil];
[handle success:[SudCommon dictionaryToJson:dict]];
@@ -443,9 +443,9 @@
/// @param state
/// @param dataJson json
- (void)notifyStateChange:(NSString *) state dataJson:(NSString*) dataJson {
// nslog(@"ISudFSMMG: START notifyStateChange:state=%@ \ndataJson=%@", state, dataJson);
NSLog(@"ISudFSMMG: START notifyStateChange:state=%@ \ndataJson=%@", state, dataJson);
[self.fsmAPP2MG notifyStateChange:state dataJson:dataJson listener:^(int retCode, const NSString *retMsg, const NSString *dataJson) {
// nslog(@"ISudFSMMG:notifyStateChange:retCode=%@ retMsg=%@ dataJson=%@", @(retCode), retMsg, dataJson);
NSLog(@"ISudFSMMG:notifyStateChange:retCode=%@ retMsg=%@ dataJson=%@", @(retCode), retMsg, dataJson);
if (retCode == 0 && [state isEqualToString:APP_COMMON_SELF_PLAYING]) {//
//
@@ -606,11 +606,11 @@
}
- (void)handleState_MG_DG_SELECTING_WithUserId:(NSString *)userId dataJson:(NSString *)dataJson {
// nslog(@"handleState_MG_DG_SELECTING_WithUserId%@",dataJson);
NSLog(@"handleState_MG_DG_SELECTING_WithUserId%@",dataJson);
}
- (void)handleState_MG_DG_PAINTING_WithUserId:(NSString *)userId dataJson:(NSString *)dataJson {
// nslog(@"handleState_MG_DG_PAINTING_WithUserId%@",dataJson);
NSLog(@"handleState_MG_DG_PAINTING_WithUserId%@",dataJson);
///
NSDictionary * dic = [SudCommon turnStringToDictionary:dataJson];
bool isPainting = NO;
@@ -621,18 +621,18 @@
- (void)handleState_MG_DG_ERRORANSWER_WithUserId:(NSString *)userId dataJson:(NSString *)dataJson {
///
// nslog(@"handleState_MG_DG_ERRORANSWER_WithUserId%@",dataJson);
NSLog(@"handleState_MG_DG_ERRORANSWER_WithUserId%@",dataJson);
}
- (void)handleState_MG_DG_TOTALSCORE_WithUserId:(NSString *)userId dataJson:(NSString *)dataJson {
///
// nslog(@"handleState_MG_DG_TOTALSCORE_WithUserId%@",dataJson);
NSLog(@"handleState_MG_DG_TOTALSCORE_WithUserId%@",dataJson);
}
- (void)handleState_MG_DG_SCORE_WithUserId:(NSString *)userId dataJson:(NSString *)dataJson {
///
// nslog(@"handleState_MG_DG_SCORE_WithUserId%@",dataJson);
NSLog(@"handleState_MG_DG_SCORE_WithUserId%@",dataJson);
}
/// MG

View File

@@ -1447,13 +1447,13 @@ XPCandyTreeInsufficientBalanceViewDelegate>
self.userInfo = userInfo;
[self requestBoomData];
[self getOnlineCount];
@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)(2 * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{
@kStrongify(self);
//
[self.presenter getRedPacket:[NSString stringWithFormat:@"%ld", self.roomInfo.uid]];
[self getOnlineCount];
});
switch (roomInfo.type) {
@@ -1842,7 +1842,7 @@ XPCandyTreeInsufficientBalanceViewDelegate>
continue;
}
NSLog(@" --- Message Raw Attach Content: %@, %@, %ld", @(message.senderClientType), message.rawAttachContent, (long)message.messageType);
// NSLog(@" --- Message Raw Attach Content: %@, %@, %ld", @(message.senderClientType), message.rawAttachContent, (long)message.messageType);
if (message.messageType == NIMMessageTypeNotification) {
NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject;