Documentation ¶
Index ¶
- Constants
- func GetPlayerID(playerName string) string
- func GetPlayerName(playerID string) string
- type AllAltsResponse
- type AltsOfResponse
- type Config
- type DelAltResponse
- type DiscordConfig
- type ErrorResponse
- type InvalidPlayer
- type InvalidPlayerAuth
- type NewAltResponse
- type PlayerDetailsRes
- type ResolveIDResponse
- type ValidPlayer
- type WebServerConfig
Constants ¶
const ( // Maintenance means maintenance mode is on. Maintenance = "maintenance" // MCAuth Version Version = "3.0.0" )
const ( // The player is an admin. IsAdmin = "admin" // AuthCode means the player has a pending authentication code. AuthCode = "auth_code" // NoLink means the player isn't linked with an account. NoLink = "no_link" // NotWhitelisted means the player's Discord account // has missing required roles. NotWhitelisted = "no_role" // The player is an alt of an admin account. IsAlt = "alt_acc" // The player is verified. Whitelisted = "whitelisted" )
States of a player
Variables ¶
This section is empty.
Functions ¶
func GetPlayerID ¶
GetPlayerID will get the UUID of a given Minecraft player name. An empty string will be returned if nothing was found.
func GetPlayerName ¶
GetPlayerName gets a Minecraft player name of a player UUID. It will return an empty string if nothing was found.
Types ¶
type AllAltsResponse ¶
AllAltsResponse unlike AltsOfResponse this will show all the alts in the database.
type AltsOfResponse ¶
type AltsOfResponse struct { Accounts []db.AltAcc `json:"alt_accs"` // The owner's Minecraft player name. Owner string `json:"owner"` }
AltsOfResponse has the owner of the alts and an slice of alt accounts.
type Config ¶
type Config struct { DB db.Config `yaml:"database"` Discord DiscordConfig `yaml:"discord_bot"` WebServer WebServerConfig `yaml:"webserver"` }
Config is all the configurations below combined.
type DelAltResponse ¶
type DelAltResponse struct { // whether or not it was successfully removed IsRemoved bool `json:"is_deleted"` }
DelAltResponse represents whether or not an alt given was removed.
type DiscordConfig ¶
type DiscordConfig struct { Help string `yaml:"help_message"` Token string `yaml:"token"` Prefix string `yaml:"prefix"` Guild string `yaml:"guild"` Whitelist []string `yaml:"whitelisted_roles"` AdminRoles []string `yaml:"admin_roles"` }
DiscordConfig is the Discord bot config.
type ErrorResponse ¶
type ErrorResponse struct { ErrorCode string `json:"errcode"` // a human readable reason why an issue occurred Message string `json:"message"` }
ErrorResponse represents a generic error
type InvalidPlayer ¶
InvalidPlayer describes why a player isn't valid
type InvalidPlayerAuth ¶
type InvalidPlayerAuth struct { Reason string `json:"reason"` Verified bool `json:"valid"` AuthCode string `json:"auth_code"` }
InvalidPlayerAuth gives the minecraft server the provided player's pending authentication code.
type NewAltResponse ¶
type NewAltResponse struct { // The name of the alt account being claimed PlayerName string `json:"player_name"` // The owner of the alt account Owner string `json:"owner"` }
NewAltResponse is what the client gives us when a new alt is being claimed.
type PlayerDetailsRes ¶
type ResolveIDResponse ¶
type ResolveIDResponse struct {
Resolved string `json:"resolved_id"`
}
ResolveIDResponse comes from the /api/resolve/{id} endpoint
type ValidPlayer ¶
type ValidPlayer struct {
Verified bool `json:"valid"`
}
ValidPlayer says that the provided player is valid and ready to join the Minecraft server.
type WebServerConfig ¶
WebServerConfig is the configuration attributes for the webserver talking to the plugin.