Hi
Got side-tracked into finding out why players can occur twice in the scoreboard. After having looked through the code I’ve found this in the G_SendScore function near the bottom of the function:
if(size + strlen(entry) > 1000) {
i--; // we need to redo this client in the next buffer (if we can)
break;
}
size += strlen(entry);
Q_strcat(buffer, 1024, entry);
if( ++count >= 32 ) {
i--; // we need to redo this client in the next buffer (if we can)
break;
}
The scores are sent in multiple packages if there are too many in one packet or if the buffer string is above 1024 chars.
From what I can understand of this code it breaks away properly when current entry is too big to fit within the buffer. However after that check it copies it. It then checks if the current entry would be number 32 or above. If thats the case it decreases i, so that the entry would be re-processed for the next packet. However it is already in the current packet.
My guess is that moving the count check so that you get this:
if(size + strlen(entry) > 1000) {
i--; // we need to redo this client in the next buffer (if we can)
break;
}
// CHRUKER: #060 - Trying to fix the duplicate names on the scoreboard
if( ++count >= 32 ) {
i--; // we need to redo this client in the next buffer (if we can)
break;
} // #060
size += strlen(entry);
Q_strcat(buffer, 1024, entry);
***** EDIT: This turned out to fix 50% of it. See the later post for the entire fix: http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&p=112871#112871 ******
could possibly solve it. However I have no way of testing this, since I got no hugely popular server nor bot support yet.
Any comments?

