-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathWarningsConfig.cs
57 lines (52 loc) · 2.1 KB
/
WarningsConfig.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
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using Rocket.API;
namespace AdminWarnings
{
public class WarningsConfig : IRocketPluginConfiguration
{
public bool Enabled;
public bool AnnouceWarningKicksAndBansServerWide;
public bool AnnouceWarningsServerWide;
public string MessageColor;
public int DaysWarningsExpire;
[XmlArrayItem(ElementName = "WarningPoint")]
public List<WarningPoint> WarningPoints;
[XmlArrayItem(ElementName = "PlayerWarning")]
public List<PlayerWarning> PlayerWarnings;
public void LoadDefaults()
{
Enabled = true;
MessageColor = "Green";
DaysWarningsExpire = 7;
AnnouceWarningKicksAndBansServerWide = true;
AnnouceWarningsServerWide = false;
WarningPoints = new List<WarningPoint> {
new WarningPoint{ WarningsToTrigger = 3, KickPlayer = true, BanPlayer = false, BanLengthSeconds = 0, ConsoleCommand = "" },
new WarningPoint{ WarningsToTrigger = 4, KickPlayer = false, BanPlayer = true, BanLengthSeconds = 600, ConsoleCommand = "" },
new WarningPoint{ WarningsToTrigger = 5, KickPlayer = false, BanPlayer = true, BanLengthSeconds = 1800, ConsoleCommand = "" },
new WarningPoint{ WarningsToTrigger = 6, KickPlayer = false, BanPlayer = true, BanLengthSeconds = 86400, ConsoleCommand = "" },
new WarningPoint{ WarningsToTrigger = 7, KickPlayer = false, BanPlayer = true, BanLengthSeconds = 432000, ConsoleCommand = "" }
};
PlayerWarnings = new List<PlayerWarning>();
}
}
public class WarningPoint
{
public int WarningsToTrigger;
public bool KickPlayer;
public bool BanPlayer;
public uint BanLengthSeconds;
public string ConsoleCommand;
}
public class PlayerWarning
{
[XmlAttribute]
public string CSteamID;
[XmlAttribute]
public int Warnings;
[XmlAttribute]
public DateTime DateAdded;
}
}