question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create a room asynchronously

See original GitHub issue

colyseus-issue.zip

As explain on the Discord, there is an issue when a room is created asynchronously. The issue is that in the unity client, the function GetAvailableRooms() returns all the rooms but without metadatas nor any other param like maxClients. I link a .zip which contain a reproduction scenario. I tried with promises promise().then({ CreateRoom }), with async/await, and I also tried to set OnCreate async and the result is the same.

My aim was to load a configuration file before creating the room, and configure the room from the data loaded.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
endelcommented, Dec 5, 2020

Hi @Lucidarme,

I’ve checked your sources and the problems seems to be because maxClients is parsed as string when coming from the XML file. Whereas when you set it manually, it is a number.

If you use parseInt(res.room.maxClients || 6) it works. I think this is more of a type definition issue, as res.room.maxClients is interpreted as any

Perhaps we should throw an error if this.maxClients is anything other than Number

1reaction
Lucidarmecommented, Dec 6, 2020

Hi @endel

You are right, and it’s the same thing for publicName, I had to parse it to string to make it work. Yes an explicit error could be fine, it may save lot of time !

Thank you for your help !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Write asynchronous DAO queries
This restriction means that you must make your DAO queries asynchronous. The Room library includes integrations with several different ...
Read more >
android - Do Room queries happen asynchronously?
The only place where Room does asynchronous stuff is on @Query with a reactive return value (LiveData, Flowable, etc.). There could be issues ......
Read more >
Asynchronous queries in Android.
This tutorial is going to be on, how to retrieve a single row from a Room database . I am creating it out...
Read more >
44. The Room API asynchronously (AS 3.3) - YouTube
In this video we see how we can run the methods created in our DAO class in an AsyncTask. The Room API must...
Read more >
Learning Android's Room Database Made Easy | by Elye
Making it asynchronous. If you recall previously we have allowMainThreadQueries() , which is not ideal. Now just remove it as below. class ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found