• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code Webadmin on scoreboard bug

FluX

Grizzled Veteran
Oct 26, 2010
5,378
234
www.fluxiserver.co.uk
The title says it all. I have all of a sudden got this bug where the webadmin replaces a player on the scoreboard. Where am I supposed to be looking? There has been absolutely no changes to my scoreboard but I have changed so much code on my mod that I can't pinpoint anything down (was testing through solo so it never showed).


Picture: http://steamcommunity.com/sharedfiles/filedetails/?id=275414626
 
This bug is very wierd, most cases I've seen it happen is odd cases, most things are directly in the scorboard or in the case of Marco Versus mod, happens from the playercontroller with a function being replicated and then edited in a state

Can you remember exactly what function this is? I have not touched my scoreboard at all, which is why I am so confused about this. Also, can it be anywhere else?

P.S. My custom replication is now extending KF_StoryPRI. I have only just noticed this is connected to the controller class. I believe this could be it. If this is the problem, how can I work around it? I'm just trying to make sure I am making things compatible with story mode (requested by the others on my server).

Isn't this the same bug with objective mode?
Yes, this is/was in objective mode too. I have this in a normal gametype (remember, my server is fully customised).
 
Last edited:
Upvote 0
The bug is somewhere inside UpdateScoreBoard(). I don't remember where exactly. IIRC bOnlySpectator check was missing somewhere.

Usually webadmin is the last in PRIArray and is ignored. In the patch, where Objective Mode was introduced, something went wrong, and webadmin now can be in the middle of the PRIArray.
 
Upvote 0
The bug is somewhere inside UpdateScoreBoard(). I don't remember where exactly. IIRC bOnlySpectator check was missing somewhere.

Usually webadmin is the last in PRIArray and is ignored. In the patch, where Objective Mode was introduced, something went wrong, and webadmin now can be in the middle of the PRIArray.

Understandable but my scoreboard has had nothing changed to it at all. This is the confusion I am having.
 
Upvote 0
Happens because of WebAdmin using PlayerReplicationInfo instead of KFPlayerReplicationInfo.
Problem is in KFScoreboard.uc:
Code:
simulated function bool InOrder( PlayerReplicationInfo P1, PlayerReplicationInfo P2 )
{
	local KFPlayerReplicationInfo P11,P22;

	P11 = KFPlayerReplicationInfo(P1);
	P22 = KFPlayerReplicationInfo(P2);

	if( P11==None || P22==None )
		return true;
	if( P1.bOnlySpectator )
	{
		if( P2.bOnlySpectator )
			return true;
		else return false;
	}
	else if ( P2.bOnlySpectator )
		return true;

	if( P11.Kills < P22.Kills )
		return false;
	else if( P11.Kills==P22.Kills )
	{
		// Kills is equal, go for assists.
		if( P11.KillAssists < P22.KillAssists )
		{
			return false;
		}
        else if( P11.KillAssists==P22.KillAssists )
		{
			if( P11.Score < P22.Score )
			{
                return false;
            }
            else if( P11.Score == P22.Score)
            {
               return (P1.PlayerName<P2.PlayerName); // Go for name.
            }
        }
	}
	return true;
}
It doesn't properly sort back non KFPRI's.
 
Upvote 0
Happens because of WebAdmin using PlayerReplicationInfo instead of KFPlayerReplicationInfo.
Problem is in KFScoreboard.uc:
It doesn't properly sort back non KFPRI's.

Why in the world is that if( P1.bOnlySpectator ) and P2.bOnlySpectator under if( P11==None || P22==None ) that would mean if the PRI is PlayerReplicationInfo then P1.bOnlySpectator and P2.bOnlySpectator will be skipped cause it's not a KFPlayerReplicationInfo
 
Upvote 0