An under used Steam api feature is getting server information such as players, map, name, location and version. Here is how to do it using DayZ mod as an example.
The php file consists of the following:
response->servers[0]; $name = $main->name; $address = $main->addr; $version = $main->version; $players = $main->players; $map = $main->map; $bots = $main->bots; echo "Server: $name
Address: $address
Players: $players
Bots: $bots
Map: $map
Version: $version";
*You need a Steam api key
The $data variable has filters of appid and addr . The appid is a number steam gives to a game (730 is csgo etc), addr is the servers ip address and steamport (steamport is one more than the connection port ie 2303 2302).
To use the above script for your needs you need to edit the appid, addr and add your Steam api key. Then you can follow how i went through the array to get the data like players, map, name, location and version.
A drained and empty Kennington reservoir images from a drone in early July 2024. The…
Merrimu Reservoir from drone. Click images to view larger.
Using FTP and PHP to get an array of file details such as size and…
Creating and using Laravel form requests to create cleaner code, separation and reusability for your…
Improving the default Laravel login and register views in such a simple manner but making…
Laravel validation for checking if a field value exists in the database. The validation rule…