Raised This Month: $121 Target: $400
 30% 

[Any?] Double Quote Fix


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Plugin ID:
4805
Plugin Version:
18.0220.0
Plugin Category:
Technical/Development
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Provides a temporary fix to the issue with double quotes in the TF2 and CS:GO chat box.
    Old 09-06-2015 , 04:50   [Any?] Double Quote Fix
    Reply With Quote #1

    [Any?] Double Quote Fix
    v. 18.0220.0

    This plugin aims to provide a fix bandaid to the issue that exists in CS:GO, TF2, and probably other games, wherein any chat message which is sent through the chat box (and not through the console) has all double quote characters ( " ) changed to single quote characters ( ' ) by the client. This causes issues when typing commands with arguments enclosed in quotation marks.

    The plugin works as follows:
    1. The plugin first listens for all incoming commands that aren't say or say_team, but were triggered through say or say_team. If such a command is detected, we move on to step 2, then 3.
    2. If sm_doublequotefix_doubles is set appropriately, the plugin will search for any pair of consecutive single quote characters ( '' ) and change them into a single doublequote character ( " ).
    3. If sm_doublequotefix_smartchange is set appropriately, the plugin will attempt to intelligently change any pair of remaining single quotes into double quotes. This will only happen if:
      • Two single quotes are found.
      • The first single quote is either preceded by a space, or is the first character in the argstring.
      • The second single quote is followed by either a space or the null terminator.
      • No double quote is found between the two single quotes.

    Normally, the plugin should allow you to use doublequote marks as normal. However, if your argument, enclosed in quotes, contains an apostrophe, you may need to enclose the argument in FOUR quote characters (of either type) with two on each side.

    The results speak for themselves. Expand the spoiler box below for a demonstration. Notice how the plugin doesn't always get it right.

    Spoiler





    ConVars
    • sm_doublequotefix_update 2 - Controls Updater compatibility
      • 0 : Completely disables Updater integration
      • 1 : Updater will notify you in Updater.log if an update becomes available.
      • 2 : Updater will automatically download any updates. They will be installed on the next server start or map change.
      • 3 : Updater will automatically download and immediately install any updates.

    • sm_doublequotefix_doubles 2 : (0/1/2/3) Should the plugin attempt to change all pairs of consecutive single quotes into double quotes?
      • 0 : Never do this. Completely disable this feature.
      • 1 : No by default, but allow individual players to enable it for themselves with the /settings menu.
      • 2 : Yes by default, but allow individual players to disable it for themselves with the /settings menu.
      • 3 : Always do this.


    • sm_doublequotefix_smartchange 2 : (0/1/2/3) Should the plugin attempt to intelligently change any remaining pairs of single quotes into double quotes?
      • 0 : Never do this. Completely disable this feature.
      • 1 : No by default, but allow individual players to enable it for themselves with the /settings menu.
      • 2 : Yes by default, but allow individual players to disable it for themselves with the /settings menu.
      • 3 : Always do this.

    Changelog
    Spoiler



    Installation:
    To install, simply ensure that your Sourcemod installation is up to date, and place the SMX in your plugins folder.

    Please also consider installing Updater. This will let you automatically keep your plugins up-to-date.
    Compiling:
    The plugin requires custom includes. As such, it does not compile here on the forums. Includes required to compile the plugin are:

    Downloads:
    If you like what you see here, please consider donating~
    __________________

    Last edited by ddhoward; 02-21-2018 at 02:28.
    ddhoward is offline
    Randommagic
    Senior Member
    Join Date: Jun 2014
    Location: S.Korea
    Old 09-11-2015 , 13:16   Re: [TF2/CS:GO] Double Quote Fix
    Reply With Quote #2

    works like a charm. thanks.
    __________________
    Randommagic is offline
    ddhoward
    Veteran Member
    Join Date: May 2012
    Location: California
    Old 09-17-2015 , 03:23   Re: [TF2/CS:GO] Double Quote Fix
    Reply With Quote #3

    Uploading new version 15.0916. Changes are:
    • Added client preferences support through clientprefs' /settings menu. Code borrowed from the Aim Names plugin, as I've never messed with menus before.

    • Changed how the cvars work, see the first post for more info. Relates to the previously listed change.

    • The "smart change" feature of the plugin will no longer replace single quote pairs if a double quote character is found between them.


    Please let me know if you run into any issues. Please also consider installing Updater if you haven't already!
    __________________

    Last edited by ddhoward; 09-17-2015 at 03:27.
    ddhoward is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 10-03-2016 , 01:21   Re: [Any?] Double Quote Fix
    Reply With Quote #4

    Just noticed this plugin, and was wondering: is there a reason for using a command listener rather than OnClientSayCommand()?
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, etc.
    Post in plugin threads with questions.
    Steam is for playing games.
    You will be fed to javalia otherwise.
    Psyduck likes replays.

    Last edited by FlaminSarge; 10-03-2016 at 01:22.
    FlaminSarge is offline
    ddhoward
    Veteran Member
    Join Date: May 2012
    Location: California
    Old 10-03-2016 , 01:28   Re: [Any?] Double Quote Fix
    Reply With Quote #5

    PHP Code:
    if (!StrEqual(command"say") && !StrEqual(command"say_team") && IsChatTrigger()) { 
    My plugin's code only runs when the command being sent is NEITHER of the chat commands, but was triggered through a chat command. OnClientSayCommand only fires when I don't need it to.

    Further, OnClientSayCommand does not fire when the client uses a registered command with the silent trigger ('/' by default.)

    I originally tried modifying the message earlier, so the modifications even show up in the chat, but it ended up being too buggy and complicated. And I still had the OnClientSayCommand problem mentioned above.
    __________________

    Last edited by ddhoward; 10-03-2016 at 03:59.
    ddhoward is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 10-03-2016 , 19:54   Re: [Any?] Double Quote Fix
    Reply With Quote #6

    Hurp, I can't read.

    Nice work.

    Out of curiousity, if a client uses "say !<command>", does the command listener fire twice? Once for say, once for the command?
    __________________
    Bread EOTL GunMettle Invasion Jungle Inferno will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, etc.
    Post in plugin threads with questions.
    Steam is for playing games.
    You will be fed to javalia otherwise.
    Psyduck likes replays.

    Last edited by FlaminSarge; 10-03-2016 at 19:57.
    FlaminSarge is offline
    ddhoward
    Veteran Member
    Join Date: May 2012
    Location: California
    Old 10-03-2016 , 20:09   Re: [Any?] Double Quote Fix
    Reply With Quote #7

    I don't think that this will cause any problems with regards to that, no. However, you've made me realize that I could probably run a StrContains near the top of the function to check for any true doublequotes. If any are found, then immediately return Plugin_Continue. [I]This paragraph was written in response to a part of the previous post that has been edited out.

    In regards to the listener firing twice, that shouldn't be an issue.
    __________________

    Last edited by ddhoward; 10-03-2016 at 21:08.
    ddhoward is offline
    BReeZ
    AlliedModders Donor
    Join Date: Feb 2013
    Location: Denmark
    Old 10-03-2016 , 20:34   Re: [Any?] Double Quote Fix
    Reply With Quote #8

    could i get a quick tl;dr for what benefits this has? Other than looking nice in the chat
    BReeZ is offline
    ddhoward
    Veteran Member
    Join Date: May 2012
    Location: California
    Old 10-03-2016 , 20:43   Re: [Any?] Double Quote Fix
    Reply With Quote #9

    Quote:
    Originally Posted by banjomus99 View Post
    could i get a quick tl;dr for what benefits this has? Other than looking nice in the chat
    It does not look nice in the chat. This plugin does not affect the modification of doublequotes as they appear in the chat messages. The benefits are summarized in the first paragraph of the first post, and relate to doublequotes being delimiters for command arguments. Please review the spoilered demonstration with the sm_rename command, also found in the first post.
    __________________

    Last edited by ddhoward; 10-03-2016 at 20:44.
    ddhoward is offline
    BReeZ
    AlliedModders Donor
    Join Date: Feb 2013
    Location: Denmark
    Old 10-04-2016 , 09:03   Re: [Any?] Double Quote Fix
    Reply With Quote #10

    Quote:
    Originally Posted by ddhoward View Post
    It does not look nice in the chat. This plugin does not affect the modification of doublequotes as they appear in the chat messages. The benefits are summarized in the first paragraph of the first post, and relate to doublequotes being delimiters for command arguments. Please review the spoilered demonstration with the sm_rename command, also found in the first post.
    Ah i see . Cheers for the answer.
    BReeZ 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 16:19.


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