host discovery Chinese localization. Cancel LAN restriction
This commit is contained in:
1 parent
070fbc8b52
commit
34d9875ff3
2 files changed
+34
-10
No files matched your search
@@ -14,6 +14,7 @@
|
||||
#import "DiscoveryWorker.h"
|
||||
#import "ServerInfoResponse.h"
|
||||
#import "IdManager.h"
|
||||
#import "LocalizationHelper.h"
|
||||
|
||||
#include <Limelight.h>
|
||||
#include <arpa/inet.h>
|
||||
@@ -110,7 +111,8 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
BOOL ret = ![DiscoveryManager isAddressLAN:((struct sockaddr_in*)result->ai_addr)->sin_addr.s_addr];
|
||||
// BOOL ret = ![DiscoveryManager isAddressLAN:((struct sockaddr_in*)result->ai_addr)->sin_addr.s_addr];
|
||||
BOOL ret = NO; // Cancel LAN restriction for personnal use.
|
||||
freeaddrinfo(result);
|
||||
|
||||
return ret;
|
||||
@@ -128,13 +130,7 @@
|
||||
|
||||
- (void) discoverHost:(NSString *)hostAddress withCallback:(void (^)(TemporaryHost *, NSString*))callback {
|
||||
BOOL prohibitedAddress = [DiscoveryManager isProhibitedAddress:hostAddress];
|
||||
NSString* prohibitedAddressMessage = [NSString stringWithFormat: @"Moonlight only supports adding PCs on your local network on %s.",
|
||||
#if TARGET_OS_TV
|
||||
"tvOS"
|
||||
#else
|
||||
"iOS"
|
||||
#endif
|
||||
];
|
||||
NSString* prohibitedAddressMessage = [LocalizationHelper localizedStringForKey: @"Moonlight-iOS/tvOS only supports adding PCs on your local network on %s."];
|
||||
ServerInfoResponse* serverInfoResponse = [self getServerInfoResponseForAddress:hostAddress];
|
||||
|
||||
TemporaryHost* host = nil;
|
||||
@@ -202,7 +198,7 @@
|
||||
callback(host, nil);
|
||||
}
|
||||
} else if (!prohibitedAddress) {
|
||||
callback(nil, @"Could not connect to host.\n\nIf you're hosting using GeForce Experience, make sure you've enabled the toggle on the SHIELD tab.\n\nIf you're hosting using Sunshine, ensure it is running properly. If you're using a non-default port, you will need to include that here.");
|
||||
callback(nil, [LocalizationHelper localizedStringForKey:@"Manual_Add_Host_Fail"]);
|
||||
} else {
|
||||
callback(nil, prohibitedAddressMessage);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user