I was just wondering if there is any way to get data about the Beam MP server such as players, mods, map and so on from an API in any way.
Since I’m hosting it is there an option I could get it serverside and create my own API?
Hello, The information you are looking for is partially available from the servers Lua interface however if you are looking for generic information then you could obtain it from the BeamMP server list.
Thank you for your response. After doing some research I was not able to find any more information about this, would you be so kind and provide some resources.
Hey, recently in the server pre-release (v3.8.0) an information packet (technical details on github) was added which allows you to fetch the information you want from your server.
To use it you have to connect to your server over TCP and send I
, the server will then respond with its information in JSON and the length of it, the packet will look like: [int32_t (4 bytes) the size of the data][json data]
with the json data looking like:
{
"clientversion":"2.2.0",
"desc":"BeamMP Default Description",
"guests":"true",
"map":"/levels/gridmap_v2/info.json",
"maxplayers":"10",
"modlist":"",
"modstotal":"0",
"modstotalsize":"0",
"name":"BeamMP Server",
"players":"0",
"playerslist":"",
"port":"30814",
"private":"false",
"tags":"Freeroam",
"version":"3.7.2"
}
You can then parse this in your code and process it as you please.
Thats exactly what I was looking for thank you for letting me know.