ai-economy-simulator / ecosim-client

https://ecosim-client-fliptrails-projects.vercel.app
Apache License 2.0
1 stars 10 forks source link

Implement error handling with game room is full or does not exist #10

Open fliptrail opened 10 months ago

fliptrail commented 10 months ago

Right now we are not handling errors when a client attempts to connect to a game room which does not exist or has reached the max limit of 8. Proper toasts should be shown in such cases. Referring to Colyseus documentation might help.

Nikhil-IITG commented 9 months ago

@fliptrail I can try to solve this issue, can you please assign this to me

fliptrail commented 9 months ago

@Nikhil-IITG are you still working on it?

fliptrail commented 9 months ago

I'll assume you are no longer working on it and open it for someone else.

Nikhil-IITG commented 9 months ago

Sorry for not responding, suddenly I got some important stuff to do. Will be free from tomorrow. I still wanna try but can't do today.

fliptrail commented 9 months ago

I'll assign it back to you in case. Hope you're well! Just let me know.

maadi7 commented 9 months ago

@fliptrail hii, I would like to work on this issue if its still open.

fliptrail commented 9 months ago

@maadi7 I've assigned it to you.

maadi7 commented 9 months ago

@fliptrail hii, I have been working on this, but the issue is that setGameContext is not updating the gameContext when a new room is created. is this an issue too?? or am I missing something??

snippet=> Capture2

result=> Capture

fliptrail commented 9 months ago

@maadi7 Check these to understand how states work in React:

  1. https://legacy.reactjs.org/docs/faq-state.html#why-is-setstate-giving-me-the-wrong-value
  2. https://stackoverflow.com/questions/36085726/why-is-setstate-in-reactjs-async-instead-of-sync
  3. https://javascript.plainenglish.io/why-is-setstate-asynchronous-in-react-63827033ff45
Bikram-ghuku commented 8 months ago

Can I work on this issue? Please assign me

fliptrail commented 8 months ago

I've assigned it to you @Bikram-ghuku.