lfnetwork.com mark read register faq members calendar

Thread: Cvar madness
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 06-23-2006, 03:01 PM   #1
Dom_152
Rookie
 
Dom_152's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 150
Cvar madness

Right I have 3 Cvars that govern what commands Admins can and can't use. but for some reason in my function that checks their admin status etc. The values in the Cvars are always 0 meaning the Admins can't do anything. I don't know why it is doing this. I am setting them correctly in the Server Config. Any ideas as to what might be the cause?


-----------------------------------------------------
MultiPlayer Xtra
Jedi Academy MP Mod
(Released! Source Code and all!)

Jedi Academy - Xtra
Coming Soon...

-----------------------------------------------------
Dom_152 is offline   you may: quote & reply,
Old 07-10-2006, 08:54 PM   #2
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,162
what sort of cvar flags are set for those cvars?


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 07-27-2006, 11:25 AM   #3
Dom_152
Rookie
 
Dom_152's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 150
CVAR_ARCHIVE and CVAR_INTERNAL.


-----------------------------------------------------
MultiPlayer Xtra
Jedi Academy MP Mod
(Released! Source Code and all!)

Jedi Academy - Xtra
Coming Soon...

-----------------------------------------------------
Dom_152 is offline   you may: quote & reply,
Old 07-27-2006, 03:02 PM   #4
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
just set the flags to 0 theres no need for internal, it just makes it so you can't tab auto complete, and you really shouldn't archive the pw.

showing some code how your getting those files would be nice to see for help.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 07-27-2006, 04:40 PM   #5
Dom_152
Rookie
 
Dom_152's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 150
The vaules are just in the Server.cfg setup the same way as every other CVAR.


-----------------------------------------------------
MultiPlayer Xtra
Jedi Academy MP Mod
(Released! Source Code and all!)

Jedi Academy - Xtra
Coming Soon...

-----------------------------------------------------
Dom_152 is offline   you may: quote & reply,
Old 07-27-2006, 06:04 PM   #6
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
CVAR_ARCHIVE, means store in jampconfig.cfg and/or jampserver.cfg depending if your using jamp or jampDed. i know what they are and 'server.cfg' is just a random config that isnt used by the game at all other than you calling +exec server.cfg and i hate when people use seta in non jampconfig.cfg files.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 07-28-2006, 05:16 AM   #7
Dom_152
Rookie
 
Dom_152's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 150
I'll remove those flags as soon as I get my computer back then. And what exactly is wrong with using seta in non jampconfig.cfg files?


-----------------------------------------------------
MultiPlayer Xtra
Jedi Academy MP Mod
(Released! Source Code and all!)

Jedi Academy - Xtra
Coming Soon...

-----------------------------------------------------
Dom_152 is offline   you may: quote & reply,
Old 07-28-2006, 01:41 PM   #8
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
too many cvars. nor is it needed when u use seta it makes a copy in jampconfig and then its always set to that until another seta is hit with same cvar, set will override it but not forever on quit it will override it again. also if you overflow than among other configs, you will be getting the Recursive Error: MAX_CVARS notice all the time and wont be able to run . i see a bunch of fools running JA+ and their whole server.cfg's are seta seta seta seta seta seta seta seta seta ... there's no need. slider mentioned a while back that his mod runs best with seta well, then thats kind of his fault for poor coding but yeah. because most other q3 engine games even i recommend using set instead of seta where you can.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 07-29-2006, 05:37 AM   #9
Dom_152
Rookie
 
Dom_152's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 150
Right, thanks for the advice


-----------------------------------------------------
MultiPlayer Xtra
Jedi Academy MP Mod
(Released! Source Code and all!)

Jedi Academy - Xtra
Coming Soon...

-----------------------------------------------------
Dom_152 is offline   you may: quote & reply,
Old 08-07-2006, 02:49 PM   #10
Dom_152
Rookie
 
Dom_152's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 150
I've set the CVar flags to 0 and it's still not working. Garr this is annoying. It's only this and reading files that are stopping me from completeting my Mod.


-----------------------------------------------------
MultiPlayer Xtra
Jedi Academy MP Mod
(Released! Source Code and all!)

Jedi Academy - Xtra
Coming Soon...

-----------------------------------------------------
Dom_152 is offline   you may: quote & reply,
Old 08-07-2006, 03:02 PM   #11
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
like i said b4, show some of the code where its being used, and how your cvar line looks.

Also, are you sure its not set to 0 in jampconfig thats overwriting your default?


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-07-2006, 04:02 PM   #12
Dom_152
Rookie
 
Dom_152's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 150
In Jampconfig the Cvars are being shown as "NULL"

Here is the offending code:

Code:
qboolean G_CheckAdmin(gentity_t *ent, int command)
{
	int Bitvalues = 0;
	
	/*if(!ent->client->sess.admin == ADMIN_NO_ADMIN)
	{
		return qtrue;
	}
	else
	{
		return qfalse;
	}*/

	//New as of 14th June 2006
	//Check if the person is even logged into an admin state

	CmdEnt(ent-g_entities, va("print \"Admin1: %i\nAdmin2: %i\nAdmin3: %i\n\"", mpx_admin1Allow.integer, mpx_admin2Allow.integer, mpx_admin3Allow.integer));

	if(ent->client->sess.admin == ADMIN_NO_ADMIN)
	{
		return qfalse;
	}

	//Right they are admin so lets check what sort so we can assign bitvalues
	if(ent->client->sess.admin == ADMIN_1)
	{
		Bitvalues = mpx_admin1Allow.integer;
	}
	if(ent->client->sess.admin == ADMIN_2)
	{
		Bitvalues = mpx_admin2Allow.integer;
	}
	if(ent->client->sess.admin == ADMIN_3)
	{
		Bitvalues = mpx_admin3Allow.integer;
	}
	if(ent->client->sess.admin == ADMIN_MOD)
	{
		Bitvalues = MOD_CMDS;
	}	

	//If the Bitvalues 0 then return false cos no commands can be allowed if it's 0
	if(Bitvalues == 0)
	{
		return qfalse;
	}

	//Got the Bitvalues so lets check if the command given is included in the Bitvalue
	if(Bitvalues & command)
	{
		return qtrue; //Command is allowed so return true
	}
	else
	{
		return qfalse;
	}

}
And the Cvar definition:
Code:
{ &mpx_admin1Allow, "mpx_admin1Allow ", "0", 0 , 0, qfalse  },
	{ &mpx_admin2Allow, "mpx_admin2Allow ", "0", 0 , 0, qfalse  },
	{ &mpx_admin3Allow, "mpx_admin3Allow ", "0", 0 , 0, qfalse  },
As you can see there the Cvar is called mpx_admin1Allow... but in jampconfig it says mpx_admin1Allowed "NULL"... Odd...


-----------------------------------------------------
MultiPlayer Xtra
Jedi Academy MP Mod
(Released! Source Code and all!)

Jedi Academy - Xtra
Coming Soon...

-----------------------------------------------------
Dom_152 is offline   you may: quote & reply,
Old 08-07-2006, 04:28 PM   #13
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
why is there a space in the cvar names?

"mpx_admin1Allow " -> "mpx_admin1Allow"

probably not the problem but try it, make sure to delete those from jampconfig also.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-07-2006, 04:30 PM   #14
Dom_152
Rookie
 
Dom_152's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 150
I'll try it.

Well it worked because it now shows the right values that I set in the server.cfg. But it's not affecting the commands I can use... I can't seem to use any at all.

EDIT: Scratch that, thats because of another function I had disabled for something earlier.


-----------------------------------------------------
MultiPlayer Xtra
Jedi Academy MP Mod
(Released! Source Code and all!)

Jedi Academy - Xtra
Coming Soon...

-----------------------------------------------------
Dom_152 is offline   you may: quote & reply,
Old 08-07-2006, 04:34 PM   #15
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,162
Those entries in jampconfig are old and overriding your new values. I'd try removing them like ensiform suggested.

Also, how are you setting the sess.admin?


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 08-07-2006, 04:37 PM   #16
Dom_152
Rookie
 
Dom_152's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 150
I'm adding it into the session struct and editing g_session accordingly.
It's finally wokring! All because of a typo lol. Thanks for all your help. Now I've jsut gotta learn how to read multi line files properly and I'm done!


-----------------------------------------------------
MultiPlayer Xtra
Jedi Academy MP Mod
(Released! Source Code and all!)

Jedi Academy - Xtra
Coming Soon...

-----------------------------------------------------
Dom_152 is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > Cvar madness

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:04 PM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.