AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   force_unmodified bug? (https://forums.alliedmods.net/showthread.php?t=240034)

OvidiuS 05-07-2014 21:31

force_unmodified bug?
 
Using force_unmodified i can check for only one file if i return PLUGIN_HANDLED in inconsistent_file?
Can someone test this? Should it work like that?

If i use force_unmodified on two files, and on both of them i should get inconsistency, but only one file is checked for consistency.

Example:

Code:
#include < amxmodx > public plugin_precache( ) {     force_unmodified( force_exactfile, { 0, 0, 0 }, { 0, 0, 0 }, "sprites/gas_puff_01.spr" );     force_unmodified( force_exactfile, { 0, 0, 0 }, { 0, 0, 0 }, "sprites/gas_puff_02.spr" ); } public inconsistent_file( id, const sFile[ ], sReason[ 64 ] ) {     log_to_file( "test.txt",  "File name: %s", sFile );     return PLUGIN_HANDLED; }

Code:

L 05/08/2014 - 03:20:41: File name: sprites/gas_puff_02.spr
Shouldn't i also see sprites/gas_puff_01.spr in log?
Any idea how to solve this?

ps. Sorry for bad explanation. I attached code and log.

OvidiuS 05-08-2014 12:53

Re: force_unmodified bug?
 
Sorry for bumping, but i got some results.
It seems that this is caused by engine. I have just recompiled amxmodx with debug messages, inconsistent file is called for first file that is inconsistent. The rest of the files are not checked and inconsistent_file is not called for them.

Is there any idea how to bypass this using orpheu/chooker or any other module?

aron9forever 05-09-2014 12:30

Re: force_unmodified bug?
 
Quote:

Originally Posted by OvidiuS (Post 2135309)
Sorry for bumping, but i got some results.
It seems that this is caused by engine. I have just recompiled amxmodx with debug messages, inconsistent file is called for first file that is inconsistent. The rest of the files are not checked and inconsistent_file is not called for them.

Is there any idea how to bypass this using orpheu/chooker or any other module?

I doubt you can work around this
The reason only the first file is checked is because if server has forced consistency on, if the first file is detected as being modified it instantly disconnects the user, so it is not a bug.

Backstabnoob 05-09-2014 14:38

Re: force_unmodified bug?
 
IIRC returning PLUGIN_HANDLED should block the disconnection.

OvidiuS 05-09-2014 18:53

Re: force_unmodified bug?
 
Quote:

Originally Posted by aron9forever (Post 2135624)
I doubt you can work around this
The reason only the first file is checked is because if server has forced consistency on, if the first file is detected as being modified it instantly disconnects the user, so it is not a bug.

Backstabnoob explained. If i return PLUGIN_HANDLED player is not disconnected. Only problem is that after returning PLUGIN_HANDLED ,inconsistent_file is not called for other files.

Quote:

Originally Posted by Backstabnoob (Post 2135674)
IIRC returning PLUGIN_HANDLED should block the disconnection.


fysiks 05-10-2014 04:28

Re: force_unmodified bug?
 
Quote:

Originally Posted by aron9forever (Post 2135624)
if the first file is detected as being modified it instantly disconnects the user, so it is not a bug.

This still applies regardless of whether you can override the kick or not. The engine doesn't need to know about other files because it detected an offending file. Consider the list of files tied to this forward as being AND'd together, this means that if one is found, the whole condition is false regardless of the value of the others.

OvidiuS 05-10-2014 15:34

Re: force_unmodified bug?
 
Quote:

Originally Posted by fysiks (Post 2135837)
This still applies regardless of whether you can override the kick or not. The engine doesn't need to know about other files because it detected an offending file. Consider the list of files tied to this forward as being AND'd together, this means that if one is found, the whole condition is false regardless of the value of the others.


I have heard that SV_ParseConsistencyResponse is the function i have to look at. I'm not able to confirm this. And i have "no" idea what am i supposed to do in this function.

meTaLiCroSS 05-10-2014 15:49

Re: force_unmodified bug?
 
Quote:

Originally Posted by OvidiuS (Post 2136088)
I have heard that SV_ParseConsistencyResponse is the function i have to look at. I'm not able to confirm this. And i have "no" idea what am i supposed to do in this function.

Roger, it is SV_ParseConsistencyResponse.

The associated code is the following:

PHP Code:

   if(status 0) { // more than 1 file different

      //This function gives the Mod the option of letting the client on anyway.
      
if(gEntityInterface.pfnInconsistentFile(host_client->padding4A84sv.ConsistencyData[status 1].szFileNameModDisconnectMessage) != 0) {

         
SV_ClientPrintf("%s"ModDisconnectMessage);
         
SV_DropClient(host_client0"Bad file %s"ModDisconnectMessage);
      }
      return;
   } 

It's just called 1 time


All times are GMT -4. The time now is 09:42.

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