Author
|
Message
|
RAAASENGAN
Join Date: Mar 2012
Location: India
|
07-18-2014
, 11:22
Module: Fake Server Queries
|
#1
|
Fake Server Queries v1.1 - 1/1/2017
In brief, This module gives you the ability to change Server Query fields. Thereby providing modified information to the client about the server. This module currently supports only some A2S_INFO Fields namely,
- Server Name
- Map Name
- Game Name
- Players (Online)
- MaxPlayers
- Bots
Others can be added on request.
Natives and Forwards :
PHP Code:
/*
Set Host Name on Sendto Quries
MaxLen In SvBrowser - 63 + 1 (null)
if an empty string ("") is passed, FL_SVNAME flag will be unset.
*/
native fq_set_hostname( const szHostName[] );
/*
Set Map Name on Sendto Quries
MaxLen In SvBrowser - 31 + 1 (null)
if an empty string ("") is passed, FL_MAPNAME flag will be unset.
*/
native fq_set_mapname( const szMapName[] );
/*
Set Game Name on Sendto Quries
MaxLen In SvBrowser - 63 + 1 (null)
if an empty string ("") is passed, FL_GAMENAME flag will be unset.
*/
native fq_set_gamename( const szGameName[] );
/*
Set Players on Sendto Quries
If iPlayers is less than 0 i.e a negative number
Original playersnum will be set.
if a Negative number is passed, FL_PLAYERS will be unset.
returns 0 On Success and -1 on Failure ( Value is greater than 127 )
*/
native fq_set_players( const iPlayers );
/*
Set Hostname on Sendto Quries
If iMaxPlayers is less than 0 i.e a negative number
Original maxplayers will be set.
if a Negative number is passed, FL_MAXPLAYERS will be unset.
returns 0 On Success and -1 on Failure ( Value is greater than 127 )
*/
native fq_set_maxplayers( const iMaxPlayers );
/*
Set Hostname on Sendto Quries
If iBotsNum is less than 0 i.e a negative number
Original botsnum will be set.
if a Negative number is passed, FL_BOTSNUM will be unset.
returns 0 On Success and -1 on Failure ( Value is greater than 127 )
*/
native fq_set_botsnum( const iBotsNum );
enum FFlags(<<=1)
{
FL_SVNAME = ( 1<<0 ),
FL_MAPNAME,
FL_GAMENAME,
FL_PLAYERS,
FL_MAXPLAYERS,
FL_BOTSNUM
}
/*
Set Hostname on Sendto Quries
UnSet respective variables. You can even pass the bitsum of the above flags
eg. fq_unset( FL_SVNAME | FL_BOTSNUM );
returns 0 on Success and -1 on Failure
*/
native fq_unset( const FFlags:iFlags );
/*
Called Before replying to a request.
To block sending Response to an IP, return PLUGIN_HANDLED.
This will block call to SendTo fuction.
Header is a part (till first \x00 encounter) of Actuall response which would be sent by the server.
*/
forward Server_SendTo( const szIP[], const szHeader[] );
Installation :1. Download fakequeries_binary.zip from the attachments.
2. Extract it in your game directory.
3. Optional: Add "fake_queries" in your modules.ini (in amxmodx/configs dir). Credits :Arkshine aka noob :p and joropito (for CHooker class) Examples :1. fq_Basic:
PHP Code:
#include <amxmodx>
#include <fake_queries>
new const szHostName[] = "Shooting Kings Test Server";
new const szMapName[] = "sk_dust2";
new const szGameName[] = "AM Game";
new const iPlayers = 12;
new const iMaxPlayers = 64;
new const iBotsNum = 0;
public plugin_init()
{
register_plugin( "FakeQueries", "1.0", "Shooting King" );
fq_set_hostname( szHostName );
fq_set_mapname( szMapName );
fq_set_gamename( szGameName );
if( !fq_set_players(iPlayers) )
log_amx( "Players Successfully Set." );
else
log_amx( "Players Failed to Set." );
if( !fq_set_maxplayers(iMaxPlayers) )
log_amx( "MaxPlayers Successfully Set." );
else
log_amx( "MaxPlayers Failed to Set." );
if( !fq_set_botsnum(iBotsNum) )
log_amx( "Bots Successfully Set." );
else
log_amx( "Bots Failed to Set." );
}
Result :
2. fq_BlockIP
PHP Code:
#include <amxmodx>
#include <fake_queries>
new szTestIP[] = "127.0.0.1";
public plugin_init()
{
register_plugin( "FakeQueries : Block IP", "1.0", "Shooting King" );
}
public Server_SendTo( const szIP[], const szHeader[] )
{
if( equal(szIP, szTestIP) )
{
log_amx( "Blocked Connection from %s with header %s", szIP, szHeader );
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
Know Issues:
ChangeLog :
Code:
1.1v
- Fixed BotCount not being set on queries
- Changed technical name of the module to fake_queries, i.e, the name of module, library, include etc etc..
- Updated vs toolkit to vs110
1.0v
- Initial Release
Github: Link (https://github.com/ShootingKing-AM/FakeServerQueries)
Plugins and the module are tested on Windows and Linux (Ubuntu 14.04 LTS x64) with HLDS v6132.
v1.0 Download count - 27277
__________________
Last edited by Shooting King; 01-01-2017 at 05:33.
Reason: Tested on Linux as well.
|
|
|
|