Bug 3018 - circumventing cheat protected cvars
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: unspecified
Hardware: All All
: P2 normal
Assignee: Tim Angus
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2007-02-02 03:55 EST by M. Kristall
Modified: 2007-05-21 11:23:15 EDT
0 users

See Also:


Attachments
svn1047 cgame/ui CVAR_CHEAT fix (1.08 KB, patch)
2007-03-02 11:18 EST, Tony J. White
svn1047 cgame/ui CVAR_CHEAT fix (2.00 KB, patch)
2007-03-02 11:41 EST, Tony J. White

Description M. Kristall 2007-02-02 03:55:54 EST
1. /set cg_drawBBOX 1 (or some such)
2. Join a game and see BBOXes
3. /set cg_drawBBOX 0:
"cg_drawBBOX is cheat protected"
Comment 1 vcxzet 2007-02-13 05:31:27 EST
(In reply to comment #0)
> 1. /set cg_drawBBOX 1 (or some such)
> 2. Join a game and see BBOXes
> 3. /set cg_drawBBOX 0:
> "cg_drawBBOX is cheat protected"
> 

it is not working on pure servers
it looks like it is working as it is supposed to be and it is something that comes from quake3 -> ioquake3 so I am pretty sure it is not bugged
are you talking about unpure ones
Comment 2 M. Kristall 2007-02-13 11:03:51 EST
(In reply to comment #1)
> it is not working on pure servers
> it looks like it is working as it is supposed to be and it is something that
> comes from quake3 -> ioquake3 so I am pretty sure it is not bugged
> are you talking about unpure ones
> 

I can consistently reproduce this on every system I have tested this on, Windows and Linux, using both backports and the original 1.1.0 binaries. Interestingly, Tremulous on my Windows computer didn't let me change cg_drawBBOX until I "set" it the first time.

The thing is that the cvar code is Q3 code, so this is probably a Quake bug. I can't test that.
Comment 3 M. Kristall 2007-02-13 11:05:40 EST
Oops. I quoted the part about pure servers. I meant to say that with all of those variations, it worked indiscriminately on both pure and unpure servers.
Comment 4 vcxzet 2007-02-17 18:22:22 EST
(In reply to comment #3)
> Oops. I quoted the part about pure servers. I meant to say that with all of
> those variations, it worked indiscriminately on both pure and unpure servers.
> 
I tried it with a freshly built svn client/cgame/game/ui
And it didn't work
Comment 5 M. Kristall 2007-02-17 20:15:50 EST
(In reply to comment #4)
> I tried it with a freshly built svn client/cgame/game/ui
> And it didn't work
>
I don't know why. I just did test isolated from all of my other Tremulous files, using game.qvm, cgame.qvm, ui.qvm, ui, tremulous.x86 and tremded.x86 from revision 898.

[msk@turbofinch test]$ ./tremded.x86 +set fs_homepath /home/msk/Desktop/test +set net_port 30720 +set sv_pure 1 +map atcs
1.1.0_SVN898 linux-x86 Feb 17 2007
...
[msk@turbofinch test]$ ./tremulous.x86 +set fs_homepath /home/msk/Desktop/test
1.1.0_SVN898 linux-x86 Feb 17 2007
...


Upon starting Tremulous, I opened the console and typed
]/set cg_drawbbox 1
]\cg_drawbbox 
"cg_drawbbox" is:"1^7" default:"1^7"
]/connect 127.0.0.1:30720

I took a couple screenshots:
http://www2.filehost.to/files/2007-02-18_01/021549_shot0000.jpg
http://www2.filehost.to/files/2007-02-18_01/021612_shot0001.jpg
Comment 6 M. Kristall 2007-02-25 12:32:48 EST
(In reply to comment #5)
> (In reply to comment #4)
> > I tried it with a freshly built svn client/cgame/game/ui
> > And it didn't work
> >
> I don't know why.
If you try it after disconnecting from a server (presumably with cheats off, I haven't tested that though), then you change a cheat protected variable, and you connect to another server, it will have it's original value (presumably what it was before connecting to the first server).
Comment 7 Tony J. White 2007-03-02 11:18:44 EST
Created attachment 1279 [details]
svn1047 cgame/ui CVAR_CHEAT fix


When connecting to a pure server Cvar_SetCheatState() is called to reset all cvars flagged CVAR_CHEAT to default values.  However this is done prior to loading the cgame and ui vms.  trap_Register_Cvar() calls done in CG_INIT or UI_INIT do override the default value of a user defined cvar, but since Cvar_SetCheatState() has already been called, the default value set by trap_Register_Cvar() never gets set.

This patch simply adds calls Cvar_SetCheatState() after calling UI_INIT and CGAME_INIT when connecting to a pure server.
Comment 8 Tony J. White 2007-03-02 11:41:04 EST
Created attachment 1280 [details]
svn1047 cgame/ui CVAR_CHEAT fix

oops, I got sv_pure and sv_cheats confused
Comment 9 Tony J. White 2007-03-02 12:08:49 EST
moving from tremulous to ioquake3
Comment 10 Tony J. White 2007-03-02 12:32:55 EST
added at revision 1048
Comment 11 Ryan C. Gordon 2007-05-21 11:23:15 EDT
Setting a QA contact on all ioquake3 bugs, even resolved ones. Sorry if you get a flood of email from this, it should only happen once. Apologies for the incovenience.

--ryan.