go-steam: github.com/kidoman/go-steam Index | Files | Directories

package steam

import "github.com/kidoman/go-steam"

Package steam allows querying of Source servers.


Package Files

comm.go doc.go rconsocket.go server.go udpsocket.go util.go wire.go


var (
    ErrRCONAuthFailed = errors.New("steam: authentication failed")

    ErrRCONNotInitialized     = errors.New("steam: rcon is not initialized")
    ErrInvalidResponseType    = errors.New("steam: invalid response type from server")
    ErrInvalidResponseID      = errors.New("steam: invalid response id from server")
    ErrInvalidResponseTrailer = errors.New("steam: invalid response trailer from server")

func SetLog Uses

func SetLog(l *logrus.Logger)

type ConnectOptions Uses

type ConnectOptions struct {
    // Default will use net.Dialer.Dial. You can override the same by
    // providing your own.
    Dial DialFn

    // RCON password.
    RCONPassword string

ConnectOptions describes the various connections options.

type DialFn Uses

type DialFn func(network, address string) (net.Conn, error)

type Environment Uses

type Environment int
const (
    EInvalid Environment = iota

func (Environment) String Uses

func (e Environment) String() string

type InfoResponse Uses

type InfoResponse struct {
    Protocol    int
    Name        string
    Map         string
    Folder      string
    Game        string
    ID          int
    Players     int
    MaxPlayers  int
    Bots        int
    ServerType  ServerType
    Environment Environment
    Visibility  Visibility
    VAC         VAC
    Version     string

    Port    int
    SteamID int64

    SourceTVPort int
    SourceTVName string

    Keywords string
    GameID   int64

func (*InfoResponse) String Uses

func (r *InfoResponse) String() string

type Player Uses

type Player struct {
    Name     string
    Score    int
    Duration float64

type PlayersInfoResponse Uses

type PlayersInfoResponse struct {
    Players []*Player

type Server Uses

type Server struct {
    // contains filtered or unexported fields

Server represents a Source engine game server.

func Connect Uses

func Connect(addr string, os ...*ConnectOptions) (_ *Server, err error)

Connect to the source server.

func (*Server) Close Uses

func (s *Server) Close()

Close releases the resources associated with this server.

func (*Server) Info Uses

func (s *Server) Info() (*InfoResponse, error)

Info retrieves server information.

func (*Server) Ping Uses

func (s *Server) Ping() (time.Duration, error)

Ping returns the RTT (round-trip time) to the server.

func (*Server) PlayersInfo Uses

func (s *Server) PlayersInfo() (*PlayersInfoResponse, error)

PlayersInfo retrieves player information from the server.

func (*Server) Send Uses

func (s *Server) Send(cmd string) (string, error)

Send RCON command to the server.

func (*Server) String Uses

func (s *Server) String() string

type ServerType Uses

type ServerType int
const (
    STInvalid ServerType = iota

func (ServerType) String Uses

func (st ServerType) String() string

type VAC Uses

type VAC int
const (
    VACInvalid VAC = iota

func (VAC) String Uses

func (v VAC) String() string

type Visibility Uses

type Visibility int
const (
    VInvalid Visibility = iota

func (Visibility) String Uses

func (v Visibility) String() string



Package steam imports 13 packages (graph) and is imported by 2 packages. Updated 2016-07-21. Refresh now. Tools for package owners.