Files
BoneSync/BoneSync/Patching/SceneManagerPatches.cs
Aaro Varis 104c52c183 Aaa
2025-03-14 21:30:03 +02:00

42 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BoneSync.Data;
using BoneSync.Sync;
using HarmonyLib;
using MelonLoader;
using StressLevelZero.Utilities;
namespace BoneSync.Patching
{
[HarmonyPatch(typeof(BoneworksSceneManager))]
internal class SceneManagerPatches
{
/*[HarmonyPatch(nameof(BoneworksSceneManager.LoadScene), new Type[] { typeof(int) }), HarmonyPrefix]
private static void LoadSceneIndexPrefix(int sceneBuildIndex)
{
SyncLogger.Msg("LoadScenePrefix: " + sceneBuildIndex);
if (!BoneSync.IsConnected) return;
if (BoneSync.lobby.IsHost)
{
SyncLogger.Msg("Host is loading scene, sending message to clients...");
SceneSync.SendSceneSyncMessage(sceneBuildIndex);
}
}
[HarmonyPatch(nameof(BoneworksSceneManager.LoadScene), new Type[] { typeof(string) }), HarmonyPostfix]
private static void LoadSceneStringPrefix(string sceneName)
{
SyncLogger.Msg("LoadScenePrefix: " + sceneName);
if (!BoneSync.IsConnected) return;
if (BoneSync.lobby.IsHost)
{
//SyncLogger.Msg("Host is loading scene, sending message to clients...");
//SceneSync.SendSceneSyncMessage(sceneName);
}
}*/
}
}