~mendelmaleh/mcstatus

64a9e7e6e4da90b743243e7b935b372dc0bd9b38 — Mendel E 1 year, 4 months ago f4a6533 master
Join MOTD into string, use resp.Plugins.Names
1 files changed, 7 insertions(+), 9 deletions(-)

M mcstatus.go
M mcstatus.go => mcstatus.go +7 -9
@@ 5,6 5,7 @@ import (
	"fmt"
	"io/ioutil"
	"net/http"
	"strings"
	"time"
)



@@ 36,10 37,9 @@ type Server struct {

// Minecraft values
type Minecraft struct {
	Map, Software, Version    string
	PlayersOnline, PlayersMax int

	MOTD, Players, Plugins []string
	Map, Software, Version, MOTD string
	PlayersOnline, PlayersMax    int
	Players, Plugins             []string
}

// Debug values


@@ 152,14 152,12 @@ func (s *Status) UnmarshalJSON(b []byte) error {
			Map:      r.Map,
			Software: r.Software,
			Version:  r.Version,
			MOTD:     strings.Join(r.MOTD.Clean, "\n"),

			PlayersOnline: r.Players.Online,
			PlayersMax:    r.Players.Max,

			Players: r.Players.List,
			Plugins: r.Plugins.Raw, // TODO
			MOTD:    r.MOTD.Clean,  // TODO

			Players:       r.Players.List,
			Plugins:       r.Plugins.Names,
		},

		Debug{