Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash after restarting while people are playing #7

Open
alentoghostflame opened this issue Nov 14, 2016 · 0 comments
Open

Crash after restarting while people are playing #7

alentoghostflame opened this issue Nov 14, 2016 · 0 comments

Comments

@alentoghostflame
Copy link

alentoghostflame commented Nov 14, 2016

Expected Behavior

When I turn off the server while people are playing, then turn it back on, things should run back to normal.

Current Behavior

Sometimes crashes when starting up when you already have people attempting to connect.

Steps to Reproduce (for bugs)

  1. Start up server initially
  2. Have people connect and play on it
  3. Turn off server while people are connected and playing
  4. Turn server back on.

Your Environment

Chrome Version: 53.0.2785.144, node.js 7.0

The error I came across goes:

Express server listening on port 3000 in development mode
/home/alento/snakegame/app/services/game-controls-service.js:42
const validNextDirections = this.getValidNextMove(player.directionBeforeMove);
^

TypeError: Cannot read property 'directionBeforeMove' of undefined
at Function.handleKeyDown (/home/alento/snakegame/app/services/game-controls-service.js:42:65)
at GameController._keyDown (/home/alento/snakegame/app/controllers/game-controller.js:146:29)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Socket.onevent (/home/alento/snakegame/node_modules/socket.io/lib/socket.js:348:8)
at Socket.onpacket (/home/alento/snakegame/node_modules/socket.io/lib/socket.js:308:12)
at /home/alento/snakegame/node_modules/socket.io/lib/client.js:195:16
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)

Note that playing normally works completely fine from what I can see, it's only when I'm restarting while people are playing that this occurs.

@alentoghostflame alentoghostflame changed the title Crash after restarting Crash after restarting while people are playing Nov 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants