mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 07:55:33 +01:00
revise command rework
This commit is contained in:
@@ -19,7 +19,7 @@ type Config struct {
|
||||
|
||||
DevModeOptions DevModeOptions
|
||||
Discord Discord
|
||||
ServerCommands ServerCommands
|
||||
Commands []Command
|
||||
Database Database
|
||||
Launcher Launcher
|
||||
Sign Sign
|
||||
@@ -64,13 +64,8 @@ type Discord struct {
|
||||
DevMode bool
|
||||
}
|
||||
|
||||
// Server commands
|
||||
type ServerCommands struct {
|
||||
Enabled bool
|
||||
Commands []ServerCommand
|
||||
}
|
||||
|
||||
type ServerCommand struct {
|
||||
// Command is a channelserver chat command
|
||||
type Command struct {
|
||||
Name string
|
||||
Enabled bool
|
||||
Prefix string
|
||||
@@ -142,17 +137,6 @@ func init() {
|
||||
|
||||
}
|
||||
|
||||
func GetServerCommandByName(cmdName string) ServerCommand {
|
||||
var val ServerCommand
|
||||
for _, c := range ErupeConfig.ServerCommands.Commands {
|
||||
if c.Name == cmdName {
|
||||
return c
|
||||
}
|
||||
}
|
||||
|
||||
return val
|
||||
}
|
||||
|
||||
// getOutboundIP4 gets the preferred outbound ip4 of this machine
|
||||
// From https://stackoverflow.com/a/37382208
|
||||
func getOutboundIP4() net.IP {
|
||||
|
||||
Reference in New Issue
Block a user