add patch file

This commit is contained in:
Mister_Nebula 2020-12-21 19:41:53 +00:00
parent dc6232bbcf
commit 022636d588
5 changed files with 35 additions and 7 deletions

View File

@ -4,6 +4,7 @@ using QSB.DeathSync;
using QSB.ElevatorSync;
using QSB.LogSync;
using QSB.OrbSync;
using QSB.QuantumSync;
using QSB.TimeSync;
using QSB.Utility;
using System;
@ -29,7 +30,8 @@ namespace QSB.Patches
new ElevatorPatches(),
new OrbPatches(),
new WakeUpPatches(),
new LogPatches()
new LogPatches(),
new ServerQuantumPatches()
};
DebugLog.DebugWrite("Patch Manager ready.", MessageType.Success);

View File

@ -4,6 +4,7 @@
{
OnModStart = 0,
OnClientConnect = 1,
OnNonServerClientConnect = 2
OnNonServerClientConnect = 2,
OnServerClientConnect = 3
}
}

View File

@ -197,6 +197,7 @@
<Compile Include="Patches\QSBPatch.cs" />
<Compile Include="Patches\QSBPatchTypes.cs" />
<Compile Include="QSBSceneManager.cs" />
<Compile Include="QuantumSync\ServerQuantumPatches.cs" />
<Compile Include="TimeSync\TimeSyncType.cs" />
<Compile Include="TimeSync\TimeSyncUI.cs" />
<Compile Include="TimeSync\WakeUpPatches.cs" />

View File

@ -176,11 +176,8 @@ namespace QSB
OrbManager.Instance.QueueBuildSlots();
}
if (!QSBNetworkServer.localClientActive)
{
QSBPatchManager.DoPatchType(QSBPatchTypes.OnNonServerClientConnect);
}
var specificType = QSBNetworkServer.active ? QSBPatchTypes.OnServerClientConnect : QSBPatchTypes.OnNonServerClientConnect;
QSBPatchManager.DoPatchType(specificType);
QSBPatchManager.DoPatchType(QSBPatchTypes.OnClientConnect);
_lobby.CanEditName = false;

View File

@ -0,0 +1,27 @@
using QSB.Patches;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace QSB.QuantumSync
{
public class ServerQuantumPatches : QSBPatch
{
public override QSBPatchTypes Type => QSBPatchTypes.OnServerClientConnect;
public override void DoPatches()
{
QSBCore.Helper.HarmonyHelper.AddPrefix<ShapeVisibilityTracker>("IsVisibleUsingCameraFrustum", typeof(ServerQuantumPatches), nameof(IsVisibleUsingCameraFrustrum));
}
// ShapeVisibilityTracker patches
public bool IsVisibleUsingCameraFrustrum()
{
return false;
}
}
}