More anti-piracy demo mode stuff pt. 2

This commit is contained in:
Eilionoir Tunnicliff authored and GitHub committed 2023-01-19 14:23:10 -05:00
1 parent febb05be46
commit 89b4650491
3 files changed
+9

No files matched your search

+3
View File
@@ -248,13 +248,16 @@
if (isDemo) {
// Remove the prefix "Demo."
subtitle = localize(@"login.option.demo", nil);
setenv("DEMO_LOCK", "1", 1);
setenv("POJAV_GAME_DIR", [NSString stringWithFormat:@"%s/.demo", getenv("POJAV_HOME")].UTF8String, 1);
} else if (selected[@"xboxGamertag"] == nil) {
subtitle = localize(@"login.option.local", nil);
unsetenv("DEMO_LOCK");
setenv("POJAV_GAME_DIR", [NSString stringWithFormat:@"%s/Library/Application Support/minecraft", getenv("POJAV_HOME")].UTF8String, 1);
} else {
// Display the Xbox gamertag for online accounts
subtitle = selected[@"xboxGamertag"];
unsetenv("DEMO_LOCK");
setenv("POJAV_GAME_DIR", [NSString stringWithFormat:@"%s/Library/Application Support/minecraft", getenv("POJAV_HOME")].UTF8String, 1);
}
@@ -6,6 +6,9 @@
self.authData[@"oldusername"] = self.authData[@"username"] = self.authData[@"input"];
self.authData[@"accessToken"] = @"0";
self.authData[@"profileId"] = @"00000000-0000-0000-0000-000000000000";
if(getenv("DEMO_LOCK")) {
unsetenv("DEMO_LOCK");
}
setenv("POJAV_GAME_DIR", [NSString stringWithFormat:@"%s/Library/Application Support/minecraft", getenv("POJAV_HOME")].UTF8String, 1);
callback(nil, [super saveChanges]);
}
@@ -185,6 +185,9 @@ typedef void(^XSTSCallback)(NSString *xsts, NSString *uhs);
self.authData[@"profilePicURL"] = [NSString stringWithFormat:@"https://mc-heads.net/head/%@/120", self.authData[@"profileId"]];
self.authData[@"oldusername"] = self.authData[@"username"];
self.authData[@"username"] = response[@"name"];
if(getenv("DEMO_LOCK")) {
unsetenv("DEMO_LOCK");
}
setenv("POJAV_GAME_DIR", [NSString stringWithFormat:@"%s/Library/Application Support/minecraft", getenv("POJAV_HOME")].UTF8String, 1);
callback(nil, [super saveChanges]);
} failure:^(NSURLSessionDataTask *task, NSError *error) {