mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 14:11:35 +00:00
added support for custom host
This commit is contained in:
@@ -14,5 +14,6 @@
|
||||
@property BOOL paired;
|
||||
|
||||
- (id) initWithHost:(NSNetService*)host;
|
||||
- (id) initWithIp:(NSString*)host;
|
||||
|
||||
@end
|
||||
|
||||
@@ -19,4 +19,13 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id) initWithIp:(NSString*)host {
|
||||
self = [super init];
|
||||
|
||||
self.hostName = host;
|
||||
self.displayName = host;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
@property (strong, nonatomic) IBOutlet UIPickerView *StreamConfigs;
|
||||
@property (strong, nonatomic) NSArray* streamConfigVals;
|
||||
@property (strong, nonatomic) NSArray* hostPickerVals;
|
||||
|
||||
- (void) segueIntoStream;
|
||||
@property (strong, nonatomic) IBOutlet UITextField *hostTextField;
|
||||
|
||||
+ (NSString*) getHost;
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@ static NSString* host;
|
||||
- (void)PairButton:(UIButton *)sender
|
||||
{
|
||||
NSLog(@"Pair Button Pressed!");
|
||||
if ([self.hostTextField.text length] > 0) {
|
||||
_selectedHost = [[Computer alloc] initWithIp:self.hostTextField.text];
|
||||
NSLog(@"Using custom host: %@", self.hostTextField.text);
|
||||
}
|
||||
[CryptoManager generateKeyPairUsingSSl];
|
||||
NSString* uniqueId = [CryptoManager getUniqueID];
|
||||
NSData* cert = [CryptoManager readCertFromFile];
|
||||
@@ -65,6 +69,10 @@ static NSString* host;
|
||||
- (void)StreamButton:(UIButton *)sender
|
||||
{
|
||||
NSLog(@"Stream Button Pressed!");
|
||||
if ([self.hostTextField.text length] > 0) {
|
||||
_selectedHost = [[Computer alloc] initWithIp:self.hostTextField.text];
|
||||
NSLog(@"Using custom host: %@", self.hostTextField.text);
|
||||
}
|
||||
host = _selectedHost.hostName;
|
||||
[self performSegueWithIdentifier:@"createStreamFrame" sender:self];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user