Permalink
Browse files

Adds icons to main tab bar. Can now join a game after signing up.

  • Loading branch information...
1 parent a6a31c8 commit f7f8a379086ce737038a66ca17fb22728981e30d @aaronpk aaronpk committed Sep 5, 2011
View
23 BlankGame.html
@@ -0,0 +1,23 @@
+<html>
+<head>
+<style type="text/css">
+ body {
+ font-family: Helvetica, sans-serif;
+ }
+</style>
+</head>
+<body>
+
+<div style="text-align: center;">
+
+ <div style="font-size: 19pt; margin: 10px;">You haven't joined a game yet!</div>
+
+ <div style="font-size: 13pt; margin: 10px;">Choose a game from the nearby games.</div>
+
+ <div style="font-size: 13pt; margin: 10px;">
+ If you don't see a game nearby, contact us at
+ <div style="font-weight: bold; font-size: 15pt;"><a href="mailto:info@mapattack.org">info@mapattack.org</a></div>
+ </div>
+</div>
+</body>
+</html>
View
7 Classes/AuthView.m
@@ -9,6 +9,7 @@
#import "AuthView.h"
#import "LQClient.h"
#import "MapAttackAuth.h"
+#import "MapAttack.h"
@implementation AuthView
@@ -46,9 +47,9 @@ - (IBAction)tappedInitials {
- (IBAction)signIn {
NSString *initials = [NSString stringWithFormat:@"%@%@", self.initial1.text, self.initial2.text];
[[LQClient single] createNewAccountWithEmail:self.emailField.text initials:initials callback:^(NSError *error, NSDictionary *response){
-// NSLog(@"Hello! %@", response);
-// MapAttackAuth *auth = [MapAttackAuth create];
-// NSLog(@"Auth: %@", auth);
+ [[NSNotificationCenter defaultCenter] postNotificationName:LQAuthenticationSucceededNotification
+ object:nil
+ userInfo:nil];
[[self parentViewController] dismissModalViewControllerAnimated:YES];
}];
}
View
1 Classes/GameListViewController.h
@@ -18,6 +18,7 @@
@property (nonatomic, retain) IBOutlet UITableView *tableView;
@property (nonatomic, retain) IBOutlet GameCell *gameCell;
@property (nonatomic, retain) NSMutableArray *games;
+@property (nonatomic, retain) NSIndexPath *selectedIndex;
- (IBAction)reloadBtnPressed;
- (IBAction)logoutBtnPressed;
View
57 Classes/GameListViewController.m
@@ -13,7 +13,16 @@
@implementation GameListViewController
-@synthesize reloadBtn, tableView, gameCell, games;
+@synthesize reloadBtn, tableView, gameCell, games, selectedIndex;
+
+- (void)dealloc {
+ [games release];
+ [gameCell release];
+ [selectedIndex release];
+ [tableView release];
+ [reloadBtn release];
+ [super dealloc];
+}
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
/*
@@ -51,8 +60,6 @@ - (IBAction)logoutBtnPressed {
- (void)getNearbyLayers {
[[LQClient single] getNearbyLayers:^(NSError *error, NSDictionary *response){
self.games = [response objectForKey:@"nearby"];
-
- NSLog(@"%@", [self.games objectAtIndex:1]);
[self.tableView reloadData];
}];
}
@@ -61,6 +68,14 @@ - (NSString *)urlForGameAtIndex:(NSInteger)index {
return [[self.games objectAtIndex:index] objectForKey:@"url"];
}
+- (NSString *)layerIDForGameAtIndex:(NSInteger)index {
+ return [[self.games objectAtIndex:index] objectForKey:@"layer_id"];
+}
+
+- (NSString *)groupTokenForGameAtIndex:(NSInteger)index {
+ return [[self.games objectAtIndex:index] objectForKey:@"group_token"];
+}
+
#pragma mark -
#pragma mark Table View
@@ -78,27 +93,48 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
- (UITableViewCell *)tableView:(UITableView *)t cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *myIdentifier = @"GameCell";
- NSLog(@"cellForRowAtIndexPath: %@", indexPath);
-
GameCell *cell = (GameCell *)[t dequeueReusableCellWithIdentifier:myIdentifier];
if(cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"GameCell" owner:self options:nil];
cell = gameCell;
}
-// NSLog(@"Game: %@", games);
id game = [self.games objectAtIndex:indexPath.row];
[cell setNameText:[game objectForKey:@"name"]];
[cell setDescriptionText:[game objectForKey:@"description"]];
return cell;
}
+- (void)authenticationDidSucceed:(NSNotificationCenter *)notification {
+ [[LQClient single] joinGame:[self layerIDForGameAtIndex:selectedIndex.row] withToken:[self groupTokenForGameAtIndex:selectedIndex.row]];
+
+ // If they're not logged in, then loadGameWithURL will first pop up a login screen
+ [lqAppDelegate loadGameWithURL:[NSString stringWithFormat:MapAttackGameURLFormat, [self layerIDForGameAtIndex:selectedIndex.row]]];
+
+ [[NSNotificationCenter defaultCenter] removeObserver:self
+ name:LQAuthenticationSucceededNotification
+ object:nil];
+}
+
- (void)tableView:(UITableView *)t didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"Selected game %d", indexPath.row);
[t deselectRowAtIndexPath:indexPath animated:NO];
- [lqAppDelegate loadGameWithURL:[self urlForGameAtIndex:indexPath.row]];
+ self.selectedIndex = indexPath;
+
+ // If they're not logged in, wait until after the authentication succeed broadcast received, then join the game
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(authenticationDidSucceed:)
+ name:LQAuthenticationSucceededNotification
+ object:nil];
+
+ if([[LQClient single] isLoggedIn]) {
+ // If they're logged in, immediately make a call to the game server to join the game
+ [self authenticationDidSucceed:nil];
+ } else {
+ [lqAppDelegate.tabBarController presentModalViewController:[[AuthView alloc] init] animated:YES];
+ }
}
#pragma mark -
@@ -117,11 +153,4 @@ - (void)viewDidUnload {
}
-- (void)dealloc {
- [games release];
- [gameCell release];
- [super dealloc];
-}
-
-
@end
View
1 Classes/GeoloqiReadClient.h
@@ -16,5 +16,6 @@
- (void)normalConnect;
- (void)disconnect;
+- (void)reconnect;
@end
View
27 Classes/GeoloqiReadClient.m
@@ -11,6 +11,7 @@
#import "CJSONSerializer.h"
#import "MapAttack.h"
#import "LQConfig.h"
+#import "MapAttackAppDelegate.h"
#define TIMEOUT_SEC 6.0
#define TAG_DEVICE_ID_SENT 1
@@ -38,36 +39,46 @@ - (void)normalConnect
NSString *host = LQ_READ_SOCKET_HOST;
UInt16 port = LQ_READ_SOCKET_PORT;
- NSLog(@"Connecting to %@:%i", host, port);
+ NSLog(@"[Read] Connecting to %@:%i", host, port);
if (![asyncSocket connectToHost:host onPort:port withTimeout:1 error:&error])
{
- NSLog(@"Error connecting: %@", error);
+ NSLog(@"[Read] Error connecting: %@", error);
}
else
{
- NSData *data = [[UIDevice currentDevice].uniqueIdentifier dataUsingEncoding:NSASCIIStringEncoding];
- NSLog(@"Writing device id: %@", data);
+ const unsigned *tokenBytes = [[MapAttackAppDelegate UUID] bytes];
+ NSString *hexDeviceID = [NSString stringWithFormat:@"%08x%08x%08x%08x",
+ ntohl(tokenBytes[0]), ntohl(tokenBytes[1]), ntohl(tokenBytes[2]), ntohl(tokenBytes[3])];
+
+ NSData *data = [hexDeviceID dataUsingEncoding:NSASCIIStringEncoding];
+ NSLog(@"[Read] Writing device id: %@", data);
[asyncSocket writeData:data withTimeout:TIMEOUT_SEC tag:TAG_DEVICE_ID_SENT];
}
}
+- (void)reconnect
+{
+ [self disconnect];
+ [self normalConnect];
+}
+
// After the client finishes writing the UUID, start listening for new data
- (void)onSocket:(AsyncSocket *)sock didWriteDataWithTag:(long)tag
{
- NSLog(@"Did write data with tag %d", tag);
+ NSLog(@"[Read] Did write data with tag %d", tag);
[asyncSocket readDataToData:[AsyncSocket CRLFData] withTimeout:-1 tag:TAG_MESSAGE_RECEIVED];
}
- (void)onSocket:(AsyncSocket *)sock didReadData:(NSData *)data withTag:(long)tag
{
- NSLog(@"Did read data with tag %d: %@", tag, data);
+ NSLog(@"[Read] Did read data with tag %d: %@", tag, data);
NSError **err;
NSDictionary *dict;
dict = [[CJSONDeserializer deserializer] deserialize:data error:err];
- NSLog(@"Message: %@", dict);
+ NSLog(@"[Read] Message: %@", dict);
if([dict objectForKey:@"aps"] == nil) {
// Custom push data, pass off to the web view
@@ -111,7 +122,7 @@ - (void)disconnect
- (void) socket:(AsyncSocket *)sock didConnectToHost:(NSString *)host port:(UInt16)port
{
- NSLog(@"Connected on local host:%@ port:%hu", [sock localHost], [sock localPort]);
+ NSLog(@"[Read] Connected on local host:%@ port:%hu", [sock localHost], [sock localPort]);
}
View
20 Classes/GeoloqiSocketClient.m
@@ -74,12 +74,12 @@ - (void) normalConnect
NSString *host = LQ_WRITE_SOCKET_HOST;
UInt16 port = LQ_WRITE_SOCKET_PORT;
- NSLog(@"Connecting to %@:%i", host, port);
+ NSLog(@"[Write] Connecting to %@:%i", host, port);
// Change to use UDP
if (![asyncSocket connectToHost:LQ_WRITE_SOCKET_HOST onPort:LQ_WRITE_SOCKET_PORT error:&error])
{
- NSLog(@"Error connecting: %@", error);
+ NSLog(@"[Write] Error connecting: %@", error);
}
}
@@ -153,39 +153,39 @@ - (void)locationManager:(CLLocationManager *)manager
// object:self];
NSData *data = [self dataFromLocation:newLocation];
- NSLog(@"Sending location data: %@", data);
+ NSLog(@"[Write] Sending location data: %@", data);
[asyncSocket sendData:data toHost:LQ_WRITE_SOCKET_HOST port:LQ_WRITE_SOCKET_PORT withTimeout:10.0 tag:TAG_DEVICE_ID_SENT];
//Look for ack back
[asyncSocket receiveWithTimeout:30.0 tag:TAG_DEVICE_ID_SENT];
} else {
#if LQ_LOCMAN_DEBUG
- NSLog(@"Location update (to %@; from %@) rejected", newLocation, oldLocation);
+ NSLog(@"[Write] Location update (to %@; from %@) rejected", newLocation, oldLocation);
#endif
}
}
- (void)onUdpSocket:(AsyncUdpSocket *)sock didSendDataWithTag:(long)tag;
{
- NSLog(@"did send");
+ NSLog(@"[Write] did send");
}
- (void)onUdpSocket:(AsyncUdpSocket *)sock didNotSendDataWithTag:(long)tag dueToError:(NSError *)error;
{
- NSLog(@"did not get ack back");
+ NSLog(@"[Write] did not get ack back");
}
- (BOOL)onUdpSocket:(AsyncUdpSocket *)sock didReceiveData:(NSData *)data withTag:(long)tag fromHost:(NSString *)host port:(UInt16)port;
{
//TODO: determine if this is a valid packet
- NSLog(@"Recieved packet back from server: %@", data);
+ NSLog(@"[Write] Recieved packet back from server: %@", data);
if (data.length == sizeof(uint32_t)) {
uint32_t time = OSSwapBigToHostInt32(*(uint32_t *)data.bytes);
- NSLog(@"Accepted packet with timestamp: %u", time);
+ NSLog(@"[Write] Accepted packet with timestamp: %u", time);
return YES;
} else {
- NSLog(@"packet invalid size: %d", data.length);
+ NSLog(@"[Write] packet invalid size: %d", data.length);
return NO;
}
}
@@ -224,7 +224,7 @@ - (NSData *)dataFromLocation:(CLLocation *)location {
// NSLog(@"Offset of command: %lu", offsetof(LQUpdatePacket, f.command));
// NSLog(@"Offset of date: %lu", offsetof(LQUpdatePacket, f.date));
- NSLog(@"Sending timestamp: %d", update.f.date);
+ NSLog(@"[Write] Sending timestamp: %d", update.f.date);
//Swap endianness of each 16 bit int
update.f.date = OSSwapHostToBigInt32(update.f.date);
View
18 Classes/HowToPlay.h
@@ -0,0 +1,18 @@
+//
+// HowToPlay.h
+// MapAttack
+//
+// Created by Aaron Parecki on 2011-09-04.
+// Copyright 2011 Geoloqi.com. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+
+@interface HowToPlay : UIViewController {
+
+}
+
+@property (nonatomic, retain) IBOutlet UILabel *test;
+
+@end
View
61 Classes/HowToPlay.m
@@ -0,0 +1,61 @@
+//
+// HowToPlay.m
+// MapAttack
+//
+// Created by Aaron Parecki on 2011-09-04.
+// Copyright 2011 Geoloqi.com. All rights reserved.
+//
+
+#import "HowToPlay.h"
+#import "LQClient.h"
+
+@implementation HowToPlay
+
+@synthesize test;
+
+// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
+/*
+- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
+ self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
+ if (self) {
+ // Custom initialization.
+ }
+ return self;
+}
+*/
+
+// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
+- (void)viewDidLoad {
+ [super viewDidLoad];
+ self.test.text = [LQClient single].shareToken;
+}
+
+
+/*
+// Override to allow orientations other than the default portrait orientation.
+- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
+ // Return YES for supported orientations.
+ return (interfaceOrientation == UIInterfaceOrientationPortrait);
+}
+*/
+
+- (void)didReceiveMemoryWarning {
+ // Releases the view if it doesn't have a superview.
+ [super didReceiveMemoryWarning];
+
+ // Release any cached data, images, etc. that aren't in use.
+}
+
+- (void)viewDidUnload {
+ [super viewDidUnload];
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
+}
+
+
+- (void)dealloc {
+ [super dealloc];
+}
+
+
+@end
View
398 Classes/HowToPlay.xib
@@ -0,0 +1,398 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1056</int>
+ <string key="IBDocument.SystemVersion">10J567</string>
+ <string key="IBDocument.InterfaceBuilderVersion">823</string>
+ <string key="IBDocument.AppKitVersion">1038.35</string>
+ <string key="IBDocument.HIToolboxVersion">462.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string key="NS.object.0">132</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="1"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBProxyObject" id="372490531">
+ <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBProxyObject" id="975951072">
+ <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIView" id="191373211">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">274</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBUILabel" id="1002673755">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{122, 152}, {54, 21}}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClipsSubviews">YES</bool>
+ <int key="IBUIContentMode">7</int>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <string key="IBUIText">Yeah!!!</string>
+ <object class="NSColor" key="IBUITextColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDAAA</bytes>
+ </object>
+ <object class="NSColor" key="IBUIHighlightedColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <int key="IBUIBaselineAdjustment">1</int>
+ <float key="IBUIMinimumFontSize">10</float>
+ </object>
+ </object>
+ <string key="NSFrameSize">{320, 460}</string>
+ <reference key="NSSuperview"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">view</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="191373211"/>
+ </object>
+ <int key="connectionID">3</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">test</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="1002673755"/>
+ </object>
+ <int key="connectionID">5</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="191373211"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1002673755"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="372490531"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="975951072"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">4</int>
+ <reference key="object" ref="1002673755"/>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.CustomClassName</string>
+ <string>-2.CustomClassName</string>
+ <string>1.IBEditorWindowLastContentRect</string>
+ <string>1.IBPluginDependency</string>
+ <string>4.IBPluginDependency</string>
+ <string>4.IBViewBoundsToFrameTransform</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>HowToPlay</string>
+ <string>UIResponder</string>
+ <string>{{341, 230}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABC0AAAwykAAA</bytes>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">5</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">HowToPlay</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">test</string>
+ <string key="NS.object.0">UILabel</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">test</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">test</string>
+ <string key="candidateClassName">UILabel</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Classes/HowToPlay.h</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="246383144">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UILabel</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UILabel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIResponder</string>
+ <string key="superclassName">NSObject</string>
+ <reference key="sourceIdentifier" ref="246383144"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchBar</string>
+ <string key="superclassName">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UISearchDisplayController</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIPrintFormatter.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIViewController</string>
+ <string key="superclassName">UIResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
+ <integer value="1056" key="NS.object.0"/>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
+ <integer value="3000" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../MapAttack.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <string key="IBCocoaTouchPluginVersion">132</string>
+ </data>
+</archive>
View
10 Classes/LQClient.h
@@ -16,23 +16,27 @@ static NSString *const LQAccessTokenKey = @"LQAccessToken";
static NSString *const LQAuthEmailAddressKey = @"LQAuthEmailAddressKey";
static NSString *const LQAuthInitialsKey = @"LQAuthInitialsKey";
static NSString *const LQAPIBaseURL = @"https://api.geoloqi.com/1/";
-static NSString *const MapAttackAPIBaseURL = @"http://mapattack.org/";
typedef void (^LQHTTPRequestCallback)(NSError *error, NSDictionary *response);
@interface LQClient : NSObject {
- NSMutableArray *queue;
+// NSMutableArray *queue;
ASIHTTPRequest *authenticationRequest;
}
@property (nonatomic, copy) NSString *accessToken;
+@property (nonatomic, copy) NSString *emailAddress;
+@property (nonatomic, copy) NSString *userInitials;
+
+@property (nonatomic, copy) NSString *shareToken;
+ (LQClient *)single;
- (BOOL)isLoggedIn;
// - (NSString *)refreshToken;
-- (void)sendPushToken:(NSString *)token;
+- (void)sendPushToken:(NSString *)token withCallback:(LQHTTPRequestCallback)callback;
- (void)getNearbyLayers:(LQHTTPRequestCallback)callback;
- (void)createNewAccountWithEmail:(NSString *)email initials:(NSString *)initials callback:(LQHTTPRequestCallback)callback;
+- (void)joinGame:(NSString *)layer_id withToken:(NSString *)group_token;
- (void)logout;
@end
View
107 Classes/LQClient.m
@@ -18,6 +18,8 @@
@implementation LQClient
+@synthesize shareToken;
+
+ (LQClient *)single {
static LQClient *singleton = nil;
if(!singleton) {
@@ -31,25 +33,39 @@ - (id) init
self = [super init];
if(!self) return nil;
- queue = [[NSMutableArray alloc] init];
-
+// queue = [[NSMutableArray alloc] init];
return self;
}
- (void)dealloc {
- [queue release];
+ // [queue release];
[super dealloc];
}
+/**
+ * Getter/setter for accessToken key, uses NSUserDefaults for permanent storage.
+ */
- (NSString *)accessToken {
return [[NSUserDefaults standardUserDefaults] stringForKey:LQAccessTokenKey];
}
- (void)setAccessToken:(NSString *)token {
-// if(token == nil) {
-// [[NSUserDefaults standardUserDefaults] removeObjectForKey:LQAccessTokenKey];
-// } else {
- [[NSUserDefaults standardUserDefaults] setObject:[[token copy] autorelease] forKey:LQAccessTokenKey];
-// }
+ [[NSUserDefaults standardUserDefaults] setObject:[[token copy] autorelease] forKey:LQAccessTokenKey];
+ [[NSUserDefaults standardUserDefaults] synchronize];
+}
+
+- (NSString *)emailAddress {
+ return [[NSUserDefaults standardUserDefaults] stringForKey:LQAuthEmailAddressKey];
+}
+- (void)setEmailAddress:(NSString *)email {
+ [[NSUserDefaults standardUserDefaults] setObject:[[email copy] autorelease] forKey:LQAuthEmailAddressKey];
+ [[NSUserDefaults standardUserDefaults] synchronize];
+}
+
+- (NSString *)userInitials {
+ return [[NSUserDefaults standardUserDefaults] stringForKey:LQAuthInitialsKey];
+}
+- (void)setUserInitials:(NSString *)initials {
+ [[NSUserDefaults standardUserDefaults] setObject:[[initials copy] autorelease] forKey:LQAuthInitialsKey];
[[NSUserDefaults standardUserDefaults] synchronize];
}
@@ -61,8 +77,8 @@ - (ASIHTTPRequest *)appRequestWithURL:(NSURL *)url {
return request;
}
-- (id)appRequestWithURL:(NSURL *)url class:(NSString *)class {
- id request = [NSClassFromString(class) requestWithURL:url];
+- (ASIHTTPRequest *)appRequestWithURL:(NSURL *)url class:(NSString *)class {
+ ASIHTTPRequest *request = [NSClassFromString(class) requestWithURL:url];
[request setAuthenticationScheme:(NSString *)kCFHTTPAuthenticationSchemeBasic];
[request setUsername:LQ_OAUTH_CLIENT_ID];
[request setPassword:LQ_OAUTH_SECRET];
@@ -72,12 +88,19 @@ - (id)appRequestWithURL:(NSURL *)url class:(NSString *)class {
- (ASIHTTPRequest *)userRequestWithURL:(NSURL *)url {
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request addRequestHeader:@"Authorization" value:[NSString stringWithFormat:@"OAuth %@", self.accessToken]];
+ // This was for when we needed to insert the access token later after it was refreshed
// NSMutableDictionary *dict = (request.userInfo ? [[NSMutableDictionary alloc] initWithDictionary:request.userInfo] : [[NSMutableDictionary alloc] init]);
// request.userInfo = dict;
// [dict setObject:[NSNumber numberWithBool:YES] forKey:LQClientRequestNeedsAuthenticationUserInfoKey];
return request;
}
+- (ASIHTTPRequest *)userRequestWithURL:(NSURL *)url class:(NSString *)class {
+ ASIHTTPRequest *request = [NSClassFromString(class) requestWithURL:url];
+ [request addRequestHeader:@"Authorization" value:[NSString stringWithFormat:@"OAuth %@", self.accessToken]];
+ return request;
+}
+
- (NSDictionary *)dictionaryFromResponse:(NSString *)response {
NSError *err = nil;
NSDictionary *res = [[CJSONDeserializer deserializer] deserializeAsDictionary:[response dataUsingEncoding:NSUTF8StringEncoding] error:&err];
@@ -112,6 +135,7 @@ - (NSString *)hardware
}
/*
+// This was for queuing/dequeuing requests so we could refresh the access token if necessary
- (void)dequeueUserRequestIfPossible {
if(queue.count > 0 && self.accessToken) {
ASIHTTPRequest *request = (ASIHTTPRequest *)[queue objectAtIndex:0];
@@ -152,12 +176,22 @@ - (void)runRequest:(ASIHTTPRequest *)inRequest callback:(LQHTTPRequestCallback)c
callback(nil, [self dictionaryFromResponse:[request responseString]]);
}];
[request setFailedBlock:^{
- NSLog(@"Request Failed %@", request);
+ DLog(@"Request Failed %@", request);
callback(request.error, nil);
}];
[request startAsynchronous];
}
+- (void)createShareToken {
+ NSURL *url = [self urlWithPath:@"link/create"];
+ __block ASIFormDataRequest *request = (ASIFormDataRequest *)[self userRequestWithURL:url class:@"ASIFormDataRequest"];
+ [request setPostValue:@"Testing for MapAttack" forKey:@"description"];
+ [self runRequest:request callback:^(NSError *error, NSDictionary *response){
+ self.shareToken = [response objectForKey:@"shortlink"];
+ DLog(@"Token: %@", response);
+ }];
+}
+
#pragma mark public methods
- (BOOL)isLoggedIn {
@@ -171,36 +205,61 @@ - (NSString *)refreshToken {
}
*/
-- (void)sendPushToken:(NSString *)token {
- // TODO: Send this device token to the Geoloqi API
+- (void)addDeviceInfoToRequest:(ASIFormDataRequest *)request {
+ UIDevice *d = [UIDevice currentDevice];
+ [request setPostValue:[NSString stringWithFormat:@"%@ %@", d.systemName, d.systemVersion] forKey:@"platform"];
+ [request setPostValue:[self hardware] forKey:@"hardware"];
+ const unsigned *tokenBytes = [[MapAttackAppDelegate UUID] bytes];
+ NSString *hexDeviceID = [NSString stringWithFormat:@"%08x%08x%08x%08x",
+ ntohl(tokenBytes[0]), ntohl(tokenBytes[1]), ntohl(tokenBytes[2]), ntohl(tokenBytes[3])];
+ [request setPostValue:hexDeviceID forKey:@"device_id"];
}
- (void)createNewAccountWithEmail:(NSString *)email initials:(NSString *)initials callback:(LQHTTPRequestCallback)callback {
NSURL *url = [self urlWithPath:@"user/create_anon"];
- __block ASIFormDataRequest *request = [self appRequestWithURL:url class:@"ASIFormDataRequest"];
+ __block ASIFormDataRequest *request = (ASIFormDataRequest *)[self appRequestWithURL:url class:@"ASIFormDataRequest"];
[request setPostValue:initials forKey:@"name"];
- UIDevice *d = [UIDevice currentDevice];
- [request setPostValue:[NSString stringWithFormat:@"%@ %@", d.systemName, d.systemVersion] forKey:@"platform"];
- [request setPostValue:[self hardware] forKey:@"hardware"];
-
- const unsigned *tokenBytes = [[MapAttackAppDelegate UUID] bytes];
- NSString *hexDeviceID = [NSString stringWithFormat:@"%08x%08x%08x%08x",
- ntohl(tokenBytes[0]), ntohl(tokenBytes[1]), ntohl(tokenBytes[2]), ntohl(tokenBytes[3])];
- [request setPostValue:hexDeviceID forKey:@"device_id"];
+ [self addDeviceInfoToRequest:request];
[request setCompletionBlock:^{
NSDictionary *responseDict = [self dictionaryFromResponse:[request responseString]];
// [[NSUserDefaults standardUserDefaults] setObject:(NSString *)[responseDict objectForKey:@"refresh_token"] forKey:LQRefreshTokenKey];
- [[NSUserDefaults standardUserDefaults] setObject:email forKey:LQAuthEmailAddressKey];
- [[NSUserDefaults standardUserDefaults] setObject:initials forKey:LQAuthInitialsKey];
+ self.emailAddress = email;
+ self.userInitials = initials;
self.accessToken = (NSString *)[responseDict objectForKey:@"access_token"]; // this runs synchronize
callback(nil, responseDict);
+
+ [self createShareToken];
+ }];
+ [request startAsynchronous];
+}
+
+- (void)joinGame:(NSString *)layer_id withToken:(NSString *)group_token {
+ NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:MapAttackJoinURLFormat, layer_id]];
+ NSLog(@"Joining game... %@", url);
+ __block ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
+ [request setPostValue:self.userInitials forKey:@"initials"];
+ [request setPostValue:self.emailAddress forKey:@"email"];
+ [request setPostValue:self.accessToken forKey:@"access_token"];
+ [request setCompletionBlock:^{
+// NSDictionary *responseDict = [self dictionaryFromResponse:[request responseString]];
+ NSLog(@"Response from mapattack.org %@", [request responseString]);
}];
[request startAsynchronous];
}
+- (void)sendPushToken:(NSString *)token withCallback:(LQHTTPRequestCallback)callback {
+ // TODO: Send this device token to the Geoloqi API
+ NSURL *url = [self urlWithPath:@"account/set_apn_token"];
+ NSLog(@"Sending push token %@ to %@", token, url);
+ __block ASIFormDataRequest *request = (ASIFormDataRequest *)[self userRequestWithURL:url class:@"ASIFormDataRequest"];
+ [self addDeviceInfoToRequest:request];
+ [request setPostValue:token forKey:@"token"];
+ [self runRequest:request callback:callback];
+}
+
- (void)getNearbyLayers:(LQHTTPRequestCallback)callback {
NSURL *url = [self urlWithPath:[NSString stringWithFormat:@"layer/nearby?latitude=45.5246&longitude=-122.6843&application_id=%@", MapAttackAppID]];
__block ASIHTTPRequest *request;
View
6 Classes/LQConfig.h
@@ -6,15 +6,13 @@
// Copyright 2011 Geoloqi.com. All rights reserved.
//
-#define PERMANENT_ACCESS_TOKEN @"517-721f909edfc33426c0276b22241b7e795856da23"
-
#define LQ_OAUTH_CLIENT_ID @"7bcd478f26bd14b1fed18e9fe59e506f"
#define LQ_OAUTH_SECRET @"8bf6952f46f325311a67d5a3ed90c9a0"
-#define LQ_USER_AGENT @"mapattack-11.244"
+#define LQ_USER_AGENT @"mapattack-11.247"
#define LQ_WRITE_SOCKET_HOST @"loki.geoloqi.com"
#define LQ_WRITE_SOCKET_PORT 40000
-#define LQ_READ_SOCKET_HOST @"localhost"
+#define LQ_READ_SOCKET_HOST @"loki.geoloqi.com"
#define LQ_READ_SOCKET_PORT 40001
View
4 Classes/MapAttack.h
@@ -6,8 +6,8 @@
// Copyright 2011 Geoloqi.com. All rights reserved.
//
-#define LQMapAttackWebURL @"http://localhost/index2.html"
-// @"http://geoloqi.com/test-js.php"
+static NSString *const MapAttackJoinURLFormat = @"http://mapattack.org/game/%@/join";
+static NSString *const MapAttackGameURLFormat = @"http://mapattack.org/game/%@";
static NSString *const LQMapAttackDataNotification = @"LQMapAttackDataNotification";
static NSString *const MapAttackAppID = @"R";
View
32 Classes/MapAttackAppDelegate.m
@@ -22,7 +22,9 @@ @implementation MapAttackAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
lqAppDelegate = self;
-
+
+ DLog(@"App Launch %@", launchOptions);
+
// Override point for customization after application launch.
// Add the tab bar controller's view to the window and display.
@@ -37,13 +39,18 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
if([[LQClient single] isLoggedIn]) {
// Start sending location updates
[socketClient startMonitoringLocation];
+
+ [[UIApplication sharedApplication]
+ registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
+ UIRemoteNotificationTypeSound |
+ UIRemoteNotificationTypeAlert)];
+ } else {
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(authenticationDidSucceed:)
+ name:LQAuthenticationSucceededNotification
+ object:nil];
}
- [[UIApplication sharedApplication]
- registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
- UIRemoteNotificationTypeSound |
- UIRemoteNotificationTypeAlert)];
-
return YES;
}
@@ -53,9 +60,9 @@ - (void)authenticationDidSucceed:(NSNotificationCenter *)notification
[[NSNotificationCenter defaultCenter] removeObserver:self
name:LQAuthenticationSucceededNotification
object:nil];
- [[NSNotificationCenter defaultCenter] removeObserver:self
- name:LQAuthenticationFailedNotification
- object:nil];
+// [[NSNotificationCenter defaultCenter] removeObserver:self
+// name:LQAuthenticationFailedNotification
+// object:nil];
if (tabBarController.modalViewController && [tabBarController.modalViewController isKindOfClass:[authViewController class]])
[tabBarController dismissModalViewControllerAnimated:YES];
@@ -66,6 +73,8 @@ - (void)authenticationDidSucceed:(NSNotificationCenter *)notification
UIRemoteNotificationTypeSound |
UIRemoteNotificationTypeAlert)];
+ [self.mapController loadURL:@""];
+
// Start sending location updates
[socketClient startMonitoringLocation];
}
@@ -80,7 +89,9 @@ - (void)application:(UIApplication *)application didRegisterForRemoteNotificatio
NSLog(@"Device Token: %@", deviceToken);
- [[LQClient single] sendPushToken:deviceToken];
+ [[LQClient single] sendPushToken:deviceToken withCallback:^(NSError *error, NSDictionary *response){
+ NSLog(@"Sent device token: %@", response);
+ }];
if ([application enabledRemoteNotificationTypes] == UIRemoteNotificationTypeNone) {
NSLog(@"Notifications are disabled for this application. Not registering.");
@@ -115,6 +126,7 @@ - (void)application:(UIApplication *)application didReceiveRemoteNotification:(N
-(void)loadGameWithURL:(NSString *)url {
[tabBarController setSelectedIndex:1];
+ NSLog(@"MapAttackAppDelegate loadGameWithURL:%@", url);
[self.mapController loadURL:url];
}
View
3 Classes/MapViewController.h
@@ -13,12 +13,13 @@
#import "GeoloqiReadClient.h"
-@interface MapViewController : UIViewController {
+@interface MapViewController : UIViewController <UIWebViewDelegate> {
UIWebView *webView;
GeoloqiReadClient *read;
}
@property (nonatomic, retain) IBOutlet UIWebView *webView;
+@property (nonatomic, retain) IBOutlet UIView *activityIndicator;
- (void)loadURL:(NSString *)url;
View
18 Classes/MapViewController.m
@@ -14,7 +14,7 @@
@implementation MapViewController
-@synthesize webView;
+@synthesize webView, activityIndicator;
/*
@@ -39,15 +39,16 @@ - (void)loadURL:(NSString *)url {
if(![[LQClient single] isLoggedIn]) {
[lqAppDelegate.tabBarController presentModalViewController:[[AuthView alloc] init] animated:YES];
} else {
- NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[url stringByAppendingFormat:@"&oauth_token=%@", [[LQClient single] accessToken]]]];
- [webView loadRequest:req];
+ NSLog(@"Loading URL in game view %@", url);
+ [webView loadRequest:[NSMutableURLRequest requestWithURL:[NSURL URLWithString:[url stringByAppendingFormat:@"?access_token=%@", [[LQClient single] accessToken]]]]];
}
}
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
- [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:LQMapAttackWebURL]]];
+ [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"BlankGame" ofType:@"html"]isDirectory:NO]]];
+// [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:LQMapAttackWebURL]]];
read = [[GeoloqiReadClient alloc] init];
@@ -115,6 +116,15 @@ - (IBAction)tappedLocate:(id)sender
}
*/
+- (void)webViewDidFinishLoad:(UIWebView *)w {
+ self.activityIndicator.alpha = 0.0;
+}
+
+- (void)webViewDidStartLoad:(UIWebView *)webView {
+ self.activityIndicator.alpha = 1.0;
+}
+
+
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
View
236 MainWindow.xib
@@ -12,8 +12,8 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="125"/>
<integer value="106"/>
+ <integer value="125"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -67,8 +67,13 @@
<object class="NSMutableArray" key="IBUIViewControllers">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIViewController" id="268481961">
+ <string key="IBUITitle">Nearby Games</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="807309489">
- <string key="IBUITitle">Nearby</string>
+ <string key="IBUITitle">Nearby Games</string>
+ <object class="NSCustomResource" key="IBUIImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">nearby-games-icon.png</string>
+ </object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
@@ -81,8 +86,13 @@
<bool key="IBUIHorizontal">NO</bool>
</object>
<object class="IBUIViewController" id="1024858337">
+ <string key="IBUITitle">Game Map</string>
<object class="IBUITabBarItem" key="IBUITabBarItem" id="765670903">
- <string key="IBUITitle">Game</string>
+ <string key="IBUITitle">Game Map</string>
+ <object class="NSCustomResource" key="IBUIImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">map-icon.png</string>
+ </object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUITabBar"/>
</object>
@@ -94,6 +104,26 @@
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIHorizontal">NO</bool>
</object>
+ <object class="IBUIViewController" id="551911689">
+ <string key="IBUITitle">How to Play</string>
+ <object class="IBUITabBarItem" key="IBUITabBarItem" id="525412579">
+ <string key="IBUITitle">How to Play</string>
+ <object class="NSCustomResource" key="IBUIImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">how-to-play-icon.png</string>
+ </object>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <reference key="IBUITabBar"/>
+ </object>
+ <reference key="IBUIToolbarItems" ref="0"/>
+ <reference key="IBUIParentViewController" ref="1034742383"/>
+ <string key="IBUINibName">HowToPlay</string>
+ <object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics">
+ <int key="interfaceOrientation">1</int>
+ </object>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIHorizontal">NO</bool>
+ </object>
</object>
<object class="IBUITabBar" key="IBUITabBar" id="795333663">
<nil key="NSNextResponder"/>
@@ -196,6 +226,7 @@
<reference ref="795333663"/>
<reference ref="268481961"/>
<reference ref="1024858337"/>
+ <reference ref="551911689"/>
</object>
<reference key="parent" ref="0"/>
</object>
@@ -243,6 +274,20 @@
<reference key="object" ref="208291676"/>
<reference key="parent" ref="0"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">128</int>
+ <reference key="object" ref="551911689"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="525412579"/>
+ </object>
+ <reference key="parent" ref="1034742383"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">129</int>
+ <reference key="object" ref="525412579"/>
+ <reference key="parent" ref="551911689"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -263,6 +308,7 @@
<string>125.CustomClassName</string>
<string>125.IBEditorWindowLastContentRect</string>
<string>125.IBPluginDependency</string>
+ <string>128.CustomClassName</string>
<string>2.IBAttributePlaceholdersKey</string>
<string>2.IBEditorWindowLastContentRect</string>
<string>2.IBPluginDependency</string>
@@ -285,6 +331,7 @@
<string>AuthView</string>
<string>{{329, 222}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>HowToPlay</string>
<object class="NSMutableDictionary">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
@@ -314,23 +361,90 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">127</int>
+ <int key="maxID">129</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">AuthView</string>
<string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>signIn</string>
+ <string>tappedInitials</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>signIn</string>
+ <string>tappedInitials</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">signIn</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">tappedInitials</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
<object class="NSMutableDictionary" key="outlets">
- <string key="NS.key.0">initialPicker</string>
- <string key="NS.object.0">UIPickerView</string>
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>emailField</string>
+ <string>initial1</string>
+ <string>initial2</string>
+ <string>initialPicker</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UITextField</string>
+ <string>UILabel</string>
+ <string>UILabel</string>
+ <string>UIPickerView</string>
+ </object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
- <string key="NS.key.0">initialPicker</string>
- <object class="IBToOneOutletInfo" key="NS.object.0">
- <string key="name">initialPicker</string>
- <string key="candidateClassName">UIPickerView</string>
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>emailField</string>
+ <string>initial1</string>
+ <string>initial2</string>
+ <string>initialPicker</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">emailField</string>
+ <string key="candidateClassName">UITextField</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">initial1</string>
+ <string key="candidateClassName">UILabel</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">initial2</string>
+ <string key="candidateClassName">UILabel</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">initialPicker</string>
+ <string key="candidateClassName">UIPickerView</string>
+ </object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -382,14 +496,35 @@
<string key="className">GameListViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
- <string key="NS.key.0">reloadBtnPressed</string>
- <string key="NS.object.0">id</string>
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>logoutBtnPressed</string>
+ <string>reloadBtnPressed</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ </object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
- <string key="NS.key.0">reloadBtnPressed</string>
- <object class="IBActionInfo" key="NS.object.0">
- <string key="name">reloadBtnPressed</string>
- <string key="candidateClassName">id</string>
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>logoutBtnPressed</string>
+ <string>reloadBtnPressed</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">logoutBtnPressed</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">reloadBtnPressed</string>
+ <string key="candidateClassName">id</string>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
@@ -437,6 +572,14 @@
</object>
</object>
<object class="IBPartialClassDescription">
+ <string key="className">HowToPlay</string>
+ <string key="superclassName">UIViewController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">Classes/HowToPlay.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">MapAttackAppDelegate</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="outlets">
@@ -494,14 +637,35 @@
<string key="className">MapViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="outlets">
- <string key="NS.key.0">webView</string>
- <string key="NS.object.0">UIWebView</string>
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>activityIndicator</string>
+ <string>webView</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>UIView</string>
+ <string>UIWebView</string>
+ </object>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
- <string key="NS.key.0">webView</string>
- <object class="IBToOneOutletInfo" key="NS.object.0">
- <string key="name">webView</string>
- <string key="candidateClassName">UIWebView</string>
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>activityIndicator</string>
+ <string>webView</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">activityIndicator</string>
+ <string key="candidateClassName">UIView</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">webView</string>
+ <string key="candidateClassName">UIWebView</string>
+ </object>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -729,21 +893,26 @@
</object>
</object>
<object class="IBPartialClassDescription">
- <string key="className">UIView</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="className">UITextField</string>
+ <string key="superclassName">UIControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="527555183">
<string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">UIKit.framework/Headers/UIPrintFormatter.h</string>
+ <string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
+ <string key="minorKey">UIKit.framework/Headers/UIPrintFormatter.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIView</string>
+ <reference key="sourceIdentifier" ref="527555183"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">UIView</string>
<string key="superclassName">UIResponder</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
@@ -814,6 +983,21 @@
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<string key="IBDocument.LastKnownRelativeProjectPath">MapAttack.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>how-to-play-icon.png</string>
+ <string>map-icon.png</string>
+ <string>nearby-games-icon.png</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>{25, 25}</string>
+ <string>{25, 25}</string>
+ <string>{25, 25}</string>
+ </object>
+ </object>
<string key="IBCocoaTouchPluginVersion">132</string>
</data>
</archive>
View
57 MapAttack.xcodeproj/project.pbxproj
@@ -27,6 +27,7 @@
0F12916613F4C809007AAB66 /* fakeLocations.kml in Resources */ = {isa = PBXBuildFile; fileRef = 0F12916013F4C809007AAB66 /* fakeLocations.kml */; };
0F12916713F4C809007AAB66 /* FTLocationSimulator.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F12916213F4C809007AAB66 /* FTLocationSimulator.m */; };
0F12916813F4C809007AAB66 /* RegexKitLite.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F12916513F4C809007AAB66 /* RegexKitLite.m */; };
+ 0F78A72B141553E000029E9C /* DebugLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 0F78A72A141553E000029E9C /* DebugLog.m */; };
0FFD5EBA140C25D6008BC18B /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD5EB8140C25D6008BC18B /* Icon.png */; };
0FFD5EBB140C25D6008BC18B /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD5EB9140C25D6008BC18B /* Icon@2x.png */; };
0FFD5ECA140F218D008BC18B /* LQClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 0FFD5EC9140F218D008BC18B /* LQClient.m */; };
@@ -54,6 +55,15 @@
0FFD65FA1412C718008BC18B /* initialFrame.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD65F81412C718008BC18B /* initialFrame.png */; };
0FFD65FB1412C718008BC18B /* initialFrame@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD65F91412C718008BC18B /* initialFrame@2x.png */; };
0FFD66AB1412D719008BC18B /* MapAttackAuth.m in Sources */ = {isa = PBXBuildFile; fileRef = 0FFD66AA1412D719008BC18B /* MapAttackAuth.m */; };
+ 0FFD682A1413F1E5008BC18B /* BlankGame.html in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD68291413F1E5008BC18B /* BlankGame.html */; };
+ 0FFD68581413F3F8008BC18B /* HowToPlay.m in Sources */ = {isa = PBXBuildFile; fileRef = 0FFD68561413F3F8008BC18B /* HowToPlay.m */; };
+ 0FFD68591413F3F8008BC18B /* HowToPlay.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD68571413F3F8008BC18B /* HowToPlay.xib */; };
+ 0FFD68E5141402F4008BC18B /* how-to-play-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD68DF141402F4008BC18B /* how-to-play-icon.png */; };
+ 0FFD68E6141402F4008BC18B /* how-to-play-icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD68E0141402F4008BC18B /* how-to-play-icon@2x.png */; };
+ 0FFD68E7141402F4008BC18B /* map-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD68E1141402F4008BC18B /* map-icon.png */; };
+ 0FFD68E8141402F4008BC18B /* map-icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD68E2141402F4008BC18B /* map-icon@2x.png */; };
+ 0FFD68E9141402F4008BC18B /* nearby-games-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD68E3141402F4008BC18B /* nearby-games-icon.png */; };
+ 0FFD68EA141402F4008BC18B /* nearby-games-icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0FFD68E4141402F4008BC18B /* nearby-games-icon@2x.png */; };
1D3623260D0F684500981E51 /* MapAttackAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* MapAttackAppDelegate.m */; };
1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
@@ -104,6 +114,8 @@
0F12916313F4C809007AAB66 /* FTSynthesizeSingleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FTSynthesizeSingleton.h; sourceTree = "<group>"; };
0F12916413F4C809007AAB66 /* RegexKitLite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegexKitLite.h; sourceTree = "<group>"; };
0F12916513F4C809007AAB66 /* RegexKitLite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RegexKitLite.m; sourceTree = "<group>"; };
+ 0F78A729141553E000029E9C /* DebugLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugLog.h; sourceTree = "<group>"; };
+ 0F78A72A141553E000029E9C /* DebugLog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DebugLog.m; sourceTree = "<group>"; };
0FFD5EB8140C25D6008BC18B /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
0FFD5EB9140C25D6008BC18B /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = "<group>"; };
0FFD5EC8140F218D008BC18B /* LQClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LQClient.h; sourceTree = "<group>"; };
@@ -151,6 +163,16 @@
0FFD65F91412C718008BC18B /* initialFrame@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "initialFrame@2x.png"; sourceTree = "<group>"; };
0FFD66A91412D719008BC18B /* MapAttackAuth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapAttackAuth.h; sourceTree = "<group>"; };
0FFD66AA1412D719008BC18B /* MapAttackAuth.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MapAttackAuth.m; sourceTree = "<group>"; };
+ 0FFD68291413F1E5008BC18B /* BlankGame.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = BlankGame.html; sourceTree = "<group>"; };
+ 0FFD68551413F3F8008BC18B /* HowToPlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HowToPlay.h; sourceTree = "<group>"; };
+ 0FFD68561413F3F8008BC18B /* HowToPlay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HowToPlay.m; sourceTree = "<group>"; };
+ 0FFD68571413F3F8008BC18B /* HowToPlay.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = HowToPlay.xib; path = Classes/HowToPlay.xib; sourceTree = "<group>"; };
+ 0FFD68DF141402F4008BC18B /* how-to-play-icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "how-to-play-icon.png"; sourceTree = "<group>"; };
+ 0FFD68E0141402F4008BC18B /* how-to-play-icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "how-to-play-icon@2x.png"; sourceTree = "<group>"; };
+ 0FFD68E1141402F4008BC18B /* map-icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "map-icon.png"; sourceTree = "<group>"; };
+ 0FFD68E2141402F4008BC18B /* map-icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "map-icon@2x.png"; sourceTree = "<group>"; };
+ 0FFD68E3141402F4008BC18B /* nearby-games-icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "nearby-games-icon.png"; sourceTree = "<group>"; };
+ 0FFD68E4141402F4008BC18B /* nearby-games-icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "nearby-games-icon@2x.png"; sourceTree = "<group>"; };
1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
1D3623240D0F684500981E51 /* MapAttackAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapAttackAppDelegate.h; sourceTree = "<group>"; };
1D3623250D0F684500981E51 /* MapAttackAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MapAttackAppDelegate.m; sourceTree = "<group>"; };
@@ -201,24 +223,27 @@
0F007B831401666E00057C53 /* GeoloqiReadClient.m */,
0F128FAB13F4A92E007AAB66 /* GeoloqiSocketClient.h */,
0F128FAC13F4A92E007AAB66 /* GeoloqiSocketClient.m */,
- 28216C950DB411BC00E5133A /* MapViewController.h */,
- 28216C960DB411BC00E5133A /* MapViewController.m */,
0FFD5FA2140F4396008BC18B /* GameListViewController.h */,
0FFD5FA3140F4396008BC18B /* GameListViewController.m */,
+ 28216C950DB411BC00E5133A /* MapViewController.h */,
+ 28216C960DB411BC00E5133A /* MapViewController.m */,
0FFD633E1410397D008BC18B /* GameCell.h */,
0FFD633F1410397D008BC18B /* GameCell.m */,
0FFD634B14103A16008BC18B /* GameCell.xib */,
0FFD6080140FF95B008BC18B /* AuthView.h */,
0FFD6081140FF95B008BC18B /* AuthView.m */,
0FFD66A91412D719008BC18B /* MapAttackAuth.h */,
0FFD66AA1412D719008BC18B /* MapAttackAuth.m */,
+ 0FFD68551413F3F8008BC18B /* HowToPlay.h */,
+ 0FFD68561413F3F8008BC18B /* HowToPlay.m */,
);
path = Classes;
sourceTree = "<group>";
};
0F128D4E13F4A207007AAB66 /* Externals */ = {
isa = PBXGroup;
children = (
+ 0F78A728141553D900029E9C /* DebugLog */,
0FFD5F28140F3903008BC18B /* Reachability */,
0FFD5F07140F38B3008BC18B /* ASIHTTPRequest */,
0F12915F13F4C809007AAB66 /* FTLocationSimulator */,
@@ -287,6 +312,15 @@
path = FTLocationSimulator;
sourceTree = "<group>";
};
+ 0F78A728141553D900029E9C /* DebugLog */ = {
+ isa = PBXGroup;
+ children = (
+ 0F78A729141553E000029E9C /* DebugLog.h */,
+ 0F78A72A141553E000029E9C /* DebugLog.m */,
+ );
+ name = DebugLog;
+ sourceTree = "<group>";
+ };
0FFD5F07140F38B3008BC18B /* ASIHTTPRequest */ = {
isa = PBXGroup;
children = (
@@ -368,6 +402,12 @@
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
+ 0FFD68DF141402F4008BC18B /* how-to-play-icon.png */,
+ 0FFD68E0141402F4008BC18B /* how-to-play-icon@2x.png */,
+ 0FFD68E1141402F4008BC18B /* map-icon.png */,
+ 0FFD68E2141402F4008BC18B /* map-icon@2x.png */,
+ 0FFD68E3141402F4008BC18B /* nearby-games-icon.png */,
+ 0FFD68E4141402F4008BC18B /* nearby-games-icon@2x.png */,
0FFD5EB8140C25D6008BC18B /* Icon.png */,
0FFD5EB9140C25D6008BC18B /* Icon@2x.png */,
0FFD65F81412C718008BC18B /* initialFrame.png */,
@@ -377,8 +417,10 @@
0FFD6082140FF95B008BC18B /* AuthView.xib */,
2840D7CD1179279E00D7F93C /* MapView.xib */,
282CCBFD0DB6C98000C4EA27 /* GameList.xib */,
+ 0FFD68571413F3F8008BC18B /* HowToPlay.xib */,
28AD73870D9D96C1002E5188 /* MainWindow.xib */,
8D1107310486CEB800E47090 /* MapAttack-Info.plist */,
+ 0FFD68291413F1E5008BC18B /* BlankGame.html */,
);
name = Resources;
sourceTree = "<group>";
@@ -460,6 +502,14 @@
0FFD634C14103A16008BC18B /* GameCell.xib in Resources */,
0FFD65FA1412C718008BC18B /* initialFrame.png in Resources */,
0FFD65FB1412C718008BC18B /* initialFrame@2x.png in Resources */,
+ 0FFD682A1413F1E5008BC18B /* BlankGame.html in Resources */,
+ 0FFD68591413F3F8008BC18B /* HowToPlay.xib in Resources */,
+ 0FFD68E5141402F4008BC18B /* how-to-play-icon.png in Resources */,
+ 0FFD68E6141402F4008BC18B /* how-to-play-icon@2x.png in Resources */,
+ 0FFD68E7141402F4008BC18B /* map-icon.png in Resources */,
+ 0FFD68E8141402F4008BC18B /* map-icon@2x.png in Resources */,
+ 0FFD68E9141402F4008BC18B /* nearby-games-icon.png in Resources */,
+ 0FFD68EA141402F4008BC18B /* nearby-games-icon@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -504,6 +554,8 @@
0FFD6083140FF95B008BC18B /* AuthView.m in Sources */,
0FFD63401410397D008BC18B /* GameCell.m in Sources */,
0FFD66AB1412D719008BC18B /* MapAttackAuth.m in Sources */,
+ 0FFD68581413F3F8008BC18B /* HowToPlay.m in Sources */,
+ 0F78A72B141553E000029E9C /* DebugLog.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -547,6 +599,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = /usr/include/libxml2;
+ OTHER_CFLAGS = "-DDEBUG";
OTHER_LDFLAGS = "-lxml2";
PREBINDING = NO;
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "CF7AE5F7-6348-4BEE-B4CD-499DC0FB6C89";
View
122 MapView.xib
@@ -12,7 +12,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="1"/>
+ <integer value="15"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -56,6 +56,32 @@
<int key="IBUIDataDetectorTypes">1</int>
<bool key="IBUIDetectsPhoneNumbers">YES</bool>
</object>
+ <object class="IBUIView" id="1001533614">
+ <reference key="NSNextResponder" ref="191373211"/>
+ <int key="NSvFlags">292</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBUIActivityIndicatorView" id="547502710">
+ <reference key="NSNextResponder" ref="1001533614"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{141.5, 191.5}, {37, 37}}</string>
+ <reference key="NSSuperview" ref="1001533614"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <bool key="IBUIHidesWhenStopped">NO</bool>
+ <bool key="IBUIAnimating">YES</bool>
+ <int key="IBUIStyle">0</int>
+ </object>
+ </object>
+ <string key="NSFrameSize">{320, 411}</string>
+ <reference key="NSSuperview" ref="191373211"/>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MCAwLjQ5AA</bytes>
+ </object>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
</object>
<string key="NSFrameSize">{320, 411}</string>
<reference key="NSSuperview"/>
@@ -85,7 +111,23 @@
<reference key="source" ref="372490531"/>
<reference key="destination" ref="196921757"/>
</object>
- <int key="connectionID">12</int>
+ <int key="connectionID">13</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="196921757"/>
+ <reference key="destination" ref="372490531"/>
+ </object>
+ <int key="connectionID">14</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">activityIndicator</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="1001533614"/>
+ </object>
+ <int key="connectionID">17</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
@@ -103,6 +145,7 @@
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="196921757"/>
+ <reference ref="1001533614"/>
</object>
<reference key="parent" ref="0"/>
</object>
@@ -118,6 +161,20 @@
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
+ <int key="objectID">15</int>
+ <reference key="object" ref="1001533614"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="547502710"/>
+ </object>
+ <reference key="parent" ref="191373211"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">16</int>
+ <reference key="object" ref="547502710"/>
+ <reference key="parent" ref="1001533614"/>
+ </object>
+ <object class="IBObjectRecord">
<int key="objectID">11</int>
<reference key="object" ref="196921757"/>
<reference key="parent" ref="191373211"/>
@@ -134,16 +191,26 @@
<string>1.IBPluginDependency</string>
<string>11.IBPluginDependency</string>
<string>11.IBViewBoundsToFrameTransform</string>
+ <string>15.IBPluginDependency</string>
+ <string>15.IBViewBoundsToFrameTransform</string>
+ <string>16.IBPluginDependency</string>
+ <string>16.IBViewBoundsToFrameTransform</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>FirstViewController</string>
+ <string>MapViewController</string>
<string>UIResponder</string>
<string>{{306, 241}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <object class="NSAffineTransform"/>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<object class="NSAffineTransform">
- <bytes key="NSTransformStruct">P4AAAL+AAAAAAAAAw7CAAA</bytes>
+ <bytes key="NSTransformStruct">P4AAAL+AAABCoAAAw5+AAA</bytes>
+ </object>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <object class="NSAffineTransform">
+ <bytes key="NSTransformStruct">P4AAAL+AAABCeAAAwwMAAA</bytes>
</object>
</object>
</object>
@@ -163,28 +230,49 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">12</int>
+ <int key="maxID">17</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray"