diff --git a/AppArtworkIcon@2x.png b/AppArtworkIcon@2x.png old mode 100644 new mode 100755 index 471ade1..2acc880 Binary files a/AppArtworkIcon@2x.png and b/AppArtworkIcon@2x.png differ diff --git a/GameCenterManager Mac/AppDelegateMac.h b/GameCenterManager Mac/AppDelegateMac.h old mode 100644 new mode 100755 diff --git a/GameCenterManager Mac/AppDelegateMac.m b/GameCenterManager Mac/AppDelegateMac.m old mode 100644 new mode 100755 index 4028251..4ddefff --- a/GameCenterManager Mac/AppDelegateMac.m +++ b/GameCenterManager Mac/AppDelegateMac.m @@ -54,7 +54,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { } //------------------------------------------------------------------------------------------------------------// -//Region: GameCenter Manager Delegate ------------------------------------------------------------------------// +//------- GameCenter Manager Delegate ------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - GameCenter Manager Delegate @@ -140,7 +140,7 @@ - (void)gameCenterViewControllerDidFinish:(GKGameCenterViewController *)gameCent } //------------------------------------------------------------------------------------------------------------// -//Region: GameCenter Scores ----------------------------------------------------------------------------------// +//------- GameCenter Scores ----------------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - GameCenter Scores @@ -168,7 +168,7 @@ - (void)leaderboardViewControllerDidFinish:(GKLeaderboardViewController *)viewCo } //------------------------------------------------------------------------------------------------------------// -//Region: GameCenter Achievements ----------------------------------------------------------------------------// +//------- GameCenter Achievements ----------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - GameCenter Achievements @@ -208,7 +208,7 @@ - (IBAction)resetAchievements:(id)sender { } //------------------------------------------------------------------------------------------------------------// -//Region: GameCenter Challenges ------------------------------------------------------------------------------// +//------- GameCenter Challenges ------------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - GameCenter Challenges diff --git a/GameCenterManager Mac/GC Manager/GameCenterManager-Mac.h b/GameCenterManager Mac/GC Manager/GameCenterManager-Mac.h old mode 100644 new mode 100755 index 1dcae5f..8140aba --- a/GameCenterManager Mac/GC Manager/GameCenterManager-Mac.h +++ b/GameCenterManager Mac/GC Manager/GameCenterManager-Mac.h @@ -41,37 +41,37 @@ enum { // Returns the shared instance of GameCenterManager. + (GameCenterManager *)sharedManager; -// Initializes Game Center Manager. Should be called at app launch. +/// Initializes Game Center Manager. Should be called at app launch. - (void)initGameCenter; -// Synchronizes local player data with Game Center data. +/// Synchronizes local player data with Game Center data. - (void)syncGameCenter; -// Saves score locally and reports it to Game Center. If error occurs, score is saved to be submitted later. +/// Saves score locally and reports it to Game Center. If error occurs, score is saved to be submitted later. - (void)saveAndReportScore:(int)score leaderboard:(NSString *)identifier sortOrder:(GameCenterSortOrder)order; -// Saves achievement locally and reports it to Game Center. If error occurs, achievement is saved to be submitted later. +/// Saves achievement locally and reports it to Game Center. If error occurs, achievement is saved to be submitted later. - (void)saveAndReportAchievement:(NSString *)identifier percentComplete:(double)percentComplete shouldDisplayNotification:(BOOL)displayNotification; -// Reports scores and achievements which could not be reported earlier. +/// Reports scores and achievements which could not be reported earlier. - (void)reportSavedScoresAndAchievements; -// Saves score to be submitted later. +/// Saves score to be submitted later. - (void)saveScoreToReportLater:(GKScore *)score; -// Saves achievement to be submitted later. +/// Saves achievement to be submitted later. - (void)saveAchievementToReportLater:(NSString *)identifier percentComplete:(double)percentComplete; -// Returns local player's high score for specified leaderboard. +/// Returns local player's high score for specified leaderboard. - (int)highScoreForLeaderboard:(NSString *)identifier; -// Returns local player's high scores for multiple leaderboards. +/// Returns local player's high scores for multiple leaderboards. - (NSDictionary *)highScoreForLeaderboards:(NSArray *)identifiers; -// Returns local player's percent completed for specified achievement. +/// Returns local player's percent completed for specified achievement. - (double)progressForAchievement:(NSString *)identifier; -// Returns local player's percent completed for multiple achievements. +/// Returns local player's percent completed for multiple achievements. - (NSDictionary *)progressForAchievements:(NSArray *)identifiers; /** Gets a list of challenges for the current player and game. If GameCenter is not available it will return nil and provide an error using the gameCenterManager:error: delegate method. Use the completion handler to get challenges. @@ -82,7 +82,7 @@ enum { /** Resets local player's achievements */ - (void)resetAchievements; -// Returns currently authenticated local player. If no player is authenticated, "unknownPlayer" is returned. +/// Returns currently authenticated local player. If no player is authenticated, "unknownPlayer" is returned. - (NSString *)localPlayerId; - (GKLocalPlayer *)localPlayerData; - (void)localPlayerPhoto:(void (^)(NSImage *playerPhoto))handler; @@ -92,16 +92,16 @@ enum { */ - (BOOL)isInternetAvailable; -// Check if GameCenter is supported +/// Check if GameCenter is supported - (BOOL)checkGameCenterAvailability; -// Use this property to check if Game Center is available and supported on the current device. +/// Use this property to check if Game Center is available and supported on the current device. @property (nonatomic, assign) BOOL isGameCenterAvailable; @end -//GameCenterManager Mac Delegate +/// GameCenterManager Mac Delegate @protocol GameCenterManagerDelegate @optional - (void)gameCenterManager:(GameCenterManager *)manager availabilityChanged:(NSDictionary *)availabilityInformation; diff --git a/GameCenterManager Mac/GC Manager/GameCenterManager-Mac.m b/GameCenterManager Mac/GC Manager/GameCenterManager-Mac.m old mode 100644 new mode 100755 index 8cfb95d..99ffe3b --- a/GameCenterManager Mac/GC Manager/GameCenterManager-Mac.m +++ b/GameCenterManager Mac/GC Manager/GameCenterManager-Mac.m @@ -9,7 +9,7 @@ //------------------------------------------------------------------------------------------------------------// -//Region: GameCenter Manager Singleton -----------------------------------------------------------------------// +//------- GameCenter Manager Singleton -----------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark GameCenter Manager @@ -44,23 +44,23 @@ + (id)allocWithZone:(NSZone *)zone { } - (id)copyWithZone:(NSZone *)zone { - return self; + return self; } //------------------------------------------------------------------------------------------------------------// -//Region: GameCenter Manager Setup ---------------------------------------------------------------------------// +//------- GameCenter Manager Setup ---------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - GameCenter Manager Setup - (void)initGameCenter { BOOL gameCenterAvailable = [self checkGameCenterAvailability]; if (gameCenterAvailable) { - //Set GameCenter as available + // Set GameCenter as available [[GameCenterManager sharedManager] setIsGameCenterAvailable:YES]; if (![[NSUserDefaults standardUserDefaults] boolForKey:[@"scoresSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]] || - ![[NSUserDefaults standardUserDefaults] boolForKey:[@"achievementsSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]) { - [[GameCenterManager sharedManager] syncGameCenter]; + ![[NSUserDefaults standardUserDefaults] boolForKey:[@"achievementsSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]) { + [[GameCenterManager sharedManager] syncGameCenter]; } else { [[GameCenterManager sharedManager] reportSavedScoresAndAchievements]; } @@ -71,88 +71,105 @@ - (void)initGameCenter { } - (BOOL)checkGameCenterAvailability { - //First, check if the the GameKit Framework exists on the device. Return NO if it does not. + // First, check if the the GameKit Framework exists on the device. Return NO if it does not. BOOL isGameCenterAPIAvailable = (NSClassFromString(@"GKLocalPlayer")) != nil; if (!isGameCenterAPIAvailable) { - return NO; - NSDictionary *errorDictionary = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"GameKit Framework not available on this Mac. GameKit is only available on Macs with OS X 10.8.0 or higher.", @"GameCenter Unavailable", nil] forKeys:[NSArray arrayWithObjects:@"message", @"title", nil]]; + NSDictionary *errorDictionary = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"GameKit Framework not available on this Mac. GameKit is only available on Macs with OS X 10.8.0 or higher.", @"GameCenter Unavailable", nil] + forKeys:[NSArray arrayWithObjects:@"message", @"title", nil]]; + dispatch_async(dispatch_get_main_queue(), ^{ if ([[self delegate] respondsToSelector:@selector(gameCenterManager:availabilityChanged:)]) [[self delegate] gameCenterManager:self availabilityChanged:errorDictionary]; }); + return NO; + } else { - //The GameKit Framework is available. Now check if an internet connection can be established + // The GameKit Framework is available. Now check if an internet connection can be established BOOL internetAvailable = [self isInternetAvailable]; if (!internetAvailable) { - return NO; NSDictionary *errorDictionary = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"Cannot connect to the internet. Connect to the internet to establish a connection with GameCenter. Achievements and scores will still be saved locally and then uploaded later.", @"Internet Unavailable", nil] forKeys:[NSArray arrayWithObjects:@"message", @"title", nil]]; + dispatch_async(dispatch_get_main_queue(), ^{ if ([[self delegate] respondsToSelector:@selector(gameCenterManager:availabilityChanged:)]) [[self delegate] gameCenterManager:self availabilityChanged:errorDictionary]; }); + return NO; + } else { - //The internet is available and the current device is connected. Now check if the player is authenticated + // The internet is available and the current device is connected. Now check if the player is authenticated GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; localPlayer.authenticateHandler = ^(NSViewController *viewController, NSError *error) { if (viewController != nil) { NSDictionary *errorDictionary = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"Player is not yet signed into GameCenter. Please prompt the player using the authenticateUser delegate method.", @"No Player", nil] forKeys:[NSArray arrayWithObjects:@"message", @"title", nil]]; + dispatch_async(dispatch_get_main_queue(), ^{ if ([[self delegate] respondsToSelector:@selector(gameCenterManager:availabilityChanged:)]) [[self delegate] gameCenterManager:self availabilityChanged:errorDictionary]; }); } else if (!error) { - //Authentication handler completed successfully. Re-check availability + // Authentication handler completed successfully. Re-check availability [self checkGameCenterAvailability]; } }; if (![[GKLocalPlayer localPlayer] isAuthenticated]) { NSDictionary *errorDictionary = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"Player is not signed into GameCenter, has declined to sign into GameCenter, or GameKit had an issue validating this game / app.", @"Player not Authenticated", nil] forKeys:[NSArray arrayWithObjects:@"message", @"title", nil]]; + if ([[self delegate] respondsToSelector:@selector(gameCenterManager:availabilityChanged:)]) [[self delegate] gameCenterManager:self availabilityChanged:errorDictionary]; + return NO; + } else { - //The current player is logged into GameCenter + // The current player is logged into GameCenter NSDictionary *successDictionary = [NSDictionary dictionaryWithObject:@"GameCenter Available" forKey:@"status"]; + dispatch_async(dispatch_get_main_queue(), ^{ if ([[self delegate] respondsToSelector:@selector(gameCenterManager:availabilityChanged:)]) [[self delegate] gameCenterManager:self availabilityChanged:successDictionary]; }); + self.isGameCenterAvailable = YES; + return YES; } } } } -//Check for internet with Reachability +// Check for internet with Reachability - (BOOL)isInternetAvailable { Reachability *reachability = [Reachability reachabilityForInternetConnection]; NetworkStatus internetStatus = [reachability currentReachabilityStatus]; + if (internetStatus == NotReachable) { - return NO; NSError *error = [NSError errorWithDomain:[NSString stringWithFormat:@"Internet unavailable - could not connect to the internet. Connect to WiFi or a Cellular Network to upload data to GameCenter."] code:GCMErrorInternetNotAvailable userInfo:nil]; + dispatch_async(dispatch_get_main_queue(), ^{ if ([[self delegate] respondsToSelector:@selector(gameCenterManager:error:)]) [[self delegate] gameCenterManager:self error:error]; }); + + return NO; } else { return YES; } } //------------------------------------------------------------------------------------------------------------// -//Region: GameCenter Syncing ---------------------------------------------------------------------------------// +//------- GameCenter Syncing ---------------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - GameCenter Syncing - (void)syncGameCenter { // Begin Syncing with GameCenter + // Check if GameCenter is available if ([[GameCenterManager sharedManager] checkGameCenterAvailability] == YES) { + // Check if Leaderboard Scores are synced if (![[NSUserDefaults standardUserDefaults] boolForKey:[@"scoresSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]) { if (_leaderboards == nil) { [GKLeaderboard loadLeaderboardsWithCompletionHandler:^(NSArray *leaderboards, NSError *error) { @@ -178,18 +195,23 @@ - (void)syncGameCenter { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; + if (playerDict == nil) { playerDict = [NSMutableDictionary dictionary]; } + float savedHighScoreValue = 0; NSNumber *savedHighScore = [playerDict objectForKey:leaderboardRequest.localPlayerScore.category]; + if (savedHighScore != nil) { savedHighScoreValue = [savedHighScore intValue]; } + [playerDict setObject:[NSNumber numberWithInt:MAX(leaderboardRequest.localPlayerScore.value, savedHighScoreValue)] forKey:leaderboardRequest.localPlayerScore.category]; [plistDict setObject:playerDict forKey:[[GameCenterManager sharedManager] localPlayerId]]; + NSData *saveData = [[NSKeyedArchiver archivedDataWithRootObject:plistDict] encryptedWithKey:kGameCenterManagerKey]; [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; } @@ -212,6 +234,8 @@ - (void)syncGameCenter { [[NSUserDefaults standardUserDefaults] setBool:YES forKey:[@"scoresSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]; [[GameCenterManager sharedManager] syncGameCenter]; } + + // Check if Achievements are synced } else if (![[NSUserDefaults standardUserDefaults] boolForKey:[@"achievementsSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]) { [GKAchievement loadAchievementsWithCompletionHandler:^(NSArray *achievements, NSError *error) { if (error == nil) { @@ -219,12 +243,15 @@ - (void)syncGameCenter { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; + if (playerDict == nil) { playerDict = [NSMutableDictionary dictionary]; } - for(GKAchievement *achievement in achievements) { + + for (GKAchievement *achievement in achievements) { [playerDict setObject:[NSNumber numberWithDouble:achievement.percentComplete] forKey:achievement.identifier]; } + [plistDict setObject:playerDict forKey:[[GameCenterManager sharedManager] localPlayerId]]; NSData *saveData = [[NSKeyedArchiver archivedDataWithRootObject:plistDict] encryptedWithKey:kGameCenterManagerKey]; [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; @@ -249,68 +276,74 @@ - (void)syncGameCenter { } } -//Report data when the internet is available again +// Report data when the internet is available again - (void)reportSavedScoresAndAchievements { - if ([[GameCenterManager sharedManager] isInternetAvailable]) { - GKScore *gkScore = nil; - - NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; - NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; - NSMutableArray *savedScores = [plistDict objectForKey:@"SavedScores"]; - if (savedScores != nil) { - if (savedScores.count > 0) { - gkScore = [NSKeyedUnarchiver unarchiveObjectWithData:[savedScores objectAtIndex:0]]; - [savedScores removeObjectAtIndex:0]; - [plistDict setObject:savedScores forKey:@"SavedScores"]; - NSData *saveData = [[NSKeyedArchiver archivedDataWithRootObject:plistDict] encryptedWithKey:kGameCenterManagerKey]; - [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; - } + if ([[GameCenterManager sharedManager] isInternetAvailable] == NO) { + return; + } + + GKScore *gkScore = nil; + + NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; + NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; + NSMutableArray *savedScores = [plistDict objectForKey:@"SavedScores"]; + + if (savedScores != nil) { + if (savedScores.count > 0) { + gkScore = [NSKeyedUnarchiver unarchiveObjectWithData:[savedScores objectAtIndex:0]]; + + [savedScores removeObjectAtIndex:0]; + [plistDict setObject:savedScores forKey:@"SavedScores"]; + + NSData *saveData = [[NSKeyedArchiver archivedDataWithRootObject:plistDict] encryptedWithKey:kGameCenterManagerKey]; + [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; } - - if (gkScore != nil) { - [gkScore reportScoreWithCompletionHandler:^(NSError *error) { - if (error == nil) { - [[GameCenterManager sharedManager] reportSavedScoresAndAchievements]; - } - else { - [[GameCenterManager sharedManager] saveScoreToReportLater:gkScore]; - } - }]; - } else { - if ([GKLocalPlayer localPlayer].authenticated) { - NSString *identifier = nil; - double percentComplete = 0; - - NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; - NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; - NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; - if (playerDict != nil) { - NSMutableDictionary *savedAchievements = [playerDict objectForKey:@"SavedAchievements"]; - if (savedAchievements != nil) { - if (savedAchievements.count > 0) { - identifier = [[savedAchievements allKeys] objectAtIndex:0]; - percentComplete = [[savedAchievements objectForKey:identifier] doubleValue]; - [savedAchievements removeObjectForKey:identifier]; - [playerDict setObject:savedAchievements forKey:@"SavedAchievements"]; - [plistDict setObject:playerDict forKey:[[GameCenterManager sharedManager] localPlayerId]]; - NSData *saveData = [[NSKeyedArchiver archivedDataWithRootObject:plistDict] encryptedWithKey:kGameCenterManagerKey]; - [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; - } + } + + if (gkScore != nil) { + [gkScore reportScoreWithCompletionHandler:^(NSError *error) { + if (error == nil) { + [[GameCenterManager sharedManager] reportSavedScoresAndAchievements]; + } else { + [[GameCenterManager sharedManager] saveScoreToReportLater:gkScore]; + } + }]; + } else { + if ([GKLocalPlayer localPlayer].authenticated) { + NSString *identifier = nil; + double percentComplete = 0; + + NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; + NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; + NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; + + if (playerDict != nil) { + NSMutableDictionary *savedAchievements = [playerDict objectForKey:@"SavedAchievements"]; + if (savedAchievements != nil) { + if (savedAchievements.count > 0) { + identifier = [[savedAchievements allKeys] objectAtIndex:0]; + percentComplete = [[savedAchievements objectForKey:identifier] doubleValue]; + + [savedAchievements removeObjectForKey:identifier]; + [playerDict setObject:savedAchievements forKey:@"SavedAchievements"]; + [plistDict setObject:playerDict forKey:[[GameCenterManager sharedManager] localPlayerId]]; + + NSData *saveData = [[NSKeyedArchiver archivedDataWithRootObject:plistDict] encryptedWithKey:kGameCenterManagerKey]; + [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; } } - - if (identifier != nil) { - GKAchievement *achievement = [[GKAchievement alloc] initWithIdentifier:identifier]; - achievement.percentComplete = percentComplete; - [achievement reportAchievementWithCompletionHandler:^(NSError *error) { - if (error == nil) { - [[GameCenterManager sharedManager] reportSavedScoresAndAchievements]; - } - else { - [[GameCenterManager sharedManager] saveAchievementToReportLater:achievement.identifier percentComplete:achievement.percentComplete]; - } - }]; - } + } + + if (identifier != nil) { + GKAchievement *achievement = [[GKAchievement alloc] initWithIdentifier:identifier]; + achievement.percentComplete = percentComplete; + [achievement reportAchievementWithCompletionHandler:^(NSError *error) { + if (error == nil) { + [[GameCenterManager sharedManager] reportSavedScoresAndAchievements]; + } else { + [[GameCenterManager sharedManager] saveAchievementToReportLater:achievement.identifier percentComplete:achievement.percentComplete]; + } + }]; } } } @@ -318,11 +351,11 @@ - (void)reportSavedScoresAndAchievements { //------------------------------------------------------------------------------------------------------------// -//Region: Score and Achievement Reporting --------------------------------------------------------------------// +//------- Score and Achievement Reporting --------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - Score and Achievement Reporting -//Save score and report it to GameCenter +// Save score and report it to GameCenter - (void)saveAndReportScore:(int)score leaderboard:(NSString *)identifier sortOrder:(GameCenterSortOrder)order { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; @@ -362,12 +395,12 @@ - (void)saveAndReportScore:(int)score leaderboard:(NSString *)identifier sortOrd } if ([[GameCenterManager sharedManager] checkGameCenterAvailability] == YES) { - GKScore *gkScore = [[GKScore alloc] initWithCategory:identifier]; - gkScore.value = score; + GKScore *gkScore = [[GKScore alloc] initWithCategory:identifier]; + gkScore.value = score; [gkScore reportScoreWithCompletionHandler:^(NSError *error) { NSDictionary *dict = nil; - + if (error == nil) { dict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:gkScore, nil] forKeys:[NSArray arrayWithObjects:@"score", nil]]; } else { @@ -386,36 +419,45 @@ - (void)saveAndReportScore:(int)score leaderboard:(NSString *)identifier sortOrd } } -//Save achievement and report it to GameCenter +// Save achievement and report it to GameCenter - (void)saveAndReportAchievement:(NSString *)identifier percentComplete:(double)percentComplete shouldDisplayNotification:(BOOL)displayNotification { + // Retrieve Saved Data NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; + // Create the player dictionary if (playerDict == nil) playerDict = [NSMutableDictionary dictionary]; + // Get the saved percent complete value - if it's nil, initialize it to 0, otherwise set it to its double value NSNumber *savedPercentComplete = [playerDict objectForKey:identifier]; - if (savedPercentComplete == nil) - savedPercentComplete = [NSNumber numberWithDouble:0]; - + if (savedPercentComplete == nil) savedPercentComplete = [NSNumber numberWithDouble:0]; double savedPercentCompleteValue = [savedPercentComplete doubleValue]; + + // Compare the saved percent and the percent that was just submitted, if the submitted percent is greater save it if (percentComplete > savedPercentCompleteValue) { [playerDict setObject:[NSNumber numberWithDouble:percentComplete] forKey:identifier]; [plistDict setObject:playerDict forKey:[[GameCenterManager sharedManager] localPlayerId]]; + NSData *saveData = [[NSKeyedArchiver archivedDataWithRootObject:plistDict] encryptedWithKey:kGameCenterManagerKey]; [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; } + // Check if GameCenter is Available if ([[GameCenterManager sharedManager] checkGameCenterAvailability] == YES) { + // Create the Achievement Object GKAchievement *achievement = [[GKAchievement alloc] initWithIdentifier:identifier]; achievement.percentComplete = percentComplete; + + // Set whether or not a GameCenter achievement banner should be displayed if (displayNotification == YES) { achievement.showsCompletionBanner = YES; } else { achievement.showsCompletionBanner = NO; } + // Report the achievement to GameCenter [achievement reportAchievementWithCompletionHandler:^(NSError *error) { NSDictionary *dict = nil; @@ -429,6 +471,7 @@ - (void)saveAndReportAchievement:(NSString *)identifier percentComplete:(double) [[GameCenterManager sharedManager] saveAchievementToReportLater:identifier percentComplete:percentComplete]; } + // Notify the delegate on the main queue dispatch_async(dispatch_get_main_queue(), ^{ if ([[self delegate] respondsToSelector:@selector(gameCenterManager:reportedAchievement:)]) [[self delegate] gameCenterManager:self reportedAchievement:dict]; @@ -437,21 +480,25 @@ - (void)saveAndReportAchievement:(NSString *)identifier percentComplete:(double) }]; } else { + // GameCenter is not available, just save the achievement for later [[GameCenterManager sharedManager] saveAchievementToReportLater:identifier percentComplete:percentComplete]; } } -//Save score to report later +// Save score to report later - (void)saveScoreToReportLater:(GKScore *)score { NSData *scoreData = [NSKeyedArchiver archivedDataWithRootObject:score]; NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; + NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableArray *savedScores = [plistDict objectForKey:@"SavedScores"]; + if (savedScores != nil) { [savedScores addObject:scoreData]; } else { savedScores = [NSMutableArray arrayWithObject:scoreData]; } + [plistDict setObject:savedScores forKey:@"SavedScores"]; NSData *saveData = [[NSKeyedArchiver archivedDataWithRootObject:plistDict] encryptedWithKey:kGameCenterManagerKey]; [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; @@ -466,16 +513,23 @@ - (void)saveAchievementToReportLater:(NSString *)identifier percentComplete:(dou NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; + if (playerDict != nil) { NSMutableDictionary *savedAchievements = [playerDict objectForKey:@"SavedAchievements"]; if (savedAchievements != nil) { double savedPercentCompleteValue = 0; NSNumber *savedPercentComplete = [savedAchievements objectForKey:identifier]; + if (savedPercentComplete != nil) { savedPercentCompleteValue = [savedPercentComplete doubleValue]; } - savedPercentComplete = [NSNumber numberWithDouble:percentComplete + savedPercentCompleteValue]; - [savedAchievements setObject:savedPercentComplete forKey:identifier]; + + // Compare the saved percent and the percent that was just submitted, if the submitted percent is greater save it + if (percentComplete > savedPercentCompleteValue) { + savedPercentComplete = [NSNumber numberWithDouble:percentComplete]; + [savedAchievements setObject:savedPercentComplete forKey:identifier]; + } + } else { savedAchievements = [NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithDouble:percentComplete], identifier, nil]; [playerDict setObject:savedAchievements forKey:@"SavedAchievements"]; @@ -484,12 +538,14 @@ - (void)saveAchievementToReportLater:(NSString *)identifier percentComplete:(dou NSMutableDictionary *savedAchievements = [NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithDouble:percentComplete], identifier, nil]; playerDict = [NSMutableDictionary dictionaryWithObjectsAndKeys:savedAchievements, @"SavedAchievements", nil]; } + [plistDict setObject:playerDict forKey:[[GameCenterManager sharedManager] localPlayerId]]; NSData *saveData = [[NSKeyedArchiver archivedDataWithRootObject:plistDict] encryptedWithKey:kGameCenterManagerKey]; [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; GKAchievement *achievement = [[GKAchievement alloc] initWithIdentifier:identifier]; NSNumber *percentNumber = [NSNumber numberWithDouble:percentComplete]; + if (percentNumber && achievement) { dispatch_async(dispatch_get_main_queue(), ^{ if ([[self delegate] respondsToSelector:@selector(gameCenterManager:savedAchievement:)]) @@ -499,6 +555,7 @@ - (void)saveAchievementToReportLater:(NSString *)identifier percentComplete:(dou } else { NSError *error = [NSError errorWithDomain:[NSString stringWithFormat:@"Could not save achievement because necessary data is missing. GameCenter needs an Achievement ID and Percent Completed to save the achievement. You provided the following data:\nAchievement: %@\nPercent Completed:%@", achievement, percentNumber] code:GCMErrorAchievementDataMissing userInfo:nil]; + dispatch_async(dispatch_get_main_queue(), ^{ if ([[self delegate] respondsToSelector:@selector(gameCenterManager:error:)]) [[self delegate] gameCenterManager:self error:error]; @@ -507,7 +564,7 @@ - (void)saveAchievementToReportLater:(NSString *)identifier percentComplete:(dou } //------------------------------------------------------------------------------------------------------------// -//Region: Score, Achievement, and Challenge Retrieval --------------------------------------------------------// +//------- Score, Achievement, and Challenge Retrieval --------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - Score, Achievement, and Challenge Retrieval @@ -515,6 +572,7 @@ - (int)highScoreForLeaderboard:(NSString *)identifier { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; + if (playerDict != nil) { NSNumber *savedHighScore = [playerDict objectForKey:identifier]; if (savedHighScore != nil) { @@ -527,20 +585,23 @@ - (int)highScoreForLeaderboard:(NSString *)identifier { } } -//Get leaderboard high scores +// Get leaderboard high scores - (NSDictionary *)highScoreForLeaderboards:(NSArray *)identifiers { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; NSMutableDictionary *highScores = [[NSMutableDictionary alloc] initWithCapacity:identifiers.count]; - for(NSString *identifier in identifiers) { + + for (NSString *identifier in identifiers) { if (playerDict != nil) { NSNumber *savedHighScore = [playerDict objectForKey:identifier]; + if (savedHighScore != nil) { [highScores setObject:[NSNumber numberWithInt:[savedHighScore intValue]] forKey:identifier]; continue; } } + [highScores setObject:[NSNumber numberWithInt:0] forKey:identifier]; } @@ -549,11 +610,12 @@ - (NSDictionary *)highScoreForLeaderboards:(NSArray *)identifiers { return highScoreDict; } -//Get achievement progress +// Get achievement progress - (double)progressForAchievement:(NSString *)identifier { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; + if (playerDict != nil) { NSNumber *savedPercentComplete = [playerDict objectForKey:identifier]; if (savedPercentComplete != nil) { @@ -563,20 +625,23 @@ - (double)progressForAchievement:(NSString *)identifier { return 0; } -//Returns local player's percent completed for multiple achievements. +// Returns local player's percent completed for multiple achievements. - (NSDictionary *)progressForAchievements:(NSArray *)identifiers { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; NSMutableDictionary *percent = [[NSMutableDictionary alloc] initWithCapacity:identifiers.count]; - for(NSString *identifier in identifiers) { + + for (NSString *identifier in identifiers) { if (playerDict != nil) { NSNumber *savedPercentComplete = [playerDict objectForKey:identifier]; + if (savedPercentComplete != nil) { [percent setObject:[NSNumber numberWithDouble:[savedPercentComplete doubleValue]] forKey:identifier]; continue; } } + [percent setObject:[NSNumber numberWithDouble:0] forKey:identifier]; } @@ -585,10 +650,11 @@ - (NSDictionary *)progressForAchievements:(NSArray *)identifiers { return percentDict; } -//Returns local player's challenges for this game +// Returns local player's challenges for this game - (void)getChallengesWithCompletion:(void (^)(NSArray *challenges, NSError *error))handler { if ([[GameCenterManager sharedManager] checkGameCenterAvailability] == YES) { BOOL isGameCenterChallengeAPIAvailable = (NSClassFromString(@"GKChallenge")) != nil; + if (isGameCenterChallengeAPIAvailable == YES) { [GKChallenge loadReceivedChallengesWithCompletionHandler:^(NSArray *challenges, NSError *error) { if (error == nil) { @@ -611,11 +677,11 @@ - (void)getChallengesWithCompletion:(void (^)(NSArray *challenges, NSError *erro } //------------------------------------------------------------------------------------------------------------// -//Region: Resetting Data -------------------------------------------------------------------------------------// +//------- Resetting Data -------------------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - Resetting Data -//Reset all achievements and progress +// Reset all achievements and progress - (void)resetAchievements { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; @@ -644,10 +710,13 @@ - (void)resetAchievements { [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; [GKAchievement resetAchievementsWithCompletionHandler:^(NSError *error) { - [[NSUserDefaults standardUserDefaults] setBool:NO forKey:[@"achievementsSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]; - [[NSUserDefaults standardUserDefaults] synchronize]; + if (error == nil) { + [[NSUserDefaults standardUserDefaults] setBool:NO forKey:[@"achievementsSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]; + [[NSUserDefaults standardUserDefaults] synchronize]; + + [[GameCenterManager sharedManager] syncGameCenter]; + } - [[GameCenterManager sharedManager] syncGameCenter]; dispatch_async(dispatch_get_main_queue(), ^{ [self syncGameCenter]; if ([[self delegate] respondsToSelector:@selector(gameCenterManager:resetAchievements:)]) @@ -660,41 +729,57 @@ - (void)resetAchievements { } //------------------------------------------------------------------------------------------------------------// -//Region: Player Data ----------------------------------------------------------------------------------------// +//------- Player Data ----------------------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - Player Data -//Checks if player is authenticated and gets his / her ID +// Checks if player is authenticated and gets his / her ID - (NSString *)localPlayerId { - if ([[GameCenterManager sharedManager] isGameCenterAvailable]) { - if ([GKLocalPlayer localPlayer].authenticated) { - return [GKLocalPlayer localPlayer].playerID; + if ([[GameCenterManager sharedManager] isGameCenterAvailable] && [GKLocalPlayer localPlayer].authenticated) { + return [GKLocalPlayer localPlayer].playerID; + } + + return @"unknownPlayer"; +} + +// Returns the local player's display name +- (NSString *)localPlayerDisplayName { + if ([[GameCenterManager sharedManager] isGameCenterAvailable] && [GKLocalPlayer localPlayer].authenticated) { + if ([[GKLocalPlayer localPlayer] respondsToSelector:@selector(displayName)]) { + return [GKLocalPlayer localPlayer].displayName; + } else { + return [GKLocalPlayer localPlayer].alias; } } + return @"unknownPlayer"; } -//Checks if player is authenticated and gets his / her ID +// Checks if player is authenticated and gets his / her ID - (GKLocalPlayer *)localPlayerData { - if ([[GameCenterManager sharedManager] isGameCenterAvailable]) { - if ([GKLocalPlayer localPlayer].authenticated) { - return [GKLocalPlayer localPlayer]; - } + if ([[GameCenterManager sharedManager] isGameCenterAvailable] && [GKLocalPlayer localPlayer].authenticated) { + return [GKLocalPlayer localPlayer]; } + return nil; } - (void)localPlayerPhoto:(void (^)(NSImage *playerPhoto))handler { - [[self localPlayerData] loadPhotoForSize:GKPhotoSizeNormal withCompletionHandler:^(NSImage *photo, NSError *error) { - handler(photo); - if (error) { - dispatch_async(dispatch_get_main_queue(), ^{ - if ([[self delegate] respondsToSelector:@selector(gameCenterManager:error:)]) - [[self delegate] gameCenterManager:self error:error]; - }); - } - }]; + if ([[GameCenterManager sharedManager] isGameCenterAvailable]) { + [[self localPlayerData] loadPhotoForSize:GKPhotoSizeNormal withCompletionHandler:^(NSImage *photo, NSError *error) { + handler(photo); + if (error) { + dispatch_async(dispatch_get_main_queue(), ^{ + if ([[self delegate] respondsToSelector:@selector(gameCenterManager:error:)]) + [[self delegate] gameCenterManager:self error:error]; + }); + } + }]; + } else { + NSError *error = [NSError errorWithDomain:[NSString stringWithFormat:@"GameCenter Unavailable"] code:GCMErrorNotAvailable userInfo:nil]; + if ([[self delegate] respondsToSelector:@selector(gameCenterManager:error:)]) + [[self delegate] gameCenterManager:self error:error]; + } } - @end \ No newline at end of file diff --git a/GameCenterManager Mac/GC Manager/NSDataAES256.h b/GameCenterManager Mac/GC Manager/NSDataAES256.h old mode 100644 new mode 100755 diff --git a/GameCenterManager Mac/GC Manager/NSDataAES256.m b/GameCenterManager Mac/GC Manager/NSDataAES256.m old mode 100644 new mode 100755 diff --git a/GameCenterManager Mac/GameCenterManager Mac-Info.plist b/GameCenterManager Mac/GameCenterManager Mac-Info.plist old mode 100644 new mode 100755 index f074d45..1075f28 --- a/GameCenterManager Mac/GameCenterManager Mac-Info.plist +++ b/GameCenterManager Mac/GameCenterManager Mac-Info.plist @@ -6,8 +6,6 @@ en CFBundleExecutable ${EXECUTABLE_NAME} - CFBundleIconFile - Mac Icon CFBundleIdentifier com.iRare-Media.GameCenterManager.Mac CFBundleInfoDictionaryVersion @@ -17,11 +15,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + 5.1 CFBundleSignature ???? CFBundleVersion - 1.0 + 5.1 LSApplicationCategoryType public.app-category.games LSMinimumSystemVersion diff --git a/GameCenterManager Mac/GameCenterManager Mac-Prefix.pch b/GameCenterManager Mac/GameCenterManager Mac-Prefix.pch old mode 100644 new mode 100755 diff --git a/GameCenterManager Mac/Images/FeltTile.png b/GameCenterManager Mac/Images/FeltTile.png old mode 100644 new mode 100755 diff --git a/GameCenterManager Mac/Images/MacHeader.png b/GameCenterManager Mac/Images/MacHeader.png old mode 100644 new mode 100755 index 8039206..26ac2bb Binary files a/GameCenterManager Mac/Images/MacHeader.png and b/GameCenterManager Mac/Images/MacHeader.png differ diff --git a/GameCenterManager Mac/Images/TopBar.png b/GameCenterManager Mac/Images/TopBar.png old mode 100644 new mode 100755 index 0fbec23..7f0043d Binary files a/GameCenterManager Mac/Images/TopBar.png and b/GameCenterManager Mac/Images/TopBar.png differ diff --git a/GameCenterManager Mac/New icon-32@2x.png b/GameCenterManager Mac/New icon-32@2x.png old mode 100644 new mode 100755 diff --git a/GameCenterManager Mac/New icon-512@2x.png b/GameCenterManager Mac/New icon-512@2x.png old mode 100644 new mode 100755 diff --git a/GameCenterManager Mac/en.lproj/Credits.rtf b/GameCenterManager Mac/en.lproj/Credits.rtf old mode 100644 new mode 100755 diff --git a/GameCenterManager Mac/en.lproj/InfoPlist.strings b/GameCenterManager Mac/en.lproj/InfoPlist.strings old mode 100644 new mode 100755 diff --git a/GameCenterManager Mac/en.lproj/MainMenu.xib b/GameCenterManager Mac/en.lproj/MainMenu.xib old mode 100644 new mode 100755 index be83fac..f6309fc --- a/GameCenterManager Mac/en.lproj/MainMenu.xib +++ b/GameCenterManager Mac/en.lproj/MainMenu.xib @@ -1,5283 +1,811 @@ - - - - 1080 - 12E55 - 3084 - 1187.39 - 626.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 3084 - - - IBNSLayoutConstraint - NSButton - NSButtonCell - NSCustomObject - NSImageCell - NSImageView - NSMenu - NSMenuItem - NSTextField - NSTextFieldCell - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - NSApplication - - - FirstResponder - - - NSApplication - - - AMainMenu - - - - GameCenterManager Mac - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - GameCenterManager Mac - - - - About GameCenterManager Mac - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Services - - 1048576 - 2147483647 - - - submenuAction: - - Services - - _NSServicesMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Hide GameCenterManager Mac - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Quit GameCenterManager Mac - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - File - - 1048576 - 2147483647 - - - submenuAction: - - File - - - - New - n - 1048576 - 2147483647 - - - - - - Open… - o - 1048576 - 2147483647 - - - - - - Open Recent - - 1048576 - 2147483647 - - - submenuAction: - - Open Recent - - - - Clear Menu - - 1048576 - 2147483647 - - - - - _NSRecentDocumentsMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Close - w - 1048576 - 2147483647 - - - - - - Save… - s - 1048576 - 2147483647 - - - - - - Revert to Saved - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Page Setup... - P - 1179648 - 2147483647 - - - - - - - Print… - p - 1048576 - 2147483647 - - - - - - - - - Edit - - 1048576 - 2147483647 - - - submenuAction: - - Edit - - - - Undo - z - 1048576 - 2147483647 - - - - - - Redo - Z - 1179648 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Cut - x - 1048576 - 2147483647 - - - - - - Copy - c - 1048576 - 2147483647 - - - - - - Paste - v - 1048576 - 2147483647 - - - - - - Paste and Match Style - V - 1572864 - 2147483647 - - - - - - Delete - - 1048576 - 2147483647 - - - - - - Select All - a - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Find - - 1048576 - 2147483647 - - - submenuAction: - - Find - - - - Find… - f - 1048576 - 2147483647 - - - 1 - - - - Find and Replace… - f - 1572864 - 2147483647 - - - 12 - - - - Find Next - g - 1048576 - 2147483647 - - - 2 - - - - Find Previous - G - 1179648 - 2147483647 - - - 3 - - - - Use Selection for Find - e - 1048576 - 2147483647 - - - 7 - - - - Jump to Selection - j - 1048576 - 2147483647 - - - - - - - - - Spelling and Grammar - - 1048576 - 2147483647 - - - submenuAction: - - Spelling and Grammar - - - - Show Spelling and Grammar - : - 1048576 - 2147483647 - - - - - - Check Document Now - ; - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Check Spelling While Typing - - 1048576 - 2147483647 - - - - - - Check Grammar With Spelling - - 1048576 - 2147483647 - - - - - - Correct Spelling Automatically - - 2147483647 - - - - - - - - - Substitutions - - 1048576 - 2147483647 - - - submenuAction: - - Substitutions - - - - Show Substitutions - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Smart Copy/Paste - f - 1048576 - 2147483647 - - - 1 - - - - Smart Quotes - g - 1048576 - 2147483647 - - - 2 - - - - Smart Dashes - - 2147483647 - - - - - - Smart Links - G - 1179648 - 2147483647 - - - 3 - - - - Text Replacement - - 2147483647 - - - - - - - - - Transformations - - 2147483647 - - - submenuAction: - - Transformations - - - - Make Upper Case - - 2147483647 - - - - - - Make Lower Case - - 2147483647 - - - - - - Capitalize - - 2147483647 - - - - - - - - - Speech - - 1048576 - 2147483647 - - - submenuAction: - - Speech - - - - Start Speaking - - 1048576 - 2147483647 - - - - - - Stop Speaking - - 1048576 - 2147483647 - - - - - - - - - - - - Format - - 2147483647 - - - submenuAction: - - Format - - - - Font - - 2147483647 - - - submenuAction: - - Font - - - - Show Fonts - t - 1048576 - 2147483647 - - - - - - Bold - b - 1048576 - 2147483647 - - - 2 - - - - Italic - i - 1048576 - 2147483647 - - - 1 - - - - Underline - u - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bigger - + - 1048576 - 2147483647 - - - 3 - - - - Smaller - - - 1048576 - 2147483647 - - - 4 - - - - YES - YES - - - 2147483647 - - - - - - Kern - - 2147483647 - - - submenuAction: - - Kern - - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Tighten - - 2147483647 - - - - - - Loosen - - 2147483647 - - - - - - - - - Ligatures - - 2147483647 - - - submenuAction: - - Ligatures - - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Use All - - 2147483647 - - - - - - - - - Baseline - - 2147483647 - - - submenuAction: - - Baseline - - - - Use Default - - 2147483647 - - - - - - Superscript - - 2147483647 - - - - - - Subscript - - 2147483647 - - - - - - Raise - - 2147483647 - - - - - - Lower - - 2147483647 - - - - - - - - - YES - YES - - - 2147483647 - - - - - - Show Colors - C - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Copy Style - c - 1572864 - 2147483647 - - - - - - Paste Style - v - 1572864 - 2147483647 - - - - - _NSFontMenu - - - - - Text - - 2147483647 - - - submenuAction: - - Text - - - - Align Left - { - 1048576 - 2147483647 - - - - - - Center - | - 1048576 - 2147483647 - - - - - - Justify - - 2147483647 - - - - - - Align Right - } - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Writing Direction - - 2147483647 - - - submenuAction: - - Writing Direction - - - - YES - Paragraph - - 2147483647 - - - - - - CURlZmF1bHQ - - 2147483647 - - - - - - CUxlZnQgdG8gUmlnaHQ - - 2147483647 - - - - - - CVJpZ2h0IHRvIExlZnQ - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - YES - Selection - - 2147483647 - - - - - - CURlZmF1bHQ - - 2147483647 - - - - - - CUxlZnQgdG8gUmlnaHQ - - 2147483647 - - - - - - CVJpZ2h0IHRvIExlZnQ - - 2147483647 - - - - - - - - - YES - YES - - - 2147483647 - - - - - - Show Ruler - - 2147483647 - - - - - - Copy Ruler - c - 1310720 - 2147483647 - - - - - - Paste Ruler - v - 1310720 - 2147483647 - - - - - - - - - - - - View - - 1048576 - 2147483647 - - - submenuAction: - - View - - - - Show Toolbar - t - 1572864 - 2147483647 - - - - - - Customize Toolbar… - - 1048576 - 2147483647 - - - - - - - - - Window - - 1048576 - 2147483647 - - - submenuAction: - - Window - - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Bring All to Front - - 1048576 - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - - - GameCenterManager Mac Help - ? - 1048576 - 2147483647 - - - - - _NSHelpMenu - - - - _NSMainMenu - - - 263 - 2 - {{691, 421}, {708, 325}} - 880280576 - GameCenter Manager Mac - NSWindow - - - {300, 300} - - - 256 - - - - 268 - - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - {{20, 89}, {668, 236}} - - - - _NS:9 - YES - - 134217728 - 33554432 - - NSImage - MacHeader - - _NS:9 - 0 - 0 - 0 - NO - - NO - YES - - - - 268 - {{54, 259}, {352, 25}} - - - - _NS:9 - {250, 750} - YES - - 67108864 - 272891904 - GAMECENTER STATUS UNKNOWN - - GillSans-Bold - 17 - 16 - - _NS:9 - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlBackgroundColor - - - - NO - YES - - - - 268 - {{54, 203}, {352, 48}} - - - - _NS:9 - {250, 750} - YES - - 67108864 - 272891904 - GameCenter Detailed Status - - GillSans - 12 - 16 - - _NS:9 - - - - - NO - YES - - - - 268 - - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - {475, 45} - - - - _NS:9 - YES - - 134217728 - 33554432 - - NSImage - TopBar - - _NS:9 - 0 - 0 - 0 - NO - - NO - YES - - - - 268 - - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - {{57, 145}, {50, 50}} - - - - _NS:9 - YES - - 134217728 - 33554432 - _NS:9 - 0 - 0 - 0 - NO - - NO - YES - - - - 268 - - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - {{469, 0}, {475, 45}} - - - _NS:9 - YES - - 134217728 - 33554432 - - _NS:9 - 0 - 0 - 0 - NO - - NO - YES - - - - 268 - {{73, 65}, {163, 32}} - - - - _NS:22 - YES - - -2080374784 - 134217728 - Submit Highscore - - LucidaGrande - 13 - 1044 - - _NS:22 - - -2038022144 - 162 - - LucidaGrande - 13 - 16 - - - - 400 - 75 - - NO - - - - 268 - {{270, 65}, {169, 32}} - - - - _NS:22 - YES - - -2080374784 - 134217728 - Submit Achievement - - _NS:22 - - -2038022144 - 162 - - - - 400 - 75 - - NO - - - - 268 - {{430, 110}, {142, 23}} - - - - _NS:22 - YES - - -2080374784 - 134217728 - Fetch Challenges - - _NS:22 - - -2038153216 - 162 - - - 400 - 75 - - NO - - - - 268 - {{119, 110}, {151, 23}} - - - - _NS:22 - YES - - -2080374784 - 134217728 - Open Leaderboards - - _NS:22 - - -2038153216 - 162 - - - 400 - 75 - - NO - - - - 268 - {{275, 110}, {147, 23}} - - - - _NS:22 - YES - - -2080374784 - 134217728 - Open Achievements - - _NS:22 - - -2038153216 - 162 - - - 400 - 75 - - NO - - - - 268 - {{476, 65}, {155, 33}} - - - - _NS:22 - YES - - -2080374784 - 134217728 - Reset Achievements - - _NS:22 - - -2038022144 - 162 - - - - 400 - 75 - - NO - - - - 268 - {{17, 10}, {674, 23}} - - - - _NS:9 - {250, 750} - YES - - 67108864 - 138678272 - GameCenter Action Status - - GillSans-Light - 14 - 16 - - _NS:9 - - - 6 - System - windowFrameTextColor - - 3 - MQA - - - - 6 - System - highlightColor - - - - NO - YES - - - - 268 - {{127, 145}, {262, 22}} - - - - _NS:9 - {250, 750} - YES - - 67108864 - 272891904 - Player underage status unknown - - GillSans-LightItalic - 12 - 16 - - _NS:9 - - - - - NO - YES - - - - 268 - {{127, 171}, {262, 24}} - - - - _NS:9 - {250, 750} - YES - - 67108864 - 272891904 - Unknown Player - - GillSans-Bold - 16 - 16 - - _NS:9 - - - - - NO - YES - - - {708, 325} - - - - - {{0, 0}, {1920, 1080}} - {300, 322} - {10000000000000, 10000000000000} - YES - - - AppDelegateMac - - - NSFontManager - - - - - - - terminate: - - - - 449 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - delegate - - - - 495 - - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - print: - - - - 86 - - - - runPageLayout: - - - - 87 - - - - clearRecentDocuments: - - - - 127 - - - - performClose: - - - - 193 - - - - toggleContinuousSpellChecking: - - - - 222 - - - - undo: - - - - 223 - - - - copy: - - - - 224 - - - - checkSpelling: - - - - 225 - - - - paste: - - - - 226 - - - - stopSpeaking: - - - - 227 - - - - cut: - - - - 228 - - - - showGuessPanel: - - - - 230 - - - - redo: - - - - 231 - - - - selectAll: - - - - 232 - - - - startSpeaking: - - - - 233 - - - - delete: - - - - 235 - - - - performZoom: - - - - 240 - - - - performFindPanelAction: - - - - 241 - - - - centerSelectionInVisibleArea: - - - - 245 - - - - toggleGrammarChecking: - - - - 347 - - - - toggleSmartInsertDelete: - - - - 355 - - - - toggleAutomaticQuoteSubstitution: - - - - 356 - - - - toggleAutomaticLinkDetection: - - - - 357 - - - - saveDocument: - - - - 362 - - - - revertDocumentToSaved: - - - - 364 - - - - runToolbarCustomizationPalette: - - - - 365 - - - - toggleToolbarShown: - - - - 366 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - unhideAllApplications: - - - - 370 - - - - newDocument: - - - - 373 - - - - openDocument: - - - - 374 - - - - raiseBaseline: - - - - 426 - - - - lowerBaseline: - - - - 427 - - - - copyFont: - - - - 428 - - - - subscript: - - - - 429 - - - - superscript: - - - - 430 - - - - tightenKerning: - - - - 431 - - - - underline: - - - - 432 - - - - orderFrontColorPanel: - - - - 433 - - - - useAllLigatures: - - - - 434 - - - - loosenKerning: - - - - 435 - - - - pasteFont: - - - - 436 - - - - unscript: - - - - 437 - - - - useStandardKerning: - - - - 438 - - - - useStandardLigatures: - - - - 439 - - - - turnOffLigatures: - - - - 440 - - - - turnOffKerning: - - - - 441 - - - - toggleAutomaticSpellingCorrection: - - - - 456 - - - - orderFrontSubstitutionsPanel: - - - - 458 - - - - toggleAutomaticDashSubstitution: - - - - 461 - - - - toggleAutomaticTextReplacement: - - - - 463 - - - - uppercaseWord: - - - - 464 - - - - capitalizeWord: - - - - 467 - - - - lowercaseWord: - - - - 468 - - - - pasteAsPlainText: - - - - 486 - - - - performFindPanelAction: - - - - 487 - - - - performFindPanelAction: - - - - 488 - - - - performFindPanelAction: - - - - 489 - - - - showHelp: - - - - 493 - - - - alignCenter: - - - - 518 - - - - pasteRuler: - - - - 519 - - - - toggleRuler: - - - - 520 - - - - alignRight: - - - - 521 - - - - copyRuler: - - - - 522 - - - - alignJustified: - - - - 523 - - - - alignLeft: - - - - 524 - - - - makeBaseWritingDirectionNatural: - - - - 525 - - - - makeBaseWritingDirectionLeftToRight: - - - - 526 - - - - makeBaseWritingDirectionRightToLeft: - - - - 527 - - - - makeTextWritingDirectionNatural: - - - - 528 - - - - makeTextWritingDirectionLeftToRight: - - - - 529 - - - - makeTextWritingDirectionRightToLeft: - - - - 530 - - - - performFindPanelAction: - - - - 535 - - - - addFontTrait: - - - - 421 - - - - addFontTrait: - - - - 422 - - - - modifyFont: - - - - 423 - - - - orderFrontFontPanel: - - - - 424 - - - - modifyFont: - - - - 425 - - - - window - - - - 532 - - - - gcStatusTitle - - - - 566 - - - - gcActionInfo - - - - 567 - - - - gcStatusMessage - - - - 568 - - - - loadChallenges: - - - - 766 - - - - reportAchievement: - - - - 767 - - - - reportScore: - - - - 768 - - - - resetAchievements: - - - - 769 - - - - showAchievements: - - - - 770 - - - - showLeaderboard: - - - - 771 - - - - playerPicture - - - - 945 - - - - playerName - - - - 946 - - - - playerStatus - - - - 947 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - - - - - - - - - - - - 19 - - - - - - - - 56 - - - - - - - - 217 - - - - - - - - 83 - - - - - - - - 81 - - - - - - - - - - - - - - - - - 75 - - - - - 78 - - - - - 72 - - - - - 82 - - - - - 124 - - - - - - - - 77 - - - - - 73 - - - - - 79 - - - - - 112 - - - - - 74 - - - - - 125 - - - - - - - - 126 - - - - - 205 - - - - - - - - - - - - - - - - - - - - - - 202 - - - - - 198 - - - - - 207 - - - - - 214 - - - - - 199 - - - - - 203 - - - - - 197 - - - - - 206 - - - - - 215 - - - - - 218 - - - - - - - - 216 - - - - - - - - 200 - - - - - - - - - - - - - 219 - - - - - 201 - - - - - 204 - - - - - 220 - - - - - - - - - - - - - 213 - - - - - 210 - - - - - 221 - - - - - 208 - - - - - 209 - - - - - 57 - - - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - - - 144 - - - - - 129 - - - - - 143 - - - - - 236 - - - - - 131 - - - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - - - - - - 296 - - - - - - - - - 297 - - - - - 298 - - - - - 211 - - - - - - - - 212 - - - - - - - - - 195 - - - - - 196 - - - - - 346 - - - - - 348 - - - - - - - - 349 - - - - - - - - - - - - - - 350 - - - - - 351 - - - - - 354 - - - - - 371 - - - - - - - - 372 - - - - - 5 - 0 - - 5 - 1 - - 469 - - 1000 - - 3 - 9 - 3 - - - - 4 - 0 - - 4 - 1 - - 0.0 - - 1000 - - 8 - 29 - 3 - - - - 6 - 0 - - 6 - 1 - - 77 - - 1000 - - 3 - 9 - 3 - - - - 10 - 0 - - 10 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 5 - 0 - - 6 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 11 - 0 - - 11 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 9 - 0 - - 9 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 11 - 0 - - 11 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 3 - 0 - - 3 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 11 - 0 - - 11 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 5 - 0 - - 5 - 1 - - 275 - - 1000 - - 3 - 9 - 3 - - - - 11 - 0 - - 11 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 4 - 0 - - 4 - 1 - - 10 - - 1000 - - 3 - 9 - 3 - - - - 6 - 0 - - 6 - 1 - - 20 - - 1000 - - 8 - 29 - 3 - - - - 5 - 0 - - 5 - 1 - - 20 - - 1000 - - 8 - 29 - 3 - - - - 4 - 0 - - 4 - 1 - - 0.0 - - 1000 - - 8 - 29 - 3 - - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 8 - 29 - 3 - - - - 5 - 0 - - 5 - 1 - - 73 - - 1000 - - 3 - 9 - 3 - - - - 4 - 0 - - 4 - 1 - - 66 - - 1000 - - 3 - 9 - 3 - - - - 4 - 0 - - 4 - 1 - - 111 - - 1000 - - 3 - 9 - 3 - - - - 5 - 0 - - 5 - 1 - - 119 - - 1000 - - 3 - 9 - 3 - - - - 6 - 0 - - 6 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 3 - 0 - - 4 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 5 - 0 - - 5 - 1 - - 130 - - 1000 - - 3 - 9 - 3 - - - - 3 - 0 - - 4 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 4 - 0 - - 4 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 3 - 0 - - 4 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 5 - 0 - - 5 - 1 - - 57 - - 1000 - - 3 - 9 - 3 - - - - 3 - 0 - - 3 - 1 - - 41 - - 1000 - - 3 - 9 - 3 - - - - 6 - 0 - - 6 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 6 - 0 - - 6 - 1 - - 20 - - 1000 - - 8 - 29 - 3 - - - - 5 - 0 - - 5 - 1 - - 20 - - 1000 - - 8 - 29 - 3 - - - - 3 - 0 - - 3 - 1 - - 0.0 - - 1000 - - 8 - 29 - 3 - - - - - - - - - - - - - - - - - - - - - 375 - - - - - - - - 376 - - - - - - - - - 377 - - - - - - - - 388 - - - - - - - - - - - - - - - - - - - - - - - 389 - - - - - 390 - - - - - 391 - - - - - 392 - - - - - 393 - - - - - 394 - - - - - 395 - - - - - 396 - - - - - 397 - - - - - - - - 398 - - - - - - - - 399 - - - - - - - - 400 - - - - - 401 - - - - - 402 - - - - - 403 - - - - - 404 - - - - - 405 - - - - - - - - - - - - 406 - - - - - 407 - - - - - 408 - - - - - 409 - - - - - 410 - - - - - 411 - - - - - - - - - - 412 - - - - - 413 - - - - - 414 - - - - - 415 - - - - - - - - - - - 416 - - - - - 417 - - - - - 418 - - - - - 419 - - - - - 420 - - - - - 450 - - - - - - - - 451 - - - - - - - - - - 452 - - - - - 453 - - - - - 454 - - - - - 457 - - - - - 459 - - - - - 460 - - - - - 462 - - - - - 465 - - - - - 466 - - - - - 485 - - - - - 490 - - - - - - - - 491 - - - - - - - - 492 - - - - - 494 - - - - - 496 - - - - - - - - 497 - - - - - - - - - - - - - - - - - 498 - - - - - 499 - - - - - 500 - - - - - 501 - - - - - 502 - - - - - 503 - - - - - - - - 504 - - - - - 505 - - - - - 506 - - - - - 507 - - - - - 508 - - - - - - - - - - - - - - - - 509 - - - - - 510 - - - - - 511 - - - - - 512 - - - - - 513 - - - - - 514 - - - - - 515 - - - - - 516 - - - - - 517 - - - - - 534 - - - - - 536 - - - - - - 7 - 0 - - 0 - 1 - - 346 - - 1000 - - 3 - 9 - 1 - - - - - - 537 - - - - - 542 - - - - - - 8 - 0 - - 0 - 1 - - 48 - - 1000 - - 3 - 9 - 1 - - - - - - 544 - - - - - 553 - - - - - - 8 - 0 - - 0 - 1 - - 23 - - 1000 - - 3 - 9 - 1 - - - - - - 555 - - - - - 597 - - - - - - - - 599 - - - - - 602 - - - - - 603 - - - - - 609 - - - - - - 8 - 0 - - 0 - 1 - - 236 - - 1000 - - 3 - 9 - 1 - - - - - - 610 - - - - - 632 - - - - - 633 - - - - - 636 - - - - - 637 - - - - - 650 - - - - - 656 - - - - - 657 - - - - - 659 - - - - - - - - 660 - - - - - 668 - - - - - 669 - - - - - 670 - - - - - 671 - - - - - 684 - - - - - - 7 - 0 - - 0 - 1 - - 163 - - 1000 - - 3 - 9 - 1 - - - - 8 - 0 - - 0 - 1 - - 30 - - 1000 - - 3 - 9 - 1 - - - - - - 685 - - - - - 692 - - - - - - 7 - 0 - - 0 - 1 - - 169 - - 1000 - - 3 - 9 - 1 - - - - - - 694 - - - - - 700 - - - - - - 7 - 0 - - 0 - 1 - - 142 - - 1000 - - 3 - 9 - 1 - - - - - - 701 - - - - - 709 - - - - - - 7 - 0 - - 0 - 1 - - 151 - - 1000 - - 3 - 9 - 1 - - - - - - 710 - - - - - 718 - - - - - - 7 - 0 - - 0 - 1 - - 147 - - 1000 - - 3 - 9 - 1 - - - - - - 720 - - - - - 726 - - - - - - 7 - 0 - - 0 - 1 - - 155 - - 1000 - - 3 - 9 - 1 - - - - - - 727 - - - - - 880 - - - - - 881 - - - - - 901 - - - - - - 8 - 0 - - 0 - 1 - - 50 - - 1000 - - 3 - 9 - 1 - - - - 7 - 0 - - 0 - 1 - - 50 - - 1000 - - 3 - 9 - 1 - - - - - - 902 - - - - - 916 - - - - - 8 - 0 - - 0 - 1 - - 22 - - 1000 - - 3 - 9 - 1 - - - - - - - 918 - - - - - 932 - - - - - - 7 - 0 - - 0 - 1 - - 256 - - 1000 - - 3 - 9 - 1 - - - - - - 933 - - - - - 976 - - - - - 977 - - - - - 781 - - - - - 988 - - - - - 997 - - - - - 1013 - - - - - 1020 - - - - - 1023 - - - - - 1026 - - - - - 1027 - - - - - 1030 - - - - - 1031 - - - - - 1032 - - - - - 1033 - - - - - 1036 - - - - - 1039 - - - - - 1041 - - - - - 1049 - - - - - 1058 - - - - - 1059 - - - - - 1060 - - - - - 1064 - - - - - 1067 - - - - - 1068 - - - - - 1070 - - - - - 1074 - - - - - 1076 - - - - - 1079 - - - - - 1080 - - - - - 1082 - - - - - 1088 - - - - - 1089 - - - - - 1090 - - - - - 1091 - - - - - 1092 - - - - - 1093 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - {{380, 496}, {480, 360}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 1093 - - - - - AppDelegateMac - NSObject - - id - id - id - id - id - id - - - - loadChallenges: - id - - - reportAchievement: - id - - - reportScore: - id - - - resetAchievements: - id - - - showAchievements: - id - - - showLeaderboard: - id - - - - NSTextField - NSTextField - NSTextField - NSTextField - NSImageView - NSTextField - NSWindow - - - - gcActionInfo - NSTextField - - - gcStatusMessage - NSTextField - - - gcStatusTitle - NSTextField - - - playerName - NSTextField - - - playerPicture - NSImageView - - - playerStatus - NSTextField - - - window - NSWindow - - - - IBProjectSource - ./Classes/AppDelegateMac.h - - - - NSLayoutConstraint - NSObject - - IBProjectSource - ./Classes/NSLayoutConstraint.h - - - - - 0 - IBCocoaFramework - YES - 3 - - {660, 235} - {11, 11} - {10, 3} - {475, 45} - - YES - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GameCenterManager Mac/main.m b/GameCenterManager Mac/main.m old mode 100644 new mode 100755 diff --git a/GameCenterManager.xcodeproj/project.pbxproj b/GameCenterManager.xcodeproj/project.pbxproj old mode 100644 new mode 100755 index 1960eaf..8041433 --- a/GameCenterManager.xcodeproj/project.pbxproj +++ b/GameCenterManager.xcodeproj/project.pbxproj @@ -16,11 +16,8 @@ 659699EE1515718800724EBE /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 659699ED1515718800724EBE /* ViewController.m */; }; 65969A06151572D800724EBE /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65969A05151572D800724EBE /* GameKit.framework */; }; 65969A0B1515748900724EBE /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65969A0A1515748900724EBE /* SystemConfiguration.framework */; }; - 9942A500172CBA2300554A22 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9942A4F9172CBA2300554A22 /* Default-568h@2x.png */; }; - 9942A505172CBA2300554A22 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 9942A4FE172CBA2300554A22 /* Default.png */; }; - 9942A506172CBA2300554A22 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9942A4FF172CBA2300554A22 /* Default@2x.png */; }; - 9942A510172CBBE100554A22 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 9942A50F172CBBE100554A22 /* Icon.png */; }; - 9942A512172CBBE400554A22 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9942A511172CBBE400554A22 /* Icon@2x.png */; }; + 994B764E17EE2F3D008DE309 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 994B764C17EE282F008DE309 /* Images.xcassets */; }; + 994B764F17EE2F47008DE309 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 994B764C17EE282F008DE309 /* Images.xcassets */; }; 994E294C17838BF300EAACD2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 994E294A17838BF300EAACD2 /* InfoPlist.strings */; }; 994E294E17838BF300EAACD2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 994E294D17838BF300EAACD2 /* main.m */; }; 994E295217838BF300EAACD2 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 994E295017838BF300EAACD2 /* Credits.rtf */; }; @@ -36,14 +33,6 @@ 994E29751783D05B00EAACD2 /* FeltTile.png in Resources */ = {isa = PBXBuildFile; fileRef = 994E29741783D05B00EAACD2 /* FeltTile.png */; }; 994E29771783D68500EAACD2 /* TopBar.png in Resources */ = {isa = PBXBuildFile; fileRef = 994E29761783D68500EAACD2 /* TopBar.png */; }; 994E29791783DC6200EAACD2 /* MacHeader.png in Resources */ = {isa = PBXBuildFile; fileRef = 994E29781783DC6200EAACD2 /* MacHeader.png */; }; - 994E297D1783E01400EAACD2 /* Mac Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 994E297C1783E01400EAACD2 /* Mac Icon.icns */; }; - 99B01641175515C000F56A5C /* GCBar.png in Resources */ = {isa = PBXBuildFile; fileRef = 99B01640175515C000F56A5C /* GCBar.png */; }; - 99B016451755178700F56A5C /* Felt-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 99B016421755178700F56A5C /* Felt-568h@2x.png */; }; - 99B016461755178700F56A5C /* Felt.png in Resources */ = {isa = PBXBuildFile; fileRef = 99B016431755178700F56A5C /* Felt.png */; }; - 99B016471755178700F56A5C /* Felt@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 99B016441755178700F56A5C /* Felt@2x.png */; }; - 99B0164B17551A7A00F56A5C /* Header@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 99B0164917551A7A00F56A5C /* Header@2x.png */; }; - 99B0164E17553C8700F56A5C /* Content.png in Resources */ = {isa = PBXBuildFile; fileRef = 99B0164C17553C8700F56A5C /* Content.png */; }; - 99B0164F17553C8700F56A5C /* Content@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 99B0164D17553C8700F56A5C /* Content@2x.png */; }; 99B16C18172D46180091618D /* Storyboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 99B16C16172D46180091618D /* Storyboard_iPhone.storyboard */; }; 99B16C1E172D70AB0091618D /* License.md in Resources */ = {isa = PBXBuildFile; fileRef = 99B16C1C172D70AB0091618D /* License.md */; }; 99B16C1F172D70AB0091618D /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 99B16C1D172D70AB0091618D /* README.md */; }; @@ -67,11 +56,7 @@ 659699ED1515718800724EBE /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 65969A05151572D800724EBE /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; }; 65969A0A1515748900724EBE /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; - 9942A4F9172CBA2300554A22 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "Images/Default-568h@2x.png"; sourceTree = ""; }; - 9942A4FE172CBA2300554A22 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Default.png; path = Images/Default.png; sourceTree = ""; }; - 9942A4FF172CBA2300554A22 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default@2x.png"; path = "Images/Default@2x.png"; sourceTree = ""; }; - 9942A50F172CBBE100554A22 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = ""; }; - 9942A511172CBBE400554A22 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = ""; }; + 994B764C17EE282F008DE309 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = GameCenterManager/Images.xcassets; sourceTree = ""; }; 994E294017838BF300EAACD2 /* GameCenterManager Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "GameCenterManager Mac.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 994E294417838BF300EAACD2 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 994E294517838BF300EAACD2 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; @@ -97,14 +82,6 @@ 994E29741783D05B00EAACD2 /* FeltTile.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = FeltTile.png; sourceTree = ""; }; 994E29761783D68500EAACD2 /* TopBar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = TopBar.png; sourceTree = ""; }; 994E29781783DC6200EAACD2 /* MacHeader.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = MacHeader.png; sourceTree = ""; }; - 994E297C1783E01400EAACD2 /* Mac Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "Mac Icon.icns"; sourceTree = ""; }; - 99B01640175515C000F56A5C /* GCBar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = GCBar.png; path = Images/GCBar.png; sourceTree = ""; }; - 99B016421755178700F56A5C /* Felt-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Felt-568h@2x.png"; path = "Images/Felt-568h@2x.png"; sourceTree = ""; }; - 99B016431755178700F56A5C /* Felt.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Felt.png; path = Images/Felt.png; sourceTree = ""; }; - 99B016441755178700F56A5C /* Felt@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Felt@2x.png"; path = "Images/Felt@2x.png"; sourceTree = ""; }; - 99B0164917551A7A00F56A5C /* Header@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Header@2x.png"; path = "Images/Header@2x.png"; sourceTree = ""; }; - 99B0164C17553C8700F56A5C /* Content.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Content.png; path = Images/Content.png; sourceTree = ""; }; - 99B0164D17553C8700F56A5C /* Content@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Content@2x.png"; path = "Images/Content@2x.png"; sourceTree = ""; }; 99B16C17172D46180091618D /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/Storyboard_iPhone.storyboard; sourceTree = ""; }; 99B16C1C172D70AB0091618D /* License.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = License.md; sourceTree = ""; }; 99B16C1D172D70AB0091618D /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.md; sourceTree = ""; }; @@ -146,11 +123,9 @@ 659699CB1515718700724EBE = { isa = PBXGroup; children = ( - 99B16C1C172D70AB0091618D /* License.md */, 99B16C1D172D70AB0091618D /* README.md */, - 9942A511172CBBE400554A22 /* Icon@2x.png */, - 9942A50F172CBBE100554A22 /* Icon.png */, - 994E297C1783E01400EAACD2 /* Mac Icon.icns */, + 99B16C1C172D70AB0091618D /* License.md */, + 994B764C17EE282F008DE309 /* Images.xcassets */, 659699E01515718800724EBE /* GameCenterManager */, 994E294717838BF300EAACD2 /* GameCenterManager Mac */, 659699D91515718800724EBE /* Frameworks */, @@ -181,7 +156,6 @@ isa = PBXGroup; children = ( 99B16C20172D71090091618D /* GC Manager */, - 9942A4F4172CB71400554A22 /* Images */, 659699E91515718800724EBE /* AppDelegate.h */, 659699EA1515718800724EBE /* AppDelegate.m */, 659699EC1515718800724EBE /* ViewController.h */, @@ -203,23 +177,6 @@ name = "Supporting Files"; sourceTree = ""; }; - 9942A4F4172CB71400554A22 /* Images */ = { - isa = PBXGroup; - children = ( - 9942A4F9172CBA2300554A22 /* Default-568h@2x.png */, - 9942A4FE172CBA2300554A22 /* Default.png */, - 9942A4FF172CBA2300554A22 /* Default@2x.png */, - 99B016421755178700F56A5C /* Felt-568h@2x.png */, - 99B016431755178700F56A5C /* Felt.png */, - 99B016441755178700F56A5C /* Felt@2x.png */, - 99B01640175515C000F56A5C /* GCBar.png */, - 99B0164917551A7A00F56A5C /* Header@2x.png */, - 99B0164C17553C8700F56A5C /* Content.png */, - 99B0164D17553C8700F56A5C /* Content@2x.png */, - ); - name = Images; - sourceTree = ""; - }; 994E294317838BF300EAACD2 /* Other Frameworks */ = { isa = PBXGroup; children = ( @@ -389,8 +346,16 @@ 659699CD1515718700724EBE /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0460; + LastUpgradeCheck = 0500; ORGANIZATIONNAME = "NABZ Software"; + TargetAttributes = { + 659699D51515718800724EBE = { + DevelopmentTeam = 243F4RK8Z3; + }; + 994E293F17838BF300EAACD2 = { + DevelopmentTeam = 243F4RK8Z3; + }; + }; }; buildConfigurationList = 659699D01515718700724EBE /* Build configuration list for PBXProject "GameCenterManager" */; compatibilityVersion = "Xcode 3.2"; @@ -416,21 +381,10 @@ buildActionMask = 2147483647; files = ( 659699E51515718800724EBE /* InfoPlist.strings in Resources */, - 9942A500172CBA2300554A22 /* Default-568h@2x.png in Resources */, - 9942A505172CBA2300554A22 /* Default.png in Resources */, - 9942A506172CBA2300554A22 /* Default@2x.png in Resources */, - 9942A510172CBBE100554A22 /* Icon.png in Resources */, - 9942A512172CBBE400554A22 /* Icon@2x.png in Resources */, + 994B764F17EE2F47008DE309 /* Images.xcassets in Resources */, 99B16C18172D46180091618D /* Storyboard_iPhone.storyboard in Resources */, 99B16C1E172D70AB0091618D /* License.md in Resources */, 99B16C1F172D70AB0091618D /* README.md in Resources */, - 99B01641175515C000F56A5C /* GCBar.png in Resources */, - 99B016451755178700F56A5C /* Felt-568h@2x.png in Resources */, - 99B016461755178700F56A5C /* Felt.png in Resources */, - 99B016471755178700F56A5C /* Felt@2x.png in Resources */, - 99B0164B17551A7A00F56A5C /* Header@2x.png in Resources */, - 99B0164E17553C8700F56A5C /* Content.png in Resources */, - 99B0164F17553C8700F56A5C /* Content@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -439,12 +393,12 @@ buildActionMask = 2147483647; files = ( 994E294C17838BF300EAACD2 /* InfoPlist.strings in Resources */, + 994B764E17EE2F3D008DE309 /* Images.xcassets in Resources */, 994E295217838BF300EAACD2 /* Credits.rtf in Resources */, 994E295817838BF300EAACD2 /* MainMenu.xib in Resources */, 994E29751783D05B00EAACD2 /* FeltTile.png in Resources */, 994E29771783D68500EAACD2 /* TopBar.png in Resources */, 994E29791783DC6200EAACD2 /* MacHeader.png in Resources */, - 994E297D1783E01400EAACD2 /* Mac Icon.icns in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -526,11 +480,9 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = ( - armv6, - armv7, - ); + CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -546,11 +498,15 @@ GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_THUMB_SUPPORT = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.0; + ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -560,11 +516,9 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = ( - armv6, - armv7, - ); + CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -573,9 +527,12 @@ GCC_C_LANGUAGE_STANDARD = gnu99; GCC_THUMB_SUPPORT = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; @@ -588,17 +545,19 @@ 659699F81515718800724EBE /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Developer: iRare Media (4N75L7CCKZ)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: iRare Media (4N75L7CCKZ)"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "GameCenterManager/GameCenterManager-Prefix.pch"; GCC_THUMB_SUPPORT = NO; INFOPLIST_FILE = "GameCenterManager/GameCenterManager-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 5.0; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "C8421D7B-DF7B-4EBD-9821-15664A1F017B"; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "C8421D7B-DF7B-4EBD-9821-15664A1F017B"; + PROVISIONING_PROFILE = "0267AEAF-9C47-4D68-B69E-87B0B4DA938D"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = "0267AEAF-9C47-4D68-B69E-87B0B4DA938D"; TARGETED_DEVICE_FAMILY = 1; WRAPPER_EXTENSION = app; }; @@ -607,17 +566,19 @@ 659699F91515718800724EBE /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Developer: iRare Media (4N75L7CCKZ)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: iRare Media (4N75L7CCKZ)"; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "GameCenterManager/GameCenterManager-Prefix.pch"; GCC_THUMB_SUPPORT = NO; INFOPLIST_FILE = "GameCenterManager/GameCenterManager-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 5.0; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE = "C8421D7B-DF7B-4EBD-9821-15664A1F017B"; - "PROVISIONING_PROFILE[sdk=iphoneos*]" = "C8421D7B-DF7B-4EBD-9821-15664A1F017B"; + PROVISIONING_PROFILE = "0267AEAF-9C47-4D68-B69E-87B0B4DA938D"; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = "0267AEAF-9C47-4D68-B69E-87B0B4DA938D"; TARGETED_DEVICE_FAMILY = 1; WRAPPER_EXTENSION = app; }; @@ -626,13 +587,15 @@ 994E295917838BF300EAACD2 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; + ASSETCATALOG_COMPILER_APPICON_NAME = MacAppIcon; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_EMPTY_BODY = YES; CODE_SIGN_IDENTITY = "Mac Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Mac Developer"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer"; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -644,7 +607,7 @@ GCC_WARN_64_TO_32_BIT_CONVERSION = YES; INFOPLIST_FILE = "GameCenterManager Mac/GameCenterManager Mac-Info.plist"; MACOSX_DEPLOYMENT_TARGET = 10.8; - ONLY_ACTIVE_ARCH = YES; + ONLY_ACTIVE_ARCH = NO; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; @@ -656,13 +619,15 @@ 994E295A17838BF300EAACD2 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + ARCHS = "$(ARCHS_STANDARD)"; + ASSETCATALOG_COMPILER_APPICON_NAME = MacAppIcon; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; CLANG_WARN_EMPTY_BODY = YES; CODE_SIGN_IDENTITY = "Mac Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Mac Developer"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer"; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( diff --git a/GameCenterManager.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/GameCenterManager.xcodeproj/project.xcworkspace/contents.xcworkspacedata old mode 100644 new mode 100755 diff --git a/GameCenterManager.xcodeproj/project.xcworkspace/xcshareddata/GameCenterManager.xccheckout b/GameCenterManager.xcodeproj/project.xcworkspace/xcshareddata/GameCenterManager.xccheckout old mode 100644 new mode 100755 diff --git a/GameCenterManager.xcodeproj/project.xcworkspace/xcuserdata/Spencers.xcuserdatad/UserInterfaceState.xcuserstate b/GameCenterManager.xcodeproj/project.xcworkspace/xcuserdata/Spencers.xcuserdatad/UserInterfaceState.xcuserstate old mode 100644 new mode 100755 index d4bbbdb..42980c3 Binary files a/GameCenterManager.xcodeproj/project.xcworkspace/xcuserdata/Spencers.xcuserdatad/UserInterfaceState.xcuserstate and b/GameCenterManager.xcodeproj/project.xcworkspace/xcuserdata/Spencers.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/GameCenterManager.xcodeproj/project.xcworkspace/xcuserdata/Spencers.xcuserdatad/WorkspaceSettings.xcsettings b/GameCenterManager.xcodeproj/project.xcworkspace/xcuserdata/Spencers.xcuserdatad/WorkspaceSettings.xcsettings old mode 100644 new mode 100755 diff --git a/GameCenterManager.xcodeproj/project.xcworkspace/xcuserdata/nihalahmed.xcuserdatad/WorkspaceSettings.xcsettings b/GameCenterManager.xcodeproj/project.xcworkspace/xcuserdata/nihalahmed.xcuserdatad/WorkspaceSettings.xcsettings old mode 100644 new mode 100755 diff --git a/GameCenterManager.xcodeproj/xcuserdata/Spencers.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/GameCenterManager.xcodeproj/xcuserdata/Spencers.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist old mode 100644 new mode 100755 diff --git a/GameCenterManager.xcodeproj/xcuserdata/Spencers.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/GameCenterManager.xcodeproj/xcuserdata/Spencers.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/GameCenterManager.xcodeproj/xcuserdata/Spencers.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/GameCenterManager.xcodeproj/xcuserdata/Spencers.xcuserdatad/xcschemes/GameCenterManager Mac.xcscheme b/GameCenterManager.xcodeproj/xcuserdata/Spencers.xcuserdatad/xcschemes/GameCenterManager Mac.xcscheme old mode 100644 new mode 100755 index 21f6c0c..40382fd --- a/GameCenterManager.xcodeproj/xcuserdata/Spencers.xcuserdatad/xcschemes/GameCenterManager Mac.xcscheme +++ b/GameCenterManager.xcodeproj/xcuserdata/Spencers.xcuserdatad/xcschemes/GameCenterManager Mac.xcscheme @@ -1,6 +1,6 @@ diff --git a/GameCenterManager/AppDelegate.m b/GameCenterManager/AppDelegate.m old mode 100644 new mode 100755 index 924661c..dc445c7 --- a/GameCenterManager/AppDelegate.m +++ b/GameCenterManager/AppDelegate.m @@ -2,19 +2,16 @@ // AppDelegate.m // GameCenterManager // -// Created by Nihal Ahmed on March 17, 2012. Edited and updated by iRare Media on April 28, 2013. -// Copyright (c) 2012 NABZ Software. All rights reserved. +// Created by iRare Media on Sepetmber 21, 2013. +// Copyright (c) 2013 iRare Media. All rights reserved. // #import "AppDelegate.h" - #import "ViewController.h" @implementation AppDelegate - @synthesize window = _window; - - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //Override point for customization after application launch. @@ -24,38 +21,33 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( return YES; } -- (void)applicationWillResignActive:(UIApplication *)application -{ +- (void)applicationWillResignActive:(UIApplication *)application { /* Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. */ } -- (void)applicationDidEnterBackground:(UIApplication *)application -{ +- (void)applicationDidEnterBackground:(UIApplication *)application { /* Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. */ } -- (void)applicationWillEnterForeground:(UIApplication *)application -{ +- (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. */ } -- (void)applicationDidBecomeActive:(UIApplication *)application -{ +- (void)applicationDidBecomeActive:(UIApplication *)application { /* Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. */ } -- (void)applicationWillTerminate:(UIApplication *)application -{ +- (void)applicationWillTerminate:(UIApplication *)application { /* Called when the application is about to terminate. Save data if appropriate. diff --git a/GameCenterManager/GC Manager/GameCenterManager.h b/GameCenterManager/GC Manager/GameCenterManager.h old mode 100644 new mode 100755 index db83ef3..25f5cc1 --- a/GameCenterManager/GC Manager/GameCenterManager.h +++ b/GameCenterManager/GC Manager/GameCenterManager.h @@ -11,6 +11,8 @@ #define LIBRARY_FOLDER [NSHomeDirectory() stringByAppendingPathComponent:@"Library"] #define kGameCenterManagerDataFile @"GameCenterManager.plist" #define kGameCenterManagerDataPath [LIBRARY_FOLDER stringByAppendingPathComponent:kGameCenterManagerDataFile] +#define __GK_USES_LEADERBOARD_ID [[GKLeaderboard alloc] respondsToSelector:@selector(leaderboardIdentifier)] == YES +#define __GK_USES_IDENTIFIER ([[GKLeaderboard alloc] respondsToSelector:@selector(identifier)]) #import #import @@ -44,18 +46,24 @@ typedef NSInteger GCMErrorCode; // Returns the shared instance of GameCenterManager. + (GameCenterManager *)sharedManager; + + /// Initializes Game Center Manager. Should be called at app launch. - (void)initGameCenter; /// Synchronizes local player data with Game Center data. - (void)syncGameCenter; + + /// Saves score locally and reports it to Game Center. If error occurs, score is saved to be submitted later. - (void)saveAndReportScore:(int)score leaderboard:(NSString *)identifier sortOrder:(GameCenterSortOrder)order; /// Saves achievement locally and reports it to Game Center. If error occurs, achievement is saved to be submitted later. - (void)saveAndReportAchievement:(NSString *)identifier percentComplete:(double)percentComplete shouldDisplayNotification:(BOOL)displayNotification; + + /// Reports scores and achievements which could not be reported earlier. - (void)reportSavedScoresAndAchievements; @@ -65,25 +73,35 @@ typedef NSInteger GCMErrorCode; /// Saves achievement to be submitted later. - (void)saveAchievementToReportLater:(NSString *)identifier percentComplete:(double)percentComplete; + + /// Returns local player's high score for specified leaderboard. - (int)highScoreForLeaderboard:(NSString *)identifier; /// Returns local player's high scores for multiple leaderboards. - (NSDictionary *)highScoreForLeaderboards:(NSArray *)identifiers; + + /// Returns local player's percent completed for specified achievement. - (double)progressForAchievement:(NSString *)identifier; /// Returns local player's percent completed for multiple achievements. - (NSDictionary *)progressForAchievements:(NSArray *)identifiers; + + /** Gets a list of challenges for the current player and game. If GameCenter is not available it will return nil and provide an error using the gameCenterManager:error: delegate method. Use the completion handler to get challenges. @param handler Completion handler with an NSArray containing challenges and an NSError. The NSError object will be nil if there is no error. */ - (void)getChallengesWithCompletion:(void (^)(NSArray *challenges, NSError *error))handler; + + /// Resets local player's achievements -- (void)resetAchievements; +- (void)resetAchievementsWithCompletion:(void (^)(NSError *error))handler; + + /// Returns currently authenticated local player ID. If no player is authenticated, "unknownPlayer" is returned. - (NSString *)localPlayerId; @@ -97,6 +115,8 @@ typedef NSInteger GCMErrorCode; /// Fetches a UIImage with the local player's profile picture at full resolution. The completion handler passes a UIImage object when the image is downloaded from the GameCenter Servers - (void)localPlayerPhoto:(void (^)(UIImage *playerPhoto))handler; + + /// Returns YES if an active internet connection is available. - (BOOL)isInternetAvailable; @@ -106,21 +126,29 @@ typedef NSInteger GCMErrorCode; /// Use this property to check if Game Center is available and supported on the current device. @property (nonatomic, assign) BOOL isGameCenterAvailable; + @end /// GameCenterManager Delegate @protocol GameCenterManagerDelegate + @required +/// Required Delegate Method called when the user needs to be authenticated using the GameCenter Login View Controller - (void)gameCenterManager:(GameCenterManager *)manager authenticateUser:(UIViewController *)gameCenterLoginController; + @optional +/// Delegate Method called when the availability of GameCenter changes - (void)gameCenterManager:(GameCenterManager *)manager availabilityChanged:(NSDictionary *)availabilityInformation; +/// Delegate Method called when the there is an error with GameCenter or GC Manager - (void)gameCenterManager:(GameCenterManager *)manager error:(NSError *)error; + - (void)gameCenterManager:(GameCenterManager *)manager reportedScore:(NSDictionary *)scoreInformation; - (void)gameCenterManager:(GameCenterManager *)manager reportedAchievement:(NSDictionary *)achievementInformation; - (void)gameCenterManager:(GameCenterManager *)manager savedScore:(GKScore *)score; - (void)gameCenterManager:(GameCenterManager *)manager savedAchievement:(NSDictionary *)achievementInformation; -- (void)gameCenterManager:(GameCenterManager *)manager resetAchievements:(NSError *)error; + +- (void)gameCenterManager:(GameCenterManager *)manager resetAchievements:(NSError *)error __deprecated; @end diff --git a/GameCenterManager/GC Manager/GameCenterManager.m b/GameCenterManager/GC Manager/GameCenterManager.m old mode 100644 new mode 100755 index 7190361..d2f9c4f --- a/GameCenterManager/GC Manager/GameCenterManager.m +++ b/GameCenterManager/GC Manager/GameCenterManager.m @@ -9,7 +9,7 @@ //------------------------------------------------------------------------------------------------------------// -//Region: GameCenter Manager Singleton -----------------------------------------------------------------------// +//------- GameCenter Manager Singleton -----------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark GameCenter Manager @@ -44,11 +44,11 @@ + (id)allocWithZone:(NSZone *)zone { } - (id)copyWithZone:(NSZone *)zone { - return self; + return self; } //------------------------------------------------------------------------------------------------------------// -//Region: GameCenter Manager Setup ---------------------------------------------------------------------------// +//------- GameCenter Manager Setup ---------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - GameCenter Manager Setup @@ -59,8 +59,8 @@ - (void)initGameCenter { [[GameCenterManager sharedManager] setIsGameCenterAvailable:YES]; if (![[NSUserDefaults standardUserDefaults] boolForKey:[@"scoresSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]] || - ![[NSUserDefaults standardUserDefaults] boolForKey:[@"achievementsSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]) { - [[GameCenterManager sharedManager] syncGameCenter]; + ![[NSUserDefaults standardUserDefaults] boolForKey:[@"achievementsSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]) { + [[GameCenterManager sharedManager] syncGameCenter]; } else { [[GameCenterManager sharedManager] reportSavedScoresAndAchievements]; } @@ -71,7 +71,7 @@ - (void)initGameCenter { } - (BOOL)checkGameCenterAvailability { - //First, check if the the GameKit Framework exists on the device. Return NO if it does not. + // First, check if the the GameKit Framework exists on the device. Return NO if it does not. BOOL localPlayerClassAvailable = (NSClassFromString(@"GKLocalPlayer")) != nil; NSString *reqSysVer = @"4.1"; NSString *currSysVer = [[UIDevice currentDevice] systemVersion]; @@ -79,26 +79,30 @@ - (BOOL)checkGameCenterAvailability { BOOL isGameCenterAPIAvailable = (localPlayerClassAvailable && osVersionSupported); if (!isGameCenterAPIAvailable) { - return NO; NSDictionary *errorDictionary = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"GameKit Framework not available on this device. GameKit is only available on devices with iOS 4.1 or higher. Some devices running iOS 4.1 may not have GameCenter enabled.", @"GameCenter Unavailable", nil] forKeys:[NSArray arrayWithObjects:@"message", @"title", nil]]; + dispatch_async(dispatch_get_main_queue(), ^{ if ([[self delegate] respondsToSelector:@selector(gameCenterManager:availabilityChanged:)]) [[self delegate] gameCenterManager:self availabilityChanged:errorDictionary]; }); + return NO; + } else { - //The GameKit Framework is available. Now check if an internet connection can be established + // The GameKit Framework is available. Now check if an internet connection can be established BOOL internetAvailable = [self isInternetAvailable]; if (!internetAvailable) { - return NO; NSDictionary *errorDictionary = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"Cannot connect to the internet. Connect to the internet to establish a connection with GameCenter. Achievements and scores will still be saved locally and then uploaded later.", @"Internet Unavailable", nil] forKeys:[NSArray arrayWithObjects:@"message", @"title", nil]]; + dispatch_async(dispatch_get_main_queue(), ^{ if ([[self delegate] respondsToSelector:@selector(gameCenterManager:availabilityChanged:)]) [[self delegate] gameCenterManager:self availabilityChanged:errorDictionary]; }); + return NO; + } else { - //The internet is available and the current device is connected. Now check if the player is authenticated + // The internet is available and the current device is connected. Now check if the player is authenticated GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; localPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error) { if (viewController != nil) { @@ -107,51 +111,64 @@ - (BOOL)checkGameCenterAvailability { if ([[self delegate] respondsToSelector:@selector(gameCenterManager:availabilityChanged:)]) [[self delegate] gameCenterManager:self availabilityChanged:errorDictionary]; - [[self delegate] gameCenterManager:self authenticateUser:viewController]; + if ([[self delegate] respondsToSelector:@selector(gameCenterManager:authenticateUser:)]) { + [[self delegate] gameCenterManager:self authenticateUser:viewController]; + } else { + NSLog(@"[ERROR] %@ Fails to Respond to the required delegate method gameCenterManager:authenticateUser:. This delegate method must be properly implemented to use GC Manager", [self delegate]); + } }); } else if (!error) { - //Authentication handler completed successfully. Re-check availability + // Authentication handler completed successfully. Re-check availability [self checkGameCenterAvailability]; } }; if (![[GKLocalPlayer localPlayer] isAuthenticated]) { NSDictionary *errorDictionary = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"Player is not signed into GameCenter, has declined to sign into GameCenter, or GameKit had an issue validating this game / app.", @"Player not Authenticated", nil] forKeys:[NSArray arrayWithObjects:@"message", @"title", nil]]; + if ([[self delegate] respondsToSelector:@selector(gameCenterManager:availabilityChanged:)]) [[self delegate] gameCenterManager:self availabilityChanged:errorDictionary]; + return NO; + } else { - //The current player is logged into GameCenter + // The current player is logged into GameCenter NSDictionary *successDictionary = [NSDictionary dictionaryWithObject:@"GameCenter Available" forKey:@"status"]; + dispatch_async(dispatch_get_main_queue(), ^{ if ([[self delegate] respondsToSelector:@selector(gameCenterManager:availabilityChanged:)]) [[self delegate] gameCenterManager:self availabilityChanged:successDictionary]; }); + self.isGameCenterAvailable = YES; + return YES; } } } } -//Check for internet with Reachability +// Check for internet with Reachability - (BOOL)isInternetAvailable { Reachability *reachability = [Reachability reachabilityForInternetConnection]; NetworkStatus internetStatus = [reachability currentReachabilityStatus]; + if (internetStatus == NotReachable) { - return NO; NSError *error = [NSError errorWithDomain:[NSString stringWithFormat:@"Internet unavailable - could not connect to the internet. Connect to WiFi or a Cellular Network to upload data to GameCenter."] code:GCMErrorInternetNotAvailable userInfo:nil]; + dispatch_async(dispatch_get_main_queue(), ^{ if ([[self delegate] respondsToSelector:@selector(gameCenterManager:error:)]) [[self delegate] gameCenterManager:self error:error]; }); + + return NO; } else { return YES; } } //------------------------------------------------------------------------------------------------------------// -//Region: GameCenter Syncing ---------------------------------------------------------------------------------// +//------- GameCenter Syncing ---------------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - GameCenter Syncing @@ -169,32 +186,85 @@ - (void)syncGameCenter { dispatch_queue_t syncGameCenterOnBackgroundThread = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0ul); dispatch_async(syncGameCenterOnBackgroundThread, ^{ - // Check if GameCenter is available - if ([[GameCenterManager sharedManager] checkGameCenterAvailability] == YES) { - // Check if Leaderboard Scores are synced - if (![[NSUserDefaults standardUserDefaults] boolForKey:[@"scoresSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]) { - if (_leaderboards == nil) { - [GKLeaderboard loadLeaderboardsWithCompletionHandler:^(NSArray *leaderboards, NSError *error) { - if (error == nil) { - _leaderboards = [[NSMutableArray alloc] initWithArray:leaderboards]; - [[GameCenterManager sharedManager] syncGameCenter]; + // Check if GameCenter is available + if ([[GameCenterManager sharedManager] checkGameCenterAvailability] == YES) { + // Check if Leaderboard Scores are synced + if (![[NSUserDefaults standardUserDefaults] boolForKey:[@"scoresSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]) { + if (_leaderboards == nil) { + [GKLeaderboard loadLeaderboardsWithCompletionHandler:^(NSArray *leaderboards, NSError *error) { + if (error == nil) { + _leaderboards = [[NSMutableArray alloc] initWithArray:leaderboards]; + [[GameCenterManager sharedManager] syncGameCenter]; + } else { + dispatch_async(dispatch_get_main_queue(), ^{ + if ([[self delegate] respondsToSelector:@selector(gameCenterManager:error:)]) + [[self delegate] gameCenterManager:self error:error]; + }); + } + }]; + return; + } + + + if (_leaderboards.count > 0) { + GKLeaderboard *leaderboardRequest = [[GKLeaderboard alloc] initWithPlayerIDs:[NSArray arrayWithObject:[[GameCenterManager sharedManager] localPlayerId]]]; + + if ([[GKLeaderboard alloc] respondsToSelector:@selector(identifier)]) { + [leaderboardRequest setIdentifier:[(GKLeaderboard *)[_leaderboards objectAtIndex:0] identifier]]; } else { - dispatch_async(dispatch_get_main_queue(), ^{ - if ([[self delegate] respondsToSelector:@selector(gameCenterManager:error:)]) - [[self delegate] gameCenterManager:self error:error]; - }); + [leaderboardRequest setCategory:[(GKLeaderboard *)[_leaderboards objectAtIndex:0] category]]; } - }]; - return; - } - - - if (_leaderboards.count > 0) { - GKLeaderboard *leaderboardRequest = [[GKLeaderboard alloc] initWithPlayerIDs:[NSArray arrayWithObject:[[GameCenterManager sharedManager] localPlayerId]]]; - [leaderboardRequest setCategory:[(GKLeaderboard *)[_leaderboards objectAtIndex:0] category]]; - [leaderboardRequest loadScoresWithCompletionHandler:^(NSArray *scores, NSError *error) { + + [leaderboardRequest loadScoresWithCompletionHandler:^(NSArray *scores, NSError *error) { + if (error == nil) { + if (scores.count > 0) { + NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; + NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; + NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; + + if (playerDict == nil) { + playerDict = [NSMutableDictionary dictionary]; + } + + float savedHighScoreValue = 0; + NSNumber *savedHighScore = [playerDict objectForKey:leaderboardRequest.localPlayerScore.category]; + + if (savedHighScore != nil) { + savedHighScoreValue = [savedHighScore intValue]; + } + + [playerDict setObject:[NSNumber numberWithInt:MAX(leaderboardRequest.localPlayerScore.value, savedHighScoreValue)] forKey:leaderboardRequest.localPlayerScore.category]; + [plistDict setObject:playerDict forKey:[[GameCenterManager sharedManager] localPlayerId]]; + NSData *saveData = [[NSKeyedArchiver archivedDataWithRootObject:plistDict] encryptedWithKey:kGameCenterManagerKey]; + [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; + } + + // Seeing an NSRangeException for an empty array when trying to remove the object + // Despite the check above in this scope that leaderboards count is > 0 + if (_leaderboards.count > 0) { + [_leaderboards removeObjectAtIndex:0]; + } + + [[GameCenterManager sharedManager] syncGameCenter]; + } else { + dispatch_async(dispatch_get_main_queue(), ^{ + if ([[self delegate] respondsToSelector:@selector(gameCenterManager:error:)]) + [[self delegate] gameCenterManager:self error:error]; + }); + } + }]; + } else { + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:[@"scoresSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]; + [[GameCenterManager sharedManager] syncGameCenter]; + } + + + // Check if Achievements are synced + } else if (![[NSUserDefaults standardUserDefaults] boolForKey:[@"achievementsSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]) { + [GKAchievement loadAchievementsWithCompletionHandler:^(NSArray *achievements, NSError *error) { if (error == nil) { - if (scores.count > 0) { + NSLog(@"Number of Achievements: %@", achievements); + if (achievements.count > 0) { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; @@ -203,25 +273,17 @@ - (void)syncGameCenter { playerDict = [NSMutableDictionary dictionary]; } - int savedHighScoreValue = 0; - NSNumber *savedHighScore = [playerDict objectForKey:leaderboardRequest.localPlayerScore.category]; - - if (savedHighScore != nil) { - savedHighScoreValue = [savedHighScore intValue]; + for (GKAchievement *achievement in achievements) { + [playerDict setObject:[NSNumber numberWithDouble:achievement.percentComplete] forKey:achievement.identifier]; } - [playerDict setObject:[NSNumber numberWithInt:MAX(leaderboardRequest.localPlayerScore.value, savedHighScoreValue)] forKey:leaderboardRequest.localPlayerScore.category]; [plistDict setObject:playerDict forKey:[[GameCenterManager sharedManager] localPlayerId]]; NSData *saveData = [[NSKeyedArchiver archivedDataWithRootObject:plistDict] encryptedWithKey:kGameCenterManagerKey]; [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; + } - // Seeing an NSRangeException for an empty array when trying to remove the object - // Despite the check above in this scope that leaderboards count is > 0 - if (_leaderboards.count > 0) { - [_leaderboards removeObjectAtIndex:0]; - } - + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:[@"achievementsSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]; [[GameCenterManager sharedManager] syncGameCenter]; } else { dispatch_async(dispatch_get_main_queue(), ^{ @@ -230,61 +292,22 @@ - (void)syncGameCenter { }); } }]; - } else { - [[NSUserDefaults standardUserDefaults] setBool:YES forKey:[@"scoresSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]; - [[GameCenterManager sharedManager] syncGameCenter]; } - - - // Check if Achievements are synced - } else if (![[NSUserDefaults standardUserDefaults] boolForKey:[@"achievementsSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]) { - [GKAchievement loadAchievementsWithCompletionHandler:^(NSArray *achievements, NSError *error) { - if (error == nil) { - NSLog(@"Number of Achievements: %@", achievements); - if (achievements.count > 0) { - NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; - NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; - NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; - - if (playerDict == nil) { - playerDict = [NSMutableDictionary dictionary]; - } - - for (GKAchievement *achievement in achievements) { - [playerDict setObject:[NSNumber numberWithDouble:achievement.percentComplete] forKey:achievement.identifier]; - } - - [plistDict setObject:playerDict forKey:[[GameCenterManager sharedManager] localPlayerId]]; - NSData *saveData = [[NSKeyedArchiver archivedDataWithRootObject:plistDict] encryptedWithKey:kGameCenterManagerKey]; - [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; - - } - - [[NSUserDefaults standardUserDefaults] setBool:YES forKey:[@"achievementsSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]; - [[GameCenterManager sharedManager] syncGameCenter]; - } else { - dispatch_async(dispatch_get_main_queue(), ^{ - if ([[self delegate] respondsToSelector:@selector(gameCenterManager:error:)]) - [[self delegate] gameCenterManager:self error:error]; - }); - } - }]; + } else { + NSError *error = [NSError errorWithDomain:[NSString stringWithFormat:@"GameCenter unavailable."] code:GCMErrorNotAvailable userInfo:nil]; + dispatch_async(dispatch_get_main_queue(), ^{ + if ([[self delegate] respondsToSelector:@selector(gameCenterManager:error:)]) + [[self delegate] gameCenterManager:self error:error]; + }); } - } else { - NSError *error = [NSError errorWithDomain:[NSString stringWithFormat:@"GameCenter unavailable."] code:GCMErrorNotAvailable userInfo:nil]; - dispatch_async(dispatch_get_main_queue(), ^{ - if ([[self delegate] respondsToSelector:@selector(gameCenterManager:error:)]) - [[self delegate] gameCenterManager:self error:error]; - }); - } }); - //End the Background Process + // End the Background Process [[UIApplication sharedApplication] endBackgroundTask:backgroundProcess]; backgroundProcess = UIBackgroundTaskInvalid; } -//Report data when the internet is available again +// Report data when the internet is available again - (void)reportSavedScoresAndAchievements { if ([[GameCenterManager sharedManager] isInternetAvailable]) { GKScore *gkScore = nil; @@ -292,11 +315,14 @@ - (void)reportSavedScoresAndAchievements { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableArray *savedScores = [plistDict objectForKey:@"SavedScores"]; + if (savedScores != nil) { if (savedScores.count > 0) { gkScore = [NSKeyedUnarchiver unarchiveObjectWithData:[savedScores objectAtIndex:0]]; + [savedScores removeObjectAtIndex:0]; [plistDict setObject:savedScores forKey:@"SavedScores"]; + NSData *saveData = [[NSKeyedArchiver archivedDataWithRootObject:plistDict] encryptedWithKey:kGameCenterManagerKey]; [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; } @@ -306,8 +332,7 @@ - (void)reportSavedScoresAndAchievements { [gkScore reportScoreWithCompletionHandler:^(NSError *error) { if (error == nil) { [[GameCenterManager sharedManager] reportSavedScoresAndAchievements]; - } - else { + } else { [[GameCenterManager sharedManager] saveScoreToReportLater:gkScore]; } }]; @@ -319,15 +344,18 @@ - (void)reportSavedScoresAndAchievements { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; + if (playerDict != nil) { NSMutableDictionary *savedAchievements = [playerDict objectForKey:@"SavedAchievements"]; if (savedAchievements != nil) { if (savedAchievements.count > 0) { identifier = [[savedAchievements allKeys] objectAtIndex:0]; percentComplete = [[savedAchievements objectForKey:identifier] doubleValue]; + [savedAchievements removeObjectForKey:identifier]; [playerDict setObject:savedAchievements forKey:@"SavedAchievements"]; [plistDict setObject:playerDict forKey:[[GameCenterManager sharedManager] localPlayerId]]; + NSData *saveData = [[NSKeyedArchiver archivedDataWithRootObject:plistDict] encryptedWithKey:kGameCenterManagerKey]; [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; } @@ -340,11 +368,11 @@ - (void)reportSavedScoresAndAchievements { [achievement reportAchievementWithCompletionHandler:^(NSError *error) { if (error == nil) { [[GameCenterManager sharedManager] reportSavedScoresAndAchievements]; - } - else { + } else { [[GameCenterManager sharedManager] saveAchievementToReportLater:achievement.identifier percentComplete:achievement.percentComplete]; } }]; + } } } @@ -353,11 +381,11 @@ - (void)reportSavedScoresAndAchievements { //------------------------------------------------------------------------------------------------------------// -//Region: Score and Achievement Reporting --------------------------------------------------------------------// +//------- Score and Achievement Reporting --------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - Score and Achievement Reporting -//Save score and report it to GameCenter +// Save score and report it to GameCenter - (void)saveAndReportScore:(int)score leaderboard:(NSString *)identifier sortOrder:(GameCenterSortOrder)order { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; @@ -397,12 +425,12 @@ - (void)saveAndReportScore:(int)score leaderboard:(NSString *)identifier sortOrd } if ([[GameCenterManager sharedManager] checkGameCenterAvailability] == YES) { - GKScore *gkScore = [[GKScore alloc] initWithCategory:identifier]; - gkScore.value = score; + GKScore *gkScore = [[GKScore alloc] initWithCategory:identifier]; + gkScore.value = score; [gkScore reportScoreWithCompletionHandler:^(NSError *error) { NSDictionary *dict = nil; - + if (error == nil) { dict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:gkScore, nil] forKeys:[NSArray arrayWithObjects:@"score", nil]]; } else { @@ -415,13 +443,14 @@ - (void)saveAndReportScore:(int)score leaderboard:(NSString *)identifier sortOrd [[self delegate] gameCenterManager:self reportedScore:dict]; }); }]; + } else { GKScore *gkScore = [[GKScore alloc] initWithCategory:identifier]; [[GameCenterManager sharedManager] saveScoreToReportLater:gkScore]; } } -//Save achievement and report it to GameCenter +// Save achievement and report it to GameCenter - (void)saveAndReportAchievement:(NSString *)identifier percentComplete:(double)percentComplete shouldDisplayNotification:(BOOL)displayNotification { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; @@ -476,17 +505,20 @@ - (void)saveAndReportAchievement:(NSString *)identifier percentComplete:(double) } } -//Save score to report later +// Save score to report later - (void)saveScoreToReportLater:(GKScore *)score { NSData *scoreData = [NSKeyedArchiver archivedDataWithRootObject:score]; NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; + NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableArray *savedScores = [plistDict objectForKey:@"SavedScores"]; + if (savedScores != nil) { [savedScores addObject:scoreData]; } else { savedScores = [NSMutableArray arrayWithObject:scoreData]; } + [plistDict setObject:savedScores forKey:@"SavedScores"]; NSData *saveData = [[NSKeyedArchiver archivedDataWithRootObject:plistDict] encryptedWithKey:kGameCenterManagerKey]; [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; @@ -501,16 +533,22 @@ - (void)saveAchievementToReportLater:(NSString *)identifier percentComplete:(dou NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; + if (playerDict != nil) { NSMutableDictionary *savedAchievements = [playerDict objectForKey:@"SavedAchievements"]; if (savedAchievements != nil) { double savedPercentCompleteValue = 0; NSNumber *savedPercentComplete = [savedAchievements objectForKey:identifier]; + if (savedPercentComplete != nil) { savedPercentCompleteValue = [savedPercentComplete doubleValue]; } - savedPercentComplete = [NSNumber numberWithDouble:percentComplete + savedPercentCompleteValue]; - [savedAchievements setObject:savedPercentComplete forKey:identifier]; + + // Compare the saved percent and the percent that was just submitted, if the submitted percent is greater save it + if (percentComplete > savedPercentCompleteValue) { + savedPercentComplete = [NSNumber numberWithDouble:percentComplete]; + [savedAchievements setObject:savedPercentComplete forKey:identifier]; + } } else { savedAchievements = [NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithDouble:percentComplete], identifier, nil]; [playerDict setObject:savedAchievements forKey:@"SavedAchievements"]; @@ -519,20 +557,23 @@ - (void)saveAchievementToReportLater:(NSString *)identifier percentComplete:(dou NSMutableDictionary *savedAchievements = [NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithDouble:percentComplete], identifier, nil]; playerDict = [NSMutableDictionary dictionaryWithObjectsAndKeys:savedAchievements, @"SavedAchievements", nil]; } + [plistDict setObject:playerDict forKey:[[GameCenterManager sharedManager] localPlayerId]]; NSData *saveData = [[NSKeyedArchiver archivedDataWithRootObject:plistDict] encryptedWithKey:kGameCenterManagerKey]; [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; GKAchievement *achievement = [[GKAchievement alloc] initWithIdentifier:identifier]; NSNumber *percentNumber = [NSNumber numberWithDouble:percentComplete]; + if (percentNumber && achievement) { dispatch_async(dispatch_get_main_queue(), ^{ if ([[self delegate] respondsToSelector:@selector(gameCenterManager:savedAchievement:)]) [[self delegate] gameCenterManager:self savedAchievement:[NSDictionary dictionaryWithObjects:@[achievement, percentNumber] forKeys:@[@"achievement", @"percent complete"]]]; }); } else { - NSError *error = [NSError errorWithDomain:[NSString stringWithFormat:@"Could not save achievement because necessary data is missing. GameCenter needs an Achievement ID and Percent Completed to save the achievement. You provided the following data:\nAchievement: %@\nPercent Completed:%@", achievement, percentNumber] - code:GCMErrorAchievementDataMissing userInfo:nil]; + NSError *error = [NSError errorWithDomain:[NSString stringWithFormat:@"Could not save achievement because necessary data is missing. GameCenter needs an Achievement ID and Percent Completed to save the achievement. You provided the following data:\nAchievement: %@\nPercent Completed:%@", achievement, percentNumber] + code:GCMErrorAchievementDataMissing userInfo:nil]; + dispatch_async(dispatch_get_main_queue(), ^{ if ([[self delegate] respondsToSelector:@selector(gameCenterManager:error:)]) [[self delegate] gameCenterManager:self error:error]; @@ -541,7 +582,7 @@ - (void)saveAchievementToReportLater:(NSString *)identifier percentComplete:(dou } //------------------------------------------------------------------------------------------------------------// -//Region: Score, Achievement, and Challenge Retrieval --------------------------------------------------------// +//------- Score, Achievement, and Challenge Retrieval --------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - Score, Achievement, and Challenge Retrieval @@ -549,6 +590,7 @@ - (int)highScoreForLeaderboard:(NSString *)identifier { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; + if (playerDict != nil) { NSNumber *savedHighScore = [playerDict objectForKey:identifier]; if (savedHighScore != nil) { @@ -561,15 +603,17 @@ - (int)highScoreForLeaderboard:(NSString *)identifier { } } -//Get leaderboard high scores +// Get leaderboard high scores - (NSDictionary *)highScoreForLeaderboards:(NSArray *)identifiers { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; NSMutableDictionary *highScores = [[NSMutableDictionary alloc] initWithCapacity:identifiers.count]; - for(NSString *identifier in identifiers) { + + for (NSString *identifier in identifiers) { if (playerDict != nil) { NSNumber *savedHighScore = [playerDict objectForKey:identifier]; + if (savedHighScore != nil) { [highScores setObject:[NSNumber numberWithInt:[savedHighScore intValue]] forKey:identifier]; continue; @@ -584,13 +628,15 @@ - (NSDictionary *)highScoreForLeaderboards:(NSArray *)identifiers { return highScoreDict; } -//Get achievement progress +// Get achievement progress - (double)progressForAchievement:(NSString *)identifier { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; + if (playerDict != nil) { NSNumber *savedPercentComplete = [playerDict objectForKey:identifier]; + if (savedPercentComplete != nil) { return [savedPercentComplete doubleValue]; } @@ -598,20 +644,23 @@ - (double)progressForAchievement:(NSString *)identifier { return 0; } -//Returns local player's percent completed for multiple achievements. +// Returns local player's percent completed for multiple achievements. - (NSDictionary *)progressForAchievements:(NSArray *)identifiers { NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; NSMutableDictionary *playerDict = [plistDict objectForKey:[[GameCenterManager sharedManager] localPlayerId]]; NSMutableDictionary *percent = [[NSMutableDictionary alloc] initWithCapacity:identifiers.count]; - for(NSString *identifier in identifiers) { + + for (NSString *identifier in identifiers) { if (playerDict != nil) { NSNumber *savedPercentComplete = [playerDict objectForKey:identifier]; + if (savedPercentComplete != nil) { [percent setObject:[NSNumber numberWithDouble:[savedPercentComplete doubleValue]] forKey:identifier]; continue; } } + [percent setObject:[NSNumber numberWithDouble:0] forKey:identifier]; } @@ -620,10 +669,11 @@ - (NSDictionary *)progressForAchievements:(NSArray *)identifiers { return percentDict; } -//Returns local player's challenges for this game +// Returns local player's challenges for this game - (void)getChallengesWithCompletion:(void (^)(NSArray *challenges, NSError *error))handler { if ([[GameCenterManager sharedManager] checkGameCenterAvailability] == YES) { BOOL isGameCenterChallengeAPIAvailable = (NSClassFromString(@"GKChallenge")) != nil; + if (isGameCenterChallengeAPIAvailable == YES) { [GKChallenge loadReceivedChallengesWithCompletionHandler:^(NSArray *challenges, NSError *error) { if (error == nil) { @@ -631,7 +681,7 @@ - (void)getChallengesWithCompletion:(void (^)(NSArray *challenges, NSError *erro } else { handler(nil, error); } - }]; + }]; } else { NSError *error = [NSError errorWithDomain:[NSString stringWithFormat:@"GKChallenge Class is not available. GKChallenge is only available on iOS 6.0 and higher. Current iOS version: %@", [[UIDevice currentDevice] systemVersion]] code:GCMErrorFeatureNotAvailable userInfo:nil]; if ([[self delegate] respondsToSelector:@selector(gameCenterManager:error:)]) @@ -645,16 +695,12 @@ - (void)getChallengesWithCompletion:(void (^)(NSArray *challenges, NSError *erro } //------------------------------------------------------------------------------------------------------------// -//Region: Resetting Data -------------------------------------------------------------------------------------// +//------- Resetting Data -------------------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - Resetting Data -//Reset all achievements and progress -- (void)resetAchievements { - NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; - NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; - NSLog(@"PLIST: %@", plistDict); - +// Reset all achievements and progress +- (void)resetAchievementsWithCompletion:(void (^)(NSError *))handler { if ([[GameCenterManager sharedManager] isGameCenterAvailable]) { [GKAchievement loadAchievementsWithCompletionHandler:^(NSArray *achievements, NSError *error) { if (error == nil) { @@ -668,9 +714,6 @@ - (void)resetAchievements { for (GKAchievement *achievement in achievements) { [playerDict removeObjectForKey:achievement.identifier]; - NSData *gameCenterManagerData = [[NSData dataWithContentsOfFile:kGameCenterManagerDataPath] decryptedWithKey:kGameCenterManagerKey]; - NSMutableDictionary *plistDict = [NSKeyedUnarchiver unarchiveObjectWithData:gameCenterManagerData]; - NSLog(@"PLIST: %@", plistDict); } [plistDict setObject:playerDict forKey:[[GameCenterManager sharedManager] localPlayerId]]; @@ -678,26 +721,36 @@ - (void)resetAchievements { [saveData writeToFile:kGameCenterManagerDataPath atomically:YES]; [GKAchievement resetAchievementsWithCompletionHandler:^(NSError *error) { - [[NSUserDefaults standardUserDefaults] setBool:NO forKey:[@"achievementsSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]; - [[NSUserDefaults standardUserDefaults] synchronize]; - - [[GameCenterManager sharedManager] syncGameCenter]; - dispatch_async(dispatch_get_main_queue(), ^{ + if (error == nil) { + [[NSUserDefaults standardUserDefaults] setBool:NO forKey:[@"achievementsSynced" stringByAppendingString:[[GameCenterManager sharedManager] localPlayerId]]]; + [[NSUserDefaults standardUserDefaults] synchronize]; + [self syncGameCenter]; - if ([[self delegate] respondsToSelector:@selector(gameCenterManager:resetAchievements:)]) - [[self delegate] gameCenterManager:self resetAchievements:error]; - }); + + dispatch_async(dispatch_get_main_queue(), ^{ + handler(nil); + }); + } else { + dispatch_async(dispatch_get_main_queue(), ^{ + handler(error); + }); + } }]; + } else { + dispatch_async(dispatch_get_main_queue(), ^{ + handler(error); + }); } }]; } } //------------------------------------------------------------------------------------------------------------// -//Region: Player Data ----------------------------------------------------------------------------------------// +//------- Player Data ----------------------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - Player Data +// Checks if player is authenticated and gets his / her ID - (NSString *)localPlayerId { if ([[GameCenterManager sharedManager] isGameCenterAvailable]) { if ([GKLocalPlayer localPlayer].authenticated) { @@ -707,36 +760,31 @@ - (NSString *)localPlayerId { return @"unknownPlayer"; } +// Returns the local player's display name - (NSString *)localPlayerDisplayName { - if ([[GameCenterManager sharedManager] isGameCenterAvailable]) { - BOOL osVersionSupported = ([[[UIDevice currentDevice] systemVersion] compare:@"6.0" options:NSNumericSearch] != NSOrderedAscending); - if (osVersionSupported == YES) { - if ([GKLocalPlayer localPlayer].authenticated) { + if ([[GameCenterManager sharedManager] isGameCenterAvailable] && [GKLocalPlayer localPlayer].authenticated) { + if ([[GKLocalPlayer localPlayer] respondsToSelector:@selector(displayName)]) { return [GKLocalPlayer localPlayer].displayName; - } } else { - if ([GKLocalPlayer localPlayer].authenticated) { return [GKLocalPlayer localPlayer].alias; - } } } + return @"unknownPlayer"; } +// Checks if player is authenticated and gets his / her ID - (GKLocalPlayer *)localPlayerData { - if ([[GameCenterManager sharedManager] isGameCenterAvailable]) { - if ([GKLocalPlayer localPlayer].authenticated) { + if ([[GameCenterManager sharedManager] isGameCenterAvailable] && [GKLocalPlayer localPlayer].authenticated) { return [GKLocalPlayer localPlayer]; - } + } else { + return nil; } - - return nil; } - (void)localPlayerPhoto:(void (^)(UIImage *playerPhoto))handler { if ([[GameCenterManager sharedManager] isGameCenterAvailable]) { - BOOL osVersionSupported = ([[[UIDevice currentDevice] systemVersion] compare:@"5.0" options:NSNumericSearch] != NSOrderedAscending); - if (osVersionSupported == YES) { + if ([GKPlayer respondsToSelector:@selector(loadPhotoForSize:withCompletionHandler:)]) { [[self localPlayerData] loadPhotoForSize:GKPhotoSizeNormal withCompletionHandler:^(UIImage *photo, NSError *error) { handler(photo); if (error) { diff --git a/GameCenterManager/GC Manager/NSDataAES256.h b/GameCenterManager/GC Manager/NSDataAES256.h old mode 100644 new mode 100755 diff --git a/GameCenterManager/GC Manager/NSDataAES256.m b/GameCenterManager/GC Manager/NSDataAES256.m old mode 100644 new mode 100755 diff --git a/GameCenterManager/GameCenterManager-Info.plist b/GameCenterManager/GameCenterManager-Info.plist old mode 100644 new mode 100755 index 4b5a25e..bc2d119 --- a/GameCenterManager/GameCenterManager-Info.plist +++ b/GameCenterManager/GameCenterManager-Info.plist @@ -16,20 +16,9 @@ iPadIcon@2x.png CFBundleIcons - - CFBundlePrimaryIcon - - CFBundleIconFiles - - Icon.png - Icon@2x.png - iPadIcon.png - iPadIcon@2x.png - - UIPrerenderedIcon - - - + + CFBundleIcons~ipad + CFBundleIdentifier com.iRare-Media.GameCenterManager CFBundleInfoDictionaryVersion @@ -39,11 +28,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 5.0 + 5.1 CFBundleSignature ???? CFBundleVersion - 5.0 + 5.1 LSRequiresIPhoneOS UIMainStoryboardFile diff --git a/GameCenterManager/GameCenterManager-Prefix.pch b/GameCenterManager/GameCenterManager-Prefix.pch old mode 100644 new mode 100755 diff --git a/GameCenterManager/Icons/AppIcon29x29.png b/GameCenterManager/Icons/AppIcon29x29.png new file mode 100755 index 0000000..8098537 Binary files /dev/null and b/GameCenterManager/Icons/AppIcon29x29.png differ diff --git a/GameCenterManager/Icons/AppIcon29x29@2x.png b/GameCenterManager/Icons/AppIcon29x29@2x.png new file mode 100755 index 0000000..8dc8f6d Binary files /dev/null and b/GameCenterManager/Icons/AppIcon29x29@2x.png differ diff --git a/GameCenterManager/Icons/AppIcon40x40.png b/GameCenterManager/Icons/AppIcon40x40.png new file mode 100755 index 0000000..2b2c912 Binary files /dev/null and b/GameCenterManager/Icons/AppIcon40x40.png differ diff --git a/GameCenterManager/Icons/AppIcon40x40@2x.png b/GameCenterManager/Icons/AppIcon40x40@2x.png new file mode 100755 index 0000000..065cb21 Binary files /dev/null and b/GameCenterManager/Icons/AppIcon40x40@2x.png differ diff --git a/GameCenterManager/Icons/AppIcon57x57.png b/GameCenterManager/Icons/AppIcon57x57.png new file mode 100755 index 0000000..910d9ba Binary files /dev/null and b/GameCenterManager/Icons/AppIcon57x57.png differ diff --git a/GameCenterManager/Icons/AppIcon60x60.png b/GameCenterManager/Icons/AppIcon60x60.png new file mode 100755 index 0000000..bf33247 Binary files /dev/null and b/GameCenterManager/Icons/AppIcon60x60.png differ diff --git a/GameCenterManager/Icons/AppIcon60x60@2x.png b/GameCenterManager/Icons/AppIcon60x60@2x.png new file mode 100755 index 0000000..fc1e05c Binary files /dev/null and b/GameCenterManager/Icons/AppIcon60x60@2x.png differ diff --git a/GameCenterManager/Icons/AppIcon76x76.png b/GameCenterManager/Icons/AppIcon76x76.png new file mode 100755 index 0000000..8b09399 Binary files /dev/null and b/GameCenterManager/Icons/AppIcon76x76.png differ diff --git a/GameCenterManager/Icons/AppIcon76x76@2x.png b/GameCenterManager/Icons/AppIcon76x76@2x.png new file mode 100755 index 0000000..7d05a92 Binary files /dev/null and b/GameCenterManager/Icons/AppIcon76x76@2x.png differ diff --git a/GameCenterManager/Icons/iTunesArtwork.png b/GameCenterManager/Icons/iTunesArtwork.png new file mode 100755 index 0000000..2c64dcb Binary files /dev/null and b/GameCenterManager/Icons/iTunesArtwork.png differ diff --git a/GameCenterManager/Images.xcassets/AppIcon.appiconset/AppIcon29x29.png b/GameCenterManager/Images.xcassets/AppIcon.appiconset/AppIcon29x29.png new file mode 100755 index 0000000..8098537 Binary files /dev/null and b/GameCenterManager/Images.xcassets/AppIcon.appiconset/AppIcon29x29.png differ diff --git a/GameCenterManager/Images.xcassets/AppIcon.appiconset/AppIcon29x29@2x.png b/GameCenterManager/Images.xcassets/AppIcon.appiconset/AppIcon29x29@2x.png new file mode 100755 index 0000000..8dc8f6d Binary files /dev/null and b/GameCenterManager/Images.xcassets/AppIcon.appiconset/AppIcon29x29@2x.png differ diff --git a/GameCenterManager/Images.xcassets/AppIcon.appiconset/AppIcon40x40@2x.png b/GameCenterManager/Images.xcassets/AppIcon.appiconset/AppIcon40x40@2x.png new file mode 100755 index 0000000..065cb21 Binary files /dev/null and b/GameCenterManager/Images.xcassets/AppIcon.appiconset/AppIcon40x40@2x.png differ diff --git a/GameCenterManager/Images.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png b/GameCenterManager/Images.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png new file mode 100755 index 0000000..fc1e05c Binary files /dev/null and b/GameCenterManager/Images.xcassets/AppIcon.appiconset/AppIcon60x60@2x.png differ diff --git a/GameCenterManager/Images.xcassets/AppIcon.appiconset/Contents.json b/GameCenterManager/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..051d91f --- /dev/null +++ b/GameCenterManager/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,44 @@ +{ + "images" : [ + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "AppIcon29x29.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "AppIcon29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "AppIcon40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "Icon.png", + "scale" : "1x" + }, + { + "size" : "57x57", + "idiom" : "iphone", + "filename" : "Icon@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "AppIcon60x60@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Icon.png b/GameCenterManager/Images.xcassets/AppIcon.appiconset/Icon.png old mode 100644 new mode 100755 similarity index 100% rename from Icon.png rename to GameCenterManager/Images.xcassets/AppIcon.appiconset/Icon.png diff --git a/Icon@2x.png b/GameCenterManager/Images.xcassets/AppIcon.appiconset/Icon@2x.png old mode 100644 new mode 100755 similarity index 100% rename from Icon@2x.png rename to GameCenterManager/Images.xcassets/AppIcon.appiconset/Icon@2x.png diff --git a/GameCenterManager/Images.xcassets/LaunchImage.launchimage/Contents.json b/GameCenterManager/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100755 index 0000000..ce5e4a3 --- /dev/null +++ b/GameCenterManager/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,42 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "Default@2x.png", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "Default-568h@2x.png", + "minimum-system-version" : "7.0", + "subtype" : "retina4", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "Default.png", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "Default@2x.png", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "filename" : "Default-568h@2x.png", + "subtype" : "retina4", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GameCenterManager/Images/Default-568h@2x.png b/GameCenterManager/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png old mode 100644 new mode 100755 similarity index 100% rename from GameCenterManager/Images/Default-568h@2x.png rename to GameCenterManager/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png diff --git a/GameCenterManager/Images/Default.png b/GameCenterManager/Images.xcassets/LaunchImage.launchimage/Default.png old mode 100644 new mode 100755 similarity index 100% rename from GameCenterManager/Images/Default.png rename to GameCenterManager/Images.xcassets/LaunchImage.launchimage/Default.png diff --git a/GameCenterManager/Images/Default@2x.png b/GameCenterManager/Images.xcassets/LaunchImage.launchimage/Default@2x.png old mode 100644 new mode 100755 similarity index 100% rename from GameCenterManager/Images/Default@2x.png rename to GameCenterManager/Images.xcassets/LaunchImage.launchimage/Default@2x.png diff --git a/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/Contents.json b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/Contents.json new file mode 100755 index 0000000..366bee5 --- /dev/null +++ b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "GK Icon-16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "GK Icon-16@2x.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "GK Icon-32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "GK Icon-32@2x.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "GK Icon-128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "GK Icon-128@2x.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "GK Icon-256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "GK Icon-256@2x.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "GK Icon-512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "GK Icon-512@2x.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-128.png b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-128.png new file mode 100755 index 0000000..dd9c0a5 Binary files /dev/null and b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-128.png differ diff --git a/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-128@2x.png b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-128@2x.png new file mode 100755 index 0000000..4ba7634 Binary files /dev/null and b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-128@2x.png differ diff --git a/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-16.png b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-16.png new file mode 100755 index 0000000..1cdaff9 Binary files /dev/null and b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-16.png differ diff --git a/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-16@2x.png b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-16@2x.png new file mode 100755 index 0000000..ddceb65 Binary files /dev/null and b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-16@2x.png differ diff --git a/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-256.png b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-256.png new file mode 100755 index 0000000..4ba7634 Binary files /dev/null and b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-256.png differ diff --git a/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-256@2x.png b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-256@2x.png new file mode 100755 index 0000000..84a5ebe Binary files /dev/null and b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-256@2x.png differ diff --git a/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-32.png b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-32.png new file mode 100755 index 0000000..ddceb65 Binary files /dev/null and b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-32.png differ diff --git a/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-32@2x.png b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-32@2x.png new file mode 100755 index 0000000..adad812 Binary files /dev/null and b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-32@2x.png differ diff --git a/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-512.png b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-512.png new file mode 100755 index 0000000..84a5ebe Binary files /dev/null and b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-512.png differ diff --git a/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-512@2x.png b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-512@2x.png new file mode 100755 index 0000000..2a4d561 Binary files /dev/null and b/GameCenterManager/Images.xcassets/MacAppIcon.appiconset/GK Icon-512@2x.png differ diff --git a/GameCenterManager/Images/Content.png b/GameCenterManager/Images/Content.png deleted file mode 100644 index 5d46b9b..0000000 Binary files a/GameCenterManager/Images/Content.png and /dev/null differ diff --git a/GameCenterManager/Images/Content@2x.png b/GameCenterManager/Images/Content@2x.png deleted file mode 100644 index c152084..0000000 Binary files a/GameCenterManager/Images/Content@2x.png and /dev/null differ diff --git a/GameCenterManager/Images/Felt-568h@2x.png b/GameCenterManager/Images/Felt-568h@2x.png deleted file mode 100644 index 0e60c58..0000000 Binary files a/GameCenterManager/Images/Felt-568h@2x.png and /dev/null differ diff --git a/GameCenterManager/Images/Felt.png b/GameCenterManager/Images/Felt.png deleted file mode 100644 index 1a486d2..0000000 Binary files a/GameCenterManager/Images/Felt.png and /dev/null differ diff --git a/GameCenterManager/Images/Felt@2x.png b/GameCenterManager/Images/Felt@2x.png deleted file mode 100644 index 7272a96..0000000 Binary files a/GameCenterManager/Images/Felt@2x.png and /dev/null differ diff --git a/GameCenterManager/Images/GCBar.png b/GameCenterManager/Images/GCBar.png deleted file mode 100644 index 0ebe54e..0000000 Binary files a/GameCenterManager/Images/GCBar.png and /dev/null differ diff --git a/GameCenterManager/Images/Header@2x.png b/GameCenterManager/Images/Header@2x.png deleted file mode 100644 index 822299a..0000000 Binary files a/GameCenterManager/Images/Header@2x.png and /dev/null differ diff --git a/GameCenterManager/ViewController.h b/GameCenterManager/ViewController.h old mode 100644 new mode 100755 index f3e3964..57780ab --- a/GameCenterManager/ViewController.h +++ b/GameCenterManager/ViewController.h @@ -2,20 +2,18 @@ // ViewController.h // GameCenterManager // -// Created by Nihal Ahmed on March 17, 2012. Edited and updated by iRare Media on April 28, 2013. -// Copyright (c) 2012 NABZ Software. All rights reserved. +// Created by iRare Media on Sepetmber 21, 2013. +// Copyright (c) 2013 iRare Media. All rights reserved. // #import #import "GameCenterManager.h" -@interface ViewController : UIViewController +@interface ViewController : UIViewController -@property (nonatomic, strong) IBOutlet UILabel *statusLabel; -@property (weak, nonatomic) IBOutlet UILabel *statusDetailLabel; +@property (strong, nonatomic) IBOutlet UILabel *statusDetailLabel; @property (weak, nonatomic) IBOutlet UILabel *actionLabel; -@property (weak, nonatomic) IBOutlet UIToolbar *toolBar; -@property (weak, nonatomic) IBOutlet UIImageView *header; +@property (weak, nonatomic) IBOutlet UIBarButtonItem *actionBarLabel; @property (weak, nonatomic) IBOutlet UIScrollView *scrollView; @property (strong, nonatomic) IBOutlet UIImageView *playerPicture; @property (weak, nonatomic) IBOutlet UILabel *playerName; diff --git a/GameCenterManager/ViewController.m b/GameCenterManager/ViewController.m old mode 100644 new mode 100755 index 78613b9..3d86c07 --- a/GameCenterManager/ViewController.m +++ b/GameCenterManager/ViewController.m @@ -2,39 +2,32 @@ // ViewController.m // GameCenterManager // -// Created by Nihal Ahmed on March 17, 2012. Edited and updated by iRare Media on April 28, 2013. -// Copyright (c) 2012 NABZ Software. All rights reserved. +// Created by iRare Media on Sepetmber 21, 2013. +// Copyright (c) 2013 iRare Media. All rights reserved. // #import "ViewController.h" @implementation ViewController -@synthesize statusLabel, statusDetailLabel, actionLabel; -@synthesize toolBar, header, scrollView; +@synthesize scrollView; +@synthesize statusDetailLabel, actionLabel, actionBarLabel; @synthesize playerPicture, playerName, playerStatus; //------------------------------------------------------------------------------------------------------------// -//Region: View Lifecycle -------------------------------------------------------------------------------------// +//------- View Lifecycle -------------------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - View Lifecycle - (void)viewDidLoad { [super viewDidLoad]; - //Setup ViewController Appearance - self.view.backgroundColor = [UIColor underPageBackgroundColor]; - scrollView.contentSize = CGSizeMake(320, 554); - [[UIToolbar appearance] setBackgroundImage:[UIImage imageNamed:@"GCBar"] forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault]; - toolBar.layer.shadowOffset = CGSizeMake(1, 1.5); - toolBar.layer.shadowOpacity = 0.5; - header.layer.shadowOffset = CGSizeMake(1, 1.5); - header.layer.shadowOpacity = 0.5; - playerPicture.layer.BorderColor = [[UIColor whiteColor] CGColor]; - playerPicture.layer.BorderWidth = 2.0; - playerPicture.layer.shadowOffset = CGSizeMake(1, 1.5); - playerPicture.layer.shadowOpacity = 0.5; + // Setup ViewController Appearance + scrollView.contentSize = CGSizeMake(320, 450); + playerPicture.layer.cornerRadius = 25; + playerPicture.layer.masksToBounds = YES; + [actionBarLabel setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:15<=10], NSFontAttributeName,nil] forState:UIControlStateNormal]; - //Set GameCenter Manager Delegate + // Set GameCenter Manager Delegate [[GameCenterManager sharedManager] setDelegate:self]; [[GameCenterManager sharedManager] initGameCenter]; } @@ -44,15 +37,15 @@ - (void)viewWillAppear:(BOOL)animated { BOOL available = [[GameCenterManager sharedManager] checkGameCenterAvailability]; if (available) { - statusLabel.Text = @"GAME CENTER AVAILABLE"; + [self.navigationController.navigationBar setValue:@"GameCenter Available" forKeyPath:@"prompt"]; } else { - statusLabel.Text = @"GAME CENTER UNAVAILABLE"; + [self.navigationController.navigationBar setValue:@"GameCenter Unavailable" forKeyPath:@"prompt"]; } GKLocalPlayer *player = [[GameCenterManager sharedManager] localPlayerData]; if (player) { if ([player isUnderage] == NO) { - actionLabel.text = [NSString stringWithFormat:@"%@ signed in.", player.displayName]; + actionBarLabel.title = [NSString stringWithFormat:@"%@ signed in.", player.displayName]; playerName.text = player.displayName; playerStatus.text = @"Player is not underage"; [[GameCenterManager sharedManager] localPlayerPhoto:^(UIImage *playerPhoto) { @@ -61,10 +54,10 @@ - (void)viewWillAppear:(BOOL)animated { } else { playerName.text = player.displayName; playerStatus.text = @"Player is underage"; - actionLabel.text = [NSString stringWithFormat:@"Underage player, %@, signed in.", player.displayName]; + actionBarLabel.title = [NSString stringWithFormat:@"Underage player, %@, signed in.", player.displayName]; } } else { - actionLabel.text = [NSString stringWithFormat:@"No GameCenter player found."]; + actionBarLabel.title = [NSString stringWithFormat:@"No GameCenter player found."]; } } @@ -73,8 +66,6 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface } - (void)viewDidUnload { - [self setToolBar:nil]; - [self setHeader:nil]; [self setScrollView:nil]; [self setStatusDetailLabel:nil]; [self setActionLabel:nil]; @@ -85,30 +76,25 @@ - (void)viewDidUnload { } //------------------------------------------------------------------------------------------------------------// -//Region: GameCenter Scores ----------------------------------------------------------------------------------// +//------- GameCenter Scores ----------------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - GameCenter Scores - (IBAction)reportScore { [[GameCenterManager sharedManager] saveAndReportScore:[[GameCenterManager sharedManager] highScoreForLeaderboard:@"grp.PlayerScores"]+1 leaderboard:@"grp.PlayerScores" sortOrder:GameCenterSortOrderHighToLow]; - actionLabel.text = [NSString stringWithFormat:@"Score recorded."]; + actionBarLabel.title = [NSString stringWithFormat:@"Score recorded."]; } - (IBAction)showLeaderboard { - GKLeaderboardViewController *leaderboardViewController = [[GKLeaderboardViewController alloc] init]; - leaderboardViewController.timeScope = GKLeaderboardTimeScopeAllTime; - leaderboardViewController.leaderboardDelegate = self; + GKGameCenterViewController *leaderboardViewController = [[GKGameCenterViewController alloc] init]; + leaderboardViewController.viewState = GKGameCenterViewControllerStateLeaderboards; + leaderboardViewController.gameCenterDelegate = self; [self presentViewController:leaderboardViewController animated:YES completion:nil]; - actionLabel.text = [NSString stringWithFormat:@"Attempting to display GameCenter leaderboards."]; -} - -- (void)leaderboardViewControllerDidFinish:(GKLeaderboardViewController *)viewController { - [self dismissViewControllerAnimated:YES completion:nil]; - actionLabel.text = [NSString stringWithFormat:@"Displayed GameCenter leaderboard."]; + actionBarLabel.title = [NSString stringWithFormat:@"Attempting to display GameCenter leaderboards."]; } //------------------------------------------------------------------------------------------------------------// -//Region: GameCenter Achievements ----------------------------------------------------------------------------// +//------- GameCenter Achievements ----------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - GameCenter Achievements @@ -123,19 +109,15 @@ - (IBAction)reportAchievement { } NSLog(@"Achievement One Progress: %f | Achievement Two Progress: %f", [[GameCenterManager sharedManager] progressForAchievement:@"grp.FirstAchievement"], [[GameCenterManager sharedManager] progressForAchievement:@"grp.SecondAchievement"]); - actionLabel.text = [NSString stringWithFormat:@"Achievement recorded."]; + actionBarLabel.title = [NSString stringWithFormat:@"Achievement recorded."]; } - (IBAction)showAchievements { - GKAchievementViewController *achievementViewController = [[GKAchievementViewController alloc] init]; - achievementViewController.achievementDelegate = self; + GKGameCenterViewController *achievementViewController = [[GKGameCenterViewController alloc] init]; + achievementViewController.viewState = GKGameCenterViewControllerStateAchievements; + achievementViewController.gameCenterDelegate = self; [self presentViewController:achievementViewController animated:YES completion:nil]; - actionLabel.text = [NSString stringWithFormat:@"Attempting to display GameCenter achievements."]; -} - -- (void)achievementViewControllerDidFinish:(GKAchievementViewController *)viewController { - [self dismissViewControllerAnimated:YES completion:nil]; - actionLabel.text = [NSString stringWithFormat:@"Displayed GameCenter achievements."]; + actionBarLabel.title = [NSString stringWithFormat:@"Attempting to display GameCenter achievements."]; } - (IBAction)resetAchievements { @@ -144,42 +126,59 @@ - (IBAction)resetAchievements { } //------------------------------------------------------------------------------------------------------------// -//Region: GameCenter Challenges ------------------------------------------------------------------------------// +//------- GameCenter Challenges ------------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - GameCenter Challenges - (IBAction)loadChallenges { - //This feature is only supported in iOS 6 and higher (don't worry - GC Manager will check for you and return NIL if it isn't available) + // This feature is only supported in iOS 6 and higher (don't worry - GC Manager will check for you and return NIL if it isn't available) [[GameCenterManager sharedManager] getChallengesWithCompletion:^(NSArray *challenges, NSError *error) { - actionLabel.text = [NSString stringWithFormat:@"Loaded GameCenter challenges."]; + actionBarLabel.title = [NSString stringWithFormat:@"Loaded GameCenter challenges."]; NSLog(@"GC Challenges: %@ | Error: %@", challenges, error); }]; } //------------------------------------------------------------------------------------------------------------// -//Region: GameCenter Manager Delegate ------------------------------------------------------------------------// +//------- GameKit Delegate -----------------------------------------------------------------------------------// +//------------------------------------------------------------------------------------------------------------// +#pragma mark - GameKit Delegate + +- (void)gameCenterViewControllerDidFinish:(GKGameCenterViewController *)gameCenterViewController { + [self dismissViewControllerAnimated:YES completion:nil]; + if (gameCenterViewController.viewState == GKGameCenterViewControllerStateAchievements) { + actionBarLabel.title = [NSString stringWithFormat:@"Displayed GameCenter achievements."]; + } else if (gameCenterViewController.viewState == GKGameCenterViewControllerStateLeaderboards) { + actionBarLabel.title = [NSString stringWithFormat:@"Displayed GameCenter leaderboard."]; + } else { + actionBarLabel.title = [NSString stringWithFormat:@"Displayed GameCenter controller."]; + } +} + +//------------------------------------------------------------------------------------------------------------// +//------- GameCenter Manager Delegate ------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - GameCenter Manager Delegate - (void)gameCenterManager:(GameCenterManager *)manager authenticateUser:(UIViewController *)gameCenterLoginController { [self presentViewController:gameCenterLoginController animated:YES completion:^{ - NSLog(@"Done"); + NSLog(@"Finished Presenting Authentication Controller"); }]; } - (void)gameCenterManager:(GameCenterManager *)manager availabilityChanged:(NSDictionary *)availabilityInformation { NSLog(@"GC Availabilty: %@", availabilityInformation); if ([[availabilityInformation objectForKey:@"status"] isEqualToString:@"GameCenter Available"]) { - statusLabel.text = @"GAME CENTER AVAILABLE"; + [self.navigationController.navigationBar setValue:@"GameCenter Available" forKeyPath:@"prompt"]; statusDetailLabel.text = @"Game Center is online, the current player is logged in, and this app is setup."; } else { - statusLabel.Text = @"GAME CENTER UNAVAILABLE"; + [self.navigationController.navigationBar setValue:@"GameCenter Unavailable" forKeyPath:@"prompt"]; statusDetailLabel.text = [availabilityInformation objectForKey:@"error"]; } GKLocalPlayer *player = [[GameCenterManager sharedManager] localPlayerData]; if (player) { if ([player isUnderage] == NO) { + actionBarLabel.title = [NSString stringWithFormat:@"%@ signed in.", player.displayName]; playerName.text = player.displayName; playerStatus.text = @"Player is not underage and is signed-in"; [[GameCenterManager sharedManager] localPlayerPhoto:^(UIImage *playerPhoto) { @@ -188,57 +187,57 @@ - (void)gameCenterManager:(GameCenterManager *)manager availabilityChanged:(NSDi } else { playerName.text = player.displayName; playerStatus.text = @"Player is underage"; - actionLabel.text = [NSString stringWithFormat:@"Underage player, %@, signed in.", player.displayName]; + actionBarLabel.title = [NSString stringWithFormat:@"Underage player, %@, signed in.", player.displayName]; } } else { - actionLabel.text = [NSString stringWithFormat:@"No GameCenter player found."]; + actionBarLabel.title = [NSString stringWithFormat:@"No GameCenter player found."]; } } - (void)gameCenterManager:(GameCenterManager *)manager error:(NSError *)error { NSLog(@"GC Error: %@", error); - actionLabel.text = error.domain; + actionBarLabel.title = error.domain; } - (void)gameCenterManager:(GameCenterManager *)manager reportedScore:(NSDictionary *)scoreInformation { NSLog(@"GC Reported Score: %@", scoreInformation); - actionLabel.text = [NSString stringWithFormat:@"Reported leaderboard score to GameCenter."]; + actionBarLabel.title = [NSString stringWithFormat:@"Reported leaderboard score to GameCenter."]; } - (void)gameCenterManager:(GameCenterManager *)manager savedScore:(GKScore *)score { NSLog(@"Saved GC Score with value: %lld", score.value); - actionLabel.text = [NSString stringWithFormat:@"Score saved for upload to GameCenter."]; + actionBarLabel.title = [NSString stringWithFormat:@"Score saved for upload to GameCenter."]; } - (void)gameCenterManager:(GameCenterManager *)manager savedAchievement:(NSDictionary *)achievementInformation { NSLog(@"Saved GC Achievement, %@", [achievementInformation objectForKey:@"id"]); - actionLabel.text = [NSString stringWithFormat:@"Achievement saved for upload to GameCenter."]; + actionBarLabel.title = [NSString stringWithFormat:@"Achievement saved for upload to GameCenter."]; } - (void)gameCenterManager:(GameCenterManager *)manager reportedAchievement:(NSDictionary *)achievementInformation { NSLog(@"GC Reported Achievement: %@", achievementInformation); - actionLabel.text = [NSString stringWithFormat:@"Reported achievement to GameCenter."]; + actionBarLabel.title = [NSString stringWithFormat:@"Reported achievement to GameCenter."]; } - (void)gameCenterManager:(GameCenterManager *)manager resetAchievements:(NSError *)error { if (error) { - actionLabel.text = [NSString stringWithFormat:@"Error reseting all GameCenter achievements."]; + actionBarLabel.title = [NSString stringWithFormat:@"Error reseting all GameCenter achievements."]; } else { - actionLabel.text = [NSString stringWithFormat:@"Reset all GameCenter achievements."]; + actionBarLabel.title = [NSString stringWithFormat:@"Reset all GameCenter achievements."]; } } //------------------------------------------------------------------------------------------------------------// -//Region: UIActionSheet Delegate -----------------------------------------------------------------------------// +//------- UIActionSheet Delegate -----------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------// #pragma mark - UIActionSheet Delegate - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { NSString *buttonTitle = [actionSheet buttonTitleAtIndex:buttonIndex]; if ([buttonTitle isEqualToString:@"Reset Achievements"]) { - [[GameCenterManager sharedManager] resetAchievements]; - } else { - //Cancel + [[GameCenterManager sharedManager] resetAchievementsWithCompletion:^(NSError *error) { + if (error) NSLog(@"Error Resetting Achievements: %@", error); + }]; } } diff --git a/GameCenterManager/en.lproj/InfoPlist.strings b/GameCenterManager/en.lproj/InfoPlist.strings old mode 100644 new mode 100755 diff --git a/GameCenterManager/en.lproj/Storyboard_iPhone.storyboard b/GameCenterManager/en.lproj/Storyboard_iPhone.storyboard old mode 100644 new mode 100755 index d178874..0bb66b5 --- a/GameCenterManager/en.lproj/Storyboard_iPhone.storyboard +++ b/GameCenterManager/en.lproj/Storyboard_iPhone.storyboard @@ -1,35 +1,29 @@ - + - + + - + - + - - - - - - + + - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - + - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - diff --git a/GameCenterManager/main.m b/GameCenterManager/main.m old mode 100644 new mode 100755 diff --git a/Interface.png b/Interface.png old mode 100644 new mode 100755 index 2756a4b..c521eeb Binary files a/Interface.png and b/Interface.png differ diff --git a/License.md b/License.md old mode 100644 new mode 100755 index 6e1d355..e799117 --- a/License.md +++ b/License.md @@ -1,4 +1,4 @@ -Copyright (c) 2012, Nihal Ahmed. All rights reserved. +Copyright © 2013, iRare Media. Copyright (c) 2012, Nihal Ahmed. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/Mac Icon.icns b/Mac Icon.icns deleted file mode 100644 index 3f67a0b..0000000 Binary files a/Mac Icon.icns and /dev/null differ diff --git a/README.md b/README.md old mode 100644 new mode 100755 index dc927e2..9dcca62 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -Game Center Manager +Game Kit Manager ========================= -Game Center Manager helps you manage Game Center in your iOS or Mac app. It makes it easy to report and keep track of high scores achievements, and challenges for different players. Game Center Manager also takes care of the heavy lifting - checking internet availability, saving data when offline and uploading it when online, etc. In future updates, Game Center Manager will make it easy to setup and run live Game Center Multiplayer matches. +GameKit Manager helps you manage Game Center in your iOS or Mac app. It makes it easy to report and keep track of high scores achievements, and challenges for different players. GameKit Manager also takes care of the heavy lifting - checking internet availability, saving data when offline and uploading it when online, etc. In future updates, GameKit Manager will make it easy to setup and run live Game Center Multiplayer matches. @@ -26,7 +26,7 @@ Setup Using the Demo App ------------ -Game Center Manager's demo app makes it easier to test Game Center integration with Game Center Manager on both Mac and iOS. It also lays out how to use the `GameCenterManager` class. We recommend that you leave the Bundle ID provided with the Demo App as-is. This Bundle ID is already linked to a Game Center game in iTunes Connect with scores and achievements. You may, however, substitute your own Bundle ID and entitlements file. +GameKit Manager's demo app makes it easier to test Game Center integration with GameKit Manager on both Mac and iOS. It also lays out how to use the `GameCenterManager` class. We recommend that you leave the Bundle ID provided with the Demo App as-is. This Bundle ID is already linked to a Game Center game in iTunes Connect with scores and achievements. You may, however, substitute your own Bundle ID and entitlements file. Documentation ----- @@ -217,8 +217,8 @@ When the `gameCenterManager: error:` delegate is called, one of the following er - `GCMErrorUnknown` (0) an unknown error occured - `GCMErrorNotAvailable` (1) the feature is not available or GameCenter is not available - `GCMErrorFeatureNotAvailable` (2) the request feature is not available, check error message for info - - `GCMErrorInternetNotAvailable` (3) no internet connection - - `GCMErrorAchievementDataMissing` (3) could not save achievement because the data was formatted improperly or is missing + - `GCMErrorInternetNotAvailable` (3) no internet connection + - `GCMErrorAchievementDataMissing` (3) could not save achievement because the data was formatted improperly or is missing Changelog ----- @@ -252,11 +252,11 @@ Changelog Version 4.2 - Fixed issue where Game Center Manager would fail to handle authentication after calling the authenticateHandler. Pull Request by Jonathan Swafford + Fixed issue where GameKit Manager would fail to handle authentication after calling the authenticateHandler. Pull Request by Jonathan Swafford Version 4.1 - Fixed issue where Game Center Manager would fail to report achievements and scores even if Game Center was available. + Fixed issue where GameKit Manager would fail to report achievements and scores even if Game Center was available. Version 4.0 @@ -266,7 +266,7 @@ Changelog
  • Improved Game Center Availability Checking and Error Reporting. Now check for the availablity of Game Center with the checkGameCenterAvailability method.
  • Makes improvements to thread switching - now UI tasks are performed on the main thread. Previously they were performed on a background thread for Game Center.
  • In depth error reporting for Game Center errors and availability issues.
  • -
  • The demo app has undergone massive improvements, including many interface improvements. To eliminate redundancy, the iPad part of the Demo App has been removed - Game Center Manager still works with iPad though.
  • +
  • The demo app has undergone massive improvements, including many interface improvements. To eliminate redundancy, the iPad part of the Demo App has been removed - GameKit Manager still works with iPad though.
  • Code cleanup and reorganization to make it easier on the eyes.
  • Upgrades ARMV6 assembler codegen from THUMB to ARM