Ulysses

Ulysses Stuff => General Chat & Help and Support => Topic started by: blackfire88 on October 05, 2011, 07:56:30 PM

Title: ULX cexec
Post by: blackfire88 on October 05, 2011, 07:56:30 PM
I've noticed some commands cannot be run on players, like gmod_cleanup, disconnect, and other things.
I looked in the module file and found nothing blocking those commands, yet other lua files can run them anyway.
Title: Re: ULX cexec
Post by: JamminR on October 05, 2011, 08:12:57 PM
What exactly are you asking?
ULX blocks no commands.
Gmod server code itself monitors for certain commands using RunConsoleCommand and doesn't allow them to run.
See list of blocked at bottom of page here -
 G.RunConsoleCommand (http://wiki.garrysmod.com/favicon.ico) (http://wiki.garrysmod.com/?title=G.RunConsoleCommand)

Cexec uses runconsolecommand on the player, so, doesn't allow those commands.

What specific commands are you saying are allowed by lua, and what files are you mentioning.
Title: Re: ULX cexec
Post by: blackfire88 on October 06, 2011, 03:34:14 AM
gmod_cleanup and disconnect. Both of those work with other lua scripts, but when using !cexec it doesnt have any effect.
Title: Re: ULX cexec
Post by: Megiddo on October 06, 2011, 05:51:38 AM
What other scripts?
Title: Re: ULX cexec
Post by: blackfire88 on October 06, 2011, 04:19:26 PM
Just any lua script. If i try to use !cexec to run "disconnect" on a player, it wont work. If I try to run disconnect on a player with another lua script, they will be disconnected.
This is the same for a few other commands. Such as: kill, disconnect, gmod_cleanup, and a few others.
Title: Re: ULX cexec
Post by: JamminR on October 06, 2011, 04:26:44 PM
Blackfire, mind posting a sample of said 'any lua script'?
We'd really like to see it.
It's possible we may actually learn something.
If not learn something, then be able to explain how it works.
Title: Re: ULX cexec
Post by: blackfire88 on October 06, 2011, 04:40:21 PM
Oops i just realised something. Could you move this post to the SVN forum.
Title: Re: ULX cexec
Post by: blackfire88 on October 06, 2011, 04:43:18 PM
Also here is an example:

for k,v in pairs(player.GetAll()) do
    v:ConCommand("disconnect")
end

That will make everyone disconnect.
But typeing "!cexec * disconnect" will not work.
Title: Re: ULX cexec
Post by: Megiddo on October 10, 2011, 10:29:31 AM
I'm not ignoring this! I just haven't had time to get around to it yet. I checked the code, and we're using the same function so there's really no reason why it would work in one script but not ours... at least if you chat execute the command. Using the command in console goes through an additional "garry-check", but chatted commands go directly to the server unmolested.
Title: Re: ULX cexec
Post by: blackfire88 on December 26, 2011, 05:00:35 PM
So is it fixed?
Title: Re: ULX cexec
Post by: LuaTenshi on December 26, 2011, 07:11:22 PM
Garry's Mod blocks the following commands from being run on players.

Code: [Select]
"con_enable"
"sv_cheats",
"_restart",
"exec",
"condump",
"connect",
"bind",
"BindToggle",
"alias",
"ent_fire",
"ent_setname",
"sensitivity",
"name",
"r_aspect",
"quit",
"exit",
"lua_run",
"lua_run_cl",
"lua_open",
"lua_cookieclear",
"lua_showerrors_cl",
"lua_showerrors_sv",
"lua_openscript",
"lua_openscript_cl",
"lua_redownload",
"sent_reload",
"sent_reload_cl",
"swep_reload",
"swep_reload_cl",
"gamemode_reload",
"gamemode_reload_cl",
"con_logfile",
"clear",
"rcon_password",
"test_RandomChance",
"plugin_load",

So the answer to your question is, that it was never broken.