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

BattleJS Crashes the server sometimes #87

Open
alexmckenley opened this issue Mar 21, 2014 · 1 comment
Open

BattleJS Crashes the server sometimes #87

alexmckenley opened this issue Mar 21, 2014 · 1 comment

Comments

@alexmckenley
Copy link
Member

This is the line BattleJS always crashes on:

/home/ubuntu/git/battlejs/app/sockets.js:166
      if (thisGame && socket.id === thisGame.players[0].socketID) { 

winner: null }
debug: websocket writing 5:::{"name":"startGame","args":[{"name":"Reverse String","functionName":"reverseString","boilerplate":"var reverseString = function (string) {\n return string;\n};"}]}
debug: websocket writing 5:::{"name":"startGame","args":[{"name":"Reverse String","functionName":"reverseString","boilerplate":"var reverseString = function (string) {\n return string;\n};"}]}
debug: websocket writing 5:::{"name":"receivedAvailableGames","args":[[["NZWe",0,1,"greg"],["SBYG",1,0,"butt snacks"],["HNt6",0,1,"more"],["Xyf5",2,0,"Ray"]]]}
debug: websocket writing 5:::{"name":"receivedAvailableGames","args":[[["NZWe",0,1,"greg"],["SBYG",1,0,"butt snacks"],["HNt6",0,1,"more"],["Xyf5",2,0,"Ray"]]]}
debug: websocket writing 5:::{"name":"receivedAvailableGames","args":[[["NZWe",0,1,"greg"],["SBYG",1,0,"butt snacks"],["HNt6",0,1,"more"],["Xyf5",2,0,"Ray"]]]}
debug: websocket writing 5:::{"name":"receivedAvailableGames","args":[[["NZWe",0,1,"greg"],["SBYG",1,0,"butt snacks"],["HNt6",0,1,"more"],["Xyf5",2,0,"Ray"]]]}
debug: websocket writing 5:::{"name":"receivedAvailableGames","args":[[["NZWe",0,1,"greg"],["SBYG",1,0,"butt snacks"],["HNt6",0,1,"more"],["Xyf5",2,0,"Ray"]]]}

/home/ubuntu/git/battlejs/app/sockets.js:166
if (thisGame && socket.id === thisGame.players[0].socketID) {
^
TypeError: Cannot read property 'socketID' of undefined
at Socket. (/home/ubuntu/git/battlejs/app/sockets.js:166:56)
at Socket.EventEmitter.emit as $emit
at SocketNamespace.handlePacket (/home/ubuntu/git/battlejs/node_modules/socket.io/lib/namespace.js:335:22)
at Manager.onClientMessage (/home/ubuntu/git/battlejs/node_modules/socket.io/lib/manager.js:488:38)
at WebSocket.Transport.onMessage (/home/ubuntu/git/battlejs/node_modules/socket.io/lib/transport.js:387:20)
at Parser. (/home/ubuntu/git/battlejs/node_modules/socket.io/lib/transports/websocket/hybi-16.js:39:10)
at Parser.EventEmitter.emit (events.js:95:17)
at finish (/home/ubuntu/git/battlejs/node_modules/socket.io/lib/transports/websocket/hybi-16.js:288:16)
at Parser.expectHandler (/home/ubuntu/git/battlejs/node_modules/socket.io/lib/transports/websocket/hybi-16.js:299:15)
at Parser.add (/home/ubuntu/git/battlejs/node_modules/socket.io/lib/transports/websocket/hybi-16.js:466:24)
5 Mar 01:55:15 - [nodemon] app crashed - waiting for file changes before starting...

@alexmckenley
Copy link
Member Author

Still crashing:

debug: websocket writing 5:::{"name":"receivedAvailableGames","args":[[["ftTb",0,1,"hoop"],["UM6y",1,1,null],["LlgM",1,0,""]]]}
debug: websocket writing 5:::{"name":"receivedAvailableGames","args":[[["ftTb",0,1,"hoop"],["UM6y",1,1,null],["LlgM",1,0,""]]]}

/home/ubuntu/git/battlejs/app/sockets/in_game_logic/update.js:20
    } else if (socket.id === thisGame.players[1].socketID) {
                                                ^
TypeError: Cannot read property 'socketID' of undefined
    at Socket.<anonymous> (/home/ubuntu/git/battlejs/app/sockets/in_game_logic/update.js:20:49)
    at Socket.EventEmitter.emit [as $emit] (events.js:95:17)
    at SocketNamespace.handlePacket (/home/ubuntu/git/battlejs/node_modules/socket.io/lib/namespace.js:335:22)
    at Manager.onClientMessage (/home/ubuntu/git/battlejs/node_modules/socket.io/lib/manager.js:488:38)
    at WebSocket.Transport.onMessage (/home/ubuntu/git/battlejs/node_modules/socket.io/lib/transport.js:387:20)
    at Parser.<anonymous> (/home/ubuntu/git/battlejs/node_modules/socket.io/lib/transports/websocket/hybi-16.js:39:10)
    at Parser.EventEmitter.emit (events.js:95:17)
    at finish (/home/ubuntu/git/battlejs/node_modules/socket.io/lib/transports/websocket/hybi-16.js:288:16)
    at Parser.expectHandler (/home/ubuntu/git/battlejs/node_modules/socket.io/lib/transports/websocket/hybi-16.js:299:15)
    at Parser.add (/home/ubuntu/git/battlejs/node_modules/socket.io/lib/transports/websocket/hybi-16.js:466:24)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant