-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPluginConfig.cs
More file actions
154 lines (126 loc) · 4.64 KB
/
PluginConfig.cs
File metadata and controls
154 lines (126 loc) · 4.64 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
using System.Text.Json.Serialization;
using CounterStrikeSharp.API.Core;
namespace SimpleAdminMode;
/// <summary>
/// Plugin configuration — auto-generated at:
/// configs/plugins/SimpleAdminMode/SimpleAdminMode.json
/// </summary>
public class PluginConfig : BasePluginConfig
{
// -------------------------------------------------------------------------
// Database
// -------------------------------------------------------------------------
[JsonPropertyName("Host")]
public string Host { get; set; } = "127.0.0.1";
[JsonPropertyName("Port")]
public int Port { get; set; } = 3306;
[JsonPropertyName("Database")]
public string Database { get; set; } = "sam";
[JsonPropertyName("Username")]
public string Username { get; set; } = "root";
[JsonPropertyName("Password")]
public string Password { get; set; } = "";
// -------------------------------------------------------------------------
// Telegram
// -------------------------------------------------------------------------
/// <summary>Telegram bot token for player reports. Leave empty to disable.</summary>
[JsonPropertyName("TelegramBotToken")]
public string TelegramBotToken { get; set; } = "";
/// <summary>Telegram chat ID to receive reports. Leave empty to disable.</summary>
[JsonPropertyName("TelegramChatId")]
public string TelegramChatId { get; set; } = "";
// -------------------------------------------------------------------------
// Warn system
// -------------------------------------------------------------------------
/// <summary>Maximum warns before auto-ban.</summary>
[JsonPropertyName("MaxWarns")]
public int MaxWarns { get; set; } = 3;
/// <summary>Auto-ban duration in minutes after exceeding MaxWarns. 0 = permanent.</summary>
[JsonPropertyName("WarnBanDuration")]
public int WarnBanDuration { get; set; } = 60;
/// <summary>Reason used for auto-ban when warns exceed limit.</summary>
[JsonPropertyName("WarnBanReason")]
public string WarnBanReason { get; set; } = "Exceeded warn limit";
// -------------------------------------------------------------------------
// Predefined reasons
// -------------------------------------------------------------------------
[JsonPropertyName("SlayReasons")]
public List<string> SlayReasons { get; set; } = new()
{
"Teamkill",
"AFK",
"Cheating"
};
[JsonPropertyName("KickReasons")]
public List<string> KickReasons { get; set; } = new()
{
"AFK",
"Teamkill",
"Toxic behavior",
"Body blocking"
};
[JsonPropertyName("BanReasons")]
public List<string> BanReasons { get; set; } = new()
{
"Cheating",
"Griefing",
"Ban evasion",
"Toxic behavior"
};
[JsonPropertyName("GagReasons")]
public List<string> GagReasons { get; set; } = new()
{
"Spam",
"Toxic behavior",
"Advertising"
};
[JsonPropertyName("MuteReasons")]
public List<string> MuteReasons { get; set; } = new()
{
"Spam",
"Toxic behavior",
"Noise"
};
[JsonPropertyName("SilenceReason")]
public List<string> SilenceReason { get; set; } = new()
{
"Spam",
"Toxic behavior",
"Noise"
};
[JsonPropertyName("WarnReasons")]
public List<string> WarnReasons { get; set; } = new()
{
"Toxic behavior",
"Spam",
"Cheating",
"Griefing",
"Advertising"
};
// -------------------------------------------------------------------------
// Predefined durations
// -------------------------------------------------------------------------
private static Dictionary<string, int> DefaultDurations => new()
{
{ "30 minutes", 30 },
{ "1 hour", 60 },
{ "2 hours", 120 },
{ "3 hours", 180 },
{ "6 hours", 360 },
{ "12 hours", 720 },
{ "1 day", 1440 },
{ "3 days", 4320 },
{ "1 week", 10080 },
{ "2 weeks", 20160 },
{ "1 month", 43800 },
{ "Permanent", 0 }
};
[JsonPropertyName("BanDuration")]
public Dictionary<string, int> BanDuration { get; set; } = DefaultDurations;
[JsonPropertyName("GagDuration")]
public Dictionary<string, int> GagDuration { get; set; } = DefaultDurations;
[JsonPropertyName("MuteDuration")]
public Dictionary<string, int> MuteDuration { get; set; } = DefaultDurations;
[JsonPropertyName("SilenceDuration")]
public Dictionary<string, int> SilenceDuration { get; set; } = DefaultDurations;
}