File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ using System . Text . RegularExpressions ;
2
+ using BrokeProtocol . API ;
3
+ using BrokeProtocol . LiteDB ;
4
+ using BrokeProtocol . Managers ;
5
+ using BrokeProtocol . Utility ;
6
+
7
+ namespace BPEssentials . Events
8
+ {
9
+ public class OnDelete : IScript
10
+ {
11
+ [ Target ( GameSourceEvent . ManagerTryDelete , ExecutionMode . PreEvent ) ]
12
+ public bool OnTryDelete ( ConnectData connectionData )
13
+ {
14
+ if ( SvManager . Instance . TryGetUserData ( connectionData . username , out User user ) && Core . Instance . Settings . General . DisableAccountOverwrite )
15
+ {
16
+ SvManager . Instance . RegisterFail ( connectionData . connection , "This name has already been registered and this server has disabled overwriting accounts!" ) ;
17
+ return false ;
18
+ }
19
+
20
+ return true ;
21
+ }
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments