修复bug
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>4</string>
|
||||
<string>1</string>
|
||||
<key>FacebookAppID</key>
|
||||
<string>1266232494209868</string>
|
||||
<key>FacebookClientToken</key>
|
||||
|
@@ -22,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)exitNIMRoom:(NSString *)roomId;
|
||||
///退出房间
|
||||
-(void)closeRoomGameWithRoomId:(NSString *)roomId;
|
||||
///得到金币数量
|
||||
-(void)getCoinNum;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -17,17 +17,25 @@
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
#import "XPMessageRemoteExtModel.h"
|
||||
@implementation MSRoomGamePresenter
|
||||
-(void)getRoomGameConfig{
|
||||
|
||||
|
||||
-(void)getCoinNum{
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
[Api getUserWalletInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
WalletInfoModel * model = [WalletInfoModel modelWithDictionary:data.data];
|
||||
[[self getView]getCoinNumSuccess:model];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
|
||||
}] uid:uid ticket:ticket];
|
||||
}
|
||||
|
||||
-(void)getRoomGameConfig{
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
RACSubject* user = [RACSubject subject];
|
||||
RACSubject* coin = [RACSubject subject];
|
||||
RACSubject* game = [RACSubject subject];
|
||||
|
||||
[[RACSignal combineLatest:@[user,coin,game] reduce:^id(UserInfoModel* userModel,WalletInfoModel *coinModel,MSTabbarRoomGameModel *gameModel){
|
||||
[[self getView]getRoomGameConfigSuccessWithUser:userModel coinModel:coinModel gameModel:gameModel];
|
||||
[[RACSignal combineLatest:@[user,game] reduce:^id(UserInfoModel* userModel,MSTabbarRoomGameModel *gameModel){
|
||||
[[self getView]getRoomGameConfigSuccessWithUser:userModel gameModel:gameModel];
|
||||
return nil;
|
||||
}] subscribeError:^(NSError * _Nullable error) {
|
||||
|
||||
@@ -43,13 +51,7 @@
|
||||
} showLoading:NO errorToast:NO] uid:uid];
|
||||
|
||||
|
||||
[Api getUserWalletInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
WalletInfoModel * model = [WalletInfoModel modelWithDictionary:data.data];
|
||||
[coin sendNext:model];
|
||||
[coin sendCompleted];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[coin sendError:nil];
|
||||
}] uid:uid ticket:ticket];
|
||||
|
||||
|
||||
[Api getRoomGameHomeConfig:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
MSTabbarRoomGameModel *model = [MSTabbarRoomGameModel modelWithJSON:data.data];
|
||||
|
@@ -13,9 +13,14 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol MSRoomGameProtocol <NSObject>
|
||||
-(void)getRoomGameConfigSuccessWithUser:(UserInfoModel *)user coinModel:(WalletInfoModel *)coinModel gameModel:(MSTabbarRoomGameModel *)gameModel;
|
||||
///请求游戏配置
|
||||
-(void)getRoomGameConfigSuccessWithUser:(UserInfoModel *)user gameModel:(MSTabbarRoomGameModel *)gameModel;
|
||||
///开始游戏
|
||||
-(void)startMatchGameSuccess;
|
||||
///得到游戏详情
|
||||
-(void)getRoomGameDetailsSuccessWithModel:(MSRoomGameModel *)model;
|
||||
///得到金币数量
|
||||
-(void)getCoinNumSuccess:(WalletInfoModel *)model;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -22,7 +22,7 @@
|
||||
#import "MSRoomGameResultsModel.h"
|
||||
#import "Api.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
@interface MSRoomGameVC ()<MSRoomGameHeadViewDelegate,MSRoomGameQuitGameViewDelegate,MSRoomGameVictoryViewDelegate,NIMChatroomManagerDelegate, NIMChatManagerDelegate, NIMConversationManagerDelegate, NIMLoginManagerDelegate,MSRoomGameSendMsgViewDelegate,MSRoomGameViewDelegate,XPIAPRechargeViewControllerDelegate>
|
||||
@interface MSRoomGameVC ()<MSRoomGameProtocol,MSRoomGameHeadViewDelegate,MSRoomGameQuitGameViewDelegate,MSRoomGameVictoryViewDelegate,NIMChatroomManagerDelegate, NIMChatManagerDelegate, NIMConversationManagerDelegate, NIMLoginManagerDelegate,MSRoomGameSendMsgViewDelegate,MSRoomGameViewDelegate,XPIAPRechargeViewControllerDelegate>
|
||||
@property(nonatomic,strong) UIImageView *bgImageView;
|
||||
@property(nonatomic,strong) MSRoomGameHeadView *headView;
|
||||
@property(nonatomic,strong) MsRoomMessagChatHallView *chatView;
|
||||
@@ -60,20 +60,13 @@
|
||||
[self networkReachability];
|
||||
}
|
||||
-(void)getCoinNum{
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
[Api getUserWalletInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
WalletInfoModel * model = [WalletInfoModel modelWithDictionary:data.data];
|
||||
self.coinModel = model;
|
||||
} uid:uid ticket:ticket];
|
||||
[self.presenter getCoinNum];
|
||||
}
|
||||
-(void)installUI{
|
||||
[self.view addSubview:self.bgImageView];
|
||||
[self.view addSubview:self.headView];
|
||||
[self.view addSubview:self.msgView];
|
||||
[self.view addSubview:self.sendMsgView];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)installConstraints{
|
||||
@@ -112,17 +105,14 @@
|
||||
@kStrongify(self);
|
||||
switch (status) {
|
||||
case AFNetworkReachabilityStatusUnknown:
|
||||
|
||||
break;
|
||||
case AFNetworkReachabilityStatusNotReachable:
|
||||
|
||||
break;
|
||||
case AFNetworkReachabilityStatusReachableViaWWAN:
|
||||
case AFNetworkReachabilityStatusReachableViaWiFi:
|
||||
{
|
||||
if(self.headView.roomGameModel.data.roundStatus == 0 && self.headView.roomGameModel.data.matchStatus == 1){
|
||||
[self.presenter getRoomGameDetailWithRoomType:@"0"];
|
||||
}
|
||||
[self.presenter getRoomGameDetailWithRoomType:@"0"];
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -162,6 +152,9 @@
|
||||
[self.view addSubview:sendTextView];
|
||||
}
|
||||
#pragma mark - MSRoomGameProtocol
|
||||
- (void)getCoinNumSuccess:(WalletInfoModel *)model{
|
||||
self.coinModel = model;
|
||||
}
|
||||
-(void)getRoomGameDetailsSuccessWithModel:(MSRoomGameModel *)model{
|
||||
self.headView.roomGameModel = model;
|
||||
self.headView.userInfo = self.userinfo;
|
||||
@@ -176,8 +169,6 @@
|
||||
}];
|
||||
[self.roomGameView onRoomEntered];
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
[self.roomGameView handleSelfInExitEvent];
|
||||
[self.roomGameView destroyMG];
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
#import "XPWebViewController.h"
|
||||
#import "XPRoomHalfWebView.h"
|
||||
@interface MSTabbarRoomGameVC ()<MSTabbarRoomGameViewDelegate,MSTabbarRoomGameHeadViewDelegate,MSTabbarBeginGameViewDelegate,XPIAPRechargeViewControllerDelegate>
|
||||
@interface MSTabbarRoomGameVC ()<MSRoomGameProtocol,MSTabbarRoomGameViewDelegate,MSTabbarRoomGameHeadViewDelegate,MSTabbarBeginGameViewDelegate>
|
||||
@property(nonatomic,strong) UIImageView *bgImageView;
|
||||
@property(nonatomic,strong) MSTabbarRoomGameHeadView *headView;
|
||||
@property(nonatomic,strong) MSTabbarRoomGameView *gameView;
|
||||
@@ -31,15 +31,15 @@
|
||||
}
|
||||
- (void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
if(self.gameModel == nil){
|
||||
[self.presenter getRoomGameConfig];
|
||||
}
|
||||
[self.presenter getRoomGameConfig];
|
||||
[self.presenter getCoinNum];
|
||||
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self installUI];
|
||||
[self installConstraints];
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)installUI{
|
||||
@@ -72,7 +72,6 @@
|
||||
config.confirmButtonConfig.title = YMLocalizedString(@"XPTreasureFairyViewController6");
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{
|
||||
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init];
|
||||
rechargeVC.delegate = self;
|
||||
[self.navigationController pushViewController:rechargeVC animated:YES];
|
||||
} cancelHandler:^{
|
||||
|
||||
@@ -90,7 +89,6 @@
|
||||
#pragma mark - MSTabbarRoomGameHeadViewDelegate
|
||||
- (void)clickPayAction{
|
||||
XPIAPRechargeViewController *iapVC = [XPIAPRechargeViewController new];
|
||||
iapVC.delegate = self;
|
||||
[self.navigationController pushViewController:iapVC animated:YES];
|
||||
}
|
||||
- (void)clickRankAction{
|
||||
@@ -109,7 +107,7 @@
|
||||
|
||||
}
|
||||
-(void)startMatchGameSuccess{
|
||||
[self.presenter getRoomGameConfig];
|
||||
[self.presenter getCoinNum];
|
||||
MSRoomGameVC *gameVC = [MSRoomGameVC new];
|
||||
gameVC.chooseGameModel = self.chooseGameModel;
|
||||
gameVC.userinfo = self.headView.userModel;
|
||||
@@ -118,14 +116,15 @@
|
||||
[self presentViewController:nav animated:YES completion:nil];
|
||||
|
||||
}
|
||||
#pragma mark - XPIAPRechargeViewControllerDelegate
|
||||
- (void)paySuccess{
|
||||
[self.presenter getRoomGameConfig];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - MSRoomGameProtocol
|
||||
-(void)getRoomGameConfigSuccessWithUser:(UserInfoModel *)user coinModel:(WalletInfoModel *)coinModel gameModel:(MSTabbarRoomGameModel *)gameModel{
|
||||
///得到金币数量
|
||||
-(void)getCoinNumSuccess:(WalletInfoModel *)model{
|
||||
self.headView.coinModel= model;
|
||||
}
|
||||
-(void)getRoomGameConfigSuccessWithUser:(UserInfoModel *)user gameModel:(MSTabbarRoomGameModel *)gameModel{
|
||||
self.headView.userModel = user;
|
||||
self.headView.coinModel= coinModel;
|
||||
self.gameView.gameModel = gameModel;
|
||||
self.gameModel = gameModel;
|
||||
|
||||
|
@@ -141,8 +141,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
// XPTabBar *tabbar = [[XPTabBar alloc]initWithFrame:CGRectMake(0, KScreenHeight - kTabBarHeight, KScreenWidth, kTabBarHeight)];
|
||||
// [self setValue:tabbar forKey:@"tabBar"];
|
||||
|
||||
[self.presenter autoLogin];
|
||||
[self configTheme];
|
||||
[self initTabs:NO];
|
||||
|
@@ -3806,3 +3806,23 @@ ineHeadView12" = "الحمل";
|
||||
///MSRoomSetingBackdropCell
|
||||
"MSRoomSetingBackdropCell0"="قيد الاستخدام";
|
||||
"MSRoomSetingBackdropCell1"="هل أنت متأكد أنك تريد اختيار هذه الصورة لتكون خلفية لغرفتك؟";
|
||||
|
||||
///MSTabbarBeginGameView
|
||||
"MSTabbarBeginGameView0"="ابدأ";
|
||||
///MSRoomGameVictoryView
|
||||
"MSRoomGameVictoryView0"="إعادة المطابقة ";
|
||||
///MSRoomGameQuitGameView
|
||||
"MSRoomGameQuitGameView0"="لقد بدأت اللعبة. سيؤدي الخروج من الغرفة إلى فشل اللعبة. هل أنت متأكد من الخروج من الغرفة؟";
|
||||
"MSRoomGameQuitGameView1"="خروج";
|
||||
"MSRoomGameQuitGameView2"="متابعة اللعب";
|
||||
"MSRoomGameQuitGameView3"="فشلت المطابقة، هل تريد المحاولة مرة أخرى؟";
|
||||
"MSRoomGameQuitGameView4"="جاري التحميل، هل تريد العودة إلى الغرفة؟";
|
||||
|
||||
//MSRoomGameHeadView
|
||||
"MSRoomGameHeadView0"="جاري المطابقة ";
|
||||
"MSRoomGameHeadView1"="تمت المطابقة ";
|
||||
"MSRoomGameHeadView2"="الفوز بمكافأة%@ عملة ذهبية";
|
||||
"MSRoomGameHeadView3"="%@ عملة ذهبية";
|
||||
//MSRoomGameVC
|
||||
"MSRoomGameVC0"="فشلت المطابقة";
|
||||
"MSRoomGameVC1"="المحفظة";
|
||||
|
@@ -3610,3 +3610,23 @@
|
||||
///MSRoomSetingBackdropCell
|
||||
"MSRoomSetingBackdropCell0"="In use";
|
||||
"MSRoomSetingBackdropCell1"="Are you sure you want to select this image as the room background?";
|
||||
|
||||
///MSTabbarBeginGameView
|
||||
"MSTabbarBeginGameView0"="Start";
|
||||
///MSRoomGameVictoryView
|
||||
"MSRoomGameVictoryView0"="Rematch";
|
||||
///MSRoomGameQuitGameView
|
||||
"MSRoomGameQuitGameView0"="The game has started. Exiting the room will be considered a game failure. Are you sure you want to exit the room?";
|
||||
"MSRoomGameQuitGameView1"="Exit";
|
||||
"MSRoomGameQuitGameView2"="Continue the game";
|
||||
"MSRoomGameQuit tGameView3"="Match failed, do you want to rematch? ";
|
||||
"MSRoomGameQuitGameView4"="Game in progress, do you want to return to the room? ";
|
||||
|
||||
//MSRoomGameHeadView
|
||||
"MSRoomGameHeadView0"="Matching";
|
||||
"MSRoomGameHeadView1"="Match successful";
|
||||
"MSRoomGameHeadView2"="Winning reward %@ gold coins";
|
||||
"MSRoomGameHeadView3"="%@ gold coins";
|
||||
//MSRoomGameVC
|
||||
"MSRoomGameVC0"="Match failed";
|
||||
"MSRoomGameVC1"="Wallet";
|
||||
|
Reference in New Issue
Block a user