Jump to content

php server query tool


Andy_1984

Recommended Posts

lastnight i got bored and decided to try and find out some information on querying an mta server, having done this with other games before i thought it would be similar and it was but being lazy i copied some old code from some dutch guy on the forums and some from another query app ive used and alot of my own stuff and came up with a great little mta:vc query tool that gets users with large scores aswel :D

Enjoy

Download: http://www.projectpulse.dreadlabs.com/d ... aquery.zip

Demo: http://www.projectpulse.dreadlabs.com/m ... aquery.php (querys dna stunt server)

mtaquery has been updated

Edited by Guest
Link to comment

Lol... can i ask what dutch guy? Might know him :)

It's a cool system, but i wonder if it's smart to publish some parts of the MTA netcode, without permission of the MTA team. I can remeber a c++ program with the code in it which was not allowed to be published becasue of this netcode.

I cant say i like the code, but what it is doing is quite nice. You might wanna think of 2 seperate files, 1 compiled with the source code, and one iwth a template. That way tou can protect the code, and use templates a bit easier. Feel free to contact me to exchange thoughts.

(btw: is doing about the same, it only connects to MTAMA, and can read out script and admin data as well (like admin logins ;))

Edited by Guest
Link to comment

the dutch guy is dutchtux heres the post:

http://mtavc.com/forum/viewtopic.php?t=2522

i was thinking of a template system but then thought nah cause i was trying to keep it simple,but when i got some time to myself ill add more stuff like a template system and a total rework of the code of which will be all my own work as that was thrown together prety quikly and realy messy coding

theres no real way to protect the code by using template system as i offer this to be downloaded and used on a website for people who run a mtavc server. and the 'netcode' cant be used in any malicious way as far as i can tell, its a way alot of game servers provide stats in this way example: call of duty is almost the exact same, as with freelancer and many others.

if you know this code can be used to exploit an mta server please email me and ill work somthin out like remote mta server query from my own site just like game monitor but id realy like to avoid that at all costs because then people cant customize the script to fit there own website

Link to comment
Lol... can i ask what dutch guy? Might know him :)

It's a cool system, but i wonder if it's smart to publish some parts of the MTA netcode, without permission of the MTA team. I can remeber a c++ program with the code in it which was not allowed to be published becasue of this netcode.

I cant say i like the code, but what it is doing is quite nice. You might wanna think of 2 seperate files, 1 compiled with the source code, and one iwth a template. That way tou can protect the code, and use templates a bit easier. Feel free to contact me to exchange thoughts.

(btw: http://130.89.167.192/mtaphp is doing about the same, it only connects to MTAMA, and can read out script and admin data as well (like admin logins ;))

It's come public? :P

Link to comment

yeah its gettin alot better im gonna add some more things like using the url to change ip:port like

http://web.co.uk/mtaquery.php?a=127.0.0.1:2000

then gets info from server like that while just going to http://web.co.uk/mtaquery.php will just use ip:port that you specifiy inside the app

also a mini mta query for site index pages, would look a little like

server name

Online

Players: 32

MTA:VC

it would look alot nicer than that though

also the way that i have formated the returned info makes it easy to set it up for gta3 aswel witht he script being able to tell the difference

Link to comment

you need to go into the php script its self to change the player part heres how:

open mtaquery.php

scroll down the page and look for

/*Players display*/

you should see this:

/*Players display*/
$player_list .= '
'.$player['name'].
''.$player['score'].
''.$player['ping'].'
';
/*end Players display*/

just add your bgcolor="" into the td

the reason this part isnt in the template is because i dont know how to do loops in them so the php script builds that part of the tpl then outputs it as {player_list}

BELLOW CODE FOR PEOPLE WANTING TO CREATE OWN TEMPLATE FROM SCRATCH

when building your own tpl always include the players part inside the bellow code

/*Players display*/

insert html here

/*end Players display*/

ok now we know where to put it heres how we start it


/*Players display*/

$player_list .= 'all your html goes in here';

/*end Players display*/

ok now that we have the start how do we get the player list

here arethe variables that are used:(paste these as is directly into your html where you want it displayed)

'.$player['name'].'

'.$player['score'].'

'.$player['ping'].'

now you should have somthing that could look like this:


/*Players display*/

$player_list .= ''.$player['name'].'-'.$player['score'].'-'.$player['ping'].'
';

/*end Players display*/

i know its a little complicated but its the only way it can be done until i figure out a new template system so its not so weird for people who dont understand php

Link to comment

I'm rebuilding the MTA:PHP tool atm, and rewriting the netcode to nice XML messages. I'm desinging all this to be quite flexible, and use signals in mIRC to read out this data as well. The php frontend should be able to display everything that is sent to it.

The only thing i need is a few servers with special scrips running, so i can write a small addon for my package.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...