lfnetwork.com mark read register faq members calendar

Thread: Q3 Engine Game Bugs / JA bugs
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 03-21-2006, 10:29 AM   #81
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
I think OJP has all the fixes suggested so far except for the last siege fix that slider posted.


---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 05-07-2006, 02:18 AM   #82
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
yay more fixes! :

1. Voice Commands show up in the notify box as well as chat box when console is not up?

Easy Client Fix:
(this also escapes the rest of line to white after name)

cg_event.c

look for this line:

Code:
char vchatstr[1024];
change the 3 lines below it to look like this:
Code:
strcpy(vchatstr, va("<%s^7: %s>", ci->name, descr));
CG_Printf( "*%s\n", vchatstr );
CG_ChatBox_AddString(vchatstr);
2. CTF Messages dont escape to white after player names:

cg_event.c

CG_PrintCTFMessage

Code:
Com_sprintf(printMsg, sizeof(printMsg), "%s ", ci->name);
should be:

Code:
Com_sprintf(printMsg, sizeof(printMsg), "%s^7 ", ci->name);
and

Code:
Com_sprintf(printMsg, sizeof(printMsg), "%s %s", ci->name, psStringEDString);
should be:

Code:
Com_sprintf(printMsg, sizeof(printMsg), "%s^7 %s", ci->name, psStringEDString);
3. New security bug out for quake 3 engine, thought it wasnt fixable without engine?

add this somewhere in bg_misc.c:

Code:
/*
============
COM_StripExtensionSafe
============
*/
void COM_StripExtensionSafe( const char *in, char *out, int destsize ) {
	int             length;

	Q_strncpyz(out, in, destsize);

	length = strlen(out)-1;
	while (length > 0 && out[length] != '.')
	{
		length--;
		if (out[length] == '/')
			return;		// no extension
	}
	if (length)
		out[length] = 0;
}
and declare it somewhere in bg_public.h:

Code:
void COM_StripExtensionSafe( const char *in, char *out, int destsize );
now replace all instances of COM_StripExtension in your source with

COM_StripExtensionSafe and the destsize should be sizeof(change me to the char of out)

ie:

Code:
COM_StripExtensionSafe(fileptr, configname, sizeof(configname));
even more...

cg_servercmds.c:

look for "remapShader" command in the function CG_ServerCommand and replace that whole if statement for remapShader to:

Code:
	if ( Q_stricmp (cmd, "remapShader") == 0 )
	{
		if (trap_Argc() == 4)
		{
			char shader1[MAX_QPATH];
			char shader2[MAX_QPATH];
			char shader3[MAX_QPATH];

			Q_strncpyz(shader1, CG_Argv(1), sizeof(shader1));
			Q_strncpyz(shader2, CG_Argv(2), sizeof(shader2));
			Q_strncpyz(shader3, CG_Argv(3), sizeof(shader3));

			trap_R_RemapShader(shader1, shader2, shader3);
		}
		
		return;
	}
last file in cgame for this bugfix, cg_syscalls.c:

comment out or delete the trap_R_RemapShader function and replace it with this:

Code:
void	trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset ) {
	char oldShaderTMP[MAX_QPATH];
	char newShaderTMP[MAX_QPATH];
	Q_strncpyz(oldShaderTMP, oldShader, sizeof(oldShaderTMP));
	Q_strncpyz(newShaderTMP, newShader, sizeof(newShaderTMP));
	COM_StripExtensionSafe(oldShaderTMP, oldShaderTMP, sizeof(oldShaderTMP));
	COM_StripExtensionSafe(newShaderTMP, newShaderTMP, sizeof(newShaderTMP));
	syscall( CG_R_REMAP_SHADER, oldShaderTMP, newShaderTMP, timeOffset );
}
k now open up ui_syscalls.c:

do the same thing for ui_syscalls.c as cg_syscalls.c only the syscall itself is changed ( UI_R_REMAP_SHADER ):

Code:
void	trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset ) {
	char oldShaderTMP[MAX_QPATH];
	char newShaderTMP[MAX_QPATH];
	Q_strncpyz(oldShaderTMP, oldShader, sizeof(oldShaderTMP));
	Q_strncpyz(newShaderTMP, newShader, sizeof(newShaderTMP));
	COM_StripExtensionSafe(oldShaderTMP, oldShaderTMP, sizeof(oldShaderTMP));
	COM_StripExtensionSafe(newShaderTMP, newShaderTMP, sizeof(newShaderTMP));
	syscall( UI_R_REMAP_SHADER, oldShaderTMP, newShaderTMP, timeOffset );
}
now ui_atoms.c:

look for this line:

Code:
if ( Q_stricmp (cmd, "postgame") == 0 ) {
above it add:

Code:
	if ( Q_stricmp (cmd, "remapShader") == 0 ) {
		if (trap_Argc() == 4) {
			char shader1[MAX_QPATH];
			char shader2[MAX_QPATH];
			char shader3[MAX_QPATH];
			
			Q_strncpyz(shader1, UI_Argv(1), sizeof(shader1));
			Q_strncpyz(shader2, UI_Argv(2), sizeof(shader2));
			Q_strncpyz(shader3, UI_Argv(3), sizeof(shader3));
			
			trap_R_RemapShader(shader1, shader2, shader3);
			return qtrue;
		}
	}
i think that is all for this bug.

Source of bug:

http://www.gamer.nl/doc/32206

Translated by Babelfish:

Quote:
Gamers which still old, on the Quake 3 Engine play based games have been warned. Are not only slow you desperately, also a serious leak in the engine as a result of which can computer offenders, crackers and other gajes take over your PC'tje, has been discovered.

The leak is caused by "boundary error" during the processing of the "remapShader" commando. This can lead to a buffer overflow, as a result of which the attacker can carry out in question random commandos and software on the vulnerable PC..

If this is all too technical for your, then you must remember simply to make no connection with "malicious servers". An attacker must to abuse the leak, as it happens, by means of its server a command to the PC. send.

Enemy Territory 2.60, return to Castle Wolfenstein 1.41 and Quake III and 1.32b is vulnerable, but also other versions its probable leak.
4. Limbs dont take team color if u have a custom rgb model

g_combat.c:

in function G_Dismember:

Code:
	limb->s.customRGBA[0] = ent->s.customRGBA[0];
	limb->s.customRGBA[1] = ent->s.customRGBA[1];
	limb->s.customRGBA[2] = ent->s.customRGBA[2];
	limb->s.customRGBA[3] = ent->s.customRGBA[3];
should be:

Code:
	if (g_gametype.integer >= GT_TEAM) {
		switch(ent->client->sess.sessionTeam)
		{
		case TEAM_RED:
			limb->s.customRGBA[0] = 255;
			limb->s.customRGBA[1] = 0;
			limb->s.customRGBA[2] = 0;
			break;
		case TEAM_BLUE:
			limb->s.customRGBA[0] = 0;
			limb->s.customRGBA[1] = 0;
			limb->s.customRGBA[2] = 255;
			break;
		default:
			limb->s.customRGBA[0] = ent->s.customRGBA[0];
			limb->s.customRGBA[1] = ent->s.customRGBA[1];
			limb->s.customRGBA[2] = ent->s.customRGBA[2];
			limb->s.customRGBA[3] = ent->s.customRGBA[3];
			break;
		}
	} else {
		limb->s.customRGBA[0] = ent->s.customRGBA[0];
		limb->s.customRGBA[1] = ent->s.customRGBA[1];
		limb->s.customRGBA[2] = ent->s.customRGBA[2];
		limb->s.customRGBA[3] = ent->s.customRGBA[3];
	}
5. weird tint for the meters and values when playing ffa or on blue team

cg_draw.c

look for this:

Code:
if (cgs.gametype >= GT_TEAM && cgs.gametype != GT_SIEGE)
	{	// tint the hud items based on team
		if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED )
			hudTintColor = redhudtint;
		else if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE )
			hudTintColor = bluehudtint;
		else // If we're not on a team for whatever reason, leave things as they are.
			hudTintColor = colorTable[CT_WHITE];
	}
	else
	{	// tint the hud items white (dont' tint)
		hudTintColor = colorTable[CT_WHITE];
	}
replace it with:

Code:
hudTintColor = redhudtint;	// always use red because blue and white screws it up
6. flag icons have a dark tint when you are in scope because raven forgets to do trap_R_SetColor(NULL) after every change in color thats not needed anymore.

cg_draw.c again:

CG_DrawFlagStatus

above the !cg.snap line add:

Code:
trap_R_SetColor( NULL );
also CG_DrawPowerupIcons

add

Code:
trap_R_SetColor( NULL );
same spot as flagstatus


iojamp project lead / coder

Last edited by ensiform; 06-08-2006 at 11:28 PM.
ensiform is offline   you may: quote & reply,
Old 07-30-2006, 09:57 PM   #83
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
This code in G_SayTo doesn't really work and it is kinda pointless to disable chat, it would make more sense to write something better that disables the voice chat instead.

Code:
if (g_gametype.integer == GT_SIEGE &&
		ent->client && (ent->client->tempSpectate >= level.time || ent->client->sess.sessionTeam == TEAM_SPECTATOR) &&
		other->client->sess.sessionTeam != TEAM_SPECTATOR &&
		other->client->tempSpectate < level.time)
	{ //siege temp spectators should not communicate to ingame players
		return;
	}
if you still use the base method of voice_cmd add this in Cmd_VoiceCommand_f:

Code:
	if ( g_gametype.integer == GT_SIEGE && 
			ent->client->tempSpectate >= level.time ) {
		return;
	}
otherwise add it to G_Voice.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 07-31-2006, 03:38 PM   #84
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
don't show the cursor during map load:

ui_main.c in function _UI_Refresh:

look for this piece of code:

Code:
	// draw cursor
	UI_SetColor( NULL );
	if (Menu_Count() > 0) {
		UI_DrawHandlePic( uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory, 48, 48, uiInfo.uiDC.Assets.cursor);
	}
change it to:

Code:
	// draw cursor
	UI_SetColor( NULL );
	if (Menu_Count() > 0) {
		uiClientState_t	cstate;
		trap_GetClientState( &cstate );
		if(cstate.connState <= CA_DISCONNECTED || cstate.connState >= CA_ACTIVE) {
			UI_DrawHandlePic( uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory, 48, 48, uiInfo.uiDC.Assets.cursor);
		}
	}


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-01-2006, 11:40 PM   #85
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
k so this one is kind of raven's fault, they forgot many many many checks for their EF_DOUBLE_AMMO, thus tech's cannot give you ammo > than the normal max and you cannot pickup ammo > normal max (this is usually for siege).

Open up g_items.c and Change the function "Add_Ammo" to look like this:

Code:
void Add_Ammo (gentity_t *ent, int weapon, int count)
{
	if ( ent->client->ps.eFlags & EF_DOUBLE_AMMO ) {
		if ( ent->client->ps.ammo[weapon] < ammoData[weapon].max*2 )
		{
			ent->client->ps.ammo[weapon] += count;
			if ( ent->client->ps.ammo[weapon] > ammoData[weapon].max*2 )
			{
				ent->client->ps.ammo[weapon] = ammoData[weapon].max*2;
			}
		}
	} else {
		if ( ent->client->ps.ammo[weapon] < ammoData[weapon].max )
		{
			ent->client->ps.ammo[weapon] += count;
			if ( ent->client->ps.ammo[weapon] > ammoData[weapon].max )
			{
				ent->client->ps.ammo[weapon] = ammoData[weapon].max;
			}
		}
	}
}
Open up g_utils.c and look for the function "G_UseDispenserOn":

change the else if statement for ammodisp to:

Code:
	else if (dispType == HI_AMMODISP)
	{
		if (ent->client->medSupplyDebounce < level.time)
		{ //do the next increment
			//increment based on the amount of ammo used per normal shot.
			target->client->ps.ammo[weaponData[target->client->ps.weapon].ammoIndex] += weaponData[target->client->ps.weapon].energyPerShot;

			if ( target->client->ps.eFlags & EF_DOUBLE_AMMO ) {
				if (target->client->ps.ammo[weaponData[target->client->ps.weapon].ammoIndex] > ammoData[weaponData[target->client->ps.weapon].ammoIndex].max*2)
				{ //cap it off
					target->client->ps.ammo[weaponData[target->client->ps.weapon].ammoIndex] = ammoData[weaponData[target->client->ps.weapon].ammoIndex].max*2;
				}
			} else {
				if (target->client->ps.ammo[weaponData[target->client->ps.weapon].ammoIndex] > ammoData[weaponData[target->client->ps.weapon].ammoIndex].max)
				{ //cap it off
					target->client->ps.ammo[weaponData[target->client->ps.weapon].ammoIndex] = ammoData[weaponData[target->client->ps.weapon].ammoIndex].max;
				}
			}

			//base the next supply time on how long the weapon takes to fire. Seems fair enough.
			ent->client->medSupplyDebounce = level.time + weaponData[target->client->ps.weapon].fireTime;
		}
		target->client->isMedSupplied = level.time + 500;
	}
next function down "G_CanUseDispOn":


change the else if statement for ammodisp to:

Code:
	else if (dispType == HI_AMMODISP)
	{
		if (ent->client->ps.weapon <= WP_NONE || ent->client->ps.weapon > LAST_USEABLE_WEAPON)
		{ //not a player-useable weapon
			return 0;
		}

		if ( ent->client->ps.eFlags & EF_DOUBLE_AMMO ) {
			if (ent->client->ps.ammo[weaponData[ent->client->ps.weapon].ammoIndex] < ammoData[weaponData[ent->client->ps.weapon].ammoIndex].max*2)
			{ //needs more ammo for current weapon
				return 1;
			}
		} else {
			if (ent->client->ps.ammo[weaponData[ent->client->ps.weapon].ammoIndex] < ammoData[weaponData[ent->client->ps.weapon].ammoIndex].max)
			{ //needs more ammo for current weapon
				return 1;
			}
		}

		//needs none
		return 0;
	}
I think that is all.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-02-2006, 03:10 PM   #86
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
Quote:
Originally Posted by ensiform
This code in G_SayTo doesn't really work and it is kinda pointless to disable chat, it would make more sense to write something better that disables the voice chat instead.
I think the point was to prevent dead/spectators from revealing information to live players in the game.


---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-02-2006, 05:03 PM   #87
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
does not matter, its useless code that doesn't work. people can still see your chat. i could have swore Enemy Territory had something like this for voice chats but i cant seem to find it for "Dead" Players.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-03-2006, 05:31 PM   #88
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
this bug is kinda funny, raven forgot to put a tempSpec check in /follow and followprev/next.

Cmd_Follow_f add this below the other spectator check:

Code:
	// can't follow another spectator
	if ( level.clients[ i ].tempSpectate >= level.time ) {
		return;
	}
Cmd_FollowCycle_f add this below the other spectator check in the do while loop:

Code:
		// can't follow another spectator
		if ( level.clients[ clientnum ].tempSpectate >= level.time ) {
			continue;
		}
also, there are some pieces in the code that check if tempSpectate > level.time, it should always be >= level.time because level.time and above means you are tempSpectate, less than means you are not.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-03-2006, 07:09 PM   #89
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
Mind explaining what this fixes?


---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-03-2006, 08:18 PM   #90
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
if you are a real spectator (team s) and watching a siege game and someone who is "dead" (tempSpectator) you follow them around while they are in tempSpectate mode. This fixes it so that you don't follow them while they are moving freely.


Btw, I have figured out a way to make spectators move through most entities now even doors, and the security walls on desert and even the red forcefield on hoth. This way spectators do not have to rely on using the crappy teleport thing which doesn't always work if the map has a forced trigger or sometimes it teleports you out of the level causing you to be in the void. :/ If you want me to post this its a bit of a hack in some trace code on server and client for slight stability but it works very well.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-03-2006, 11:59 PM   #91
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Also, somewhat of a bug: There should only be 3 places where ps.clientNum should be used on the game module, anything else can potentially cause troubles with specators. For example, your code for auto balance in ojp will sometimes spam to the spectator "You were switched" message. Or even use the spectator's name in messages, or in the duel/pduel check code it could potentially pick a spectator when it didn't mean to.

You should only have these lines:

Near Top of ClientUserInfoChanged:

Code:
client->ps.clientNum = clientNum;
Here in ClientSpawn:

Code:
	client->ps.clientNum = index;
	//give default weapons
	client->ps.stats[STAT_WEAPONS] = ( 1 << WP_NONE );
and...

In Stop Following:

Code:
ent->client->ps.clientNum = ent - g_entities;
Use gentity_t->s.number or gentity_t - g_entities.

(gentity_t being the entity you want the number from)

anything ps->clientNum (meaning something from pmove usually) and client-side is required that it be used but the server no.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-04-2006, 03:13 AM   #92
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
I don't really want to describe it however its hard to explain why it is a bug:

- Play hoth until you gain the access codes
- Get the codes
- Bring them to AT-ST and get in and type this in console without the quotes but the space:
" /reconnect"
- Even though the player may not be still visible, the objective item never was told the client wasn't 'inuse'. / disconnected.

Add this to ClientDisconnect just below this line:

Code:
ent->r.contents = 0;
Code:
	if (ent->client->holdingObjectiveItem > 0)
	{ //carrying a siege objective item - make sure it updates and removes itself from us now in case this is an instant death-respawn situation
		gentity_t *objectiveItem = &g_entities[ent->client->holdingObjectiveItem];

		if (objectiveItem->inuse && objectiveItem->think)
		{
            objectiveItem->think(objectiveItem);
		}
	}


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-05-2006, 04:07 AM   #93
stubert
 
Join Date: Aug 2002
Location: Philadelphia
Posts: 227
damn son u findin dem bugs yo
stubert is offline   you may: quote & reply,
Old 08-11-2006, 05:48 PM   #94
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Minor bug when pressing fire on a speeder that allows the speeder to still fire if only 1 of two sabers are on or if 1 blade of staff is on.

Open up g_active.c and just above G_CheapWeaponFire function extern this:

Code:
extern qboolean BG_SabersOff( playerState_t *ps );
then inside the function the following line should be repleaced:

Code:
(rider->client->ps.weapon != WP_SABER || !rider->client->ps.saberHolstered))
with:

Code:
(rider->client->ps.weapon != WP_SABER || !BG_SabersOff(&rider->client->ps)))


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-13-2006, 02:25 AM   #95
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Anybody ever heard of the "speeder lag 'bug'" ?

I think I've got a theory as to why. I was playing siege earlier today and I had originally though, well hell maybe they forgot to clear ent->client->ps.m_iVehicleNum in StopFollowing because somebody had mentioned that it only occurs after spectating somebody.

This code is untested but I'm just wondering if maybe forcing the spectator to exit the vehicle if they were in one.

StopFollowing (g_cmds.c):

Code:
	if (ent->client->ps.m_iVehicleNum)
	{ //tell it I'm getting off
		gentity_t *veh = &g_entities[ent->client->ps.m_iVehicleNum];

		if (veh->inuse && veh->client && veh->m_pVehicle)
		{
			veh->m_pVehicle->m_pVehicleInfo->Eject(veh->m_pVehicle, (bgEntity_t *)ent, qtrue);
		}
	}
note: make sure you put this above where it clears ent->client->ps.m_iVehicleNum.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-14-2006, 03:53 PM   #96
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
zomg this bug is really annoying: http://www.lucasforums.com/showthread.php?t=168805

Why should arena files not load on the server if bot_enable is off?

Open up these 2 files: g_bot.c, g_main.c

First make G_LoadArenas not static.

Then extern G_LoadArenas above G_InitGame in g_main.c.

Then change this if statement (G_InitGame):

Code:
	if ( trap_Cvar_VariableIntegerValue( "bot_enable" ) ) {
		BotAISetup( restart );
		BotAILoadMap( restart );
		G_InitBots( restart );
	}
to this:

Code:
	if ( trap_Cvar_VariableIntegerValue( "bot_enable" ) ) {
		BotAISetup( restart );
		BotAILoadMap( restart );
		G_InitBots( restart );
	} else {
		// We still want to load arenas even if bot_enable is off so that 
		// g_autoMapCycle can work let alone any other code that relies on 
		// using arena information that normally wouldn't be loaded :Nervous
		G_LoadArenas();
	}


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-14-2006, 05:27 PM   #97
Vruki Salet
Junior Member
 
Vruki Salet's Avatar
 
Join Date: Aug 2005
Location: Somewhere else entirely
Posts: 443
Ensiform, what's the difference between setting vars in cfg files with "set" vs. "seta"?
Vruki Salet is offline   you may: quote & reply,
Old 08-15-2006, 12:30 AM   #98
dumbledore
Rookie
 
Join Date: Nov 2005
Posts: 85
seta forces the vars to be added to your jampserver.cfg, which isn't really necessary. also, there's this weird thing where using seta lets you set cvar_rom / cvar_cheat vars if you do it on cmd line :S
dumbledore is offline   you may: quote & reply,
Old 08-18-2006, 11:28 PM   #99
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Not sure why this happens but here's how to test it:

Make sure you are in siege.
Have a Rancor grab you so he is in your hands, then change your siegeclass before he kills you. You will die, but he will be in an infinite loop of trying to kill you and it won't let you spawn until you /team s.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-23-2006, 05:54 PM   #100
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Max Weapon Charge Time seems it can be overridden by +button2 (Use Held Item) So ie: holding a pistol alt charge for as long as you want...


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-24-2006, 07:18 PM   #101
dumbledore
Rookie
 
Join Date: Nov 2005
Posts: 85
there seems to be a bug in interpolation on playback of demos recorded from a localhost server (created through the create game ui option). if you watch one of these demos, especially in lower timescale, the motion seems jerky compared to normal remote-server demos. i've found this fix for it:

cg_snapshot.c function CG_ReadNextSnapshot
find the line
Code:
// FIXME: why would trap_GetSnapshot return a snapshot with the same server time
and change it to
Code:
// FIXME: why would trap_GetSnapshot return a snapshot with the same server time
		if ( cg.snap && r && dest->serverTime == cg.snap->serverTime ) {
			// because we're playing back demos taken by local servers apparently :O
			if ( cg.demoPlayback ) continue;
			//continue;
		}
dumbledore is offline   you may: quote & reply,
Old 08-25-2006, 01:53 PM   #102
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
setting forcepowers to something illegal can cause a crash after forcechanged and respawn.

Mod List Wraps strange sometimes. I will post screenshot when I get a chance.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-27-2006, 04:27 PM   #103
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
npc command uses Com_Printf instead of sending a servercommand of print to the specified client thus when trying for syntax and not being the server while using /npc cmd it will only show up for the server.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-27-2006, 04:36 PM   #104
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
For whatever reason, Raven chose to use strcpy and strncpy in a lot of places instead of Q_strncpyz. This can cause buffer overflows and overruns. There are only a few places i can think of that should be left. Ususally when the dest is a char *something, however a few can be still length checked only when you don't really know what length should be. Also, bg_vehicleLoad and q_shared really should be left alone.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-31-2006, 09:51 PM   #105
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Thanks to hex on this one also.

speed and rage don't work together to give you more speed like it did in jk2.

cause: raven used an if speed else if rage else ragerecovery

fix: revert it back (use a cvar though)

bg_pmove.c "BG_AdjustClientSpeed"

look for and replace this code:

Code:
	if (ps->fd.forcePowersActive & (1 << FP_SPEED))
	{
		ps->speed *= 1.7;
	}
	else if (ps->fd.forcePowersActive & (1 << FP_RAGE))
	{
		ps->speed *= 1.3;
	}
	else if (ps->fd.forceRageRecoveryTime > svTime)
	{
		ps->speed *= 0.75;
	}
with:

Code:
	if (ps->fd.forcePowersActive & (1 << FP_SPEED))
	{
		ps->speed *= 1.7;
	}

	if (ps->fd.forcePowersActive & (1 << FP_RAGE))
	{
		ps->speed *= 1.3;
	}
	else if (ps->fd.forceRageRecoveryTime > svTime)
	{
		ps->speed *= 0.75;
	}
The client-side will be needed for this for best performance.


iojamp project lead / coder

Last edited by ensiform; 08-31-2006 at 11:18 PM.
ensiform is offline   you may: quote & reply,
Old 08-31-2006, 10:09 PM   #106
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
If you haven't respawned into temp spectator mode and in siege, you can still use your holdable items because they are not cleared

g_combat.c "player_die"

look for these lines:

Code:
	// remove powerups
	memset( self->client->ps.powerups, 0, sizeof(self->client->ps.powerups) );
below it add:

Code:
	self->client->ps.stats[STAT_HOLDABLE_ITEMS] = 0;
	self->client->ps.stats[STAT_HOLDABLE_ITEM] = 0;


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 09-03-2006, 10:43 AM   #107
=X=Master HeX
 
=X=Master HeX's Avatar
 
Join Date: Dec 2002
Location: Lake Villa, IL.
Posts: 117
Quote:
Originally Posted by ensiform
setting forcepowers to something illegal can cause a crash after forcechanged and respawn.
This is caused by a malformed forcepower string. To fix this we need to take any garbage the client sends us and turn it into a real forcepower string. A real forcepower string looks like #-#-##################. To do this we try to read anything the client gives us and then we fill in the blanks.

Add the following somewhere:
Code:
void FR_NormalizeForcePowers(char *powerOut, int powerLen)
{
	char powerBuf[128];
	char readBuf[2];
	int finalPowers[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
	int i, c;

	if (powerLen >= 128 || powerLen < 1)
	{ //This should not happen. If it does, this is obviously a bogus string.
		//They can have this string. Because I said so.
		strcpy(powerBuf, "7-1-032330000000001333");
	}
	else
	{
		Q_strncpyz(powerBuf, powerOut, sizeof(powerBuf)); //copy it as the original
	}

	c = 0;
	i = 0;
	while (i < powerLen && i < 128 && powerBuf[i] && powerBuf[i] != '\n' && powerBuf != '\0' && c < NUM_FORCE_POWERS+2)
	{
		if (powerBuf[i] != '-')
		{
			readBuf[0] = powerBuf[i];
			readBuf[1] = 0;
			finalPowers[c] = atoi(readBuf);
			c++;
		}
		i++;
	}

	strcpy(powerOut, va("%i-%i-%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i\0",
						finalPowers[0], finalPowers[1], finalPowers[2], 
						finalPowers[3], finalPowers[4], finalPowers[5], 
						finalPowers[6], finalPowers[7], finalPowers[8], 
						finalPowers[9], finalPowers[10], finalPowers[11], 
						finalPowers[12], finalPowers[13], finalPowers[14], 
						finalPowers[15], finalPowers[16], finalPowers[17], 
						finalPowers[18], finalPowers[19], finalPowers[20]));
}
In g_client.c, look for:
Code:
	Q_strncpyz( forcePowers, Info_ValueForKey (userinfo, "forcepowers"), sizeof( forcePowers ) );
replace with:
Code:
	if (!(ent->r.svFlags & SVF_BOT))
	{ // clients could have a bad forcepower string
		char *n;
		n = Info_ValueForKey (userinfo, "forcepowers");
		FR_NormalizeForcePowers(n, strlen(n));
		strcpy( forcePowers, n );
	}
	else
	{
		Q_strncpyz( forcePowers, Info_ValueForKey (userinfo, "forcepowers"), sizeof( forcePowers ) );
	}
in w_force.c, look for:
Code:
	Q_strncpyz( forcePowers, Info_ValueForKey (userinfo, "forcepowers"), sizeof( forcePowers ) );
replace with:
Code:
	if (!(ent->r.svFlags & SVF_BOT))
	{
		char *s;
		s = Info_ValueForKey (userinfo, "forcepowers");
		FR_NormalizeForcePowers(s, strlen(s));
		strcpy( forcePowers, s );
	}
	else
	{
		Q_strncpyz( forcePowers, Info_ValueForKey (userinfo, "forcepowers"), sizeof( forcePowers ) );
	}
**EDIT** Fixed to correct bot name issues.


Last edited by =X=Master HeX; 09-04-2006 at 05:33 PM.
=X=Master HeX is offline   you may: quote & reply,
Old 09-03-2006, 09:43 PM   #108
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
This works for that except for when certain bots like the basejka bots do not have a funname defined or if a player is /name "" it will set their name to 0-0-000000000000000000


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 09-04-2006, 09:55 AM   #109
=X=Master HeX
 
=X=Master HeX's Avatar
 
Join Date: Dec 2002
Location: Lake Villa, IL.
Posts: 117
Hmm, I see.. Interesting side effect.

That may require some modification to how names are checked, and bots names are stored. I will update the fix as soon as I have some time to run tests.

Or, it could be *s being null so the forcepower info is getting placed in there.

=X=Master HeX is offline   you may: quote & reply,
Old 09-04-2006, 01:48 PM   #110
=X=Master HeX
 
=X=Master HeX's Avatar
 
Join Date: Dec 2002
Location: Lake Villa, IL.
Posts: 117
I fixed it so it doesn't mess up bot names. I couldn't reproduce the client name being set to "" bug.

=X=Master HeX is offline   you may: quote & reply,
Old 09-04-2006, 02:01 PM   #111
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
K, applied the fix. i will test the blank name thing again to see.

Also i would suggest using Q_strncpyz instead of strcpy in these situations:

strcpy(powerBuf, "7-1-032330000000001333"); => Q_strncpyz(powerBuf, "7-1-032330000000001333", sizeof(powerBuf));

strcpy(powerBuf, powerOut); //copy it as the original => Q_strncpyz(powerBuf, powerOut, sizeof(powerBuf)); //copy it as the original

strcpy( forcePowers, n ); => Q_strncpyz( forcePowers, n, sizeof(forcePowers) );

strcpy( forcePowers, s ); => Q_strncpyz( forcePowers, s, sizeof(forcePowers) );


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 09-04-2006, 03:37 PM   #112
=X=Master HeX
 
=X=Master HeX's Avatar
 
Join Date: Dec 2002
Location: Lake Villa, IL.
Posts: 117
I just overloaded my strcpy functions to use a safe bounds checking version.

=X=Master HeX is offline   you may: quote & reply,
Old 09-04-2006, 03:39 PM   #113
=X=Master HeX
 
=X=Master HeX's Avatar
 
Join Date: Dec 2002
Location: Lake Villa, IL.
Posts: 117
Issue with charging weapons max charge time not being checked if you hold the use item key. Working on a stable fix.


Last edited by =X=Master HeX; 09-08-2006 at 01:51 AM.
=X=Master HeX is offline   you may: quote & reply,
Old 09-04-2006, 10:02 PM   #114
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,172
Here's a really old bug fix that CerburuS told me about ages ago. However, I never actually tried it so your mileage may vary. I'll give this a shot when I have time as well.

Quote:
Originally Posted by CerburuS
just wanted to let you know that there's a bug in basejka which disables Areaportals in Siege permanently if that Areaportal is "open" when the round is being restarted (i.e. the Areaportal will not work at all in the next round, causing bad FPS for the players).

In basejka Siege it's obviously not as much of an issue as it is in MBII since there's only one round restart per map at max (opposed to 20+ in MBII). Thought you might be interested nonetheless...

I've written a relatively simple fix for this problems - could forward to you if you want. It'd need a small modification for basejka though since I'm using a MBII-specific value to determine whether the server is currently in round transition.

Well, area portals should be used quite frequently in Siege maps - I imagine that siege_desert for example uses quite a few. The only one I know for sure is located at the Command Center doors at siege_hoth. They should be easy to detect via /r_showtris 1 though.

Code:
		//fix for self-deactivating areaportals in Siege
		if ( ent->s.eType == ET_MOVER && g_gametype.integer == GT_SIEGE && level.MBIntermission)
		{
			if ( !Q_stricmp("func_door", ent->classname) && ent->moverState != MOVER_POS1 )
			{
				SetMoverState( ent, MOVER_POS1, level.time );
				if ( ent->teammaster == ent || !ent->teammaster ) 
				{
					trap_AdjustAreaPortalState( ent, qfalse );
				}

				//stop the looping sound
				ent->s.loopSound = 0;
				ent->s.loopIsSoundset = qfalse;			}
			continue;
		}
This is the code I inserted in g_main.c (around line 4169 in the MB version). I'd just send you the file but since my comp just got fried 2 hours ago, this would take a while Basically you should be able to insert it anywhere in the G_RunFrame function.

Basically it closes any door that is not closed (i.e. opening, closing, or open) and activates the areaportal again. According to our beta testers, it works pretty well so far. If you can think of a better way to do this though, just let me know

The only thing that will need adapting is the level.MBintermission value I'm using since that one's MB specific.

Hope it's at least of some help.
EDIT: Ensiform has come up with code to fix this bug for basejka. Look down in this thread for it.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder

Last edited by razorace; 09-06-2006 at 03:50 PM.
razorace is offline   you may: quote & reply,
Old 09-06-2006, 01:37 AM   #115
=X=Master HeX
 
=X=Master HeX's Avatar
 
Join Date: Dec 2002
Location: Lake Villa, IL.
Posts: 117
There is a bug with saber blocking not working at all if you die while your saber is knocked out of your hands. I am currently working on a stable fix.


Last edited by =X=Master HeX; 09-06-2006 at 12:19 PM.
=X=Master HeX is offline   you may: quote & reply,
Old 09-06-2006, 03:26 PM   #116
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
For those not able to understand how the areaportal fix works with non-MB2 code open up g_main.c and look for the following piece of code:

Code:
		if ( ent->s.eType == ET_MOVER ) {
			G_RunMover( ent );
			continue;
		}
below it add:

Code:
		//fix for self-deactivating areaportals in Siege
		if ( ent->s.eType == ET_MOVER && g_gametype.integer == GT_SIEGE && level.intermissiontime)
		{
			if ( !Q_stricmp("func_door", ent->classname) && ent->moverState != MOVER_POS1 )
			{
				SetMoverState( ent, MOVER_POS1, level.time );
				if ( ent->teammaster == ent || !ent->teammaster ) 
				{
					trap_AdjustAreaPortalState( ent, qfalse );
				}

				//stop the looping sound
				ent->s.loopSound = 0;
				ent->s.loopIsSoundset = qfalse;
			}
			continue;
		}


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 09-07-2006, 10:51 AM   #117
=X=Master HeX
 
=X=Master HeX's Avatar
 
Join Date: Dec 2002
Location: Lake Villa, IL.
Posts: 117
The following appears to fix the bug with saber collision after you die when your saber was knocked away.

In g_combat.c, function player_die
Find:
Code:
	self->client->ps.saberEntityNum = self->client->saberStoredIndex; //in case we died while our saber was knocked away.
After, add:
Code:
	if (self->client->ps.weapon == WP_SABER && self->client->saberKnockedTime)
	{
		gentity_t *saberEnt = &g_entities[self->client->ps.saberEntityNum];
		//G_Printf("DEBUG: Running saber cleanup for %s\n", self->client->pers.netname);
		self->client->saberKnockedTime = 0;
		saberReactivate(saberEnt, self);
		saberEnt->r.contents = CONTENTS_LIGHTSABER;
		saberEnt->think = saberBackToOwner;
		saberEnt->nextthink = level.time;
		G_RunObject(saberEnt);
	}

=X=Master HeX is offline   you may: quote & reply,
Old 09-07-2006, 04:01 PM   #118
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
nice find

btw, don't forget to extern saberReactivate and saberBackToOwner above player_die.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 09-07-2006, 04:41 PM   #119
stubert
 
Join Date: Aug 2002
Location: Philadelphia
Posts: 227
i'd say leave the changes that raven made to speed + rage intact... it would way unbalance darkside =S
stubert is offline   you may: quote & reply,
Old 09-07-2006, 05:15 PM   #120
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
well if someone chooses to add it they can make a toggle then like hex and i have. :nervou


iojamp project lead / coder
ensiform 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 > Q3 Engine Game Bugs / JA bugs

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 11:13 AM.

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