AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Blocking client side cvar ... (https://forums.alliedmods.net/showthread.php?t=6854)

jsterling 10-16-2004 23:07

Blocking client side cvar ...
 
Ok, so I run a Scoutzknivez server and for some reason it allows players to type "fullupdate" in the console why they are alive and it will spawn a scout and a knife which is the only two weapons you are allowed to use. If you use the command while spectating someone after your dead it will spawn ammo to them. Now most may not care but the problem is that it crashs the server if used to much. This appears to be a bug in the map and not the hlds engine.

Would it be possible to write a plugin to block this from being used by clients? If so could someone post an example. Thanks.

DS 10-17-2004 00:49

Interesting, I'd never seen this before. That could be a problem. But it's pretty simple to block this actually. It isn't really a client side cvar (which I don't believe are blockable anyways), just a client command that does come in contact with the server, so it is indeed blockable.

This should do the trick:
Code:
#include <amxmodx> public plugin_init() {         register_clcmd("fullupdate", "cmd_fullupdate") } public cmd_fullupdate(id) {     return PLUGIN_HANDLED }

All you really needed to do is register the command like any other client command and return PLUGIN_HANDLED to block. I just tested this out and it seems to block it. Hope this helps.

EKS 10-17-2004 08:08

no.
The command is there for a reason. If i had to guess fullupdate makes the client call the ResetHUD event.

So the plugin running that server is poory made.

DS 10-17-2004 08:45

I'm sorry, I couldn't make much sense of that last sentence you wrote, EKS. However, I think I understand what you're saying. Yes, the command may be there for some reason, but what that reason is I don't know. Yes, it may be calling ResetHUD as the money on the HUD flashes when you try using this in other maps besides scoutzknivez. But the other maps don't reset your gun. It's possible other custom maps besides scoutzknivez do this, but I have no idea.

Anyways, I did what he asked. And I tested it out on a server for awhile. It didn't seem to be causing any problems with any of the other plugins I had running (i.e. StatsX). So blocking that command isn't interfering with anything. And honestly, I don't think blocking a particular client command will interfere some in the game internally as you seem to be suggesting.

But after a bit of searching, I found a bit more about fullupdate. Seemingly being used more than just for scoutzknivez I see. I've read that it is possibly being used in TFC as an anti-conc measure. Someone on the Steam forums reported said it can be used in War3 and Superhero mod. i've also read somewhere it can possible be usesd to block flashes on the flash grenade. I can't confirm all this, but all in all seems to be used in a few exploits of some kind.

So in the end, it may be a good thing to block this. I hope the original poster can use this and find out for sure whether this seems to intefere with anything though.

EKS 10-17-2004 10:19

The command is there for a reason. If i had to guess its used to make sure the client is "synced".
Imagine player A multitasking out of CS, and playing around for 2min. Then comming back into CS. His client is now be slacking behind 2min, and when you block the fullupdate issues will happen.
I also think its called when starting to record a demo. So even more issues.

The fact of the mather is that a plugin that uses ResetHUD is not properbly made, and there are other ways to make the event trigger. You should post a bug report about the plugin instead of trying to fix the expoit(Yes i use ResetHUD in 1 of my plugins to :) But its still bad programing practice )

devicenull 10-17-2004 11:02

There's already a plugin to do this, iirc.. if not, I seem to remember writing one that had that feature. Also be aware there are other things that can trigger ResetHUD

DS 10-17-2004 11:19

This wasn't about a plugin problem, but more of a map problem. As the scoutzknivez map is the only map (to my knowledge) that seems to be giving the player a new set of weapons every time you use the fullupdate command. This is certainly a problem if the player knows about it. But again it may be the mappers fault unfortunately or perhaps an odd glitch that happens in not giving the player the default set of CS weapons (glock/usp and knife and some ammo). But I'm not really sure.

It doesn't really make sense to me that an easily accessible client command would be called to sync players. Isn't that more or less the server's job anyway? I would think something might be called within the code of the engine for the things you described (demos and coming back into CS) rather than executing a client command. I don't know...

And about ResetHUD. I agree there are better things to use in some cases, especially for detecting the start of a round or when freezetime begins or something. But there are times where ResetHUD should be used. StatsX for instance uses it. I also use it for my drop defuser plugin. The reason being is that I spawn defuser kits that were made from info_target entities. And these fake defuser kits don't get removed at the end of the round like real defuser kits on the ground do. And I don't want them removed when the win sound is played as players are still moving about for a few seconds at this time. And removing them at the beginning of freezetime is also not a great idea considering that players might still see these fake defuse kits before they are removed. So to make them more like the real defuse kits that need to be removed at ResetHUD in which the players won't have a chance at seeing any fake defuse kits.

But anyways, enough about ResetHUD. The point is using ResetHUD in a plugin didn't really have anything to do with this whole thing btw. It was the map scoutzknivez that the original poster and I were talking about. I only referred to War3 and Superhero mod as to point out the fact that the command could possibly be used as an exploit. But I also said the command could possibly be used as exploit when it came to concing TFC as well. So it's not necessarily a fault of the plugins.

jsterling 10-17-2004 11:25

Ok, thanks for all the help and suggestions guys. I have installed the plugin that Damaged Soul offered to see if there are any side effects of blocking the command. I will post back with the results as soon as I have some. If so, is there any other ideas. Thanks.

EDIT: I have installed the plugin and tested a bit and there appears to be no issues with it on the scoutzknivez map. Also, devicenull, you are correct you had seen this before. http://forums.alliedmods.net/showthread.php?t=4407

also, I did some reading and "fullupdate" is used only to "force" the server to resync with a client so there is no reason to believe that it is used as a standard entity. Thanks again for your help.

jsterling 11-03-2004 13:54

How hard would it be to add functionality of kicking someone when they use this command and printing a reason why? Thanks.

Geesu 11-03-2004 15:19

war3ft blocks fullupdate, bad things happen when people type it in


All times are GMT -4. The time now is 17:28.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.