govrageremote

package module
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

README

GoVRageRemote

Implements the Space Engineers Remote API protocol. https://spaceengineers.fandom.com/wiki/Setting_up_a_Space_Engineers_Dedicated_Server#Remote_API

Installation

go get gitlab.com/uranoxyd/govrageremote

Usage Example

package main

import (
    "fmt"

    "gitlab.com/uranoxyd/govrageremote"
)

func main() {
    client := govrageremote.NewVRageRemoteClient("http://localhost:8080", "RTOLNUrsQ2ZUW1ZDYqkKwA==")

    response, err := client.GetServerInfo()
    if err != nil {
        panic(err)
    }

    fmt.Println("Server is running version:", response.Data.Version)
}

License

GNU GPL

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Distance added in v0.1.4

Types

type VRageBannedPlayer

type VRageBannedPlayer struct {
	SteamID     int64
	DisplayName string
}

type VRageChatMessage

type VRageChatMessage struct {
	SteamID     int64
	DisplayName string
	Content     string
	Timestamp   string
}

func (*VRageChatMessage) GetRealTimestamp added in v0.1.5

func (message *VRageChatMessage) GetRealTimestamp() time.Time

type VRageKickedPlayer

type VRageKickedPlayer struct {
	SteamID     int64
	DisplayName string
	Time        int64
}

type VRagePlanet

type VRagePlanet struct {
	DisplayName string
	EntityID    int64 `json:"EntityId"`
	Position    VRagePosition
	// contains filtered or unexported fields
}

func (*VRagePlanet) Delete added in v0.1.1

func (planet *VRagePlanet) Delete() error

func (*VRagePlanet) GetPosition added in v0.1.4

func (planet *VRagePlanet) GetPosition() VRagePosition

type VRagePosition

type VRagePosition struct {
	X float64
	Y float64
	Z float64
}

func (VRagePosition) DistanceTo added in v0.1.1

func (pos VRagePosition) DistanceTo(other VRagePosition) float64

type VRagePositionable added in v0.1.7

type VRagePositionable interface {
	GetPosition() VRagePosition
}

type VRageRemoteAsteroid

type VRageRemoteAsteroid struct {
	DisplayName string
	EntityID    int64
	Position    VRagePosition
	// contains filtered or unexported fields
}

func (*VRageRemoteAsteroid) Delete added in v0.1.1

func (roid *VRageRemoteAsteroid) Delete() error

func (*VRageRemoteAsteroid) GetPosition added in v0.1.4

func (roid *VRageRemoteAsteroid) GetPosition() VRagePosition

type VRageRemoteAsteroidsList

type VRageRemoteAsteroidsList struct {
	Asteroids []*VRageRemoteAsteroid
}

type VRageRemoteAsteroidsListResponse

type VRageRemoteAsteroidsListResponse struct {
	*VRageRemoteResponse
	Data *VRageRemoteAsteroidsList `json:"data"`
}

type VRageRemoteBannedPlayersList

type VRageRemoteBannedPlayersList struct {
	BannedPlayers []*VRageBannedPlayer
}

type VRageRemoteBannedPlayersListResponse

type VRageRemoteBannedPlayersListResponse struct {
	*VRageRemoteResponse
	Data *VRageRemoteBannedPlayersList `json:"data"`
}

type VRageRemoteCharacter added in v0.1.4

type VRageRemoteCharacter struct {
	DisplayName string
	EntityID    int64 `json:"EntityId"`
	Mass        float64
	Position    VRagePosition
	LinearSpeed float64
	// contains filtered or unexported fields
}

func (*VRageRemoteCharacter) GetPosition added in v0.1.4

func (char *VRageRemoteCharacter) GetPosition() VRagePosition

func (*VRageRemoteCharacter) Stop added in v0.1.7

func (char *VRageRemoteCharacter) Stop() error

type VRageRemoteCharacterList added in v0.1.4

type VRageRemoteCharacterList struct {
	Characters []*VRageRemoteCharacter
}

type VRageRemoteCharacterListResponse added in v0.1.4

type VRageRemoteCharacterListResponse struct {
	*VRageRemoteResponse
	Data *VRageRemoteCharacterList `json:"data"`
}

type VRageRemoteChatMessageList

type VRageRemoteChatMessageList struct {
	Messages []*VRageChatMessage
}

type VRageRemoteChatMessageListResponse

type VRageRemoteChatMessageListResponse struct {
	*VRageRemoteResponse
	Data *VRageRemoteChatMessageList `json:"data"`
}

type VRageRemoteClient

type VRageRemoteClient struct {
	BaseURL       string
	RemoteAddress string
	Key           string
	// contains filtered or unexported fields
}

func NewVRageRemoteClient

func NewVRageRemoteClient(remoteAddress string, key string) *VRageRemoteClient

func (*VRageRemoteClient) BanPlayer

func (client *VRageRemoteClient) BanPlayer(steamID int64) error

func (*VRageRemoteClient) DeleteAsteroid

func (client *VRageRemoteClient) DeleteAsteroid(entityID int64) error

func (*VRageRemoteClient) DeleteFloatingObject

func (client *VRageRemoteClient) DeleteFloatingObject(entityID int64) error

func (*VRageRemoteClient) DeleteGrid

func (client *VRageRemoteClient) DeleteGrid(entityID int64) error

func (*VRageRemoteClient) DeletePlanet

func (client *VRageRemoteClient) DeletePlanet(entityID int64) error

func (*VRageRemoteClient) DemotePlayer added in v0.1.1

func (client *VRageRemoteClient) DemotePlayer(steamID int64) error

func (*VRageRemoteClient) GetAsteroids

func (client *VRageRemoteClient) GetAsteroids() (*VRageRemoteAsteroidsListResponse, error)

func (*VRageRemoteClient) GetBannedPlayers

func (client *VRageRemoteClient) GetBannedPlayers() (*VRageRemoteBannedPlayersListResponse, error)

func (*VRageRemoteClient) GetCharacters added in v0.1.4

func (client *VRageRemoteClient) GetCharacters() (*VRageRemoteCharacterListResponse, error)

func (*VRageRemoteClient) GetChat

func (*VRageRemoteClient) GetFloatingObjects

func (client *VRageRemoteClient) GetFloatingObjects() (*VRageRemoteFloatingObjectListResponse, error)

func (*VRageRemoteClient) GetGrids

func (client *VRageRemoteClient) GetGrids() (*VRageRemoteGridListResponse, error)

func (*VRageRemoteClient) GetKickedPlayers

func (client *VRageRemoteClient) GetKickedPlayers() (*VRageRemoteKickedPlayersListResponse, error)

func (*VRageRemoteClient) GetPlanets

func (client *VRageRemoteClient) GetPlanets() (*VRageRemotePlanetListResponse, error)

func (*VRageRemoteClient) GetPlayers

func (client *VRageRemoteClient) GetPlayers() (*VRageRemotePlayerListResponse, error)

func (*VRageRemoteClient) GetServerInfo

func (client *VRageRemoteClient) GetServerInfo() (*VRageRemoteServerInfoResponse, error)

func (*VRageRemoteClient) KickPlayer

func (client *VRageRemoteClient) KickPlayer(steamID int64) error

func (*VRageRemoteClient) Ping

func (client *VRageRemoteClient) Ping() (time.Duration, error)

func (*VRageRemoteClient) PowerDownGrid

func (client *VRageRemoteClient) PowerDownGrid(entityID int64) error

func (*VRageRemoteClient) PowerUpGrid

func (client *VRageRemoteClient) PowerUpGrid(entityID int64) error

func (*VRageRemoteClient) PromotePlayer added in v0.1.1

func (client *VRageRemoteClient) PromotePlayer(steamID int64) error

func (*VRageRemoteClient) Save added in v0.1.1

func (client *VRageRemoteClient) Save() error

func (*VRageRemoteClient) SaveAs added in v0.1.1

func (client *VRageRemoteClient) SaveAs(name string) error

func (*VRageRemoteClient) SendChat

func (client *VRageRemoteClient) SendChat(content string) error

func (*VRageRemoteClient) StopCharacter added in v0.1.7

func (client *VRageRemoteClient) StopCharacter(entityID int64) error

func (*VRageRemoteClient) StopFloatingObject

func (client *VRageRemoteClient) StopFloatingObject(entityID int64) error

func (*VRageRemoteClient) StopGrid

func (client *VRageRemoteClient) StopGrid(entityID int64) error

func (*VRageRemoteClient) StopServer added in v0.1.7

func (client *VRageRemoteClient) StopServer() error

func (*VRageRemoteClient) UnbanPlayer

func (client *VRageRemoteClient) UnbanPlayer(steamID int64) error

func (*VRageRemoteClient) UnkickPlayer

func (client *VRageRemoteClient) UnkickPlayer(steamID int64) error

type VRageRemoteFloatingObject

type VRageRemoteFloatingObject struct {
	DisplayName      string
	EntityID         int64 `json:"EntityId"`
	Kind             string
	Mass             float64
	Position         VRagePosition
	LinearSpeed      float64
	DistanceToPlayer float64
	// contains filtered or unexported fields
}

func (*VRageRemoteFloatingObject) Delete added in v0.1.1

func (object *VRageRemoteFloatingObject) Delete() error

func (*VRageRemoteFloatingObject) GetNearestGrids added in v0.1.3

func (object *VRageRemoteFloatingObject) GetNearestGrids() ([]*VRageRemoteGrid, error)

GetNearestGrids ordered by distance

func (*VRageRemoteFloatingObject) GetNearestGridsIf added in v0.1.3

func (object *VRageRemoteFloatingObject) GetNearestGridsIf(fnc func(grid *VRageRemoteGrid) bool) ([]*VRageRemoteGrid, error)

GetNearestGrids ordered by distance but only return grids which match a callback criteria

func (*VRageRemoteFloatingObject) GetPosition added in v0.1.4

func (object *VRageRemoteFloatingObject) GetPosition() VRagePosition

func (*VRageRemoteFloatingObject) Stop added in v0.1.1

func (object *VRageRemoteFloatingObject) Stop() error

type VRageRemoteFloatingObjectList

type VRageRemoteFloatingObjectList struct {
	FloatingObjects []*VRageRemoteFloatingObject
}

type VRageRemoteFloatingObjectListResponse

type VRageRemoteFloatingObjectListResponse struct {
	*VRageRemoteResponse
	Data *VRageRemoteFloatingObjectList `json:"data"`
}

type VRageRemoteGrid

type VRageRemoteGrid struct {
	DisplayName      string
	EntityID         int64 `json:"EntityId"`
	GridSize         string
	BlocksCount      int64
	Mass             float64
	Position         VRagePosition
	LinearSpeed      float64
	DistanceToPlayer float64
	OwnerSteamID     int64 `json:"OwnerSteamId"`
	OwnerDisplayName string
	IsPowered        bool
	PCU              int64
	// contains filtered or unexported fields
}

func (*VRageRemoteGrid) Delete added in v0.1.1

func (grid *VRageRemoteGrid) Delete() error

func (*VRageRemoteGrid) GetPosition added in v0.1.4

func (grid *VRageRemoteGrid) GetPosition() VRagePosition

func (*VRageRemoteGrid) PowerDown added in v0.1.1

func (grid *VRageRemoteGrid) PowerDown() error

func (*VRageRemoteGrid) PowerUp added in v0.1.1

func (grid *VRageRemoteGrid) PowerUp() error

func (*VRageRemoteGrid) Stop added in v0.1.1

func (grid *VRageRemoteGrid) Stop() error

type VRageRemoteGridList

type VRageRemoteGridList struct {
	Grids []*VRageRemoteGrid
}

type VRageRemoteGridListResponse

type VRageRemoteGridListResponse struct {
	*VRageRemoteResponse
	Data *VRageRemoteGridList `json:"data"`
}

type VRageRemoteKickedPlayersList

type VRageRemoteKickedPlayersList struct {
	KickedPlayers []*VRageKickedPlayer
}

type VRageRemoteKickedPlayersListResponse

type VRageRemoteKickedPlayersListResponse struct {
	*VRageRemoteResponse
	Data *VRageRemoteKickedPlayersList `json:"data"`
}

type VRageRemotePlanetList

type VRageRemotePlanetList struct {
	Planets []*VRagePlanet
}

type VRageRemotePlanetListResponse

type VRageRemotePlanetListResponse struct {
	*VRageRemoteResponse
	Data *VRageRemotePlanetList `json:"data"`
}

type VRageRemotePlayer

type VRageRemotePlayer struct {
	FactionTag   string
	PromoteLevel int
	Ping         float64
	SteamID      int64
	DisplayName  string
	FactionName  string
	// contains filtered or unexported fields
}

func (*VRageRemotePlayer) Ban added in v0.1.1

func (player *VRageRemotePlayer) Ban() error

func (*VRageRemotePlayer) Kick added in v0.1.1

func (player *VRageRemotePlayer) Kick() error

type VRageRemotePlayerList

type VRageRemotePlayerList struct {
	Players []*VRageRemotePlayer
}

type VRageRemotePlayerListResponse

type VRageRemotePlayerListResponse struct {
	*VRageRemoteResponse
	Data *VRageRemotePlayerList `json:"data"`
}

type VRageRemoteResponse

type VRageRemoteResponse struct {
	Error *VRageRemoteResponseError `json:"error,omitempty"`
	Meta  *VRageRemoteResponseMeta  `json:"meta"`
}

type VRageRemoteResponseError

type VRageRemoteResponseError struct {
	Message string `json:"message"`
}

type VRageRemoteResponseMeta

type VRageRemoteResponseMeta struct {
	ApiVersion string  `json:"apiVersion"`
	QueryTime  float64 `json:"queryTime"`
}

type VRageRemoteServerInfo

type VRageRemoteServerInfo struct {
	Game              string
	IsReady           bool
	Players           int64
	ServerID          int64 `json:"ServerId"`
	ServerName        string
	SimSpeed          float64
	SimulationCPULoad float64 `json:"SimulationCpuLoad"`
	TotalTime         float64
	PirateUsedPCU     int64
	UsedPCU           int64
	Version           string
	WorldName         string
}

type VRageRemoteServerInfoResponse

type VRageRemoteServerInfoResponse struct {
	*VRageRemoteResponse
	Data *VRageRemoteServerInfo `json:"data"`
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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