xXMADEXx Posted April 12, 2015 Share Posted April 12, 2015 Hello everyone, I'm making an app for MTA servers, but I can't seem to find anywhere to query the MTA server list. I tried checking the MTA source code, but couldn't find where it gets the server list from. If someone could send me a link or API that will give me the server list, that would be awesome! Thanks. Link to comment
Mr.unpredictable. Posted April 12, 2015 Share Posted April 12, 2015 http://www.game-state.com/index.php?game=mta Link to comment
xXMADEXx Posted April 12, 2015 Author Share Posted April 12, 2015 http://www.game-state.com/index.php?game=mta Thanks, but I need to to be directly printed to the web page, in some format that I can work with such as JSON. Link to comment
Mr.unpredictable. Posted April 12, 2015 Share Posted April 12, 2015 The only thing i found in Mta folder is servercache file which contains the server list. Link to comment
xXMADEXx Posted April 12, 2015 Author Share Posted April 12, 2015 The only thing i found in Mta folder is servercache file which contains the server list. That wouldn't work because I want the stats to be life (not cached) and be available a smart phone. Link to comment
Zarkolix Posted April 12, 2015 Share Posted April 12, 2015 This file might be interesting: https://github.com/multitheftauto/mtasa ... r.Util.hpp If you look through it you'll find this: http://master.mtasa.com/ase/mta/?v=%VERSION%&id=%ID% And this: http://ase.aventine.modpro.be/ase2.dat?v=%VERSION%&id=%ID% Looks like that's where they get the server-list data (master server list). Now it's up to you to figure out how to parse it. This might help with the parsing: https://github.com/multitheftauto/mtasa-blue/blob/3bd948ed6efb02b09a7633819de50193bc2d21be/Shared/sdk/SharedUtil.Buffer.h 1 Link to comment
xXMADEXx Posted April 13, 2015 Author Share Posted April 13, 2015 This file might be interesting: https://github.com/multitheftauto/mtasa ... r.Util.hppIf you look through it you'll find this: http://master.mtasa.com/ase/mta/?v=%VERSION%&id=%ID% And this: http://ase.aventine.modpro.be/ase2.dat?v=%VERSION%&id=%ID% Looks like that's where they get the server-list data (master server list). Now it's up to you to figure out how to parse it. This might help with the parsing: https://github.com/multitheftauto/mtasa-blue/blob/3bd948ed6efb02b09a7633819de50193bc2d21be/Shared/sdk/SharedUtil.Buffer.h Strange, I was looking in that file bout couldn't find the http://mtaster.mtasa.com/ link, are you sure it was from this file? After viewing the link, I believe this is what I'm looking for, but I can't seem to find where they did it in the MTA source. Link to comment
Zarkolix Posted April 13, 2015 Share Posted April 13, 2015 This file might be interesting: https://github.com/multitheftauto/mtasa ... r.Util.hppIf you look through it you'll find this: http://master.mtasa.com/ase/mta/?v=%VERSION%&id=%ID% And this: http://ase.aventine.modpro.be/ase2.dat?v=%VERSION%&id=%ID% Looks like that's where they get the server-list data (master server list). Now it's up to you to figure out how to parse it. This might help with the parsing: https://github.com/multitheftauto/mtasa-blue/blob/3bd948ed6efb02b09a7633819de50193bc2d21be/Shared/sdk/SharedUtil.Buffer.h Strange, I was looking in that file bout couldn't find the http://mtaster.mtasa.com/ link, are you sure it was from this file? After viewing the link, I believe this is what I'm looking for, but I can't seem to find where they did it in the MTA source. Well if you look at the top of the file "CVersionUpdater.Util.cpp" you see #define UPDATER_MASTER_URL1 "https://updatesa.multitheftauto.com/sa/master/?v=%VERSION%&id=%ID%" #define UPDATER_MASTER_URL2 "https://updatesa.multitheftauto.com/sa/master/?v=%VERSION%&id=%ID%" These are called master files and are being loaded into the programs memory. They contain the links I gave you above to the master-server lists. Oh and you're welcome by the way. Link to comment
Recommended Posts