mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 14:11:35 +00:00
Created new host discovery system
- now store host uuid and mac address - use uuid to check for duplicate hosts - try local and external IPs - pair status is shown - server status is shown - validate host when manually adding
This commit is contained in:
@@ -19,6 +19,6 @@
|
||||
- (Settings*) retrieveSettings;
|
||||
- (NSArray*) retrieveHosts;
|
||||
- (void) saveHosts;
|
||||
- (Host*) createHost:(NSString*)name hostname:(NSString*)address;
|
||||
- (Host*) createHost;
|
||||
|
||||
@end
|
||||
|
||||
@@ -45,12 +45,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (Host*) createHost:(NSString*)name hostname:(NSString*)address {
|
||||
- (Host*) createHost {
|
||||
NSEntityDescription* entity = [NSEntityDescription entityForName:@"Host" inManagedObjectContext:[self.appDelegate managedObjectContext]];
|
||||
Host* host = [[Host alloc] initWithEntity:entity insertIntoManagedObjectContext:[self.appDelegate managedObjectContext]];
|
||||
|
||||
host.name = name;
|
||||
host.address = address;
|
||||
return host;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,17 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <CoreData/CoreData.h>
|
||||
|
||||
#import "Utils.h"
|
||||
|
||||
@interface Host : NSManagedObject
|
||||
|
||||
@property (nonatomic, retain) NSString * address;
|
||||
@property (nonatomic, retain) NSString * name;
|
||||
@property (nonatomic, retain) NSString * address;
|
||||
@property (nonatomic, retain) NSString * localAddress;
|
||||
@property (nonatomic, retain) NSString * externalAddress;
|
||||
@property (nonatomic, retain) NSString * uuid;
|
||||
@property (nonatomic, retain) NSString * mac;
|
||||
@property (nonatomic) BOOL online;
|
||||
@property (nonatomic) PairState pairState;
|
||||
|
||||
@end
|
||||
|
||||
@@ -11,7 +11,13 @@
|
||||
|
||||
@implementation Host
|
||||
|
||||
@dynamic address;
|
||||
@dynamic name;
|
||||
@dynamic address;
|
||||
@dynamic localAddress;
|
||||
@dynamic externalAddress;
|
||||
@dynamic uuid;
|
||||
@dynamic mac;
|
||||
@dynamic pairState;
|
||||
@synthesize online;
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user