Skip to content

Commit

Permalink
Update for the iPhone Simulator bug "server did not accept client reg…
Browse files Browse the repository at this point in the history
…istration 68" and hard coded the current location to 1 infinite loop.
  • Loading branch information
deepabhan committed Sep 19, 2011
1 parent c2dd9ef commit 81619d0
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
12 changes: 9 additions & 3 deletions Classes/GameListViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#import "LQClient.h"
#import "LQConfig.h"
#import "MapAttackAppDelegate.h"
#import "FTLocationSimulator.h"

@implementation GameListViewController

Expand Down Expand Up @@ -83,20 +84,26 @@ - (void)refreshNearbyLayers {
self.loadingStatus.hidden = NO;
self.gamesNearLabel.text = @"";

#ifdef FAKE_CORE_LOCATION
[self locationManager:locationManager
didUpdateToLocation:[[CLLocation alloc] initWithLatitude:37.33095 longitude:-122.03066] fromLocation:nil];
#else
if (!locationManager) {
locationManager = [[CLLocationManager alloc] init];
locationManager.distanceFilter = 1.0;
locationManager.delegate = self;
[locationManager startUpdatingLocation];
}

[locationManager startUpdatingLocation];
#endif

}

- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation {

//[locationManager stopUpdatingLocation];

NSLog(@"Got location update! %@", newLocation);

[[LQClient single] getPlaceContext:newLocation withCallback:^(NSError *error, NSDictionary *response){
Expand Down Expand Up @@ -137,7 +144,6 @@ - (void)locationManager:(CLLocationManager *)manager
}];
}];

[locationManager stopUpdatingLocation];
}

- (NSString *)urlForGameAtIndex:(NSInteger)index {
Expand Down
2 changes: 1 addition & 1 deletion Classes/GeoloqiReadClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define TAG_DEVICE_ID_SENT 1
#define TAG_MESSAGE_RECEIVED 2

#define VERBOSE 0
#define VERBOSE 1

@implementation GeoloqiReadClient

Expand Down
6 changes: 4 additions & 2 deletions Classes/GeoloqiSocketClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#define TIMEOUT_SEC 6.0
#define TAG_DEVICE_ID_SENT 1

#define VERBOSE 0
#define VERBOSE 1

#if LITTLE_ENDIAN

Expand Down Expand Up @@ -101,6 +101,8 @@ - (void)startMonitoringLocation {
locationManager.distanceFilter = distanceFilterDistance;
locationManager.delegate = self;
}

DLog(@"Starting location updates");

[locationManager startUpdatingLocation];

Expand Down Expand Up @@ -144,7 +146,7 @@ - (void)locationManager:(CLLocationManager *)manager
return;
}

// Only capture points as frequently as the min. tracking interval
// Only capture points as frequently as the min. tracking inter
// These checks are done against the last saved location (currentLocation)
if (YES || !oldLocation || // first update
([newLocation distanceFromLocation:currentLocation] > distanceFilterDistance && // check min. distance
Expand Down
3 changes: 2 additions & 1 deletion Classes/MapAttackAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

if([[LQClient single] isLoggedIn]) {
// Start sending location updates
[socketClient startMonitoringLocation];
// [socketClient startMonitoringLocation];

[[UIApplication sharedApplication]
registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
Expand Down Expand Up @@ -129,6 +129,7 @@ - (void)application:(UIApplication *)application didReceiveRemoteNotification:(N
-(void)loadGameWithURL:(NSString *)url {
[tabBarController setSelectedIndex:1];
DLog(@"MapAttackAppDelegate loadGameWithURL:%@", url);
[socketClient startMonitoringLocation];
[self.mapController loadURL:url];
}

Expand Down
6 changes: 4 additions & 2 deletions MapAttack.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CODE_SIGN_IDENTITY = "iPhone Developer: Aaron Parecki (UR6C55S2E6)";
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
Expand All @@ -629,19 +629,21 @@
);
PRODUCT_NAME = MapAttack;
PROVISIONING_PROFILE = "C00E2949-5BFA-43B4-8B4B-A4A880578555";
TARGETED_DEVICE_FAMILY = 1;
};
name = Debug;
};
1D6058950D05DD3E006BFB54 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
COPY_PHASE_STRIP = YES;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = MapAttack_Prefix.pch;
INFOPLIST_FILE = "MapAttack-Info.plist";
PRODUCT_NAME = MapAttack;
TARGETED_DEVICE_FAMILY = 1;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down

0 comments on commit 81619d0

Please sign in to comment.