A simple Golang class to query an Odamex server. It currently supports Odamex 0.7.0/0.8.X servers at the moment (and probably more in the future)
go get github.com/ch0ww/odamexgo
- First of all, import this class to your project.
import "github.com/ch0ww/odamexgo"
Then, create an ServerQuery class by parsing an Odamex URI :
odasv, err := odamexgo.NewOdaURI("odamex://<ip>[:<port>]")
if err != nil {
fmt.Println(err)
return
}
// Receive and parse all Odamex data.
sv, err := odasv.GetServerInfo()
if err != nil {
fmt.Println(err) // In case of a server unreachable
return
}
If you want to see an example of how it should be done, check example/odaquery.go .