jacob404 / promod-future

GNU General Public License v3.0
7 stars 1 forks source link

Allow casters to use fullbright maps? #133

Closed MattNF closed 8 years ago

MattNF commented 9 years ago

Watching the Dead Air matches from RBT was really painful... some areas are completely pitch black and you see nothing but the glows.

jbzdarkid commented 9 years ago

I think removing fog should be sufficient, but that's also not a bad idea. Again, I'm not totally sure how to enable this.

MattNF commented 9 years ago

mat_fullbright 1

jbzdarkid commented 9 years ago

No shit, I mean how do you get a client to run a cheat CVAR.

MattNF commented 9 years ago

:^)

jacob probably knows.

jacob404 commented 9 years ago

is this a clientside or serverside cvar?

jbzdarkid commented 9 years ago

I believe it can be set by either. It's not replicated, so likely it can be used clientside.

HighCookie commented 9 years ago

I think what you are looking for is in my tank melee plugin, you can turn cheats on for one command, do a force client command then turn it off

jbzdarkid commented 9 years ago
new flagsgive = GetCommandFlags("give");
SetCommandFlags("give", flagsgive & ~FCVAR_CHEAT);
FakeClientCommand(client, "give %s", weaponname);
SetCommandFlags("give", flagsgive|FCVAR_CHEAT);

That's what I was picturing, too. Good to know it works.

jbzdarkid commented 9 years ago

Mat_fullbright 1 is clientside, fyi. The other command to add would be fog_enable 0.

I'm game to do this one, my plate is relatively clear.

jbzdarkid commented 9 years ago

@HighCookie It's not changing the cvar or the cvar flags ._. halp https://gist.github.com/jbzdarkid/412af9dc788fe72903a3

HighCookie commented 9 years ago

If the cvar is client side you have to use clientcommand instead of fakeclientcommand. Currently at the gym, I'll have a look at link when I'm home

jbzdarkid commented 9 years ago

FCVAR_SERVER_CAN_EXECUTE prevented server running command: mat_fullbright FCVAR_SERVER_CAN_EXECUTE prevented server running command: fog_enable caster_addons.sp(52) : error 017: undefined symbol "FCVAR_SERVER_CAN_EXECUTE"

jbzdarkid commented 9 years ago

Also, fog_enable is a client-only cvar, so I can't find it with FindConVar() to change its flags.

HighCookie commented 9 years ago

I'm not really sure what you should do then, Ive only used client command to do non-cheat things like play sounds to the client.

clientcommand("play bleep.wav");

jbzdarkid commented 9 years ago

There's a way on the internet to allow clients to run cheat commands, see here. That might be usable, in some form. The relevant command is SendConVarValue.

jbzdarkid commented 9 years ago

We can always just enable cheats and let the casters set fog_enable and mat_fullbright themselves. Edit: Got that bit working, not sure how safe it is.

HighCookie commented 9 years ago

https://forums.alliedmods.net/showthread.php?t=81101?t=81101

from what I've been readying you can strip the cheat flag off the cvar and then change it, or thats what's being suggested.

not sure if the source to that plugin will be any use,

HighCookie commented 9 years ago

nevermind thats just commands as well and not cvars, although I have seen a post saying that you can strip the cheat command off a cvar. It just didn't give any indication how

jbzdarkid commented 9 years ago

You can strip FCVAR_CHEAT off a cvar, but only server-side ones. The issue being that mat_fullbright and fog_enable are not server-side.

Attano commented 9 years ago

There is no way of executing commands or changing cvars on the client on modern branches of the Source engine, except for a few whitelisted commands. Aside from that, FakeClientCommand() can be used for serverside commands such as those added by various Sourcemod plugins.

If it were as simple as you think, this would had become a major security risk. Allowing the server to fully control each and every random cvar on the client is a terrible idea, and they got rid of the remaining games affected by it cca ~2010.

The solution to this problem lies beyond Sourcemod. I will provide it a little later.

jbzdarkid commented 9 years ago

mat_fullbright 1; fog_override 1; fog_enable 0

jbzdarkid commented 9 years ago

Also, I got banned when I used these, how do I make SMAC ignore these cheat vars?

jbzdarkid commented 9 years ago

SMAC is banning me because I don't match the server-defined value for sv_cheats. I can use smac_removecvar to get rid of the tracking on sv_cheats, which is ehhh but will work. Looks like fog_enable is also listed.

jbzdarkid commented 9 years ago

SMAC could also be used in place of the thirdpersonshoulder block we have, there's an smac_addcvar.

jbzdarkid commented 9 years ago

I have a "functional" version which simply allows casters to use cheats. N.B. SMAC still verifies some cheat cvars, I'd encourage people to only use mat_fullbright, fog_disable, fog_override, and mat_postprocess.

Since this isn't turning cheats on on the server, I don't foresee any exploits, but please tell me if possible.

Attano commented 9 years ago

Cast, change cheat cvar, uncast, profit

jbzdarkid commented 9 years ago

Cheats are turned off whenever you join team

On Oct 8, 2015, at 3:53 PM, Attano notifications@github.com wrote:

Cast, change cheat cvar, uncast, profit

— Reply to this email directly or view it on GitHub.

jbzdarkid commented 9 years ago

This tries to target bots, which throws an error. IsFakeClient() pls.

jbzdarkid commented 9 years ago

I never committed the source for this, nobody caught it, I deleted my local copy. Will rebuild asap, if you could inform server owners @jacob404

Attano commented 9 years ago

You do realize that removing sv_cheats from the list of tracked cvars is a major security risk, right? There are plenty of sv_cheats bypassers, and this approach renders SMAC impotent against them.

While this thing works, I highly discourage you from including it in Promod. The price is just too big, and xbye's tears definitely aren't worth it. If @jacob404 decides to anyway, make sure to let every server admin on the forum know what they're signing up for.

jbzdarkid commented 9 years ago

@jacob404 @Attano Do either of you know where the source for smac_cvars actually is? I can find some old copies, but I don't see any that look official.

jbzdarkid commented 8 years ago

Note to self to update smac_cvars and implement BAN_IF_NOT_CASTER.

jbzdarkid commented 8 years ago

3fe53cd