This commit is contained in:
启星
2025-12-04 14:11:00 +08:00
parent 2d37ab6844
commit 1c5a908dda
49 changed files with 505 additions and 192 deletions

View File

@@ -116,8 +116,8 @@ typedef void (^showFinishBlock)(void);
-(void)finishTask;
-(void)vibrationFeedback;
/// 进入房间后开始保活
-(void)startKeepAlive;
-(void)dirfViewDidToBackground;
-(void)dirfViewBecomeToFront;
@end

View File

@@ -36,6 +36,8 @@
@property (nonatomic,assign)BOOL isClickJoinRoom;
@property (nonatomic,strong)QXTimer *timer;
@property (nonatomic,strong)NSTimer *keepTimer;
@property (nonatomic,assign)NSInteger taskTime;
@end
@implementation QXGlobal
@@ -319,6 +321,29 @@
}
}
}
-(void)startKeepAlive{
[self stopKeepTimer];
self.keepTimer = [NSTimer scheduledTimerWithTimeInterval:60
target:self
selector:@selector(checkAndUpdateRedPackets)
userInfo:nil
repeats:YES];
}
-(void)checkAndUpdateRedPackets{
if ([self.roomId isExist]) {
[QXMineNetwork appKeepAliveWithRoomId:self.roomId];
}
}
-(void)stopKeepTimer{
if (self.keepTimer) {
[self.keepTimer invalidate];
self.keepTimer = nil;
}
}
-(void)showAlertWithMessage:(NSString*)message roomId:(NSString*)roomId{
UIAlertController *al = [UIAlertController alertControllerWithTitle:@"温馨提示" message:message preferredStyle:(UIAlertControllerStyleAlert)];
if ([roomId isExist] && self.roomId==nil) {
@@ -347,6 +372,7 @@
}
}
-(void)quitRoomWithRoomId:(NSString *)roomId{
[self stopKeepTimer];
[UIApplication sharedApplication].idleTimerDisabled = NO;
///
[[QXRedPacketManager sharedManager] destoryRedpacketInfo];