From d64cc5f5df08a7177a1564c98e20eb9dc5910582 Mon Sep 17 00:00:00 2001 From: esterTion Date: Mon, 2 Mar 2020 23:41:51 +0800 Subject: [PATCH] bump version & fix background server inactive --- Brokenithm-iOS.xcodeproj/project.pbxproj | 12 ++- .../xcschemes/Brokenithm-iOS-Release.xcscheme | 78 +++++++++++++++++++ .../xcschemes/Brokenithm-iOS.xcscheme | 8 +- .../xcschemes/xcschememanagement.plist | 5 ++ Brokenithm-iOS/AppDelegate.m | 1 - Brokenithm-iOS/Info.plist | 4 +- Brokenithm-iOS/SocketDelegate.m | 30 +++++-- Brokenithm-iOS/ViewController.m | 3 +- Podfile.lock | 2 +- 9 files changed, 123 insertions(+), 20 deletions(-) create mode 100644 Brokenithm-iOS.xcodeproj/xcshareddata/xcschemes/Brokenithm-iOS-Release.xcscheme diff --git a/Brokenithm-iOS.xcodeproj/project.pbxproj b/Brokenithm-iOS.xcodeproj/project.pbxproj index f9b4351..752a661 100644 --- a/Brokenithm-iOS.xcodeproj/project.pbxproj +++ b/Brokenithm-iOS.xcodeproj/project.pbxproj @@ -332,16 +332,20 @@ baseConfigurationReference = B78B36B35C6A90E4F71F84B4 /* Pods-Brokenithm-iOS.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = MXJJEEMF3U; + CURRENT_PROJECT_VERSION = 2; + DEVELOPMENT_TEAM = K9CP5766XY; INFOPLIST_FILE = "Brokenithm-iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 1.1; PRODUCT_BUNDLE_IDENTIFIER = com.estertion.brokenithm; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -351,16 +355,20 @@ baseConfigurationReference = 259804D4CC006A58255BC938 /* Pods-Brokenithm-iOS.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = MXJJEEMF3U; + CURRENT_PROJECT_VERSION = 2; + DEVELOPMENT_TEAM = K9CP5766XY; INFOPLIST_FILE = "Brokenithm-iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 1.1; PRODUCT_BUNDLE_IDENTIFIER = com.estertion.brokenithm; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/Brokenithm-iOS.xcodeproj/xcshareddata/xcschemes/Brokenithm-iOS-Release.xcscheme b/Brokenithm-iOS.xcodeproj/xcshareddata/xcschemes/Brokenithm-iOS-Release.xcscheme new file mode 100644 index 0000000..c2c804e --- /dev/null +++ b/Brokenithm-iOS.xcodeproj/xcshareddata/xcschemes/Brokenithm-iOS-Release.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Brokenithm-iOS.xcodeproj/xcshareddata/xcschemes/Brokenithm-iOS.xcscheme b/Brokenithm-iOS.xcodeproj/xcshareddata/xcschemes/Brokenithm-iOS.xcscheme index 0bde12f..8718098 100644 --- a/Brokenithm-iOS.xcodeproj/xcshareddata/xcschemes/Brokenithm-iOS.xcscheme +++ b/Brokenithm-iOS.xcodeproj/xcshareddata/xcschemes/Brokenithm-iOS.xcscheme @@ -27,8 +27,6 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> - - - - + + - - SchemeUserState + Brokenithm-iOS-Release.xcscheme_^#shared#^_ + + orderHint + 3 + Brokenithm-iOS.xcscheme_^#shared#^_ orderHint diff --git a/Brokenithm-iOS/AppDelegate.m b/Brokenithm-iOS/AppDelegate.m index e62de08..c543664 100644 --- a/Brokenithm-iOS/AppDelegate.m +++ b/Brokenithm-iOS/AppDelegate.m @@ -7,7 +7,6 @@ // #import "AppDelegate.h" -#import "MainApp.h" @interface AppDelegate () diff --git a/Brokenithm-iOS/Info.plist b/Brokenithm-iOS/Info.plist index e6770f2..555ca66 100644 --- a/Brokenithm-iOS/Info.plist +++ b/Brokenithm-iOS/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + $(MARKETING_VERSION) CFBundleVersion - 1 + $(CURRENT_PROJECT_VERSION) LSRequiresIPhoneOS UILaunchStoryboardName diff --git a/Brokenithm-iOS/SocketDelegate.m b/Brokenithm-iOS/SocketDelegate.m index d252bc9..992811d 100644 --- a/Brokenithm-iOS/SocketDelegate.m +++ b/Brokenithm-iOS/SocketDelegate.m @@ -15,16 +15,18 @@ - (id)init { server = [[GCDAsyncSocket alloc] initWithDelegate:(id)self delegateQueue:dispatch_get_main_queue()]; - { - NSError *error = nil; - if (![server acceptOnPort:24864 error:&error]) { - NSLog(@"error creating server: %@", error); - return nil; - } - } + [self acceptConnection]; connectedSockets = [[NSMutableArray alloc] initWithCapacity:1]; + [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(becomeInactive) name:UIApplicationWillResignActiveNotification object:nil]; + [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(becomeActive) name:UIApplicationDidBecomeActiveNotification object:nil]; return [super init]; } +- (void)acceptConnection { + NSError *error = nil; + if (![server acceptOnPort:24864 error:&error]) { + NSLog(@"error creating server: %@", error); + } +} - (void)socket:(GCDAsyncSocket *)sock didAcceptNewSocket:(GCDAsyncSocket *)newSocket { @synchronized(connectedSockets) @@ -80,5 +82,19 @@ } } +- (void)becomeInactive { + server.IPv4Enabled = NO; + server.IPv6Enabled = NO; + for (GCDAsyncSocket* sock in connectedSockets) { + [sock disconnect]; + [connectedSockets removeObject:sock]; + } +} +- (void)becomeActive { + server.IPv4Enabled = YES; + server.IPv6Enabled = YES; + [self acceptConnection]; +} + @end diff --git a/Brokenithm-iOS/ViewController.m b/Brokenithm-iOS/ViewController.m index 7c06a94..2ebad18 100644 --- a/Brokenithm-iOS/ViewController.m +++ b/Brokenithm-iOS/ViewController.m @@ -103,7 +103,8 @@ -(BOOL)prefersStatusBarHidden { return kCFCoreFoundationVersionNumber < 1443.00; } -(UIRectEdge)preferredScreenEdgesDeferringSystemGestures { return UIRectEdgeAll; } -(BOOL)prefersHomeIndicatorAutoHidden { return YES; } --(UIStatusBarStyle) preferredStatusBarStyle { return UIStatusBarStyleLightContent;} +-(UIStatusBarStyle) preferredStatusBarStyle { return UIStatusBarStyleLightContent; } +-(UIEditingInteractionConfiguration)editingInteractionConfiguration { return UIEditingInteractionConfigurationNone; } -(void)updateTouches:(UIEvent *)event { float airHeight = screenHeight * 0.4; diff --git a/Podfile.lock b/Podfile.lock index 3b486ab..8c01b25 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -13,4 +13,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 203779727e696b4a59a26ea541d7cfcfdf196b38 -COCOAPODS: 1.8.4 +COCOAPODS: 1.9.0