Raised This Month: $127 Target: $400
 31% 

Module: Fake Server Queries


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 07-18-2014 , 11:22   Module: Fake Server Queries
Reply With Quote #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<<),
    
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_hostnameszHostName );
    
fq_set_mapnameszMapName );
    
fq_set_gamenameszGameName );

    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(szIPszTestIP) )
    {
        
log_amx"Blocked Connection from %s with header %s"szIPszHeader );
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;

Know Issues:
Code:
 - None.
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
Attached Files
File Type: sma Get Plugin or Get Source (fq_Basic.sma - 249 views - 831 Bytes)
File Type: sma Get Plugin or Get Source (fq_BlockIP.sma - 225 views - 406 Bytes)
File Type: inc fake_queries.inc (2.3 KB, 147 views)
File Type: zip fakequeries_binary.zip (177.1 KB, 169 views)
File Type: zip fakequeries_source.zip (49.1 KB, 120 views)
File Type: dll fake_queries_amxx.dll (405.5 KB, 79 views)
File Type: so fake_queries_amxx_i386.so (25.5 KB, 114 views)
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate

Last edited by Shooting King; 01-01-2017 at 05:33. Reason: Tested on Linux as well.
Shooting King is offline
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 07-18-2014 , 11:38   Re: Module: Fake Server Queries
Reply With Quote #2

Good Job
__________________
All my work is here
xxxperts is offline
bboygrun
CHOMP
Join Date: May 2010
Location: France
Old 07-18-2014 , 11:48   Re: Module: Fake Server Queries
Reply With Quote #3

Good job, but, isn't it illegal ?
__________________
bboygrun is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 07-18-2014 , 11:50   Re: Module: Fake Server Queries
Reply With Quote #4

For what purpose can this be used besides fooling players?
__________________
hleV is offline
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 07-18-2014 , 11:55   Re: Module: Fake Server Queries
Reply With Quote #5

Quote:
Originally Posted by hleV View Post
For what purpose can this be used besides fooling players?
Quote:
Originally Posted by Arkshine View Post
I would think it could be useful, if a player connects to the server, he may stay and it may lead to other players connection ; and eventually a server filled with only players. I see really no harm done. It's more a tool to motivate players to stay on the server and waiting for others players. If you want to blame someone, blame the admin who puts the module bots.
Quote:
Originally Posted by bboygrun View Post
Good job, but, isn't it illegal ?
I don't think its illegal with HL1 games.
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate

Last edited by Shooting King; 07-18-2014 at 11:59.
Shooting King is offline
bboygrun
CHOMP
Join Date: May 2010
Location: France
Old 07-18-2014 , 12:06   Re: Module: Fake Server Queries
Reply With Quote #6

AFAIK it is, i have to retrieve the text i found from Valve about it.
__________________
bboygrun is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-18-2014 , 12:21   Re: Module: Fake Server Queries
Reply With Quote #7

Oh, don't quote me \o/.
__________________
Working on : CS Weapon Mod (72%) , MonsterAI (PAUSED),

Arkshine is offline
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 07-18-2014 , 12:24   Re: Module: Fake Server Queries
Reply With Quote #8

Quote:
Originally Posted by Arkshine View Post
Oh, don't quote me \o/.
:p
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate
Shooting King is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Old 07-18-2014 , 12:59   Re: Module: Fake Server Queries
Reply With Quote #9

Haha impressive!
Faster download all files before delete by moderatoz.
__________________
Hi, 7 years ago i run nosteam servers and i support nosteam community. So please ban me. Thank you legitmodders.

Last edited by yokomo; 07-18-2014 at 13:08.
yokomo is offline
vlad_slick
Member
Join Date: Jul 2009
Old 07-18-2014 , 13:50   Re: Module: Fake Server Queries
Reply With Quote #10

Quote:
Originally Posted by yokomo View Post

Faster download all files before delete by moderatoz.
AHAHAHAH! That's the first thing I thought after seeing the thread title.
vlad_slick is offline
Reply


Thread Tools
Display Modes

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 15:02.


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