Miami Night Studio Posted February 4, 2022 Share Posted February 4, 2022 (edited) Hello everyone, Now i preesent you simple MTA:SA server monitoring solution written in go language. Actually this is an adoptation of Lipau3n's python 3 solution ( topic, repo ). Via server object you can get some information like: Game (mta) Address string with MTA server ip address Port - server main port (UDP) AsePort - main MTA:SA port + 123 Name - server name Gamemode - server mode Map - server map Version - mta:sa server version Players - number of players on the server right now Maxplayers - the maximum number of players that can join Usage example: package main import ( "fmt" "github.com/LuaSavage/mta-monitoring/server" ) func main() { // pass server address and port exampleServer := server.NewServer("185.71.66.81", 22003) // Note that it updating fields once. // To update them frequently or on occasion you've to have some sort of poller if err := exampleServer.UpdateOnce(); err != nil { panic(err) } // Printing updated data in objects structure fmt.Printf("%+v\n", exampleServer) // Printing link to join mta:sa server fmt.Println(exampleServer.GetJoinLink()) } Source code here: github Edited January 13, 2023 by Miami Night Studio 2 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now