-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsamples.mt
184 lines (135 loc) · 4.2 KB
/
samples.mt
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#####################################################################
#
# only allow administrator access (by username or IP address)
#
#####################################################################
pass any
if $addr eq 172.16.100.1
if $addr eq 172.16.100.2
if $name eq "admin"
continue
fail now
#####################################################################
#
# block access from a range of IP addresses
#
#####################################################################
try "This subnet is blocked by the administrator."
fail any
if $addr is /192.88.99.6</a
if $addr is /203.0.113.?/a
if $addr is /192.168.12^14.?/a
continue
pass now
#####################################################################
#
# only allow access from whitelisted players
#
#####################################################################
try "The account '$name' is not permitted to join this server."
when $name in @whitelist.txt pass
fall now
#####################################################################
#
# never allow access from blacklisted players
#
#####################################################################
try "The account '$name' is not permitted to join this server."
when $name in @blacklist.txt fail
pass now
#####################################################################
#
# notify players that the server is unavailable right now
#
#####################################################################
try "The server is temporarily offline for maintenance."
fail now
#####################################################################
#
# disallow players with all uppercase names
#
#####################################################################
try "Sorry, we do not accept all uppercase player names."
when $name eq uc($name) fail
pass now
#####################################################################
#
# disallow players with very short or very long names
#
#####################################################################
try "Sorry, this player name is too long or too short."
fail any
if $name->len() gt 20
if $name->len() lt 3
continue
pass now
#####################################################################
#
# disallow users that appear to be bots or guests
#
#####################################################################
try "Sorry, we do not accept autogenerated player names."
fail any
if $name is /;*;*##/
if $name is /;*;*###/
if $name is /Player#/
if $name is /Player##/
if $name is /Guest#/
if $name is /Guest##/
continue
pass now
#####################################################################
#
# disallow new players when the server is near capacity
#
#####################################################################
try "There are too many players online right now."
fail all
if $is_new eq $true
if $cur_users gte $max_users->mul(0.8)
continue
pass now
#####################################################################
#
# prevent players from joining with a reserved name
#
#####################################################################
try "Sorry, this acccount has been permanently restricted."
fail all
if $is_new eq $true
if ("moderator","server","client","owner","player","system","operator","minetest") has $name
continue
pass now
#####################################################################
#
# disallow players that have been inactive for 90 days
#
#####################################################################
try "Sorry, this acccount has been disabled for inactivity."
fail all
if $is_new eq $false
if age($newlogin) gt 90d
continue
pass now
#####################################################################
#
# disallow new players during the weekends
#
#####################################################################
try "Sorry, we are not accepting new players at this time."
fail now
if $is_new eq $true
if $clock->day() in ("Sat","Sun")
continue
pass now
#####################################################################
#
# prevent players from spam-logging the server
#
#####################################################################
try "You are doing that too much. Please wait awhile."
fail all
if $is_new eq $false
if age($newlogin) lt 15s
continue
pass now