wxyz-abcd/node-haxball

Error in playerObject

Closed this issue · 1 comments

Sometimes when a player join the room who you're not the host, a error occur in playerObjectCreated event. This cause a loop and create more than one playerObject for one player.

It's not a bug, but a feature. This callback will run for each player object just once. If you just joined the room, there are more than one player inside. It runs once for each one of them. Note that onPlayerJoin does not work like this, that's why I created this callback so that we can now define custom variables inside all player objects by just writing it here once. Of course it's not as simple as that, but you get the idea.