automaton

package module
v0.0.0-...-499b373 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2022 License: MIT Imports: 6 Imported by: 0

README

automaton

A Go wrapper for allocs server fixes api for the game 7 Days To Die.

Requires allocs server fixes mod to be installed.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin struct {
	Level    string
	ID       string
	Username string
}

type Admins

type Admins []Admin

type AllowedCommands

type AllowedCommands struct {
	Commands []Command `json:"commands"`
}

AllowedCommands ....

type Belt

type Belt struct {
	Count        int64   `json:"count"`
	Name         string  `json:"name"`
	Icon         string  `json:"icon"`
	Iconcolor    string  `json:"iconcolor"`
	Quality      int64   `json:"quality"`
	Qualitycolor *string `json:"qualitycolor,omitempty"`
}

Belt ....

type BoolType

type BoolType struct {
	Type  string `json:"type"`
	Value bool   `json:"value"`
}

BoolType ....

type ClaimOwner

type ClaimOwner struct {
	Steamid     string     `json:"steamid"`
	Claimactive bool       `json:"claimactive"`
	Playername  string     `json:"playername"`
	Claims      []Position `json:"claims"`
}

ClaimOwner ....

type Command

type Command struct {
	Command     string `json:"command"`
	Description string `json:"description"`
	Help        string `json:"help"`
}

Command ....

type CommandResponse

type CommandResponse struct {
	Command    string `json:"command"`
	Parameters string `json:"parameters"`
	Result     string `json:"result"`
}

CommandResponse ...

type EntityLocationElement

type EntityLocationElement struct {
	ID       int64    `json:"id"`
	Name     string   `json:"name"`
	Position Position `json:"position"`
}

EntityLocationElement ....

type EntityLocations

type EntityLocations []EntityLocationElement

EntityLocations ....

type Equipment

type Equipment struct {
	Head     Belt `json:"head"`
	Eyes     Belt `json:"eyes"`
	Face     Belt `json:"face"`
	Armor    Belt `json:"armor"`
	Jacket   Belt `json:"jacket"`
	Shirt    Belt `json:"shirt"`
	Legarmor Belt `json:"legarmor"`
	Pants    Belt `json:"pants"`
	Boots    Belt `json:"boots"`
	Gloves   Belt `json:"gloves"`
}

Equipment ....

type GameServer

type GameServer struct {
	IP         string
	Port       string
	AdminUser  string
	AdminToken string
	// contains filtered or unexported fields
}

GameServer ....

func NewGameServer

func NewGameServer(ip string, port string, user string, token string, schemeIn ...string) *GameServer

NewGameServer create a game server struct based on passed params

func (GameServer) ExecuteConsoleCommand

func (gs GameServer) ExecuteConsoleCommand(command string) (commandResponse CommandResponse, err error)

ExecuteConsoleCommand ....

func (GameServer) GetAdmins

func (gs GameServer) GetAdmins() (admins Admins, err error)

func (GameServer) GetAllowedCommands

func (gs GameServer) GetAllowedCommands() (allowedCommands AllowedCommands, err error)

GetAllowedCommands ....

func (GameServer) GetAnimalsLocation

func (gs GameServer) GetAnimalsLocation() (entityLocations EntityLocations, err error)

GetAnimalsLocation ....

func (GameServer) GetHostileLocation

func (gs GameServer) GetHostileLocation() (entityLocations EntityLocations, err error)

GetHostileLocation ....

func (GameServer) GetLandClaims

func (gs GameServer) GetLandClaims(steamID string) (landClaims LandClaims, err error)

GetLandClaims ....

func (GameServer) GetLog

func (gs GameServer) GetLog(firstLine int, counts ...int) (theLog Log, err error)

GetLog ....

func (GameServer) GetOnlinePlayers

func (gs GameServer) GetOnlinePlayers() (onlinePlayers OnlinePlayers, err error)

GetOnlinePlayers ....

func (GameServer) GetPlayerInventories

func (gs GameServer) GetPlayerInventories() (inventories Inventories, err error)

GetPlayerInventories ....

func (GameServer) GetPlayerInventory

func (gs GameServer) GetPlayerInventory(steamID string) (inventory Inventory, err error)

GetPlayerInventory ....

func (GameServer) GetPlayerList

func (gs GameServer) GetPlayerList(rowsperpage int, page int) (playerList PlayerList, err error)

GetPlayerList ....

func (GameServer) GetPlayersLocation

func (gs GameServer) GetPlayersLocation(offline bool) (playerLocations PlayerLocations, err error)

GetPlayersLocation ....

func (GameServer) GetServerInfo

func (gs GameServer) GetServerInfo() (serverInfo ServerInfo, err error)

GetServerInfo ....

func (GameServer) GetStats

func (gs GameServer) GetStats() (stats Stats, err error)

GetStats calles /api/getstats

func (GameServer) GetWebUIUpdates

func (gs GameServer) GetWebUIUpdates(latestLine int) (webUIUpdates WebUIUpdates, err error)

GetWebUIUpdates ....

type GameTime

type GameTime struct {
	Days    json.Number `json:"days"`
	Hours   json.Number `json:"hours"`
	Minutes json.Number `json:"minutes"`
}

GameTime ....

type IntType

type IntType struct {
	Type  string      `json:"type"`
	Value json.Number `json:"value"`
}

IntType ....

type Inventories

type Inventories []Inventory

Inventories ....

type Inventory

type Inventory struct {
	Steamid    string    `json:"steamid"`
	Entityid   int64     `json:"entityid"`
	Playername string    `json:"playername"`
	Bag        []*Belt   `json:"bag"`
	Belt       []Belt    `json:"belt"`
	Equipment  Equipment `json:"equipment"`
}

Inventory ....

type LandClaims

type LandClaims struct {
	Claimsize   int64        `json:"claimsize"`
	ClaimOwners []ClaimOwner `json:"claimowners"`
}

LandClaims ....

type Log

type Log struct {
	FirstLine int64      `json:"firstLine"`
	LastLine  int64      `json:"lastLine"`
	Entries   []LogEntry `json:"entries"`
}

Log ....

type LogEntry

type LogEntry struct {
	Date   string `json:"date"`
	Time   string `json:"time"`
	Uptime string `json:"uptime"`
	Msg    string `json:"msg"`
	Trace  string `json:"trace"`
	Type   string `json:"type"`
}

LogEntry ....

type OnlinePlayer

type OnlinePlayer struct {
	ID           string      `json:"id"`
	EntityID     json.Number `json:"entityid"`
	IP           string      `json:"ip"`
	Name         string      `json:"name"`
	Online       bool        `json:"online"`
	Position     Position    `json:"position"`
	Experience   json.Number `json:"experience"`
	Level        json.Number `json:"level"`
	Health       json.Number `json:"health"`
	Stamina      json.Number `json:"stamina"`
	ZombieKills  json.Number `json:"zombiekills"`
	PlayerKills  json.Number `json:"playerkills"`
	PlayerDeaths json.Number `json:"deaths"`
	Score        json.Number `json:"score"`
	Playtime     json.Number `json:"totalplaytime"`
	LastOnline   string      `json:"lastonline"`
	Ping         json.Number `json:"ping"`
}

OnlinePlayer ....

type OnlinePlayers

type OnlinePlayers []OnlinePlayer

OnlinePlayers ....

type Player

type Player struct {
	Steamid       string   `json:"steamid"`
	Entityid      int64    `json:"entityid"`
	IP            string   `json:"ip"`
	Name          string   `json:"name"`
	Online        bool     `json:"online"`
	Position      Position `json:"position"`
	Totalplaytime int64    `json:"totalplaytime"`
	Lastonline    string   `json:"lastonline"`
	Ping          int64    `json:"ping"`
	Banned        bool     `json:"banned"`
}

Player ....

type PlayerList

type PlayerList struct {
	Total           int64    `json:"total"`
	TotalUnfiltered int64    `json:"totalUnfiltered"`
	FirstResult     int64    `json:"firstResult"`
	Players         []Player `json:"players"`
}

PlayerList ....

type PlayerLocation

type PlayerLocation struct {
	Steamid  string   `json:"steamid"`
	Name     string   `json:"name"`
	Online   bool     `json:"online"`
	Position Position `json:"position"`
}

PlayerLocation ....

type PlayerLocations

type PlayerLocations []PlayerLocation

PlayerLocations ....

type Position

type Position struct {
	X json.Number `json:"x"`
	Y json.Number `json:"y"`
	Z json.Number `json:"z"`
}

Position ....

type ServerInfo

type ServerInfo struct {
	GameType                           StringType `json:"GameType"`
	GameName                           StringType `json:"GameName"`
	GameHost                           StringType `json:"GameHost"`
	ServerDescription                  StringType `json:"ServerDescription"`
	ServerWebsiteURL                   StringType `json:"ServerWebsiteURL"`
	LevelName                          StringType `json:"LevelName"`
	GameMode                           StringType `json:"GameMode"`
	Version                            StringType `json:"Version"`
	IP                                 StringType `json:"IP"`
	CountryCode                        StringType `json:"CountryCode"`
	ID                                 StringType `json:"id"`
	CompatibilityVersion               StringType `json:"CompatibilityVersion"`
	Platform                           StringType `json:"Platform"`
	ServerLoginConfirmationText        StringType `json:"ServerLoginConfirmationText"`
	Port                               IntType    `json:"Port"`
	CurrentPlayers                     IntType    `json:"CurrentPlayers"`
	MaxPlayers                         IntType    `json:"MaxPlayers"`
	GameDifficulty                     IntType    `json:"GameDifficulty"`
	DayNightLength                     IntType    `json:"DayNightLength"`
	BloodMoonFrequency                 IntType    `json:"BloodMoonFrequency"`
	BloodMoonRange                     IntType    `json:"BloodMoonRange"`
	BloodMoonWarning                   IntType    `json:"BloodMoonWarning"`
	ZombiesRun                         IntType    `json:"ZombiesRun"`
	ZombieMove                         IntType    `json:"ZombieMove"`
	ZombieMoveNight                    IntType    `json:"ZombieMoveNight"`
	ZombieFeralMove                    IntType    `json:"ZombieFeralMove"`
	ZombieBMMove                       IntType    `json:"ZombieBMMove"`
	XPMultiplier                       IntType    `json:"XPMultiplier"`
	DayCount                           IntType    `json:"DayCount"`
	Ping                               IntType    `json:"Ping"`
	DropOnDeath                        IntType    `json:"DropOnDeath"`
	DropOnQuit                         IntType    `json:"DropOnQuit"`
	BloodMoonEnemyCount                IntType    `json:"BloodMoonEnemyCount"`
	EnemyDifficulty                    IntType    `json:"EnemyDifficulty"`
	PlayerKillingMode                  IntType    `json:"PlayerKillingMode"`
	CurrentServerTime                  IntType    `json:"CurrentServerTime"`
	DayLightLength                     IntType    `json:"DayLightLength"`
	BlockDurabilityModifier            IntType    `json:"BlockDurabilityModifier"`
	BlockDamagePlayer                  IntType    `json:"BlockDamagePlayer"`
	BlockDamageAI                      IntType    `json:"BlockDamageAI"`
	BlockDamageAIBM                    IntType    `json:"BlockDamageAIBM"`
	AirDropFrequency                   IntType    `json:"AirDropFrequency"`
	LootAbundance                      IntType    `json:"LootAbundance"`
	LootRespawnDays                    IntType    `json:"LootRespawnDays"`
	MaxSpawnedZombies                  IntType    `json:"MaxSpawnedZombies"`
	LandClaimCount                     IntType    `json:"LandClaimCount"`
	LandClaimSize                      IntType    `json:"LandClaimSize"`
	LandClaimDeadZone                  IntType    `json:"LandClaimDeadZone"`
	LandClaimExpiryTime                IntType    `json:"LandClaimExpiryTime"`
	LandClaimDecayMode                 IntType    `json:"LandClaimDecayMode"`
	LandClaimOnlineDurabilityModifier  IntType    `json:"LandClaimOnlineDurabilityModifier"`
	LandClaimOfflineDurabilityModifier IntType    `json:"LandClaimOfflineDurabilityModifier"`
	LandClaimOfflineDelay              IntType    `json:"LandClaimOfflineDelay"`
	PartySharedKillRange               IntType    `json:"PartySharedKillRange"`
	MaxSpawnedAnimals                  IntType    `json:"MaxSpawnedAnimals"`
	ServerVisibility                   IntType    `json:"ServerVisibility"`
	BedrollExpiryTime                  IntType    `json:"BedrollExpiryTime"`
	IsDedicated                        BoolType   `json:"IsDedicated"`
	IsPasswordProtected                BoolType   `json:"IsPasswordProtected"`
	ShowFriendPlayerOnMap              BoolType   `json:"ShowFriendPlayerOnMap"`
	BuildCreate                        BoolType   `json:"BuildCreate"`
	EACEnabled                         BoolType   `json:"EACEnabled"`
	Architecture64                     BoolType   `json:"Architecture64"`
	StockSettings                      BoolType   `json:"StockSettings"`
	StockFiles                         BoolType   `json:"StockFiles"`
	ModdedConfig                       BoolType   `json:"ModdedConfig"`
	RequiresMod                        BoolType   `json:"RequiresMod"`
	AirDropMarker                      BoolType   `json:"AirDropMarker"`
	EnemySpawnMode                     BoolType   `json:"EnemySpawnMode"`
	IsPublic                           BoolType   `json:"IsPublic"`
}

ServerInfo ....

type Stats

type Stats struct {
	Gametime GameTime    `json:"gametime"`
	Players  json.Number `json:"players"`
	Hostiles json.Number `json:"hostiles"`
	Animals  json.Number `json:"animals"`
}

Stats ....

type StringType

type StringType struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

StringType ....

type WebUIUpdates

type WebUIUpdates struct {
	Gametime GameTime `json:"gametime"`
	Players  int64    `json:"players"`
	Hostiles int64    `json:"hostiles"`
	Animals  int64    `json:"animals"`
	Newlogs  int64    `json:"newlogs"`
}

WebUIUpdates ....

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL