garrysmod-requests icon indicating copy to clipboard operation
garrysmod-requests copied to clipboard

GM:PreConCommand() and GM:PostConCommand()

Open VaasKahnGrim opened this issue 5 years ago • 16 comments

two hooks for getting the moment before and after a ConCommand has been run in the players console. both hooks being able to see which player, the command and the args put into it.

VaasKahnGrim avatar Jan 29 '20 10:01 VaasKahnGrim

What would you use this for?

ThatLing avatar Jan 30 '20 12:01 ThatLing

for getting when a secific user has used a concommand and doing something just before and doing something after a user has used it.

Would be useful for blocking access to certain concommands that are written in the engine and not lua.

VaasKahnGrim avatar Jan 30 '20 19:01 VaasKahnGrim

Pretty sure this has been requested since 2007 but was decided to not be a good idea.

thegrb93 avatar Jan 30 '20 19:01 thegrb93

It's all well and funny until someone blocks rcon, rcon_password, kickid, kickip, kickall, banid, banip, sv_password, map and changelevel, no thank you. Not to mention the ability to spy on the args being entered so they can be sent to someone external.

neico avatar Jan 31 '20 01:01 neico

maybe people should quit trying to enter in commands and variables they know they shouldn't be playing with

VaasKahnGrim avatar Jan 31 '20 02:01 VaasKahnGrim

@VaasKahnGrim you misunderstood what he was saying.

thegrb93 avatar Jan 31 '20 02:01 thegrb93

it sounds like he's worried that somebody will see what commands and cvars he tries to set on clientside. but that would only be an issue of concern if somebody was messing with cvars and args that they weren't supposed to

VaasKahnGrim avatar Jan 31 '20 02:01 VaasKahnGrim

Why am I not allowed to change the settings of my own game? Like neico said, being able to block concommands is a huge security risk. The only legit use for this that I can think of, is to detect cheats but this is such a stupid way to detect them.

ThatLing avatar Jan 31 '20 08:01 ThatLing

ok, then if people are worried about their commands being blocked, make it where it can only see what the command was and who ran it but not prevent it from running or anything

VaasKahnGrim avatar Jan 31 '20 16:01 VaasKahnGrim

What's the use case for this besides detecting cheats? (which, as i said, is a stupid way of detecting cheats)

ThatLing avatar Jan 31 '20 17:01 ThatLing

Detecting people attempting to use RCON the moment they join, putting in a means of providing more infromation about default sorce engine commands(because valve decieded to keep descriptions too simple), user statists for things like user rate settings(because some people do change these on their end) and I'm sure quite a lot of other things aswell

VaasKahnGrim avatar Jan 31 '20 18:01 VaasKahnGrim

Detecting people attempting to use RCON the moment they join

Why does this matter? Just disable rcon if you're so scared about it.

putting in a means of providing more infromation about default sorce engine commands

Again, why does this matter? If you want more info about certain commands, google them. Your players don't give a shit if you add more info to certain default concommands.

user statists for things like user rate settings

I have no clue what a user statists is but consider using cvars.AddChangeCallback to check players changing convars.

ThatLing avatar Jan 31 '20 18:01 ThatLing

Disabling RCON is a given, its still useful to know of people attempting to use it. those are the people you'd want to keep an eye on.

putting in the additional information on default commands ise useful to both players and staff btw(better to NOT make your team each have to go through google to learn individual commands)

as for statistics cvars callbacks are fine and dandy, but that doesn't really help when its not a cvar thats been used in console

VaasKahnGrim avatar Jan 31 '20 18:01 VaasKahnGrim

Similar requests https://github.com/Facepunch/garrysmod-requests/issues/1135 https://github.com/Facepunch/garrysmod-requests/issues/1038

robotboy655 avatar Feb 18 '20 20:02 robotboy655

This looks like a security issue if the hook won't have any whitelisted concommands

GitSparTV avatar Mar 01 '20 16:03 GitSparTV

if it's a security risk for stuff like rcon_password or whatever, can this be added for lua concommands at least?

or something similar to cvars.AddChangeCallback for lua concommands since the only way for multiple addons to "hook" to the same command isn't very elegant right now

afaik this can be done entirely within lua

mgetJane avatar Mar 30 '24 13:03 mgetJane