Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 668 Bytes

README.md

File metadata and controls

49 lines (35 loc) · 668 Bytes

Go A2S

An implementation of Source A2S Queries

Guides

Installing

go get -u github.com/oxxzz/valve

Querying

package main

import (
 "fmt"
 "time"

 "github.com/oxxzz/valve"
)

func main() {
 servers := []string{
  "62.234.169.62:26666",
  // ....
 }

 for i := 0; i < len(servers); i++ {
  c, err := valve.NewClient(servers[i], 3*time.Second)
  if err != nil {
   fmt.Printf("server %s => error: %v\n", servers[i], err)
   continue
  }
  // Ping
  fmt.Println(c.Ping())
  fmt.Println(c.Players())
  fmt.Println(c.Info())
  fmt.Println(c.Rules())

  c.Close()
 }
}

TODO

  • RCON