CoD4x_Server icon indicating copy to clipboard operation
CoD4x_Server copied to clipboard

'execClientCommand' script command

Open T-Maxxx opened this issue 7 years ago • 5 comments

Known fact, you can send string from server to client to be executed as console command using setClientDvar, openMenuNoMouse (openMenu), dvar and custom menu. But you have to add this custom menu to mod before use. So I think it'll be good to have such functionality without involving menu stuff.

Pros:

  • Can be used on servers without mods;
  • No hud flickering when using (for example, LMB -> "+melee").

Cons:

  • Must hook message dispatcher on client to parse custom command (like it made with "disconnect", "statusResponse" etc.);
  • Input string must be parsed on client to remove any harmful commands.

I can handle server part but not client. So if anybody is interesed, I can make other branch in server for you to be able to test.

T-Maxxx avatar Jun 10 '17 08:06 T-Maxxx

Up!

AlexanderCurl avatar Jun 10 '17 12:06 AlexanderCurl

@callofduty4x/dev I have added branch "iss173". Any help with CL_ConnectionlessPacket on client appreciated. About harmful commands, there are two ways: black/whitelist. I prefer blacklist because now modders can execute really anything.

T-Maxxx avatar Jun 11 '17 15:06 T-Maxxx

as of now i can only think of "connect" and "bind" that needs to be blocked. what else could be harmful? i'm sure there is more .. opening it even through a blacklist seems dangerous to me currently.

D4edalus avatar Aug 04 '17 08:08 D4edalus

vstr as it allows to execute any command as string:

self setClientDvar("execute", "connect my.shitty.server");
self execClientCommand("vstr execute");

T-Maxxx avatar Aug 05 '17 06:08 T-Maxxx

yeah i'm aware that's possible. we certainly won't put that out in the wild.

D4edalus avatar Aug 05 '17 19:08 D4edalus