Raised This Month: $51 Target: $400
 12% 

force_unmodified bug?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 05-07-2014 , 21:31   force_unmodified bug?
Reply With Quote #1

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.

Last edited by OvidiuS; 05-08-2014 at 07:29.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 05-08-2014 , 12:53   Re: force_unmodified bug?
Reply With Quote #2

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?
OvidiuS is offline
Send a message via Skype™ to OvidiuS
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 05-09-2014 , 12:30   Re: force_unmodified bug?
Reply With Quote #3

Quote:
Originally Posted by OvidiuS View Post
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.

Last edited by aron9forever; 05-09-2014 at 12:30.
aron9forever is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-09-2014 , 14:38   Re: force_unmodified bug?
Reply With Quote #4

IIRC returning PLUGIN_HANDLED should block the disconnection.
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 05-09-2014 , 18:53   Re: force_unmodified bug?
Reply With Quote #5

Quote:
Originally Posted by aron9forever View Post
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 View Post
IIRC returning PLUGIN_HANDLED should block the disconnection.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-10-2014 , 04:28   Re: force_unmodified bug?
Reply With Quote #6

Quote:
Originally Posted by aron9forever View Post
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.
__________________
fysiks is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 05-10-2014 , 15:34   Re: force_unmodified bug?
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
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.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 05-10-2014 , 15:49   Re: force_unmodified bug?
Reply With Quote #8

Quote:
Originally Posted by OvidiuS View Post
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
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS 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 04:19.


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