wxyz-abcd / node-haxball

The most powerful and lightweight API that allows you to develop your original Haxball(www.haxball.com) host, client, and standalone applications both on node.js and browser environments and also includes every possible hack and functionality that you can imagine.
MIT License
34 stars 13 forks source link

error while joining rooms simultenously #9

Closed 0x00214131812049 closed 1 year ago

0x00214131812049 commented 1 year ago

https://github.com/wxyz-abcd/node-haxball/blob/a175ec7f6ba0ca98fe44e48ee259d3a8d76bf9bb/src/index.js#L6031 TypeError: Cannot read properties of undefined (reading 'appendChild')

When i tried joinNRandomRooms.js, got this error. Also, it triggers at start of script immediately

wxyz-abcd commented 1 year ago

We have to wait for "ready" event before we can join a room:

_haxBall.on("ready", () => { _haxBall.joinRoom({ ... }); });

Changed JoinNRooms example code accordingly.