design1online / WTF-Adventure

WTF?! Adventure is a massively online 2D MMORPG with WTF?! twists.
https://design1online.github.io/WTF-Adventure/
Other
96 stars 37 forks source link

could not connect to game server #72

Closed thenewsupercell closed 11 months ago

thenewsupercell commented 3 years ago

no errors on client or server, when i go on localhost:3000 all buttons are dimmed. when i click on them they say "could not connect to game server" even though there were no errors.

thenewsupercell commented 3 years ago

now when i check the console it says that the ws connection to localhost:8081 has failed. 2 errors in console:

WebSocket connection to 'ws://localhost:8081/socket.io/?EIO=3&transport=websocket' failed: ./node_modules/engine.io-client/lib/transports/websocket.js.WS.doOpen @ websocket.js:124 ./node_modules/engine.io-client/lib/transport.js.Transport.open @ transport.js:84 ./node_modules/engine.io-client/lib/socket.js.Socket.open @ socket.js:250 Socket @ socket.js:122 Socket @ socket.js:28 ./node_modules/socket.io-client/lib/manager.js.Manager.open.Manager.connect @ manager.js:226 Manager @ manager.js:69 Manager @ manager.js:37 lookup @ index.js:56 connect @ socket.js:29 (anonymous) @ game.js:438

2nd one: log.js:230 Error: websocket error at WS../node_modules/engine.io-client/lib/transport.js.Transport.onError (transport.js:68) at WebSocket.ws.onerror (websocket.js:163) [] error @ log.js:230 (anonymous) @ socket.js:40 ./node_modules/socket.io-client/node_modules/component-emitter/index.js.Emitter.emit @ index.js:145 ./node_modules/socket.io-client/lib/socket.js.Socket.emit @ socket.js:138 ./node_modules/socket.io-client/lib/manager.js.Manager.emitAll @ manager.js:82 (anonymous) @ manager.js:243 ./node_modules/engine.io-client/node_modules/component-emitter/index.js.Emitter.emit @ index.js:145 ./node_modules/engine.io-client/lib/socket.js.Socket.onError @ socket.js:690 (anonymous) @ socket.js:281 ./node_modules/engine.io-client/node_modules/component-emitter/index.js.Emitter.emit @ index.js:145 ./node_modules/engine.io-client/lib/transport.js.Transport.onError @ transport.js:71 ws.onerror @ websocket.js:163 error (async) ./node_modules/engine.io-client/lib/transports/websocket.js.WS.addEventListeners @ websocket.js:162 ./node_modules/engine.io-client/lib/transports/websocket.js.WS.doOpen @ websocket.js:141 ./node_modules/engine.io-client/lib/transport.js.Transport.open @ transport.js:84 ./node_modules/engine.io-client/lib/socket.js.Socket.open @ socket.js:250 Socket @ socket.js:122 Socket @ socket.js:28 ./node_modules/socket.io-client/lib/manager.js.Manager.open.Manager.connect @ manager.js:226 Manager @ manager.js:69 Manager @ manager.js:37 lookup @ index.js:56 connect @ socket.js:29 (anonymous) @ game.js:438 setTimeout (async) connect @ game.js:437 login @ app.js:349 (anonymous) @ app.js:262 dispatch @ event.js:357 elemData.handle @ event.js:161

jcboysha commented 3 years ago

I am having the same problem, but none of the same errors...

leonardo3dp commented 2 years ago

same here

rcgit commented 2 years ago

Same. Anyone got a solution?

design1online commented 2 years ago

Make sure the server and mysql are both running. To start mysql you can use npm run mysql-start and then to run the server use npm run wtfserver.

leonardo3dp commented 2 years ago

everything is running it just fails to connect to the websocket I will test again

leonardo3dp commented 2 years ago

image image image

leonardo3dp commented 2 years ago

image

design1online commented 2 years ago

@leonardo3dp are you getting any errors in your browser console? This is fired on src/client/js/network/socket.js line 43. If you look a few lines above that, it should be writing the error to your browser console.

Also, do you get this only when you try to login? If so, try the Guest Login button and see if that lets you in.

leonardo3dp commented 2 years ago

Error appears when trying to login as guest or create account ttt

design1online commented 11 months ago

All packages and dependencies have been updated to fix these problems.