lgsl icon indicating copy to clipboard operation
lgsl copied to clipboard

Somekind of API?

Open MnkyArts opened this issue 4 months ago • 4 comments

Would love to see some kind of api to easily integrate lgsl into websites. Maybe something like a masterlist json where everything is listed? For example like alt:V does it for their serverlist: https://altv.mp/api/servers

MnkyArts avatar Feb 13 '24 00:02 MnkyArts

Hi @MnkyArts LGSL now have an api-like feeding page that allow you to get one server's data. Example: https://www.fungameraltersheim.de/lgsl-master/lgsl_files/lgsl_feed.php?type=ts3&ip=213.239.213.230&c_port=9987&q_port=10011&request=s Or you want to get all the servers in a row?

tltneon avatar Feb 15 '24 17:02 tltneon

Hey @tltneon,

yes i was talking about all servers in the system.

i played a bit with the system and build something like this: { "name": "A Minecraft Server", "ip": "127.0.0.1", "port": "25565", "game": "minecraft", "map": "world", "players": "0", "maxplayers": "20", "comment": "", "status": "1" }, { "name": "A Minecraft Server 2", "ip": "127.0.0.1", "port": "25566", "game": "minecraft", "map": "world", "players": "0", "maxplayers": "20", "comment": "", "status": "1" },

but would be cool to have this as a feature in the future :)

MnkyArts avatar Feb 15 '24 23:02 MnkyArts

Hey, I added little api to lgsl7 branch https://github.com/tltneon/lgsl/tree/lgsl7 To get data from api you need:

  1. Add to lgsl_config.php $lgsl_config['api'] = true;
  2. Open http://lgsl7.test/src/lgsl_feed.php
  3. Get what you need. e.g.
[{"name":"[Kgr.GD]-alte-Hasen !!! all Server Bans removed !!!","ip":"104.238.159.193","port":"7757","game":"redorchestra","map":"RO-Bondarevo-remastered-v3","players":0,"maxplayers":26,"online":true},{"name":"Pecypc-CEPBEP (Resource-SERVER)+3 perks","ip":"185.97.254.214","port":"7907","game":"killingfloor","map":"KF-Farm","players":0,"maxplayers":20,"online":true},{"name":"Punaportti","ip":"5.9.50.39","port":"34297","game":"rfactor","map":"Pello20212","players":0,"maxplayers":10,"online":true},{"name":"~[FGS]Wunderland~ ALTFIRE 2014","ip":"207.180.246.62","port":"7790","game":"deusex","map":"DXMP_Frequency","players":0,"maxplayers":20,"online":true},{"name":"","ip":"141.95.54.12","port":"7777","game":"ut3","map":"--","players":0,"maxplayers":0,"online":false},{"name":"[www.utbr.cf] The Brazilian UT3 Server","ip":"168.138.135.61","port":"7777","game":"ut3","map":"DM-ShangriLa","players":0,"maxplayers":10,"online":true}]

tltneon avatar Feb 19 '24 19:02 tltneon

This is perfect! Amazing how fast you implemented it, thank you!

MnkyArts avatar Feb 20 '24 00:02 MnkyArts