mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-15 21:21:45 +00:00
no longer allow duplicate hosts
This commit is contained in:
@@ -28,4 +28,20 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)isEqual:(id)object {
|
||||||
|
if ([object isKindOfClass:[Computer class]]) {
|
||||||
|
return [self.hostName isEqual:[object valueForKey:@"hostName"]];
|
||||||
|
} else {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSUInteger)hash {
|
||||||
|
NSUInteger prime = 31;
|
||||||
|
NSUInteger result = 1;
|
||||||
|
result = prime * result + (self.hostName == nil ? 0 : [self.hostName hash]);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -171,18 +171,20 @@ static StreamConfiguration* streamConfig;
|
|||||||
// Change button color
|
// Change button color
|
||||||
_settingsSidebarButton.tintColor = [UIColor colorWithRed:.2 green:.9 blue:0.f alpha:1.f];
|
_settingsSidebarButton.tintColor = [UIColor colorWithRed:.2 green:.9 blue:0.f alpha:1.f];
|
||||||
|
|
||||||
// Set the side bar button action. When it's tapped, it'll show up the sidebar.
|
// Set the side bar button action. When it's tapped, it'll show the sidebar.
|
||||||
_settingsSidebarButton.target = self.revealViewController;
|
_settingsSidebarButton.target = self.revealViewController;
|
||||||
_settingsSidebarButton.action = @selector(revealToggle:);
|
_settingsSidebarButton.action = @selector(revealToggle:);
|
||||||
|
|
||||||
// Set the gesture
|
// Set the gesture
|
||||||
[self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
|
[self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
|
||||||
|
|
||||||
|
// Get callbacks associated with the viewController
|
||||||
[self.revealViewController setDelegate:self];
|
[self.revealViewController setDelegate:self];
|
||||||
|
|
||||||
// Set the current position to the center
|
// Set the current position to the center
|
||||||
currentPosition = FrontViewPositionLeft;
|
currentPosition = FrontViewPositionLeft;
|
||||||
|
|
||||||
|
// Set up crypto
|
||||||
_opQueue = [[NSOperationQueue alloc] init];
|
_opQueue = [[NSOperationQueue alloc] init];
|
||||||
[CryptoManager generateKeyPairUsingSSl];
|
[CryptoManager generateKeyPairUsingSSl];
|
||||||
_uniqueId = [CryptoManager getUniqueID];
|
_uniqueId = [CryptoManager getUniqueID];
|
||||||
|
|||||||
Reference in New Issue
Block a user