Search the Community
Showing results for tags 'golang'.
-
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
-
- 2
-
- server
- monitoring
-
(and 2 more)
Tagged with: