-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfiguration.cs
66 lines (61 loc) · 1.83 KB
/
Configuration.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using Rocket.API;
using Rocket.Core.Assets;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
using Rocket.Unturned.Items;
using SDG.Unturned;
namespace StrikesPlugin
{
public sealed class Strike
{
[XmlAttribute("SequenceNumber")]
public int SequenceNumber;
[XmlAttribute("Action")]
public string Action;
[XmlAttribute("BanOrKickReason")]
public string Reason;
[XmlAttribute("BanTime")]
public uint BanTime;
[XmlAttribute("ClearWarnings")]
public bool ClearWarnings;
public Strike(int sequencenumber, string action, string reason, uint bantime, bool clearwarnings)
{
SequenceNumber = sequencenumber;
Action = action;
Reason = reason;
BanTime = bantime;
ClearWarnings = clearwarnings;
}
public Strike()
{
SequenceNumber = 0;
Action = "none";
Reason = "";
BanTime = 0;
ClearWarnings = false;
}
}
public class Configuration : IRocketPluginConfiguration
{
public bool AnnounceKickAndBanGlobally;
public bool AnnounceStrikesGlobally;
public List<Strike> StrikeSequence;
public void LoadDefaults()
{
AnnounceKickAndBanGlobally = true;
AnnounceStrikesGlobally = true;
StrikeSequence = new List<Strike>
{
new Strike(1, "", "", 0, false),
new Strike(2, "", "", 0, false),
new Strike(3, "", "", 0, false),
new Strike(4, "", "", 0, false),
new Strike(5, "BAN", "You have reached your 5th strike", 18000, true)
};
}
}
}