web api secret / go fmt
This commit is contained in:
parent
4f53a7996e
commit
2ae8559a40
@ -23,7 +23,11 @@ type Config struct {
|
||||
}
|
||||
|
||||
type WebApiConfig struct {
|
||||
//mapblock debugging
|
||||
EnableMapblock bool `json:"enablemapblock"`
|
||||
|
||||
//mod http bridge secret
|
||||
SecretKey string `json:"secretkey"`
|
||||
}
|
||||
|
||||
type RenderStateType struct {
|
||||
@ -72,6 +76,7 @@ func WriteConfig(filename string, cfg *Config) error {
|
||||
func ParseConfig(filename string) (*Config, error) {
|
||||
webapi := WebApiConfig{
|
||||
EnableMapblock: false,
|
||||
SecretKey: RandStringRunes(16),
|
||||
}
|
||||
|
||||
rstate := RenderStateType{
|
||||
|
@ -1,11 +1,11 @@
|
||||
package player
|
||||
|
||||
type Player struct {
|
||||
X int `json:"x"`
|
||||
Y int `json:"y"`
|
||||
Z int `json:"z"`
|
||||
Name string `json:"name"`
|
||||
HP int `json:"hp"`
|
||||
Breath int `json:"breath"`
|
||||
X int `json:"x"`
|
||||
Y int `json:"y"`
|
||||
Z int `json:"z"`
|
||||
Name string `json:"name"`
|
||||
HP int `json:"hp"`
|
||||
Breath int `json:"breath"`
|
||||
//TODO: stamina, skin, etc
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"encoding/json"
|
||||
"mapserver/app"
|
||||
"net/http"
|
||||
)
|
||||
@ -11,7 +11,7 @@ type Minetest struct {
|
||||
}
|
||||
|
||||
func (t *Minetest) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
|
||||
resp.Header().Add("content-type", "application/json")
|
||||
json.NewEncoder(resp).Encode("stub")
|
||||
resp.Header().Add("content-type", "application/json")
|
||||
json.NewEncoder(resp).Encode("stub")
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user