lfnetwork.com mark read register faq members calendar

Thread: Getting client info on CG
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 11-04-2006, 12:44 PM   #1
Dom_152
Rookie
 
Dom_152's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 150
Getting client info on CG

I have a boolean in the server side client->pers structure and now I want to use that boolean to determine if the client should draw something extra on the scoreboard. My question is how can I access the state of that boolean from cg_scorboard.c or in any cg_xxx.x file?


-----------------------------------------------------
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 11-04-2006, 11:23 PM   #2
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
Ooh, I don't know much about client->pers but I know the client->ps (playerState) can be edited from q_shared.h. This is the tricky thing though, editing q_shared.h can really mess everything else up so I would stick with using userints. Even if you do edit userint though, you have to make sure enough bits are being sent across the network to represent it properly, so you'll need to edit the external netf_overrides and psf_overrides too (I can tell you where those are if you don't know).


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Old 11-05-2006, 01:54 AM   #3
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
An easier way would be to send it in ClientUserinfoChanged.

pers.myqboolean and x being the key being stored to be recognized in client.

Note: Don't just copy and paste this as it appears to have extra spaces in the s = va() area but it really doesn't.

Code:
	// send over a subset of the userinfo keys so other clients can
	// print scoreboards, display models, and play custom sounds
	if ( ent->r.svFlags & SVF_BOT ) {
		s = va("n\\%s\\t\\%i\\model\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\skill\\%s\\tt\\%d\\tl\\%d\\siegeclass\\%s\\st\\%s\\st2\\%s\\dt\\%i\\sdt\\%i\\x\\%d",
			client->pers.netname, team, model,  c1, c2, 
			client->pers.maxHealth, client->sess.wins, client->sess.losses,
			Info_ValueForKey( userinfo, "skill" ), teamTask, teamLeader, className, saberName, saber2Name, client->sess.duelTeam, client->sess.siegeDesiredTeam, client->pers.myqboolean);
	} else {
		if (g_gametype.integer == GT_SIEGE)
		{ //more crap to send
			s = va("n\\%s\\t\\%i\\model\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\tt\\%d\\tl\\%d\\siegeclass\\%s\\st\\%s\\st2\\%s\\dt\\%i\\sdt\\%i\\x\\%d",
				client->pers.netname, client->sess.sessionTeam, model, c1, c2, 
				client->pers.maxHealth, client->sess.wins, client->sess.losses, teamTask, teamLeader, className, saberName, saber2Name, client->sess.duelTeam, client->sess.siegeDesiredTeam, client->pers.myqboolean);
		}
		else
		{
			s = va("n\\%s\\t\\%i\\model\\%s\\c1\\%s\\c2\\%s\\hc\\%i\\w\\%i\\l\\%i\\tt\\%d\\tl\\%d\\st\\%s\\st2\\%s\\dt\\%i\\x\\%d",
				client->pers.netname, client->sess.sessionTeam, model, c1, c2, 
				client->pers.maxHealth, client->sess.wins, client->sess.losses, teamTask, teamLeader, saberName, saber2Name, client->sess.duelTeam, client->pers.myqboolean);
		}
	}
Add it to the end of the s char, then you can get it in the clientinfo in cg_players.c: CG_NewClientInfo

Code:
	// myqboolean x
	v = Info_ValueForKey( configstring, "x" );
	newInfo.myqboolean = atoi( v );


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 11-05-2006, 04:45 AM   #4
Dom_152
Rookie
 
Dom_152's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 150
Thank you. And for the record I barely ever Copy-Paste example code as I like to write it out step by step so I know what I'm doing.


-----------------------------------------------------
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 > Getting client info on CG

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:08 AM.

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