Skip to content

Commit

Permalink
Fixes & improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
SkySwimmer committed Mar 15, 2024
1 parent 8654d97 commit a49b23d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
5 changes: 3 additions & 2 deletions discord-rpc-mod/RpcMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public override void PostInit()
+ " \"enabled\": true,\n"
+ " \"pipe\": -1,\n"
+ " \"joiningEnabled\": " + (Environment.GetEnvironmentVariable("CENTURIA_LAUNCHER_PATH") != null ? "true" : "false") + ",\n"
+ " \"disableAskToJoin\": false,"
+ " \"disableAskToJoin\": false,\n"
+ " \"joinExecutableWindows\": \"\",\n"
+ " \"joinExecutableLinux\": \"\",\n"
+ " \"joinExecutableOSX\": \"\",\n"
Expand Down Expand Up @@ -169,7 +169,8 @@ public override void PostInit()
// Bind updates
client.OnReady += (sender, e) =>
{
LogInfo("Received Ready from user " + e.User.Username);
if (config.enableLogging)
LogInfo("Received Ready from user " + e.User.Username);
if (client.CurrentPresence != null)
{
RichPresence pr = client.CurrentPresence.Clone();
Expand Down
5 changes: 5 additions & 0 deletions feraltweaks/FeralTweaks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using FeralTweaks;
using FeralTweaks.Actions;
using FeralTweaks.BundleInjection;
using Razorwhip.Sentinel.Feral;

namespace feraltweaks
{
Expand Down Expand Up @@ -54,6 +55,9 @@ public override void Init()
// Start action thread
FeralTweaksActionManager.StartActionThread();

// Sentinel
FeralSentinelInitializer.Init();

// Patch with harmony
LogInfo("Applying patches...");
ApplyPatches();
Expand Down Expand Up @@ -173,6 +177,7 @@ private void ApplyPatches()
ApplyPatch(typeof(DragonSparkSkeletonPatch));
ApplyPatch(typeof(NpcHeadRotationPatch));
ApplyPatch(typeof(PlayerJoinNotifPatch));
ApplyPatch(typeof(DisplayNameManagerPatches));
ApplyPatch(typeof(NotificationPatches));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using HarmonyLib;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem.Threading.Tasks;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using UnityEngine;

namespace feraltweaks.Patches.AssemblyCSharp
{
public class DisplayNameManagerPatches
{
[HarmonyPrefix]
[HarmonyPatch(typeof(UserManager), "GetDisplayNameBatched")]
public static bool GetDisplayNameBatched(UserManager __instance, string inUUID, ref Task<string> __result)
{
__result = IdentityService.GetDisplayName(inUUID, NetworkManager.JWT);
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -564,11 +564,12 @@ public static void SetChartObjectInstances()
if (!FeralTweaks.PatchConfig.ContainsKey("DisableClientChartPatches") || FeralTweaks.PatchConfig["DisableClientChartPatches"] != "True")
{
// Create patch directory
Directory.CreateDirectory(FeralTweaksLoader.GetLoadedMod<FeralTweaks>().ConfigDir + "/chartpatches");
string pth = System.Collections.Generic.CollectionExtensions.GetValueOrDefault(FeralTweaks.PatchConfig, "ChartPatchSource", FeralTweaksLoader.GetLoadedMod<FeralTweaks>().ConfigDir + "/chartpatches");
Directory.CreateDirectory(pth);

// Read patches
FeralTweaksLoader.GetLoadedMod<FeralTweaks>().LogInfo("Applying chart patches from configuration...");
foreach (FileInfo file in new DirectoryInfo(FeralTweaksLoader.GetLoadedMod<FeralTweaks>().ConfigDir + "/chartpatches").GetFiles("*.cdpf", SearchOption.AllDirectories))
foreach (FileInfo file in new DirectoryInfo(pth).GetFiles("*.cdpf", SearchOption.AllDirectories))
{
string patch = File.ReadAllText(file.FullName).Replace("\t", " ").Replace("\r", "");
ApplyPatch(patch, file.Name);
Expand Down

0 comments on commit a49b23d

Please sign in to comment.