This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Custom Server Queries


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ezio_auditore
Senior Member
Join Date: May 2013
Old 02-27-2016 , 10:33   Custom Server Queries
Reply With Quote #1

How can we use AMXX Plugins to customize the results of Server Queries (If Possible)?

If it is possible, then is there a way to register custom server queries?
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 02-28-2016 , 11:12   Re: Custom Server Queries
Reply With Quote #2

Which queries exactly ? A2S ? If A2S_INFO, you can use this (if others use the concept).
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here
Shooting King is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 02-28-2016 , 22:16   Re: Custom Server Queries
Reply With Quote #3

Queries like A2S. Like we register some special query which returns, lets say, the map cycle of the server being.
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 03-01-2016 , 12:00   Re: Custom Server Queries
Reply With Quote #4

What do you want to do exactly ? (X-Y Problem warning!)
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here
Shooting King is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 03-04-2016 , 05:59   Re: Custom Server Queries
Reply With Quote #5

Suppose I make a query (A2S_ONE_PLUS_2).

The registered callback on my AMXX plugin fires, does some calculations, and then return me whatever stuff I want.
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 03-04-2016 , 11:16   Re: Custom Server Queries
Reply With Quote #6

Quote:
Originally Posted by ezio_auditore View Post
Suppose I make a query (A2S_ONE_PLUS_2).

The registered callback on my AMXX plugin fires, does some calculations, and then return me whatever stuff I want.
You could listen to a socket, that's the best possible way to achieve this.

Its better if you tell us what exactly you are trying to achieve. (no XY)
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here

Last edited by Shooting King; 03-04-2016 at 11:16.
Shooting King is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 03-04-2016 , 23:42   Re: Custom Server Queries
Reply With Quote #7

Quote:
Originally Posted by ezio_auditore View Post
Suppose I make a query (A2S_ONE_PLUS_2).

The registered callback on my AMXX plugin fires, does some calculations, and then return me whatever stuff I want.
That was the most obvious thing I've said.

I made a plugin which has a function that can calculate the total XP of all players on the server.
Now I want to make a query which gives me this calculated XP...
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 03-04-2016 , 06:23   Re: Custom Server Queries
Reply With Quote #8

Most likely possible, but I see no reason why would you want to undergo a lot of hooking engine functions and stuff to change these responses. Probably the best thing you could do is to listen to a socket. Making your own protocol, sort of.
Anyway, you shouldn't do that stuff at AMXX level, but rather at Metamod level.
klippy is offline
Old 03-04-2016, 12:08
xxxperts
This message has been deleted by xxxperts. Reason: @Shooting King I said exactly what you posted.
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-05-2016 , 00:08   Re: Custom Server Queries
Reply With Quote #10

I tried to make an example of this using UDP sockets but unfortunately there is no way to get the requester IP address (that I know of) without the use of recvfrom() function, which is not built in any of the existing sockets modules. What this means is once your plugin receives the request for info, it doesn't know where to send it to since UDP is connection-less; you need the requester IP/port to send the data back to. If someone is willing to add this to the sockets2 source, I can make it with that. My Visual C++ Express is now erroring on me when I load a project.

You could also form your request packets to include this data in the header, like:
123.23.232.12:port:CommandID

This could all be in binary, so the packet would look like: %^#$#@^$Z

ezio_auditore, what will be requesting data from your server?
__________________

Last edited by Bugsy; 03-05-2016 at 00:28.
Bugsy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode