Skip to content

Commit

Permalink
A step towards mudball remediation.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKaden committed Aug 4, 2015
1 parent 816fcb2 commit 8ca1de1
Show file tree
Hide file tree
Showing 23 changed files with 1,234 additions and 1,122 deletions.
26 changes: 26 additions & 0 deletions Partisans.xcodeproj/project.pbxproj
Expand Up @@ -7,7 +7,11 @@
objects = { objects = {


/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
77195CFE1B70E9CF00E11518 /* NetPlayerHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 77195CFD1B70E9CF00E11518 /* NetPlayerHandler.m */; };
7721B8751B6FA4B1004D3BE0 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 7721B8741B6FA4B1004D3BE0 /* Reachability.m */; }; 7721B8751B6FA4B1004D3BE0 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 7721B8741B6FA4B1004D3BE0 /* Reachability.m */; };
7721B8781B6FA748004D3BE0 /* NetworkManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7721B8771B6FA748004D3BE0 /* NetworkManager.m */; };
7795A2941B70211000382382 /* NetHostHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 7795A2931B70211000382382 /* NetHostHandler.m */; };
7795A29A1B70D48400382382 /* NetHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 7795A2991B70D48400382382 /* NetHandler.m */; };
9300C7D8175BFCA00047AA15 /* GameTesterMenuItems.m in Sources */ = {isa = PBXBuildFile; fileRef = 9300C7D7175BFCA00047AA15 /* GameTesterMenuItems.m */; }; 9300C7D8175BFCA00047AA15 /* GameTesterMenuItems.m in Sources */ = {isa = PBXBuildFile; fileRef = 9300C7D7175BFCA00047AA15 /* GameTesterMenuItems.m */; };
9303BE5117467CAE0065ADD2 /* JoinGameViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9303BE5017467CAE0065ADD2 /* JoinGameViewController.m */; }; 9303BE5117467CAE0065ADD2 /* JoinGameViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9303BE5017467CAE0065ADD2 /* JoinGameViewController.m */; };
9303BE551746836A0065ADD2 /* GameJoiner.m in Sources */ = {isa = PBXBuildFile; fileRef = 9303BE541746836A0065ADD2 /* GameJoiner.m */; }; 9303BE551746836A0065ADD2 /* GameJoiner.m in Sources */ = {isa = PBXBuildFile; fileRef = 9303BE541746836A0065ADD2 /* GameJoiner.m */; };
Expand Down Expand Up @@ -132,9 +136,18 @@
/* End PBXBuildFile section */ /* End PBXBuildFile section */


/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
77195CFC1B70E9CF00E11518 /* NetPlayerHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetPlayerHandler.h; path = Classes/NetPlayerHandler.h; sourceTree = "<group>"; };
77195CFD1B70E9CF00E11518 /* NetPlayerHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NetPlayerHandler.m; path = Classes/NetPlayerHandler.m; sourceTree = "<group>"; };
7721B8731B6FA4B1004D3BE0 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = "<group>"; }; 7721B8731B6FA4B1004D3BE0 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = "<group>"; };
7721B8741B6FA4B1004D3BE0 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = "<group>"; }; 7721B8741B6FA4B1004D3BE0 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = "<group>"; };
7721B8761B6FA748004D3BE0 /* NetworkManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkManager.h; path = Classes/NetworkManager.h; sourceTree = "<group>"; };
7721B8771B6FA748004D3BE0 /* NetworkManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NetworkManager.m; path = Classes/NetworkManager.m; sourceTree = "<group>"; };
775407A31B6EE8B9002AE2DA /* Partisans-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Partisans-Bridging-Header.h"; sourceTree = "<group>"; }; 775407A31B6EE8B9002AE2DA /* Partisans-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Partisans-Bridging-Header.h"; sourceTree = "<group>"; };
7795A2921B70211000382382 /* NetHostHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetHostHandler.h; path = Classes/NetHostHandler.h; sourceTree = "<group>"; };
7795A2931B70211000382382 /* NetHostHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NetHostHandler.m; path = Classes/NetHostHandler.m; sourceTree = "<group>"; };
7795A2971B70583400382382 /* JSKCommandMessageProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSKCommandMessageProtocol.h; path = "Classes/Libraries/My Library/JSKCommandMessageProtocol.h"; sourceTree = "<group>"; };
7795A2981B70D48400382382 /* NetHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetHandler.h; path = Classes/NetHandler.h; sourceTree = "<group>"; };
7795A2991B70D48400382382 /* NetHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NetHandler.m; path = Classes/NetHandler.m; sourceTree = "<group>"; };
9300C7D6175BFCA00047AA15 /* GameTesterMenuItems.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GameTesterMenuItems.h; path = Classes/GameTesterMenuItems.h; sourceTree = "<group>"; }; 9300C7D6175BFCA00047AA15 /* GameTesterMenuItems.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GameTesterMenuItems.h; path = Classes/GameTesterMenuItems.h; sourceTree = "<group>"; };
9300C7D7175BFCA00047AA15 /* GameTesterMenuItems.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GameTesterMenuItems.m; path = Classes/GameTesterMenuItems.m; sourceTree = "<group>"; }; 9300C7D7175BFCA00047AA15 /* GameTesterMenuItems.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GameTesterMenuItems.m; path = Classes/GameTesterMenuItems.m; sourceTree = "<group>"; };
9303BE4F17467CAD0065ADD2 /* JoinGameViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JoinGameViewController.h; path = Classes/JoinGameViewController.h; sourceTree = "<group>"; }; 9303BE4F17467CAD0065ADD2 /* JoinGameViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JoinGameViewController.h; path = Classes/JoinGameViewController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -388,10 +401,18 @@
children = ( children = (
9307B3D2177F8A41003CEC6F /* HostFinder.h */, 9307B3D2177F8A41003CEC6F /* HostFinder.h */,
9307B3D3177F8A41003CEC6F /* HostFinder.m */, 9307B3D3177F8A41003CEC6F /* HostFinder.m */,
7795A2981B70D48400382382 /* NetHandler.h */,
7795A2991B70D48400382382 /* NetHandler.m */,
936CDFBC1761276900C6A4EE /* NetHost.h */, 936CDFBC1761276900C6A4EE /* NetHost.h */,
936CDFBD1761276900C6A4EE /* NetHost.m */, 936CDFBD1761276900C6A4EE /* NetHost.m */,
7795A2921B70211000382382 /* NetHostHandler.h */,
7795A2931B70211000382382 /* NetHostHandler.m */,
936CDFC0176202E500C6A4EE /* NetPlayer.h */, 936CDFC0176202E500C6A4EE /* NetPlayer.h */,
936CDFC1176202E500C6A4EE /* NetPlayer.m */, 936CDFC1176202E500C6A4EE /* NetPlayer.m */,
77195CFC1B70E9CF00E11518 /* NetPlayerHandler.h */,
77195CFD1B70E9CF00E11518 /* NetPlayerHandler.m */,
7721B8761B6FA748004D3BE0 /* NetworkManager.h */,
7721B8771B6FA748004D3BE0 /* NetworkManager.m */,
); );
name = Network; name = Network;
sourceTree = "<group>"; sourceTree = "<group>";
Expand Down Expand Up @@ -550,6 +571,7 @@
children = ( children = (
936510C41741597500F2AD06 /* JSKCommandMessage.h */, 936510C41741597500F2AD06 /* JSKCommandMessage.h */,
936510C51741597500F2AD06 /* JSKCommandMessage.m */, 936510C51741597500F2AD06 /* JSKCommandMessage.m */,
7795A2971B70583400382382 /* JSKCommandMessageProtocol.h */,
9365111D17415D0A00F2AD06 /* JSKCommandParcel.h */, 9365111D17415D0A00F2AD06 /* JSKCommandParcel.h */,
9365111E17415D0A00F2AD06 /* JSKCommandParcel.m */, 9365111E17415D0A00F2AD06 /* JSKCommandParcel.m */,
936510C61741597500F2AD06 /* JSKDataMiner.h */, 936510C61741597500F2AD06 /* JSKDataMiner.h */,
Expand Down Expand Up @@ -932,6 +954,7 @@
936510D51741597500F2AD06 /* JSKViewStack.m in Sources */, 936510D51741597500F2AD06 /* JSKViewStack.m in Sources */,
936510DC1741598800F2AD06 /* NSManagedObjectContext+FetchAdditions.m in Sources */, 936510DC1741598800F2AD06 /* NSManagedObjectContext+FetchAdditions.m in Sources */,
936510E3174159C900F2AD06 /* RootViewController.m in Sources */, 936510E3174159C900F2AD06 /* RootViewController.m in Sources */,
7795A2941B70211000382382 /* NetHostHandler.m in Sources */,
936510E4174159C900F2AD06 /* SystemMessage.m in Sources */, 936510E4174159C900F2AD06 /* SystemMessage.m in Sources */,
936510EB17415A1000F2AD06 /* MainMenuItems.m in Sources */, 936510EB17415A1000F2AD06 /* MainMenuItems.m in Sources */,
936510F317415A4E00F2AD06 /* ColorPickerViewController.m in Sources */, 936510F317415A4E00F2AD06 /* ColorPickerViewController.m in Sources */,
Expand All @@ -946,6 +969,7 @@
93C10B9D1744028300B47095 /* GameEnvoy.m in Sources */, 93C10B9D1744028300B47095 /* GameEnvoy.m in Sources */,
93C10BBA17440C4500B47095 /* PlayGameMenuItems.m in Sources */, 93C10BBA17440C4500B47095 /* PlayGameMenuItems.m in Sources */,
93C10BC8174439B300B47095 /* SetupGameMenuItems.m in Sources */, 93C10BC8174439B300B47095 /* SetupGameMenuItems.m in Sources */,
77195CFE1B70E9CF00E11518 /* NetPlayerHandler.m in Sources */,
93FECAB1174521A40046529A /* LabelProgressView.m in Sources */, 93FECAB1174521A40046529A /* LabelProgressView.m in Sources */,
93FECAB3174521A40046529A /* ProgressCell.m in Sources */, 93FECAB3174521A40046529A /* ProgressCell.m in Sources */,
9303BE5117467CAE0065ADD2 /* JoinGameViewController.m in Sources */, 9303BE5117467CAE0065ADD2 /* JoinGameViewController.m in Sources */,
Expand All @@ -964,7 +988,9 @@
936CDFC2176202E500C6A4EE /* NetPlayer.m in Sources */, 936CDFC2176202E500C6A4EE /* NetPlayer.m in Sources */,
93BF3B531771CABF00B20A71 /* GameDirector.m in Sources */, 93BF3B531771CABF00B20A71 /* GameDirector.m in Sources */,
93BF3B571771CEA500B20A71 /* MissionEnvoy.m in Sources */, 93BF3B571771CEA500B20A71 /* MissionEnvoy.m in Sources */,
7795A29A1B70D48400382382 /* NetHandler.m in Sources */,
9398A9C6177224EE00E5D31C /* Image.m in Sources */, 9398A9C6177224EE00E5D31C /* Image.m in Sources */,
7721B8781B6FA748004D3BE0 /* NetworkManager.m in Sources */,
9398A9CA177224EE00E5D31C /* Player.m in Sources */, 9398A9CA177224EE00E5D31C /* Player.m in Sources */,
9398A9D2177224EF00E5D31C /* Scorecard.m in Sources */, 9398A9D2177224EF00E5D31C /* Scorecard.m in Sources */,
939697E717732A110013B125 /* RoundEnvoy.m in Sources */, 939697E717732A110013B125 /* RoundEnvoy.m in Sources */,
Expand Down
7 changes: 4 additions & 3 deletions Partisans/Classes/AppDelegate.m
Expand Up @@ -22,6 +22,7 @@


#import "JSKDataMiner.h" #import "JSKDataMiner.h"
#import "RootViewController.h" #import "RootViewController.h"
#import "NetworkManager.h"
#import "SystemMessage.h" #import "SystemMessage.h"


@interface AppDelegate () @interface AppDelegate ()
Expand Down Expand Up @@ -49,19 +50,19 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(


- (void)applicationWillResignActive:(UIApplication *)application - (void)applicationWillResignActive:(UIApplication *)application
{ {
[SystemMessage putPlayerOffline]; [NetworkManager putPlayerOffline];
} }


- (void)applicationDidEnterBackground:(UIApplication *)application - (void)applicationDidEnterBackground:(UIApplication *)application
{ {
[SystemMessage putPlayerOffline]; [NetworkManager putPlayerOffline];
[JSKDataMiner save]; [JSKDataMiner save];
} }


- (void)applicationWillTerminate:(UIApplication *)application - (void)applicationWillTerminate:(UIApplication *)application
{ {
[JSKDataMiner save]; [JSKDataMiner save];
[SystemMessage putPlayerOffline]; [NetworkManager putPlayerOffline];
} }


@end @end
18 changes: 6 additions & 12 deletions Partisans/Classes/GameDirector.m
Expand Up @@ -25,6 +25,7 @@
#import "GamePrecis.h" #import "GamePrecis.h"
#import "JSKCommandParcel.h" #import "JSKCommandParcel.h"
#import "MissionEnvoy.h" #import "MissionEnvoy.h"
#import "NetworkManager.h"
#import "PlayerEnvoy.h" #import "PlayerEnvoy.h"
#import "RoundEnvoy.h" #import "RoundEnvoy.h"
#import "SystemMessage.h" #import "SystemMessage.h"
Expand Down Expand Up @@ -81,7 +82,7 @@ - (void)startGame
[self saveGame]; [self saveGame];


JSKCommandParcel *parcel = [[JSKCommandParcel alloc] initWithType:JSKCommandParcelTypeUpdate to:nil from:[SystemMessage playerEnvoy].peerID object:gameEnvoy]; JSKCommandParcel *parcel = [[JSKCommandParcel alloc] initWithType:JSKCommandParcelTypeUpdate to:nil from:[SystemMessage playerEnvoy].peerID object:gameEnvoy];
[SystemMessage sendParcelToPlayers:parcel]; [NetworkManager sendParcelToPlayers:parcel];
} }


- (void)startMission - (void)startMission
Expand Down Expand Up @@ -172,13 +173,6 @@ - (void)saveGame
{ {
GameEnvoy *gameEnvoy = self.gameEnvoy; GameEnvoy *gameEnvoy = self.gameEnvoy;
[gameEnvoy commitAndSave]; [gameEnvoy commitAndSave];

// NSDate *oldDate = [NSDate distantPast];
// [self sendGameUpdateTo:nil modifiedDate:oldDate shouldSendAllData:NO];

// JSKCommandParcel *parcel = [[JSKCommandParcel alloc] initWithType:JSKCommandParcelTypeUpdate to:nil from:[SystemMessage playerEnvoy].peerID object:gameEnvoy];
// [SystemMessage sendParcelToPlayers:parcel];
// [parcel release];
} }




Expand Down Expand Up @@ -234,11 +228,11 @@ - (void)sendGameUpdateTo:(NSString *)peerID modifiedDate:(NSDate *)modifiedDate
JSKCommandParcel *parcel = [[JSKCommandParcel alloc] initWithType:JSKCommandParcelTypeUpdate to:peerID from:hostID object:gameEnvoy]; JSKCommandParcel *parcel = [[JSKCommandParcel alloc] initWithType:JSKCommandParcelTypeUpdate to:peerID from:hostID object:gameEnvoy];
if (peerID) if (peerID)
{ {
[SystemMessage sendCommandParcel:parcel shouldAwaitResponse:NO]; [NetworkManager sendCommandParcel:parcel shouldAwaitResponse:NO];
} }
else else
{ {
[SystemMessage sendParcelToPlayers:parcel]; [NetworkManager sendParcelToPlayers:parcel];
} }
return; return;
} }
Expand Down Expand Up @@ -278,11 +272,11 @@ - (void)sendGameUpdateTo:(NSString *)peerID modifiedDate:(NSDate *)modifiedDate
JSKCommandParcel *parcel = [[JSKCommandParcel alloc] initWithType:JSKCommandParcelTypeUpdate to:peerID from:hostID object:objectArray]; JSKCommandParcel *parcel = [[JSKCommandParcel alloc] initWithType:JSKCommandParcelTypeUpdate to:peerID from:hostID object:objectArray];
if (peerID) if (peerID)
{ {
[SystemMessage sendCommandParcel:parcel shouldAwaitResponse:NO]; [NetworkManager sendCommandParcel:parcel shouldAwaitResponse:NO];
} }
else else
{ {
[SystemMessage sendParcelToPlayers:parcel]; [NetworkManager sendParcelToPlayers:parcel];
} }
} }


Expand Down
7 changes: 4 additions & 3 deletions Partisans/Classes/HostFinder.m
Expand Up @@ -21,6 +21,7 @@
#import "HostFinder.h" #import "HostFinder.h"


#import "GameEnvoy.h" #import "GameEnvoy.h"
#import "NetworkManager.h"
#import "PlayerEnvoy.h" #import "PlayerEnvoy.h"
#import "SystemMessage.h" #import "SystemMessage.h"


Expand Down Expand Up @@ -53,7 +54,7 @@ - (void)dealloc


- (BOOL)isConnected - (BOOL)isConnected
{ {
self.isConnected = [SystemMessage isPlayerOnline]; self.isConnected = [NetworkManager isPlayerOnline];
return m_isConnected; return m_isConnected;
} }


Expand All @@ -65,14 +66,14 @@ - (NSString *)hostPeerID


- (void)connect - (void)connect
{ {
if ([SystemMessage isPlayerOnline]) if ([NetworkManager isPlayerOnline])
{ {
return; return;
} }


[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(hostReadyToCommunicate:) name:kPartisansNotificationHostReadyToCommunicate object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(hostReadyToCommunicate:) name:kPartisansNotificationHostReadyToCommunicate object:nil];


[SystemMessage putPlayerOnline]; [NetworkManager putPlayerOnline];


if (!self.timer) if (!self.timer)
{ {
Expand Down
5 changes: 3 additions & 2 deletions Partisans/Classes/Libraries/My Library/JSKCommandMessage.h
Expand Up @@ -19,6 +19,7 @@
// //


#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "JSKCommandMessageProtocol.h"




typedef enum typedef enum
Expand Down Expand Up @@ -47,12 +48,12 @@ typedef enum
// My intent here is a small, generic object that can provide punctuation for other // My intent here is a small, generic object that can provide punctuation for other
// objects when sending them to and fro between devices. // objects when sending them to and fro between devices.


@interface JSKCommandMessage : NSObject <NSCoding> @interface JSKCommandMessage : NSObject <NSCoding, JSKCommandMessageProtocol>


@property (nonatomic, assign) JSKCommandMessageType commandMessageType; @property (nonatomic, assign) JSKCommandMessageType commandMessageType;
@property (nonatomic, strong) NSString *to; @property (nonatomic, strong) NSString *to;
@property (nonatomic, strong) NSString *from; @property (nonatomic, strong) NSString *from;
@property (weak, readonly, nonatomic) NSString *commandMessageTypeName; @property (nonatomic, readonly) NSString *commandMessageTypeName;
@property (nonatomic, strong) NSString *responseKey; @property (nonatomic, strong) NSString *responseKey;


- (id)initWithType:(JSKCommandMessageType)commandMessageType to:(NSString *)to from:(NSString *)from; - (id)initWithType:(JSKCommandMessageType)commandMessageType to:(NSString *)to from:(NSString *)from;
Expand Down
14 changes: 14 additions & 0 deletions Partisans/Classes/Libraries/My Library/JSKCommandMessageProtocol.h
@@ -0,0 +1,14 @@
//
// JSKCommandMessageProtocol.h
// Partisans
//
// Created by Joshua Kaden on 8/3/15.
// Copyright © 2015 Chadford Software. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol JSKCommandMessageProtocol <NSObject>
@property (nonatomic, strong) NSString *from;
@property (nonatomic, strong) NSString *responseKey;
@end
5 changes: 3 additions & 2 deletions Partisans/Classes/Libraries/My Library/JSKCommandParcel.h
Expand Up @@ -19,6 +19,7 @@
// //


#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import "JSKCommandMessageProtocol.h"


typedef enum typedef enum
{ {
Expand All @@ -31,11 +32,11 @@ typedef enum
} JSKCommandParcelType; } JSKCommandParcelType;




@interface JSKCommandParcel : NSObject <NSCoding> @interface JSKCommandParcel : NSObject <NSCoding, JSKCommandMessageProtocol>


@property (nonatomic, assign) JSKCommandParcelType commandParcelType; @property (nonatomic, assign) JSKCommandParcelType commandParcelType;
@property (nonatomic, strong) NSString *responseKey; @property (nonatomic, strong) NSString *responseKey;
@property (weak, readonly, nonatomic) NSString *commandParcelTypeName; @property (nonatomic, readonly) NSString *commandParcelTypeName;
@property (nonatomic, strong) NSString *to; @property (nonatomic, strong) NSString *to;
@property (nonatomic, strong) NSString *from; @property (nonatomic, strong) NSString *from;
@property (nonatomic, strong) NSObject <NSCoding> *object; @property (nonatomic, strong) NSObject <NSCoding> *object;
Expand Down
5 changes: 3 additions & 2 deletions Partisans/Classes/MissionViewController.m
Expand Up @@ -23,6 +23,7 @@
#import "GameEnvoy.h" #import "GameEnvoy.h"
#import "HostFinder.h" #import "HostFinder.h"
#import "MissionEnvoy.h" #import "MissionEnvoy.h"
#import "NetworkManager.h"
#import "PlayerEnvoy.h" #import "PlayerEnvoy.h"
#import "SystemMessage.h" #import "SystemMessage.h"


Expand Down Expand Up @@ -200,7 +201,7 @@ - (void)connectAndPerformMission:(BOOL)shouldSucceed
[self.spinner startAnimating]; [self.spinner startAnimating];




if ([SystemMessage isPlayerOnline]) if ([NetworkManager isPlayerOnline])
{ {
GameEnvoy *gameEnvoy = [SystemMessage gameEnvoy]; GameEnvoy *gameEnvoy = [SystemMessage gameEnvoy];
self.hostPeerID = gameEnvoy.host.peerID; self.hostPeerID = gameEnvoy.host.peerID;
Expand Down Expand Up @@ -239,7 +240,7 @@ - (void)performMission:(BOOL)shouldSucceed
{ {
message.commandMessageType = JSKCommandMessageTypeFail; message.commandMessageType = JSKCommandMessageTypeFail;
} }
[SystemMessage sendCommandMessage:message shouldAwaitResponse:YES]; [NetworkManager sendCommandMessage:message shouldAwaitResponse:YES];
} }




Expand Down
28 changes: 28 additions & 0 deletions Partisans/Classes/NetHandler.h
@@ -0,0 +1,28 @@
//
// NetHandler.h
// Partisans
//
// Created by Joshua Kaden on 8/4/15.
// Copyright © 2015 Chadford Software. All rights reserved.
//

#import <Foundation/Foundation.h>

@class JSKCommandParcel;
@class GameEnvoy;
@class PlayerEnvoy;

@interface NetHandler : NSObject

@property (nonatomic, readonly) GameEnvoy *gameEnvoy;
@property (nonatomic, readonly) NSString *myPeerID;
@property (nonatomic, readonly) PlayerEnvoy *playerEnvoy;

- (void)sendDigestTo:(NSString *)toPeerID;

/** This will check the local data and ask for new data as needed. */
- (void)processDigest:(NSDictionary *)digest;

- (void)handlePlayerUpdate:(JSKCommandParcel *)parcel;

@end

0 comments on commit 8ca1de1

Please sign in to comment.