add old id option
This commit is contained in:
8
main.go
8
main.go
@@ -24,6 +24,7 @@ type TF2Server string
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
server = flag.String("server", "", "comma seperated list of addresses to query")
|
server = flag.String("server", "", "comma seperated list of addresses to query")
|
||||||
|
oldIDs = flag.Bool("oldids", false, "use old gamedig IDs")
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -51,7 +52,12 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (ip TF2Server) Stats() (*TF2Stat, error) {
|
func (ip TF2Server) Stats() (*TF2Stat, error) {
|
||||||
cmd := exec.Command("gamedig", "--type", "teamfortress2", string(ip))
|
gameID := "teamfortress2"
|
||||||
|
if *oldIDs {
|
||||||
|
gameID = "tf2"
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd := exec.Command("gamedig", "--type", gameID, string(ip))
|
||||||
bOut, err := cmd.CombinedOutput()
|
bOut, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Reference in New Issue
Block a user