routes

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsString

func ContainsString(arr []string, target string) bool

func GetEntityValueRouteHandler

func GetEntityValueRouteHandler(ctx *server.EngineCtx) gin.HandlerFunc

calculate state root hash for a game world

func GetStateRouteHandler

func GetStateRouteHandler(ctx *server.EngineCtx) gin.HandlerFunc

fetch the world state

func StateRootRouteHandler

func StateRootRouteHandler(ctx *server.EngineCtx) gin.HandlerFunc

calculate state root hash for a game world

Types

type DownloadStateRequest

type DownloadStateRequest struct {
	Tables []string `json:"tables"`
}

request

type GameStateResponse

type GameStateResponse struct {
	Tick   int         `json:"tick"`
	Tables []TableData `json:"tables"`
}

response

type GetEntityRequest

type GetEntityRequest struct {
	Entity int `json:"entity"`
}

request

type GetEntityResponse

type GetEntityResponse struct {
	Table string `json:"table"`
	Value any    `json:"value"`
}

response

type StateRootRequest

type StateRootRequest struct {
}

request

type StateRootResponse

type StateRootResponse struct {
	GameId   string `json:"gameId"`
	RootHash string `json:"rootHash"`
}

response

type TableData

type TableData struct {
	Name   string  `json:"name"`
	Values []Value `json:"values"`
}

type Value

type Value struct {
	Entity int `json:"entity"`
	Value  any `json:"value"`
}

Jump to

Keyboard shortcuts

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