diff --git a/server/app/config.go b/server/app/config.go index 2b3e89c..f6b196a 100644 --- a/server/app/config.go +++ b/server/app/config.go @@ -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{ diff --git a/server/player/player.go b/server/player/player.go index a8d8411..ccae247 100644 --- a/server/player/player.go +++ b/server/player/player.go @@ -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 } diff --git a/server/web/minetest.go b/server/web/minetest.go index 9de1a95..f8991cb 100644 --- a/server/web/minetest.go +++ b/server/web/minetest.go @@ -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") }