forked from NamelessSCP/LobbySystem
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPatch.cs
More file actions
44 lines (40 loc) · 1.32 KB
/
Patch.cs
File metadata and controls
44 lines (40 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using CommandSystem.Commands.RemoteAdmin;
using CommandSystem.Commands.Shared;
using Exiled.API.Features;
using HarmonyLib;
using LabApi.Events;
using PlayerRoles;
using Round = LabApi.Features.Wrappers.Round;
namespace LobbySystem;
[HarmonyPatch(typeof(CharacterClassManager), nameof(CharacterClassManager.ForceRoundStart))]
internal static class RoundStartPatch
{
private static void Postfix()
{
//EventManager.InvokeEvent(Round.Start);
//Round.Start();
Server.Host.ReferenceHub.characterClassManager.NetworkRoundStarted = true;
Server.Host.ReferenceHub.characterClassManager.RpcRoundStarted();
}
}
[HarmonyPatch(typeof(ForceStartCommand), nameof(ForceStartCommand.Execute))]
internal static class CommandPatch
{
private static void Postfix(bool __result)
{
if (__result)
{
Plugin.Instance.eventHandler.RestoreDoorLockStates();
Plugin.Instance.eventHandler.CleanUpRagdolls();
Plugin.Instance.eventHandler.ClearGlobalIntercom();
foreach (Player player in Player.List)
player.Role.Set(RoleTypeId.Spectator);
}
//Round.Start();
}
}
[HarmonyPatch(typeof(CharacterClassManager), nameof(CharacterClassManager.Init))]
internal static class InitPatch
{
private static bool Prefix() => false;
}