api

package
v0.0.0-...-e8bb1c2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SquadTypeCommander = SquadType("Commander")
	SquadTypeRecon     = SquadType("Recon")
	SquadTypeArmor     = SquadType("Armor")
	SquadTypeInfantry  = SquadType("Infantry")
)

Functions

func NewHandler

func NewHandler(p RConPool) *handler

Types

type GameScore

type GameScore struct {
	Axis   int `json:"axis"`
	Allies int `json:"allies"`
}

type Player

type Player struct {
	Name      string `json:"name"`
	SteamId64 string `json:"steam_id_64"`
	Team      string `json:"team"`
	Role      string `json:"role"`
	Loadout   string `json:"loadout"`
	Unit      Unit   `json:"unit"`
	Kills     int    `json:"kills"`
	Deaths    int    `json:"deaths"`
	Score     Score  `json:"score"`
	Level     int    `json:"level"`
}

type PlayerCount

type PlayerCount struct {
	Axis   int `json:"axis"`
	Allies int `json:"allies"`
}

type RConPool

type RConPool interface {
	GetWithContext(ctx context.Context) (*rcon.Connection, error)
	WithConnection(ctx context.Context, f func(c *rcon.Connection) error) error
	Return(c *rcon.Connection, err error)
}

type Score

type Score struct {
	CombatEffectiveness int `json:"combat_effectiveness"`
	Offensive           int `json:"offensive"`
	Defensive           int `json:"defensive"`
	Support             int `json:"support"`
}

func (*Score) Merge

func (s *Score) Merge(o Score)

type ServerInfo

type ServerInfo struct {
	Name          string      `json:"name"`
	Map           string      `json:"map"`
	NextMap       string      `json:"next_map"`
	PlayerCount   int         `json:"player_count"`
	Players       PlayerCount `json:"players"`
	MaxPlayers    int         `json:"max_players"`
	RemainingTime string      `json:"remaining_time"`
	GameScore     GameScore   `json:"game_score"`
}

type Squad

type Squad struct {
	Type    SquadType `json:"type"`
	Score   Score     `json:"score"`
	Players []Player  `json:"players"`
}

type SquadType

type SquadType string

type Team

type Team struct {
	Squads         map[string]*Squad `json:"squads"`
	NoSquadPlayers []Player          `json:"no_squad_players"`
	Commander      *Squad            `json:"commander"`
	Score          Score             `json:"score"`
}

type TeamView

type TeamView map[string]*Team

type Unit

type Unit struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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