Documentation ¶
Index ¶
- func New(c ifaces.IConfigurator, wg *sync.WaitGroup, exit chan struct{}, args ...string) ifaces.IGameServer
- type Alliance
- func (a *Alliance) AddJump(sc ifaces.ShipCoordData)
- func (a *Alliance) GetLastJumps(limit int) []ifaces.ShipCoordData
- func (a *Alliance) Index() string
- func (a *Alliance) Loglevel() int
- func (a *Alliance) Message(string)
- func (a *Alliance) Name() string
- func (a *Alliance) SetJumpHistory([]ifaces.ShipCoordData)
- func (a *Alliance) SetLoglevel(l int)
- func (a *Alliance) UUID() string
- func (a *Alliance) Update() error
- func (a *Alliance) UpdateFromData(d [13]string) error
- type Player
- func (p *Player) AddJump(sc ifaces.ShipCoordData)
- func (p *Player) Ban(r string)
- func (p *Player) DiscordUID() string
- func (p *Player) GetLastJumps(limit int) []ifaces.ShipCoordData
- func (p *Player) IP() net.IP
- func (p *Player) Index() string
- func (p *Player) Kick(r string)
- func (p *Player) Loglevel() int
- func (p *Player) Message(string)
- func (p *Player) Name() string
- func (p *Player) Online() bool
- func (p *Player) SetDiscordUID(uid string)
- func (p *Player) SetIP(ips string)
- func (p *Player) SetJumpHistory([]ifaces.ShipCoordData)
- func (p *Player) SetLoglevel(l int)
- func (p *Player) SetOnline(o bool)
- func (p *Player) Steam64() int64
- func (p *Player) SteamUID() int64
- func (p *Player) UUID() string
- func (p *Player) Update() error
- func (p *Player) UpdateFromData(d [15]string) error
- type RunState
- type Server
- func (s *Server) AddIntegrationRequest(index, pin string)
- func (s *Server) AddPlayerOnline()
- func (s *Server) Alliance(index string) ifaces.IAlliance
- func (s *Server) AllianceFromName(name string) ifaces.IAlliance
- func (s *Server) Alliances() []ifaces.IAlliance
- func (s *Server) CompareStatus(a, b ifaces.ServerStatus) bool
- func (s *Server) Config() ifaces.IConfigurator
- func (s *Server) Crashed()
- func (s *Server) InitializeEvents()
- func (s *Server) IsCrashed() bool
- func (s *Server) IsUp() bool
- func (s *Server) Loglevel() int
- func (s *Server) MOTD() string
- func (s *Server) NewAlliance(index string, d []string) ifaces.IAlliance
- func (s *Server) NewPlayer(index string, d []string) ifaces.IPlayer
- func (s *Server) NotifyServer(in string) error
- func (s *Server) Password() string
- func (s *Server) Player(plrstr string) ifaces.IPlayer
- func (s *Server) PlayerFromDiscord(name string) ifaces.IPlayer
- func (s *Server) PlayerFromName(name string) ifaces.IPlayer
- func (s *Server) Players() []ifaces.IPlayer
- func (s *Server) Recovered()
- func (s *Server) RemovePlayer(n string)
- func (s *Server) Restart() error
- func (s *Server) RunCommand(c string) (string, error)
- func (s *Server) Sector(x, y int) *ifaces.Sector
- func (s *Server) Seed() string
- func (s *Server) SendChat(input ifaces.ChatData)
- func (s *Server) SendLog(input ifaces.ChatData)
- func (s *Server) SetLoglevel(l int)
- func (s *Server) SetMOTD(m string)
- func (s *Server) SetPassword(p string)
- func (s *Server) SetSeed(seed string)
- func (s *Server) SetVersion(v string)
- func (s *Server) Start(sendchat bool) error
- func (s *Server) Status() ifaces.ServerStatus
- func (s *Server) Stop(sendchat bool) error
- func (s *Server) SubPlayerOnline()
- func (s *Server) UUID() string
- func (s *Server) UpdatePlayerDatabase(notify bool) error
- func (s *Server) ValidateIntegrationPin(in, discordID string) bool
- func (s *Server) Version() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(c ifaces.IConfigurator, wg *sync.WaitGroup, exit chan struct{}, args ...string) ifaces.IGameServer
New returns a new object of type Server
Types ¶
type Alliance ¶
type Alliance struct {
// contains filtered or unexported fields
}
Alliance defines a player alliance in Avorion
func (*Alliance) AddJump ¶
func (a *Alliance) AddJump(sc ifaces.ShipCoordData)
AddJump registers a jump that a player took into a system
func (*Alliance) GetLastJumps ¶
func (a *Alliance) GetLastJumps(limit int) []ifaces.ShipCoordData
GetLastJumps returns up to (max) jumps that this player has performed recently TODO: This should return both the jumps and how many were found
func (*Alliance) SetJumpHistory ¶
func (a *Alliance) SetJumpHistory([]ifaces.ShipCoordData)
SetJumpHistory sets the jump history for an alliance
func (*Alliance) SetLoglevel ¶
SetLoglevel sets the loglevel of an alliance
func (*Alliance) UpdateFromData ¶
UpdateFromData updates the alliances information using the data from
a successful reAllianceData match
type Player ¶
Player is a player that has connected to the server at some point, and has data present in the game db
func (*Player) AddJump ¶
func (p *Player) AddJump(sc ifaces.ShipCoordData)
AddJump registers a jump that a player took into a system
func (*Player) DiscordUID ¶
DiscordUID returns a players Discord ID
func (*Player) GetLastJumps ¶
func (p *Player) GetLastJumps(limit int) []ifaces.ShipCoordData
GetLastJumps returns up to (max) jumps that this player has performed recently
TODO: This should return both the jumps and how many were found so that we can avoid an extra len call later
func (*Player) SetDiscordUID ¶
SetDiscordUID sets a players Discord ID
func (*Player) SetJumpHistory ¶
func (p *Player) SetJumpHistory([]ifaces.ShipCoordData)
SetJumpHistory sets the jump history for a player
func (*Player) SetLoglevel ¶
SetLoglevel sets the loglevel of a player
func (*Player) SteamUID ¶
SteamUID returns the steamUID or 0 of the player TODO: Modify this function, as well as the GameDB to store this data in the sqlite database
func (*Player) UpdateFromData ¶
UpdateFromData updates the players information using the data from
a successful rePlayerData match
type RunState ¶
type RunState struct {
// contains filtered or unexported fields
}
RunState describes the current state of commands being run
type Server ¶
type Server struct { ifaces.IGameServer // Execution variables Cmd *exec.Cmd // contains filtered or unexported fields }
Server - Avorion server definition
func (*Server) AddIntegrationRequest ¶
AddIntegrationRequest registers a request by a player for Discord integration TODO: Move this to our sqlite DB
func (*Server) AddPlayerOnline ¶
func (s *Server) AddPlayerOnline()
AddPlayerOnline increments the count of online players
func (*Server) AllianceFromName ¶
AllianceFromName returns an alliance object that matches the name given
func (*Server) Alliances ¶
Alliances returns a slice of all of the alliances that are currently known
func (*Server) CompareStatus ¶
func (s *Server) CompareStatus(a, b ifaces.ServerStatus) bool
CompareStatus takes two ifaces.ServerStatus arguments and compares
them. If they are equivalent, then return true. Else, false.
func (*Server) Config ¶
func (s *Server) Config() ifaces.IConfigurator
Config returns the server configuration struct
func (*Server) InitializeEvents ¶
func (s *Server) InitializeEvents()
InitializeEvents runs the event initializer
func (*Server) NewAlliance ¶
NewAlliance adds a new alliance to the list of alliances if it isn't already
present
func (*Server) NewPlayer ¶
NewPlayer adds a new player to the list of players if it isn't already present
func (*Server) NotifyServer ¶
NotifyServer sends an ingame notification
func (*Server) PlayerFromDiscord ¶
PlayerFromDiscord return a player object that has been assigned the given
Discord user
TODO: Complete this stub
func (*Server) PlayerFromName ¶
PlayerFromName return a player object that matches the name given
func (*Server) Recovered ¶
func (s *Server) Recovered()
Recovered sets the server status to be normal (from crashed)
func (*Server) RemovePlayer ¶
RemovePlayer removes a player from the list of online players TODO: This function is currently a stub and needs to be made functional once more.
func (*Server) RunCommand ¶
RunCommand runs a command via rcon and returns the output
TODO 1: Modify this to use the games rcon websocket interface or an rcon lib TODO 2: Modify this function to make use of permitted command levels
func (*Server) SendChat ¶
SendChat sends an ifaces.ChatData object to the discord bot if chatting is
currently enabled in the configuration
func (*Server) SendLog ¶
SendLog sends an ifaces.ChatData object to the discord bot if logging is
currently enabled in the configuration
func (*Server) SetLoglevel ¶
SetLoglevel sets the loglevel of an avorion.Server
func (*Server) SetPassword ¶
SetPassword - Set the server password
func (*Server) SetSeed ¶
SetSeed - Sets the seed stored in the *Server, *does not* change the games seed
func (*Server) SetVersion ¶
SetVersion - Sets the current version of the Avorion server
func (*Server) Status ¶
func (s *Server) Status() ifaces.ServerStatus
Status returns a struct containing the current status of the server
func (*Server) SubPlayerOnline ¶
func (s *Server) SubPlayerOnline()
SubPlayerOnline decrements the count of online players
func (*Server) UpdatePlayerDatabase ¶
UpdatePlayerDatabase updates the Avorion player database with all of the players that are known to the game
FIXME: Fix this absolute mess of a method
func (*Server) ValidateIntegrationPin ¶
ValidateIntegrationPin confirms that a given pin was indeed a valid request
and registers the integration