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

[ALL] Fixed basetriggers.smx


Post New Thread Reply   
 
Thread Tools Display Modes
Author
404UserNotFound
BANNED
Join Date: Dec 2011
Plugin ID:
3905
Plugin Version:
SOURCEMOD_VERSION
Plugin Category:
Admin Commands
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Fixed basetriggers.smx, recoded so that sm_ff is now an admin command to prevent players from spamming it.
    Unapprover:
    Reason for Unapproving:
    https://forums.alliedmods.net/showpost.php?p=2034845&postcount=2
    Old 09-14-2013 , 21:03   [ALL] Fixed basetriggers.smx
    Reply With Quote #1

    Introduction
    Some of you who run servers may have had this experience in the past; players spamming the sm_ff command hundreds of times to spam the chat and players' consoles with friendly fire enabled/disabled messages.

    This was a result of the Friendly Fire command being public-access. With the simple changing of "RegConsoleCmd" to "RegAdminCmd", and the addition of the "ADMFLAG_CHEATS" flag, this command can no longer be spammed by players.

    The basetriggers.sp file itself was obtained through the latest SourceMod snapshot, 1.5.2-hg3927.

    This is basically my public-offering of a fix until the SourceMod dev team actually fixes this issue and pushes the change in a future snapshot.
    Attached Files
    File Type: sp Get Plugin or Get Source (basetriggers.sp - 1064 views - 13.0 KB)

    Last edited by asherkin; 04-05-2014 at 03:43.
    404UserNotFound is offline
    asherkin
    SourceMod Developer
    Join Date: Aug 2009
    Location: OnGameFrame()
    Old 09-14-2013 , 21:28   Re: [ALL] Fixed basetriggers.smx
    Reply With Quote #2

    • You can already achieve this through the overrides system without changing any code.
    • Modified base plugins need to have different file names to be posted.
    • SOURCEMOD_VERSION isn't a version number.
    • "No convar in this." isn't a valid cvar name.

    EDIT: Additionally, antiflood already deals with spamming of these commands (in 1.5.0+), and you can turn off the public announcement with "sm_trigger_show".
    __________________

    Last edited by asherkin; 09-14-2013 at 21:30.
    asherkin is offline
    404UserNotFound
    BANNED
    Join Date: Dec 2011
    Old 09-14-2013 , 21:35   Re: [ALL] Fixed basetriggers.smx
    Reply With Quote #3

    Quote:
    Originally Posted by asherkin View Post
    • You can already achieve this through the overrides system without changing any code.
    • Modified base plugins need to have different file names to be posted.
    • SOURCEMOD_VERSION isn't a version number.
    • "No convar in this." isn't a valid cvar name.

    EDIT: Additionally, antiflood already deals with spamming of these commands (in 1.5.0+), and you can turn off the public announcement with "sm_trigger_show".
    Right-o, but that doesn't really answer the question at hand.

    Why is a command such as Friendly Fire....a public access command? That's just silly. Yes, you can override it, that's a given. But why? Why override it when it should've been an admin command from the get-go?

    Same with hiding the messages. If players are actually able to toggle friendly fire by default (which I'm still not sure if they are, or if the plugin just displays the message and doesn't actually toggle friendly fire), that's a bad thing.

    ConVars. There's none in basetriggers. That's why I put that. SOURCEMOD_VERSION is the "version" listed in the plugin.

    Modified base plugins need different names? Why? There's no point in giving this a different name when the average server owner (such as myself) is just going to remove the existing basetriggers.smx, and replace it with this one.

    Any other questions/statements? I'll be more than glad to answer.

    EDIT: Unapproved. Nice. Welp, I'm still using this on my server

    Last edited by 404UserNotFound; 09-14-2013 at 21:36.
    404UserNotFound is offline
    asherkin
    SourceMod Developer
    Join Date: Aug 2009
    Location: OnGameFrame()
    Old 09-14-2013 , 21:38   Re: [ALL] Fixed basetriggers.smx
    Reply With Quote #4

    Quote:
    Originally Posted by abrandnewday View Post
    Why is a command such as Friendly Fire....a public access command? That's just silly. Yes, you can override it, that's a given. But why? Why override it when it should've been an admin command from the get-go?
    Everything in basetriggers is public informational commands. The entire plugin is to provide feature-parity with the other administration plugins that were popular when SourceMod was released.

    Quote:
    Originally Posted by abrandnewday View Post
    ConVars. There's none in basetriggers. That's why I put that. SOURCEMOD_VERSION is the "version" listed in the plugin.
    So you should have left them blank. SOURCEMOD_VERSION evaluates out to the version number in version.inc, and doesn't mean anything in the context of the forum.

    Quote:
    Originally Posted by abrandnewday View Post
    Modified base plugins need different names? Why? There's no point in giving this a different name when the average server owner (such as myself) is just going to remove the existing basetriggers.smx, and replace it with this one.
    So people don't accidentally overwrite their files.
    __________________
    asherkin is offline
    404UserNotFound
    BANNED
    Join Date: Dec 2011
    Old 09-14-2013 , 21:58   Re: [ALL] Fixed basetriggers.smx
    Reply With Quote #5

    Quote:
    Originally Posted by asherkin View Post
    Everything in basetriggers is public informational commands. The entire plugin is to provide feature-parity with the other administration plugins that were popular when SourceMod was released.
    Good to know!



    Quote:
    Originally Posted by asherkin View Post
    So you should have left them blank. SOURCEMOD_VERSION evaluates out to the version number in version.inc, and doesn't mean anything in the context of the forum.
    Oh, I thought it was required to toss in a convar and version =\


    Quote:
    Originally Posted by asherkin View Post
    So people don't accidentally overwrite their files.
    But this plugin is a good kind of overwriting. It replaces one plugin, and the changes are very miniscule (RegConsoleCmd > RegAdminCmd, plus the addition of ADMFLAG_CHEATS)

    This wouldn't hurt anything.
    404UserNotFound is offline
    11530
    Veteran Member
    Join Date: Sep 2011
    Location: Underworld
    Old 09-14-2013 , 23:30   Re: [ALL] Fixed basetriggers.smx
    Reply With Quote #6

    Quote:
    Originally Posted by abrandnewday View Post
    But this plugin is a good kind of overwriting. It replaces one plugin, and the changes are very miniscule (RegConsoleCmd > RegAdminCmd, plus the addition of ADMFLAG_CHEATS)
    You can use overrides on commands registered with RegConsoleCmd too.
    __________________
    11530 is offline
    404UserNotFound
    BANNED
    Join Date: Dec 2011
    Old 09-14-2013 , 23:38   Re: [ALL] Fixed basetriggers.smx
    Reply With Quote #7

    Quote:
    Originally Posted by 11530 View Post
    You can use overrides on commands registered with RegConsoleCmd too.
    I.....I know.....
    404UserNotFound is offline
    11530
    Veteran Member
    Join Date: Sep 2011
    Location: Underworld
    Old 09-14-2013 , 23:54   Re: [ALL] Fixed basetriggers.smx
    Reply With Quote #8

    Quote:
    Originally Posted by abrandnewday View Post
    I.....I know.....
    I'm hinting that this plugin is redundant because of that reason. At least the thought was there.
    __________________
    11530 is offline
    404UserNotFound
    BANNED
    Join Date: Dec 2011
    Old 09-15-2013 , 00:02   Re: [ALL] Fixed basetriggers.smx
    Reply With Quote #9

    Quote:
    Originally Posted by 11530 View Post
    I'm hinting that this plugin is redundant because of that reason. At least the thought was there.
    Oh, lol
    404UserNotFound is offline
    ddhoward
    Veteran Member
    Join Date: May 2012
    Location: California
    Old 09-15-2013 , 01:26   Re: [ALL] Fixed basetriggers.smx
    Reply With Quote #10

    How do you use overrides to override 'ff'? I am nowhere near a position to test it now, but it seems that you wouldn't be able to? The "command" is created by adding command listeners to "say" and the like, and then checking if the ArgString == "ff". Do overrides work for "commands" created in this way?

    To clarify, "ff" is NOT created with RegAdminCmd nor is it created with RegConsoleCmd. The plugin listens for "say" and related commands, and then checks what was "said."

    Also, please do not confuse "say ff" with sm_ff. One is provided by basetriggers, the other is... I don't know, but it's a separate thing entirely.

    Asherkin, the antiflood does NOT seem to stop users from spamming this command! The default Sourcemod behavior seems to be to allow users to spam "say ff," with NO indication of who is spamming it, and NO way to override the command.

    Last edited by ddhoward; 09-15-2013 at 01:45.
    ddhoward 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 09:33.


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