ReferenceError: io is not defined
at disconnect (C:/Users/Simon Kyger/Desktop/zealotry/server/routes/sockets/v1/index.js:43:9)
at Socket. (C:/Users/Simon Kyger/Desktop/zealotry/server/routes/sockets/v1/index.js:28:36)
at Socket.emit (events.js:159:13)
at Socket.emit (C:\Users\Simon Kyger\Desktop\zealotry\node_modules\socket.io\lib\socket.js:140:10)
at Socket.onclose (C:\Users\Simon Kyger\Desktop\zealotry\node_modules\socket.io\lib\socket.js:452:8)
at Client.onclose (C:\Users\Simon Kyger\Desktop\zealotry\node_modules\socket.io\lib\client.js:233:24)
at Socket.emit (events.js:164:20)
at Socket.onClose (C:\Users\Simon Kyger\Desktop\zealotry\node_modules\engine.io\lib\socket.js:318:10)
at Object.onceWrapper (events.js:254:19)
at WebSocket.emit (events.js:159:13)
at WebSocket.Transport.onClose (C:\Users\Simon Kyger\Desktop\zealotry\node_modules\engine.io\lib\transport.js:127:8)
at WebSocket.internalOnClose (C:\Users\Simon Kyger\Desktop\zealotry\node_modules\uws\uws.js:199:17)
at process.nextTick (C:\Users\Simon Kyger\Desktop\zealotry\node_modules\uws\uws.js:445:27)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
[nodemon] app crashed - waiting for file changes before starting...
after your refactoring of a ton of code, i gave the server/client a quick testrun.
login to the game to launch the overworld.js client, and refresh window on this screen, server crashes with this stack trace:
C:\Users\Simon Kyger\Desktop\zealotry\server\routes\sockets\v1\index.js:69 io.sockets.emit('removeplayer', player); ^
ReferenceError: io is not defined at disconnect (C:/Users/Simon Kyger/Desktop/zealotry/server/routes/sockets/v1/index.js:43:9) at Socket. (C:/Users/Simon Kyger/Desktop/zealotry/server/routes/sockets/v1/index.js:28:36)
at Socket.emit (events.js:159:13)
at Socket.emit (C:\Users\Simon Kyger\Desktop\zealotry\node_modules\socket.io\lib\socket.js:140:10)
at Socket.onclose (C:\Users\Simon Kyger\Desktop\zealotry\node_modules\socket.io\lib\socket.js:452:8)
at Client.onclose (C:\Users\Simon Kyger\Desktop\zealotry\node_modules\socket.io\lib\client.js:233:24)
at Socket.emit (events.js:164:20)
at Socket.onClose (C:\Users\Simon Kyger\Desktop\zealotry\node_modules\engine.io\lib\socket.js:318:10)
at Object.onceWrapper (events.js:254:19)
at WebSocket.emit (events.js:159:13)
at WebSocket.Transport.onClose (C:\Users\Simon Kyger\Desktop\zealotry\node_modules\engine.io\lib\transport.js:127:8)
at WebSocket.internalOnClose (C:\Users\Simon Kyger\Desktop\zealotry\node_modules\uws\uws.js:199:17)
at process.nextTick (C:\Users\Simon Kyger\Desktop\zealotry\node_modules\uws\uws.js:445:27)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
[nodemon] app crashed - waiting for file changes before starting...