Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just some Summer cleaning. #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Components/JvsPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ private static bool getTriggerOff(ref bool __result, JvsButtonID __0)
return false;
}

// Use height because the touchpad is rotated

[MethodPatch(PatchType.Prefix, typeof(Jvs), "getAnalog")]
private static bool getAnalog(ref float __result)
{
Expand Down
17 changes: 17 additions & 0 deletions Components/SaveLoad/PacketPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,23 @@ private static bool PacketGetUserBpBaseProc(ref Packet.State __result, ref Packe
return true;
}

[MethodPatch(PatchType.Prefix, typeof(PacketGetUserTechCount), "proc")]
private static bool PacketGetUserTechCountProc(ref Packet.State __result, ref PacketGetUserTechCount __instance)
{
Log.Info($"PacketGetUserTechCount proc");

GetUserTechCount query = __instance.query as GetUserTechCount;

if (!FileSystem.Configuration.FileExists("UserTechCount.json"))
{
query.response_ = GetUserTechCountResponse.create();
FileSystem.Configuration.SaveJson("UserTechCount.json", query.response_);
}

query.response_ = FileSystem.Configuration.LoadJson<GetUserTechCountResponse>("UserTechCount.json");
return true;
}

[MethodPatch(PatchType.Prefix, typeof(PacketGameLogin), "proc")]
private static bool PacketGameLoginProc(ref Packet.State __result, PacketGameLogin __instance)
{
Expand Down
2 changes: 1 addition & 1 deletion Components/SerialPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public static void Patch()
[MethodPatch(PatchType.Prefix, typeof(SerialId), "get_Value")]
private static bool GetSerialId(ref string __result)
{
__result = "T3KNOG0DZ";
__result = "T3KNOG0DZ/FLAME";

return false;
}
Expand Down
9 changes: 0 additions & 9 deletions Components/SysConfigPatches.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MU3;
using MU3.Sys;
using System.IO;
using UnityEngine;

Expand All @@ -25,7 +24,6 @@ public static void Patch()
Harmony.MakeRET(typeof(MU3.Sys.Config), "get_isUseNetwork", false);
Harmony.MakeRET(typeof(MU3.Sys.Config), "get_isUseAllnet", false);
Harmony.MakeRET(typeof(MU3.Sys.Config), "get_isUseLocalCollab", false);
Harmony.MakeRET(typeof(MU3.Sys.Config), "get_isForceLogout", false);
// get_serverUri
// get_cameraType
Harmony.MakeRET(typeof(MU3.Sys.Config), "get_isKeyboardInput", true);
Expand Down Expand Up @@ -74,12 +72,5 @@ static bool LogPath(ref string __result)
__result = Directory.GetCurrentDirectory();
return false;
}

[MethodPatch(PatchType.Prefix, typeof(MU3.SystemUI), "initialize")]
static bool initialize()
{
Screen.fullScreen = SettingsManager.instance.settings.DisplayFullscreen;
return true;
}
}
}
2 changes: 0 additions & 2 deletions FileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public static string TimePrefix(string data)
public T LoadJson<T>(string fileName)
{
return JsonUtility.FromJson<T>(File.ReadAllText($"{m_basePath}\\{fileName}"));
//return JsonConvert.DeserializeObject<T>(File.ReadAllText($"{m_basePath}\\{fileName}"));
}

public T TryLoadJson<T>(string fileName)
Expand All @@ -52,7 +51,6 @@ public T TryLoadJson<T>(string fileName)
public void SaveJson<T>(string fileName, T data)
{
File.WriteAllText($"{m_basePath}\\{fileName}", JsonUtility.ToJson(data, true));
//File.WriteAllText($"{m_basePath}\\{fileName}", JsonConvert.SerializeObject(data, Formatting.Indented));
}

public string LoadText(string fileName)
Expand Down