generated from Misaka-SL-Project/TemplatePlugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Plugin.cs
45 lines (41 loc) · 1.51 KB
/
Plugin.cs
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
45
using System;
using Exiled.API.Features;
using System.IO;
using static BetterMute.EventHandlers.EventHandlers;
namespace BetterMute
{
using EventHandlers;
public class Plugin : Plugin<Config>
{
public override string Author { get; } = "Killla";
public override string Name { get; } = "Better Mute";
public override string Prefix { get; } = "BetterMute";
public override Version Version { get; } = new Version(2, 0, 0);
public override Version RequiredExiledVersion { get; } = new Version(6, 0, 0);
public EventHandlers.EventHandlers ServerHandlers;
public override void OnEnabled()
{
ServerHandlers = new EventHandlers.EventHandlers(this);
Exiled.Events.Handlers.Server.RoundEnded += ServerHandlers.OnRoundEnded;
Exiled.Events.Handlers.Player.Verified += ServerHandlers.OnVerified;
path = Config.DataDir;
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
path = Path.Combine(path, "MuteList.txt");
if (!File.Exists(path))
{
File.Create(path).Close();
}
MuteList = GetMuteList();
base.OnEnabled();
}
public override void OnDisabled()
{
Exiled.Events.Handlers.Server.RoundEnded -= ServerHandlers.OnRoundEnded;
Exiled.Events.Handlers.Player.Verified -= ServerHandlers.OnVerified;
base.OnDisabled();
}
}
}