8 Commits

Author SHA1 Message Date
Lapis 9a8fa38780 fix voice connecting for localhosted photon servers 2026-08-19 21:00:50 -04:00
Lapis e54e87595e Merge pull request #8 from yuptune/patch-1
the 2nd part to the image fix but client side. marquee next
2026-07-23 14:31:07 -04:00
Lapis 96e9e6e54f Merge pull request #9 from yuptune/patch-2
WHAT THE FUCK IS A GAME CONFIGGGGGGGG (RC marquee change)
2026-07-23 14:30:23 -04:00
haze d475cffdeb WHAT THE FUCK IS A GAME CONFIGGGGGGGG
hi mia
2026-07-23 14:22:44 -04:00
haze 86fa174aaf the 2nd part to the image fix but client side. marquee next
mrrowww >w< >////< nyahhhh,.,.,., *purrrrrrrr*
2026-07-23 14:18:11 -04:00
Lapis d28a296f67 Update README.md 2026-06-18 12:08:21 -04:00
Lapis bd5732509f Update README.md 2026-06-10 19:29:38 -04:00
Lapis 7379bc14a4 add advanced settings 2026-06-05 08:36:49 -04:00
6 changed files with 145 additions and 12 deletions
+23
View File
@@ -0,0 +1,23 @@
using HarmonyLib;
using Org.BouncyCastle.Crypto.Tls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CannedNet.Client.Patches
{
internal class ImageFix
{
[HarmonyPatch(typeof(OHDHPENHDAP), "DHEFMCDHLCG")]
internal class ImageSigPatch
{
// if i miss this jumpshot ill kill myself
private static void Postfix(ref bool __result)
{
__result = true;
}
}
}
}
+29 -10
View File
@@ -2,7 +2,9 @@ using System;
using System.Reflection; using System.Reflection;
using ExitGames.Client.Photon; using ExitGames.Client.Photon;
using HarmonyLib; using HarmonyLib;
using Photon.Pun;
using Photon.Realtime; using Photon.Realtime;
using Photon.Voice.PUN;
namespace CannedNet.Client.Patches; namespace CannedNet.Client.Patches;
@@ -48,22 +50,39 @@ public class Photon_AppSettings_Patch
if (type != null) break; if (type != null) break;
} }
} }
return type?.GetMethod("FJOLIPKKIBE", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance); return type?.GetMethod("FJOLIPKKIBE", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance);
} }
private static void Postfix(ref AppSettings __result) private static void Postfix(ref AppSettings __result)
{ {
Plugin.Log.LogInfo("okay im patching now"); Plugin.Log.LogInfo("okay im patching now");
__result = new() if (Plugin.EnableAdvancedSettings.Value)
{ {
AppVersion = __result?.AppVersion, __result = new()
AppIdRealtime = Plugin.AppIdRT.Value, {
AppIdVoice = Plugin.AppIdVoice.Value, AppVersion = __result?.AppVersion,
AppIdChat = Plugin.AppIdChat.Value, AppIdRealtime = Plugin.AppIdRT.Value,
FixedRegion = "us", AppIdVoice = Plugin.AppIdVoice.Value,
UseNameServer = true, AppIdChat = Plugin.AppIdChat.Value,
Protocol = ConnectionProtocol.Udp, FixedRegion = "us",
}; UseNameServer = true,
Protocol = ConnectionProtocol.Udp,
Server = Plugin.PhotonHostname.Value
};
}
else
{
__result = new()
{
AppVersion = __result?.AppVersion,
AppIdRealtime = Plugin.AppIdRT.Value,
AppIdVoice = Plugin.AppIdVoice.Value,
AppIdChat = Plugin.AppIdChat.Value,
FixedRegion = "us",
UseNameServer = true,
Protocol = ConnectionProtocol.Udp
};
}
} }
} }
@@ -0,0 +1,17 @@
using HarmonyLib;
using UnityEngine;
namespace CannedNet.Client.Patches;
[HarmonyPatch(typeof(RecRoomGameRoot))]
static class RecRoomGameRootPatch
{
[HarmonyPatch(nameof(RecRoomGameRoot.Awake))]
static void Postfix()
{
if (GameObject.Find("CannedNetRoot")) return;
GameObject modRoot = new GameObject("CannedNetRoot");
GameObject.DontDestroyOnLoad(modRoot);
modRoot.AddComponent<PhotonVoiceAuth>();
}
}
+39
View File
@@ -0,0 +1,39 @@
using System;
using Photon.Pun;
using Photon.Voice.PUN;
using UnityEngine;
namespace CannedNet.Client;
public class PhotonVoiceAuth : MonoBehaviour
{
public PhotonVoiceAuth(IntPtr handle) : base(handle)
{
}
public bool authValuesSet = false;
private void Update()
{
if (Plugin.EnableAdvancedSettings.Value)
{
var realtimeAuth = PhotonNetwork.AuthValues;
if (realtimeAuth != null)
{
if (authValuesSet)
return;
PhotonVoiceNetwork.Instance.Client.AuthValues = realtimeAuth;
authValuesSet = true;
}
else
{
if (!authValuesSet)
return;
authValuesSet = false;
}
}
}
}
+36 -1
View File
@@ -1,5 +1,8 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text.Json; using System.Text.Json;
using BepInEx; using BepInEx;
using BepInEx.Configuration; using BepInEx.Configuration;
@@ -7,6 +10,8 @@ using BepInEx.Logging;
using BepInEx.Unity.IL2CPP; using BepInEx.Unity.IL2CPP;
using BepInEx.Unity.IL2CPP.Utils.Collections; using BepInEx.Unity.IL2CPP.Utils.Collections;
using HarmonyLib; using HarmonyLib;
using Il2CppInterop.Runtime.Injection;
using Photon.Voice.PUN;
using UnityEngine; using UnityEngine;
using UnityEngine.Events; using UnityEngine.Events;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
@@ -23,6 +28,9 @@ public class Plugin : BasePlugin
public static ConfigEntry<string> AppIdVoice { get; private set; } public static ConfigEntry<string> AppIdVoice { get; private set; }
public static ConfigEntry<string> AppIdChat { get; private set; } public static ConfigEntry<string> AppIdChat { get; private set; }
public static ConfigEntry<string> ServerHostname { get; private set; } public static ConfigEntry<string> ServerHostname { get; private set; }
public static ConfigEntry<bool> EnableAdvancedSettings { get; private set; }
public static ConfigEntry<string> PhotonHostname { get; private set; }
public static ConfigEntry<int> PhotonPort { get; private set; }
public override void Load() public override void Load()
{ {
@@ -31,10 +39,27 @@ public class Plugin : BasePlugin
AppIdRT = Config.Bind("Photon", "App Id Realtime", "", "Photon Realtime App ID"); AppIdRT = Config.Bind("Photon", "App Id Realtime", "", "Photon Realtime App ID");
AppIdVoice = Config.Bind("Photon", "App Id Voice", "", "Photon Voice App ID"); AppIdVoice = Config.Bind("Photon", "App Id Voice", "", "Photon Voice App ID");
AppIdChat = Config.Bind("Photon", "App Id Chat", "", "Photon Chat App ID"); AppIdChat = Config.Bind("Photon", "App Id Chat", "", "Photon Chat App ID");
ServerHostname = Config.Bind("Server", "NameServer Host", "https://ns.lapis.codes", "Host for the NameServer."); EnableAdvancedSettings = Config.Bind("Advanced", "Enabled Advanced Settings", false, "Allows other fields below in the advanced section to be modified.");
PhotonHostname = Config.Bind("Advanced", "Photon NameServer", "", "Custom Photon NameServer");
PhotonPort = Config.Bind("Advanced", "Photon NameServer Port", 0, "Custom Photon NameServer Port (if 0, it will be default)");
ServerHostname = Config.Bind("Server", "RecNet NameServer Host", "https://ns.lapis.codes", "Host for the RecNet NameServer.");
Harmony.CreateAndPatchAll(typeof(Plugin).Assembly); Harmony.CreateAndPatchAll(typeof(Plugin).Assembly);
MethodInfo registerMethod = typeof(ClassInjector)
.GetMethods(BindingFlags.Public | BindingFlags.Static)
.FirstOrDefault(m => m.Name == "RegisterTypeInIl2Cpp" && m.IsGenericMethodDefinition);
IEnumerable<Type> il2cppTypes = Assembly.GetExecutingAssembly().GetTypes()
.Where(t => t.IsClass && !t.IsAbstract && t.IsSubclassOf(typeof(MonoBehaviour)))
.Where(t => t.Namespace == "CannedNet.Client")
.Where(t => t.GetConstructor(new[] { typeof(IntPtr) }) != null);
foreach (Type type in il2cppTypes)
{
registerMethod?.MakeGenericMethod(type).Invoke(null, null);
}
SceneManager.sceneLoaded += (Action<Scene, LoadSceneMode>)OnSceneLoaded; SceneManager.sceneLoaded += (Action<Scene, LoadSceneMode>)OnSceneLoaded;
} }
@@ -49,6 +74,16 @@ public class Plugin : BasePlugin
Log.LogInfo("cheatmanager destroyed"); Log.LogInfo("cheatmanager destroyed");
} }
} }
if (scene.name == "reccenter")
{
var MarqueeWhateverTheFuck = GameObject.Find("DynamicObjects/[RecCenter_Marquee]");
if (MarqueeWhateverTheFuck != null)
{
MarqueeWhateverTheFuck.transform.GetChild(0).GetComponent<TextMesh>().text = " Is this thing on?";
MarqueeWhateverTheFuck.transform.GetChild(1).GetComponent<TextMesh>().text = " Hello?";
Log.LogInfo("Rec Center theatre text changed LOL");
}
} }
} }
}
+1 -1
View File
@@ -1,2 +1,2 @@
# CannedNet.Client # CannedNet.Client
Client mod for connecting to CannedNet BepInEx 6 Client mod for connecting to a CannedNet instance