mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-03 16:38:31 +00:00
Implement username validation
This commit is contained in:
parent
0dffc494e4
commit
95a8f710f8
7 changed files with 242 additions and 21 deletions
|
@ -13,6 +13,11 @@ func commandLineConsole() {
|
|||
|
||||
shell := ishell.NewShell()
|
||||
|
||||
shell.Register("help", func(args ...string) (string, error) {
|
||||
shell.PrintCommands()
|
||||
return "", nil
|
||||
})
|
||||
|
||||
shell.Register("clientcount", func(args ...string) (string, error) {
|
||||
server.GlobalSubscriptionInfo.RLock()
|
||||
count := len(server.GlobalSubscriptionInfo.Members)
|
||||
|
@ -67,6 +72,24 @@ func commandLineConsole() {
|
|||
return "", nil
|
||||
})
|
||||
|
||||
shell.Register("authorizeeveryone", func(args ...string) (string, error) {
|
||||
if len(args) == 0 {
|
||||
if server.Configuation.SendAuthToNewClients {
|
||||
return "All clients are recieving auth challenges upon claiming a name.", nil
|
||||
} else {
|
||||
return "All clients are not recieving auth challenges upon claiming a name.", nil
|
||||
}
|
||||
} else if args[0] == "on" {
|
||||
server.Configuation.SendAuthToNewClients = true
|
||||
return "All new clients will recieve auth challenges upon claiming a name.", nil
|
||||
} else if args[0] == "off" {
|
||||
server.Configuation.SendAuthToNewClients = false
|
||||
return "All new clients will not recieve auth challenges upon claiming a name.", nil
|
||||
} else {
|
||||
return "Usage: authorizeeveryone [ on | off ]", nil
|
||||
}
|
||||
})
|
||||
|
||||
shell.Register("panic", func(args ...string) (string, error) {
|
||||
go func() {
|
||||
panic("requested panic")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue