]> git.cworth.org Git - empires-server/commit
Don't send a re-connecting player a player-enter event for themself
authorCarl Worth <cworth@cworth.org>
Sat, 27 Jun 2020 17:26:29 +0000 (10:26 -0700)
committerCarl Worth <cworth@cworth.org>
Sat, 27 Jun 2020 17:26:29 +0000 (10:26 -0700)
commitd7b96ee0316021fa7a5e428950e2d8a9d8754582
treeca08108253168df0355371b2e27df6c14eb95b82
parent64a0af1235ca767c27e7cbd1f5416c359f212278
Don't send a re-connecting player a player-enter event for themself

It's rather ugly that we've got these semantics where the client
doesn't want to see a player-enter event for itself. This is causing
too many special cases in the code (such as the current commit).

So we'll want to change that at some point. But for now we make the
case of a player reconnecting match the semantics. Specifically we
move the add_connection call down _after_ the broadcast of the
player-enter event. This fixes the current client so that it doesn't
display its own name twice when reclaiming a pre-existing player.
game.js