Documentation ¶
Index ¶
- Constants
- func Difficulty(d int) string
- func State(s int) (string, int)
- type ChatData
- type IAlliance
- type IAuthConfigurator
- type IBotChatter
- type IBotMentioner
- type IBotStarter
- type IChatConfigurator
- type ICommandConfigurator
- type ICommandableServer
- type IConfigSaveLoader
- type IConfigurator
- type IDatabaseConfigurator
- type IDiscordBot
- type IDiscordConfigurator
- type IDiscordIntegratedPlayer
- type IDiscordIntegratedServer
- type IEventConfigurator
- type IGalaxyConfigurator
- type IGalaxyServer
- type IGameConfigurator
- type IGameServer
- type IHaveShips
- type ILockableServer
- type IMOTDServer
- type IModConfigurator
- type IModeratablePlayer
- type INetPlayer
- type IPlayableServer
- type IPlayer
- type ISeededServer
- type IServer
- type ISteamPlayer
- type ITimeConfigurator
- type ITrackedAlliance
- type ITrackedPlayer
- type IVersionedServer
- type JumpInfo
- type LoggedServerEvent
- type Sector
- type ServerGameConfig
- type ServerStatus
- type ShipCoordData
Constants ¶
const ( ServerOffline = 0 ServerOnline = 1 ServerStarting = 2 ServerStopping = 3 ServerRestarting = 4 ServerCrashedOffline = 255 ServerCrashedRecovered = 256 ServerCrashedStarting = 257 ServerCrashedStopping = 258 ServerCrashedRestarting = 259 ServerOfflineColor = 16711680 ServerOnlineColor = 6749952 ServerStartingColor = 3381759 ServerStoppingColor = 16776960 ServerRestartingColor = 3381759 ServerCrashedOfflineColor = 15158332 ServerCrashedRecoveredColor = 15158332 ServerCrashedStartingColor = 15158332 ServerCrashedStoppingColor = 15158332 ServerCrashedRestartingColor = 15158332 ServerOfflineString = "Offline" ServerOnlineString = "Online" ServerStartingString = "Initializing" ServerStoppingString = "Stopping" ServerRestartingString = "Re-Initializing" ServerCrashedOfflineString = "Crashed (Dead)" ServerCrashedRecoveredString = "Crashed (Recovered)" ServerCrashedStartingString = "Crashed (Recovering)" ServerCrashedStoppingString = "Crashed (Attempting Graceful Exit)" ServerCrashedRestartingString = "Crashed (Restarting)" CommandSuccess = 0 CommandFailure = 1 CommandWarning = 2 )
enums describing the status of a server
Variables ¶
This section is empty.
Functions ¶
func Difficulty ¶
Difficulty returns the difficulty string for a given int
Types ¶
type IAlliance ¶
type IAlliance interface { ITrackedAlliance IHaveShips }
IAlliance describes a an IServer player alliance
type IAuthConfigurator ¶
type IAuthConfigurator interface { AddRoleAuth(string, int) error RemoveRoleAuth(string) error GetRoleAuth(string) int AddCmndAuth(string, int) GetCmndAuth(string) int RemoveCmndAuth(string) error }
IAuthConfigurator describes an interface to an authorization object
type IBotChatter ¶
IBotChatter describes an interface to a bot that can chat
type IBotMentioner ¶
type IBotMentioner interface {
Mention() string
}
IBotMentioner describes an interface to a Bot that can provide a
Discord mention string (@Username#Descriminator)
type IBotStarter ¶
type IBotStarter interface {
Start(IGameServer)
}
IBotStarter describes a bot that can start
type IChatConfigurator ¶
type IChatConfigurator interface { ChatPipe() chan ChatData SetChatChannel(string) chan ChatData ChatChannel() string ReactConfirm() bool }
IChatConfigurator describes an interface to an object that can configure chats
type ICommandConfigurator ¶
type ICommandConfigurator interface { DisableCommand(string) error CommandDisabled(string) bool SetAliasCommand(string, string) error GetAliasedCommand(string) (bool, string) CommandAliases(string) (bool, []string) SetPrefix(string) Prefix() string SetToken(string) Token() string }
ICommandConfigurator describes an interface to an object that can configure
bot commands
type ICommandableServer ¶
ICommandableServer describes an interface to an IGameServer that can have run
game commands
type IConfigSaveLoader ¶
IConfigSaveLoader describes an interface to a an object that saves and loads configuration
type IConfigurator ¶
type IConfigurator interface { Validate() error IDatabaseConfigurator IDiscordConfigurator ICommandConfigurator IGalaxyConfigurator IEventConfigurator IAuthConfigurator IGameConfigurator ITimeConfigurator IChatConfigurator IConfigSaveLoader IModConfigurator logger.ILogger }
IConfigurator describes an interface to our configuration backend
type IDatabaseConfigurator ¶
type IDatabaseConfigurator interface {
DBName() string
}
IDatabaseConfigurator describes an interface to a db configurator
type IDiscordBot ¶
type IDiscordBot interface { IBotMentioner IBotChatter IBotStarter }
IDiscordBot describes an interface to a discord bot
type IDiscordConfigurator ¶
type IDiscordConfigurator interface { Token() string BotsAllowed() bool DiscordLink() string SetDiscordLink(string) SetBotsAllowed(bool) StatusChannel() (string, bool) SetStatusChannel(string) StatusChannelClear() bool }
IDiscordConfigurator describes an interface that describes Discord configurations
type IDiscordIntegratedPlayer ¶
IDiscordIntegratedPlayer describes an interface to a player that has
Discord integration
type IDiscordIntegratedServer ¶
type IDiscordIntegratedServer interface { AddIntegrationRequest(string, string) ValidateIntegrationPin(string, string) bool SendChat(ChatData) SendLog(ChatData) }
IDiscordIntegratedServer describes an IGameServer that is capable of integrating
with Discord
type IEventConfigurator ¶
type IEventConfigurator interface { GetEvents() []*LoggedServerEvent LogPipe() chan ChatData SetLogChannel(string) chan ChatData LogChannel() string }
IEventConfigurator describes a configuration object that has LoggedServerEvents
type IGalaxyConfigurator ¶
IGalaxyConfigurator describes an interface to an object that can configure a
galaxy
type IGalaxyServer ¶
IGalaxyServer describes an interface to a server with a sectored galaxy
type IGameConfigurator ¶
type IGameConfigurator interface { RCONBin() string RCONPort() int DataPath() string RCONAddr() string RCONPass() string InstallPath() string LoadGameConfig() error GameConfig() (*ServerGameConfig, bool) PostUpCommand() string PostDownCommand() string HangTimeDuration() time.Duration DBUpdateTimeDuration() time.Duration }
IGameConfigurator describes an interface to a games configuration
type IGameServer ¶
type IGameServer interface { IServer IMOTDServer ISeededServer IGalaxyServer ILockableServer IPlayableServer IVersionedServer ICommandableServer IDiscordIntegratedServer }
IGameServer describes an interface to a server with full capability
type IHaveShips ¶
type IHaveShips interface { Name() string GetLastJumps(int) []ShipCoordData SetJumpHistory([]ShipCoordData) }
IHaveShips describes an object that is capable of returning jumphistory of ships
type ILockableServer ¶
ILockableServer describes an interface to lock a server with a password
type IMOTDServer ¶
IMOTDServer describes an interface to a server that can set an MOTD
type IModConfigurator ¶
type IModConfigurator interface { BuildModConfig() error AddServerMod(int64) error RemoveServerMod(int64) error AddClientMod(int64) error RemoveClientMod(int64) error ListServerMods() []int64 ListClientMods() []int64 }
IModConfigurator describes an interface to a modconfig builder
type IModeratablePlayer ¶
IModeratablePlayer describes an interface to a player that can be
be moderated
type INetPlayer ¶
INetPlayer describes a an interface to a player that can connect
over the internet
type IPlayableServer ¶
type IPlayableServer interface { Players() []IPlayer RemovePlayer(string) NewPlayer(string, []string) IPlayer Player(string) IPlayer PlayerFromName(string) IPlayer PlayerFromDiscord(string) IPlayer Alliance(string) IAlliance AllianceFromName(string) IAlliance Alliances() []IAlliance NewAlliance(string, []string) IAlliance AddPlayerOnline() SubPlayerOnline() }
IPlayableServer defines an object that can track the players that have joined
type IPlayer ¶
type IPlayer interface { IDiscordIntegratedPlayer IModeratablePlayer ITrackedPlayer ISteamPlayer INetPlayer }
IPlayer describes a an IGameServer player
type ISeededServer ¶
ISeededServer is an interface to an object that has a seed
type IServer ¶
type IServer interface { IsUp() bool Stop(bool) error Start(bool) error Restart() error Config() IConfigurator Status() ServerStatus CompareStatus(ServerStatus, ServerStatus) bool InitializeEvents() IsCrashed() bool Crashed() logger.ILogger }
IServer defines an interface to a Gameserver that we can change the status
of and log
type ISteamPlayer ¶
type ISteamPlayer interface {
SteamUID() int64
}
ISteamPlayer describes an interface to a player that has a SteamID
type ITimeConfigurator ¶
ITimeConfigurator describes an interface to the configured timezone
type ITrackedAlliance ¶
type ITrackedAlliance interface { logger.ILogger Name() string Index() string Message(string) AddJump(ShipCoordData) Update() error UpdateFromData([13]string) error }
ITrackedAlliance defines an interface to an an alliance that has tracking
type ITrackedPlayer ¶
type ITrackedPlayer interface { logger.ILogger IHaveShips Index() string Message(string) AddJump(ShipCoordData) Update() error UpdateFromData([15]string) error }
ITrackedPlayer defines an interface to an a player that has tracking
type IVersionedServer ¶
IVersionedServer describes an interface to an IGameserver's version information
type JumpInfo ¶
type JumpInfo struct { // Jump *ShipCoordData Time time.Time Name string Kind string FID int X int Y int }
JumpInfo describes a ship jump
type LoggedServerEvent ¶
LoggedServerEvent describes an event that can be tracked and logged
type ServerGameConfig ¶
type ServerGameConfig struct { PVP bool Name string Collision string Seed string Steam bool Version string Difficulty int BlockLimit int64 VolumeLimit int64 MaxPlayerShips int64 MaxPlayerSlots int64 MaxPlayerStations int64 MaxAllianceSlots int64 MaxAllianceShips int64 MaxAllianceStations int64 }
ServerGameConfig describes an object that contains the current
game configuration