mc_misc.go 434 B

1234567891011121314151617181920
  1. package main
  2. import (
  3. "encoding/json"
  4. "net/http"
  5. "aytechnology.us/gominecraft/mod/mcping"
  6. )
  7. func SendCommand(w http.ResponseWriter, r *http.Request) {
  8. command, _ := mv(r, "command", false)
  9. MCServer.SendCommand(command)
  10. sendJSONResponse(w, "OK")
  11. }
  12. func ServerInfo(w http.ResponseWriter, r *http.Request) {
  13. resp, _ := mcping.Ping("localhost:25565")
  14. jsonData, _ := json.Marshal(resp)
  15. sendJSONResponse(w, string(jsonData))
  16. }