Luka967 / OgarII

FOSS implementation of a private Agar.io gameserver, made with Node.js.
Other
66 stars 38 forks source link

Consistent Server Crash #52

Closed ghost closed 4 years ago

ghost commented 4 years ago

Error message:

@ 2019-12-04 19:18:46.811 [FATAL] TypeError: Cannot read property 'id' of undefined at getLeaderboardData (/root/server/src/gamemodes/FFA.js:13:38) at leaderboard.map (/root/server/src/gamemodes/FFA.js:64:48) at Array.map (<anonymous>) at FFA.sendLeaderboard (/root/server/src/gamemodes/FFA.js:64:34) at Connection.update (/root/server/src/sockets/Connection.js:148:34) at Listener.update (/root/server/src/sockets/Listener.js:125:49) at ServerHandle.onTick (/root/server/src/ServerHandle.js:169:23) at Ticker._tick (/root/server/src/primitives/Ticker.js:43:30) at ontimeout (timers.js:482:11)

ghost commented 4 years ago

I have identified the cause of crash: players connecting and disconnecting. I suggest this to be labelled as high priority.

ghost commented 4 years ago

Make a PR and fix it yourself, takes 2 seconds. Stop complaining about an inactive project. Considering I use OgarII in production and have been for 6 months, it’s stable with a few minor changes. If you can’t fix it because you have no basic understanding of JavaScript, you shouldn’t be using an experimental software.

Your response was not helpful. Why not help fix the problem if it takes 2 seconds? Think before you speak. Your hostility and condescending behaviour isn't welcome. I will not fuel drama within this project.

Humble yourself.

AlexHGaming commented 4 years ago

If you can’t fix it because you have no basic understanding of JavaScript

Yeah, because fixing an ID issue within a project that you haven't developed on is really basic.

AlexHGaming commented 4 years ago

It may be simple for YOU, but you mentioned basic javascript. There is nothing basic about that lol, I wouldn't expect a near new programmer to fix that issue, possibly at all.

ghost commented 4 years ago

Should be fine now.

Thank you! I will try this.

ghost commented 4 years ago

Did some tests and the crash is still there.

ghost commented 4 years ago

Thanks @wunzer0, didn’t test it myself but it theoretically should’ve worked. Can you share the error message and stacktrace?

The error message looks similar but it's not identical. Here it is:

@ 2019-12-15 21:45:55.903 [FATAL] TypeError: Cannot read property 'id' of undefined at getLeaderboardData (/root/server/src/gamemodes/FFA.js:13:38) at leaderboard.map (/root/server/src/gamemodes/FFA.js:65:48) at Array.map (<anonymous>) at FFA.sendLeaderboard (/root/server/src/gamemodes/FFA.js:65:34) at Connection.update (/root/server/src/sockets/Connection.js:148:34) at Listener.update (/root/server/src/sockets/Listener.js:125:49) at ServerHandle.onTick (/root/server/src/ServerHandle.js:169:23) at Ticker._tick (/root/server/src/primitives/Ticker.js:43:30) at ontimeout (timers.js:482:11) at tryOnTimeout (timers.js:317:5)

retroscepter commented 4 years ago

Okay, seems like Gamemode.compileLeaderboard isn’t always called before Gamemode.sendLeaderboard. I have a hacky fix for this.

retroscepter commented 4 years ago

@wunzer0 Try this.

ghost commented 4 years ago

@wunzer0 Try this.

Done. Let's see how it goes.

retroscepter commented 4 years ago

Done. Let's see how it goes.

I'll assume it's working @wunzer0?

ghost commented 4 years ago

Done. Let's see how it goes.

I'll assume it's working @wunzer0?

Yes, I haven't got any more crashes. Thank you!

josefredohd commented 1 year ago

How did you solve this? Do not really understand