Documentation ¶
Index ¶
- type Conf
- func (c *Conf) AddClientMod(id int64) error
- func (c *Conf) AddCmndAuth(cmnd string, l int)
- func (c *Conf) AddRoleAuth(rID string, l int) error
- func (c *Conf) AddServerMod(id int64) error
- func (c *Conf) BotsAllowed() bool
- func (c *Conf) BuildModConfig() error
- func (c *Conf) ChatChannel() string
- func (c *Conf) ChatPipe() chan ifaces.ChatData
- func (c *Conf) CommandAliases(cmd string) (bool, []string)
- func (c *Conf) CommandDisabled(cmd string) bool
- func (c *Conf) DBName() string
- func (c *Conf) DBUpdateTimeDuration() time.Duration
- func (c *Conf) DataPath() string
- func (c *Conf) DisableCommand(s string) error
- func (c *Conf) DiscordLink() string
- func (c *Conf) Galaxy() string
- func (c *Conf) GameConfig() (*ifaces.ServerGameConfig, bool)
- func (c *Conf) GetAliasedCommand(s string) (bool, string)
- func (c *Conf) GetCmndAuth(cmnd string) int
- func (c *Conf) GetEvents() []*ifaces.LoggedServerEvent
- func (c *Conf) GetRoleAuth(rID string) int
- func (c *Conf) HangTimeDuration() time.Duration
- func (c *Conf) InstallPath() string
- func (c *Conf) ListClientMods() []int64
- func (c *Conf) ListServerMods() []int64
- func (c *Conf) LoadConfiguration() error
- func (c *Conf) LoadGameConfig() error
- func (c *Conf) LogChannel() string
- func (c *Conf) LogPipe() chan ifaces.ChatData
- func (c *Conf) Loglevel() int
- func (c *Conf) PostDownCommand() string
- func (c *Conf) PostUpCommand() string
- func (c *Conf) Prefix() string
- func (c *Conf) RCONAddr() string
- func (c *Conf) RCONBin() string
- func (c *Conf) RCONPass() string
- func (c *Conf) RCONPort() int
- func (c *Conf) ReactConfirm() bool
- func (c *Conf) RemoveClientMod(id int64) error
- func (c *Conf) RemoveCmndAuth(cmnd string) error
- func (c *Conf) RemoveRoleAuth(rID string) error
- func (c *Conf) RemoveServerMod(id int64) error
- func (c *Conf) SaveConfiguration() error
- func (c *Conf) SetAliasCommand(r string, a string) error
- func (c *Conf) SetBotsAllowed(allowed bool)
- func (c *Conf) SetChatChannel(id string) chan ifaces.ChatData
- func (c *Conf) SetDiscordLink(link string)
- func (c *Conf) SetGalaxy(name string)
- func (c *Conf) SetLogChannel(id string) chan ifaces.ChatData
- func (c *Conf) SetLoglevel(l int)
- func (c *Conf) SetPrefix(prefix string)
- func (c *Conf) SetStatusChannel(id string)
- func (c *Conf) SetTimeZone(tz string) error
- func (c *Conf) SetToken(t string)
- func (c *Conf) StatusChannel() (string, bool)
- func (c *Conf) StatusChannelClear() bool
- func (c *Conf) TimeZone() string
- func (c *Conf) Token() string
- func (c *Conf) UUID() string
- func (c *Conf) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conf ¶
type Conf struct { // Conf ConfigFile string // contains filtered or unexported fields }
Conf is a struct representing a server configuration
func (*Conf) AddClientMod ¶
AddClientMod adds an allowed mod to the config file and saves said config
func (*Conf) AddCmndAuth ¶
AddCmndAuth sets the authorization level required for a given command
func (*Conf) AddRoleAuth ¶
AddRoleAuth sets the role to have a given command authorization level
func (*Conf) AddServerMod ¶
AddServerMod adds a server mod to the config file and saves said config
func (*Conf) BotsAllowed ¶
BotsAllowed returns whether or not bots are permitted to issue commands to this
bot
func (*Conf) BuildModConfig ¶
BuildModConfig generates a valid modconfig.lua file for Avorion
func (*Conf) ChatChannel ¶
ChatChannel returns the current chat channel ID string
func (*Conf) CommandAliases ¶
CommandAliases - Return a slice with the current aliases for a command.
@cmd string Command with aliases that will be returned
func (*Conf) CommandDisabled ¶
CommandDisabled - Check if a given command is disabled
@cmd string Command to be checked
func (*Conf) DBUpdateTimeDuration ¶
DBUpdateTimeDuration returns a time.Duration based on the configured seconds until between dbupdates
func (*Conf) DisableCommand ¶
DisableCommand - Disable a command if it isn't already disabled.
@s string Command to be disabled
func (*Conf) DiscordLink ¶
DiscordLink returns a link to a Discord server
func (*Conf) GameConfig ¶
func (c *Conf) GameConfig() (*ifaces.ServerGameConfig, bool)
GameConfig returns the loaded server.ini object
func (*Conf) GetAliasedCommand ¶
GetAliasedCommand - Locate a command that has the given string as an alias.
@s string Alias to be checked
func (*Conf) GetCmndAuth ¶
GetCmndAuth gets the roles that are authorized to run the given command
func (*Conf) GetEvents ¶
func (c *Conf) GetEvents() []*ifaces.LoggedServerEvent
GetEvents returns the current list of LoggedServerEvents
func (*Conf) GetRoleAuth ¶
GetRoleAuth gets the integer authorization level of a role
func (*Conf) HangTimeDuration ¶
HangTimeDuration returns a time.Duration based on the configured seconds until between hang checks
func (*Conf) InstallPath ¶
InstallPath returns the current installation path for Avorion
func (*Conf) ListClientMods ¶
ListClientMods returns a slice of all of the Workshop mods configured to be allowed for clients
func (*Conf) ListServerMods ¶
ListServerMods returns a slice of all of the Workshop mods configured to be installed
func (*Conf) LoadConfiguration ¶
LoadConfiguration loads the given configuration file
func (*Conf) LoadGameConfig ¶
LoadGameConfig loads the server.ini file from the current game path
func (*Conf) LogChannel ¶
LogChannel returns the current chat channel ID string
func (*Conf) PostDownCommand ¶
PostDownCommand returns the command configured to be run when taking down the server normally
func (*Conf) PostUpCommand ¶
PostUpCommand returns the command configured to be run when starting the server
func (*Conf) RCONBin ¶
RCONBin returns the current RCON binary in use TODO: This is temporary, until the rconlib is implemented
func (*Conf) ReactConfirm ¶
ReactConfirm returns a bool that determines whether or not to react to a chat message that was transferred.
func (*Conf) RemoveClientMod ¶
RemoveClientMod removes an allowed mod to the config file and saves said config
func (*Conf) RemoveCmndAuth ¶
RemoveCmndAuth removes a commands authorization requirements
func (*Conf) RemoveRoleAuth ¶
RemoveRoleAuth removes authorization for a role
func (*Conf) RemoveServerMod ¶
RemoveServerMod removes a server mod to the config file and saves said config
func (*Conf) SaveConfiguration ¶
SaveConfiguration saves our current configuration to a yaml file
func (*Conf) SetAliasCommand ¶
SetAliasCommand - Alias a command if the alias has net yet been set.
@r string Comand to be aliased @a string Alias to be configured
func (*Conf) SetBotsAllowed ¶
SetBotsAllowed sets BotsAllowed
func (*Conf) SetChatChannel ¶
SetChatChannel sets the channel that ifaces chat is output to
@id string Channel ID to set
func (*Conf) SetDiscordLink ¶
SetDiscordLink sets a link to a Discord server
func (*Conf) SetLogChannel ¶
SetLogChannel sets the channel that ifaces chat is output to
@id string Channel ID to set
func (*Conf) SetPrefix ¶
SetPrefix sets the current bot prefix
TODO perform the checks for the prefix configuration *here* rather than in the *discord.Bot object
func (*Conf) SetStatusChannel ¶
SetStatusChannel sets the current status channel
func (*Conf) StatusChannel ¶
StatusChannel returns the current status channel
func (*Conf) StatusChannelClear ¶
StatusChannelClear returns whether or not the bot should clear
our server status channel before posting