track

package
v0.0.0-...-88c621d Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2014 License: MPL-2.0, MPL-2.0 Imports: 9 Imported by: 0

README

gorcon/track - Experimental

track is used for tracking player stats & chat messages. Utilizes gorcon to monitor game server activity. Also has a snapshot system which stores a copy of the current player list as JSON in the 'snapshot.json' file.

Example:

Rcon with AutoReconnect and Tracker usage.

package main

import (
	"fmt"
	"github.com/lee8oi/gorcon"
	"github.com/lee8oi/gorcon/track"
	"time"
)

var config = gorcon.Config{
	Admin:    "Gorcon",
	Address:  "123.123.123.123",
	Pass:     "SeCrEtPaSsWoRd",
	RconPort: "18666",
}

func main() {
	var t track.Tracker
	if err := t.Rcon.Connect(config.Address + ":" + config.Port); err != nil {
		fmt.Println(err)
		return
	}
	if err := t.Rcon.Login(config.Pass); err != nil {
		fmt.Println(err)
		return
	}
	t.Rcon.AutoReconnect("30s")
	t.Start("500ms")
}

Documentation

Overview

track is used for tracking player stats & chat messages. Utilizes gorcon to monitor game server activity. Also has a snapshot system which stores a copy of the current player list as JSON in the 'snapshot.json' file.

Index

Constants

This section is empty.

Variables

View Source
var Log func(string)

Functions

This section is empty.

Types

type Tracker

type Tracker struct {
	Rcon gorcon.Rcon
	// contains filtered or unexported fields
}

func (*Tracker) Start

func (t *Tracker) Start(wait string)

Start runs the Tracker which monitors player stats & chat messages via Rcon connection. Runs in iterations. Sleeps for the specified wait time at the end of each iteration. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h" (see time.ParseDuration doc).

Jump to

Keyboard shortcuts

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