mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 21:01:04 +00:00
Add a short comment to explain the newplayernum hack
This commit is contained in:
parent
67aba2648c
commit
c8e9e779e7
1 changed files with 50 additions and 1 deletions
|
@ -3121,8 +3121,57 @@ static boolean SV_AddWaitingPlayers(void)
|
||||||
newplayer = true;
|
newplayer = true;
|
||||||
|
|
||||||
if (netgame)
|
if (netgame)
|
||||||
|
// !!!!!!!!! EXTREMELY SUPER MEGA GIGA ULTRA ULTIMATELY TERRIBLY IMPORTANT !!!!!!!!!
|
||||||
|
//
|
||||||
|
// The line just after that comment is an awful, horrible, terrible, TERRIBLE hack.
|
||||||
|
//
|
||||||
|
// Basically, the fix I did in order to fix the download freezes happens
|
||||||
|
// to cause situations in which a player number does not match
|
||||||
|
// the node number associated to that player.
|
||||||
|
// That is totally normal, there is absolutely *nothing* wrong with that.
|
||||||
|
// Really. Player 7 being tied to node 29, for instance, is totally fine.
|
||||||
|
//
|
||||||
|
// HOWEVER. A few (broken) parts of the netcode do the TERRIBLE mistake
|
||||||
|
// of mixing up the concepts of node and player, resulting in
|
||||||
|
// incorrect handling of cases where a player is tied to a node that has
|
||||||
|
// a different number (which is a totally normal case, or at least should be).
|
||||||
|
// This incorrect handling can go as far as literally
|
||||||
|
// anyone from joining your server at all, forever.
|
||||||
|
//
|
||||||
|
// Given those two facts, there are two options available
|
||||||
|
// in order to let this download freeze fix be:
|
||||||
|
// 1) Fix the broken parts that assume a node is a player or similar bullshit.
|
||||||
|
// 2) Change the part this comment is located at, so that any player who joins
|
||||||
|
// is given the same number as their associated node.
|
||||||
|
//
|
||||||
|
// No need to say, 1) is by far the obvious best, whereas 2) is a terrible hack.
|
||||||
|
// Unfortunately, after trying 1), I most likely didn't manage to find all
|
||||||
|
// of those broken parts, and thus 2) has become the only safe option that remains.
|
||||||
|
//
|
||||||
|
// So I did this hack.
|
||||||
|
//
|
||||||
|
// If it isn't clear enough, in order to get rid of this ugly hack,
|
||||||
|
// you will have to fix all parts of the netcode that
|
||||||
|
// make a confusion between nodes and players.
|
||||||
|
//
|
||||||
|
// And if it STILL isn't clear enough, a node and a player
|
||||||
|
// is NOT the same thing. Never. NEVER. *NEVER*.
|
||||||
|
//
|
||||||
|
// And if someday you make the terrible mistake of
|
||||||
|
// daring to have the unforgivable idea to try thinking
|
||||||
|
// that a node might possibly be the same as a player,
|
||||||
|
// or that a player should have the same number as its node,
|
||||||
|
// be sure that I will somehow know about it and
|
||||||
|
// hunt you down tirelessly and make you regret it,
|
||||||
|
// even if you live on the other side of the world.
|
||||||
|
//
|
||||||
|
// TODO: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||||
|
// \todo >>>>>>>>>> Remove this horrible hack as soon as possible <<<<<<<<<<
|
||||||
|
// TODO: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
//
|
||||||
|
// !!!!!!!!! EXTREMELY SUPER MEGA GIGA ULTRA ULTIMATELY TERRIBLY IMPORTANT !!!!!!!!!
|
||||||
newplayernum = node; // OMFG SAY WELCOME TO TEH NEW HACK FOR FIX FIL DOWNLOAD!!1!
|
newplayernum = node; // OMFG SAY WELCOME TO TEH NEW HACK FOR FIX FIL DOWNLOAD!!1!
|
||||||
else
|
else // Don't use the hack if we don't have to
|
||||||
// search for a free playernum
|
// search for a free playernum
|
||||||
// we can't use playeringame since it is not updated here
|
// we can't use playeringame since it is not updated here
|
||||||
for (; newplayernum < MAXPLAYERS; newplayernum++)
|
for (; newplayernum < MAXPLAYERS; newplayernum++)
|
||||||
|
|
Loading…
Reference in a new issue