Raised This Month: $433 Target: $400
 108% 

AddCommandOverride is broken


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xm3kilo
Member
Join Date: Jan 2018
Old 03-21-2020 , 05:20   AddCommandOverride is broken
Reply With Quote #1

So with the in-game chat, it's case sensitive, e.g !slay works but !SLAY doesn't.

That's fine.

grp.AddCommandOverride("sm_slay", Override_CommandGroup, Command_Deny);

In chat, !slay doesn't work = PERFECT.

In CONSOLE you can sm_sLaY and it works. = BAD.

Wtf? Am I stupid/doing this wrong? Console isn't case sensitive for commands, I tried to hook OnClientCommand to force lower case but it looks like this is too late.

Any one have any fking idea?
xm3kilo is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 03-21-2020 , 08:38   Re: AddCommandOverride is broken
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?t=298139
Kellan123 is offline
xm3kilo
Member
Join Date: Jan 2018
Old 03-21-2020 , 09:20   Re: AddCommandOverride is broken
Reply With Quote #3

Doesn't really answer or address my question. For the most part, AddCommandOverride works fine, it's just that it looks like commands are handled differently in console vs chat thus bypassing AddCommandOverride.

I wonder if SourceBans is affected as this is the method it uses to handle overrides?


Last edited by xm3kilo; 03-21-2020 at 09:41.
xm3kilo is offline
Marttt
Senior Member
Join Date: Jan 2019
Old 03-21-2020 , 23:42   Re: AddCommandOverride is broken
Reply With Quote #4

I didn't understand very well your problem (wasn't clear)

If what you need is case insensitive commands through the chat

Try this plugin from Dragokas
[ANY] !COMMAND eater

Is very good and it does that. (and more things)

I have a private version based on what Dragokas made (more simple/less features), if it doesn't work, PM me, in case what you want is insensitive commands through the chat.

Otherwise, please explain again in another way.

If you need that insensitive format by console maybe Dragokas have an answer for you or even modify his plugin to support this (if possible)

Edit: I did some tests and in L4D2 for example console commands only works in lowercase, I don't have this behavior of typing "Sm_Slay" and working.

Which game you are testing?
__________________

Last edited by Marttt; 03-22-2020 at 00:00.
Marttt is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine
Old 03-22-2020 , 03:25   Re: AddCommandOverride is broken
Reply With Quote #5

PHP Code:
public void OnPluginStart()
{
    
RegAdminCmd("sm_test"CmdTADMFLAG_VOTE);
    
AddCommandOverride ("sm_test"Override_CommandADMFLAG_ROOT);
}

Action CmdT(int clientint args)
{
    
PrintToChat(client"WORKING!");
    return 
Plugin_Handled;

me - "k" flag

Code:
] sm_test
[SM] No access
] sm_TEST
[SM] No access
Security test passed OK.
So, override targets registered command. And looks like console just redirect your query to that command.

Same with: RegAdminCmd("sm_TEST" ...

PS. I also made such test:
Spoiler


Quote:
Originally Posted by Marttt View Post
Edit: I did some tests and in L4D2 for example console commands only works in lowercase, I don't have this behavior of typing "Sm_Slay" and working.
Are you sure? Tested on L4D2, Sm_Admin work for me. Also:

Code:
] Sm_Slay 
[SM] Usage: sm_slay <#userid|name>
=======
Offtopic (for Marttt)
Spoiler


EDIT. PS. Tested on sm v.1.10.6474
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D1 fun (Bloody Witch)
[My plugins] [My tools] [GitHub] [Articles]

Last edited by Dragokas; 03-22-2020 at 06:53.
Dragokas is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 03-22-2020 , 06:26   Re: AddCommandOverride is broken
Reply With Quote #6

I think this is probably a bug with admin group command overrides (the ACL system that runs on top) rather than command flag overrides (which are part of the command handler).

The engine has flip-flopped on whether commands are case-sensitive or not a few times, and some of SM's internal data structures were changed a while back to be case-sensitive-by-default (instead of only case-insensitive) and the combination of those 2 things has shown up a few similar bugs recently.
__________________
asherkin is offline
Marttt
Senior Member
Join Date: Jan 2019
Old 03-22-2020 , 08:48   Re: AddCommandOverride is broken
Reply With Quote #7

Quote:
Originally Posted by Dragokas View Post
[php]
Are you sure? Tested on L4D2, Sm_Admin work for me. Also:
=======
Offtopic (for Marttt)
Yes, I did the same test again in L4D2, sm_slay works in the console but eg. "Sm_slay" don't.
Maybe its because I'm running a local server (SM1.10)

EDIT: Made test in a dedicated server and console is case insensitive, only local server doesn't accept it.

And about the offtopic, I understand, thanks ^^ was just wondering.
__________________

Last edited by Marttt; 03-22-2020 at 08:52.
Marttt is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine
Old 03-22-2020 , 09:05   Re: AddCommandOverride is broken
Reply With Quote #8

Perhaps, it can depend on whether your build < 1.10.6462
I think asherkin mean this one.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D1 fun (Bloody Witch)
[My plugins] [My tools] [GitHub] [Articles]
Dragokas is offline
xm3kilo
Member
Join Date: Jan 2018
Old 03-25-2020 , 03:41   Re: AddCommandOverride is broken
Reply With Quote #9

I tried the latest version of Sourcemod, and one from late last year, both render the same effects. Sourcemod console commands are not case sensitive thus bypassing command overrides.
xm3kilo 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 12:35.


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