parser

package
v0.0.0-...-441e3cc Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2019 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Player

type Player struct {
	XMLName   xml.Name `xml:"Client"`
	ID        int      `xml:"CID,attr"`
	ColorName string   `xml:"ColorName,attr"`
	IP        string   `xml:"IP,attr"`
	GUID      string   `xml:"PBID,attr"`
	Score     int      `xml:"Score,attr"`
	Kills     int      `xml:"Kills,attr"`
	Deaths    int      `xml:"Deaths,attr"`
	Assists   int      `xml:"Assists,attr"`
	Ping      int      `xml:"Ping,attr"`
	Team      int      `xml:"Team,attr"`
	TeamName  string   `xml:"TeamName,attr"`
	Rank      int      `xml:"rank,attr"`
	Power     int      `xml:"power,attr"`
	Updated   string   `xml:"Updated,attr"`
}

Player properties

func (Player) Name

func (p Player) Name() template.HTML

Name of the player colorised

func (Player) RankTitle

func (p Player) RankTitle() string

RankTitle - returns the player's rank title

type Players

type Players map[int]*Player

Players is a List of players

func (Players) Len

func (players Players) Len() int

Len - Interface method for sort

func (Players) Less

func (players Players) Less(i, j int) bool

Less - Interface method for sort

func (Players) Swap

func (players Players) Swap(i, j int)

Swap - Interface method for sort

type Server

type Server struct {
	XMLName       xml.Name `xml:"B3Status"`
	Game          metaData `xml:"Game"`
	Time          string   `xml:"Time,attr"`
	Players       []Player `xml:"Clients>Client"`
	FormattedName template.HTML
	Teams         map[int]*team
}

Server properties

func Parse

func Parse(file string) (map[string]string, Server, error)

Parse the serverstatus.xml file

Jump to

Keyboard shortcuts

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