add old id option

This commit is contained in:
2024-04-21 15:06:26 +02:00
parent 2ce4b3cebf
commit 784cf13b2e

View File

@@ -24,6 +24,7 @@ type TF2Server string
var (
server = flag.String("server", "", "comma seperated list of addresses to query")
oldIDs = flag.Bool("oldids", false, "use old gamedig IDs")
)
func main() {
@@ -51,7 +52,12 @@ func main() {
}
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()
if err != nil {
return nil, err