utils

package
v0.0.0-...-f6d6271 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyLog

func EmptyLog(path string) error

EmptyLog empties the tf2 log file

func GetSteamIDFromPlayerName

func GetSteamIDFromPlayerName(playerName string, playersInfo []*PlayerInfo) (int64, error)

GetSteamIDFromPlayerName gets the steamID64 from a player name cache

func GrokInit

func GrokInit()

GrokInit initializes and compiles the grok patterns

func GrokParseCommand

func GrokParseCommand(line string) (string, string, error)

GrokParseCommand parses the given line with the command grok pattern

func GrokParsePlayerName

func GrokParsePlayerName(rconNameResponse string) (string, error)

GrokParsePlayerName parses the given line with the playerName grok pattern

func LogPathDection

func LogPathDection() string

LogPathDection detects the tf2 log path

func Steam3IDToSteam64

func Steam3IDToSteam64(steam3ID int64) int64

Steam3IDToSteam64 converts a steam3 id to a steam64 id

func TailLog

func TailLog(tf2LogPath string) (*tail.Tail, error)

TailLog tails the tf2 log file

Types

type ChatInfo

type ChatInfo struct {
	PlayerName string
	Message    string
}

ChatInfo is a struct containing all the info we need about a chat message

func GrokParseChat

func GrokParseChat(line string) (*ChatInfo, error)

GrokParseChat parses the given line with the chat grok pattern

type PlayerInfo

type PlayerInfo struct {
	SteamID       int64
	Name          string
	UserID        int
	SteamAccType  string
	SteamUniverse int
}

PlayerInfo is a struct containing all the info we need about a player

func GrokParse

func GrokParse(line string) (*PlayerInfo, error)

GrokParse parses the given line with the main grok pattern

Jump to

Keyboard shortcuts

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