mirror of
https://github.com/BillyCool/MariesWonderland.git
synced 2026-03-28 09:42:19 +01:00
Update hooks to make the home menu visible. Update server to return correct user data.
This commit is contained in:
@@ -307,8 +307,11 @@ function DarkClient_InvokeAsync(offset) {
|
|||||||
const func_ptr = libil2cpp.add(offset);
|
const func_ptr = libil2cpp.add(offset);
|
||||||
Interceptor.attach(func_ptr, {
|
Interceptor.attach(func_ptr, {
|
||||||
onEnter(args) {
|
onEnter(args) {
|
||||||
this.path = readString(args[1]);
|
var path = readString(args[1]);
|
||||||
onEnterLogWrapper(DarkClient_InvokeAsync.name, `path=${this.path}`);
|
onEnterLogWrapper(DarkClient_InvokeAsync.name, `path=${path}`);
|
||||||
|
},
|
||||||
|
onLeave(result) {
|
||||||
|
onLeaveLogWrapper(DarkClient_InvokeAsync.name);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -380,6 +383,30 @@ function DataManager_ApplyToDatabase(offset) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var isInitMenuButton = false;
|
||||||
|
function TitleScreen_InitializeMenuButton(offset) {
|
||||||
|
const func_ptr = libil2cpp.add(offset);
|
||||||
|
Interceptor.attach(func_ptr, {
|
||||||
|
onEnter(args) {
|
||||||
|
isInitMenuButton = true;
|
||||||
|
},
|
||||||
|
onLeave(result) {
|
||||||
|
isInitMenuButton = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function CanvasGroupExtensions_SetActive(offset) {
|
||||||
|
const func_ptr = libil2cpp.add(offset);
|
||||||
|
Interceptor.attach(func_ptr, {
|
||||||
|
onEnter(args) {
|
||||||
|
if (isInitMenuButton) {
|
||||||
|
args[1] = ptr(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
const SERVER_ADDRESS = 'humbly-tops-calf.ngrok-free.app';
|
const SERVER_ADDRESS = 'humbly-tops-calf.ngrok-free.app';
|
||||||
@@ -396,6 +423,8 @@ awaitLibil2cpp(() => {
|
|||||||
callbackWrapper(HandleNet_Decrypt, 0x279420C); // Bypass GRPC decryption
|
callbackWrapper(HandleNet_Decrypt, 0x279420C); // Bypass GRPC decryption
|
||||||
callbackWrapper(DarkClient_InvokeAsync, 0x38AC274); // GRPC requests logging
|
callbackWrapper(DarkClient_InvokeAsync, 0x38AC274); // GRPC requests logging
|
||||||
callbackWrapper(OctoAPI_DecryptAes, 0x4C27410);
|
callbackWrapper(OctoAPI_DecryptAes, 0x4C27410);
|
||||||
|
callbackWrapper(TitleScreen_InitializeMenuButton, 0x2F11900); // Make menu visible
|
||||||
|
callbackWrapper(CanvasGroupExtensions_SetActive, 0x2D257DC); // Make menu visible
|
||||||
//callbackWrapper(DataManager_SetUrls, 0x3DA0170);
|
//callbackWrapper(DataManager_SetUrls, 0x3DA0170);
|
||||||
//callbackWrapper(DataManager_ApplyToDatabase, 0x3D9F5EC);
|
//callbackWrapper(DataManager_ApplyToDatabase, 0x3D9F5EC);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ public class DataService : Art.Framework.ApiNetwork.Grpc.Api.Data.DataService.Da
|
|||||||
private const string LatestMasterDataVersion = "20240404193219";
|
private const string LatestMasterDataVersion = "20240404193219";
|
||||||
private const string UserDataBasePath = @"path\to\user\data";
|
private const string UserDataBasePath = @"path\to\user\data";
|
||||||
|
|
||||||
|
private const string TablePrefix = "Entity";
|
||||||
|
private const string TableSuffix = "Table";
|
||||||
|
|
||||||
public override Task<MasterDataGetLatestVersionResponse> GetLatestMasterDataVersion(Empty request, ServerCallContext context)
|
public override Task<MasterDataGetLatestVersionResponse> GetLatestMasterDataVersion(Empty request, ServerCallContext context)
|
||||||
{
|
{
|
||||||
return Task.FromResult(new MasterDataGetLatestVersionResponse
|
return Task.FromResult(new MasterDataGetLatestVersionResponse
|
||||||
@@ -21,7 +24,15 @@ public class DataService : Art.Framework.ApiNetwork.Grpc.Api.Data.DataService.Da
|
|||||||
{
|
{
|
||||||
UserDataGetNameResponseV2 response = new();
|
UserDataGetNameResponseV2 response = new();
|
||||||
TableNameList tableNameList = new();
|
TableNameList tableNameList = new();
|
||||||
tableNameList.TableName.AddRange(Directory.EnumerateFiles(UserDataBasePath, "*.json").Select(x => Path.GetFileNameWithoutExtension(x)));
|
var names = Directory
|
||||||
|
.EnumerateFiles(UserDataBasePath, "*.json")
|
||||||
|
.Select(path =>
|
||||||
|
{
|
||||||
|
var name = Path.GetFileNameWithoutExtension(path); // e.g. "EntityIUserTable"
|
||||||
|
return name.Substring(TablePrefix.Length, name.Length - TablePrefix.Length - TableSuffix.Length); // result for "EntityIUserTable" -> "IUser"
|
||||||
|
});
|
||||||
|
|
||||||
|
tableNameList.TableName.AddRange(names);
|
||||||
response.TableNameList.Add(tableNameList);
|
response.TableNameList.Add(tableNameList);
|
||||||
|
|
||||||
return Task.FromResult(response);
|
return Task.FromResult(response);
|
||||||
@@ -33,7 +44,7 @@ public class DataService : Art.Framework.ApiNetwork.Grpc.Api.Data.DataService.Da
|
|||||||
|
|
||||||
foreach (var tableName in request.TableName)
|
foreach (var tableName in request.TableName)
|
||||||
{
|
{
|
||||||
var filePath = Path.Combine(UserDataBasePath, tableName + ".json");
|
var filePath = Path.Combine(UserDataBasePath, TablePrefix + tableName + TableSuffix + ".json");
|
||||||
var jsonContent = File.ReadAllText(filePath);
|
var jsonContent = File.ReadAllText(filePath);
|
||||||
response.UserDataJson.Add(tableName, jsonContent);
|
response.UserDataJson.Add(tableName, jsonContent);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user