<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[requestJoin called twice]]></title><description><![CDATA[<p>Hi,</p>
<p>I was testing the example <code>04-create-or-join-room</code> from <code>colyseus-examples</code>. I added some <code>console.log</code>s around and I noticed that <code>requestJoin</code> is not behaving as I would expect.</p>
<p>Always referring to that example, if I ask to create one room from client <code>client.join('create_or_join', { create: true })</code>, I see one <code>requestJoin</code>, with <code>option.create</code> and <code>isNewRoom</code> both set to <code>true</code>. So far so good. Then using another client (or browser tab, the outcome is the same in both cases), I ask to join <code>client.join('create_or_join')</code>. I see that <code>requestJoin</code> is called twice for the same <code>roomId</code> (I assume that means the same <code>CreateOrJoinRoom</code> instance), both times with <code>option.create</code> set to <code>undefined</code>, as expected, and with <code>isNewRoom</code> set to <code>false</code>. Then I see one <code>onJoin</code> event associated to that <code>roomId</code>. colyseus/monitor lists one room with two clients connected.</p>
<p>The question is: why is <code>requestJoin</code> called twice? The first (and only one) instance is never being locked and <code>maxClient</code> is set to <code>4</code>. Funny thing, both <code>requestJoin</code>s return <code>true</code>.</p>
<p>I'm not sure I fully understood rooms and their interactions with clients, but I really want to make sure this is not a colyseus issue that might influence other parts of the code.</p>
]]></description><link>http://discuss.colyseus.io/topic/107/requestjoin-called-twice</link><generator>RSS for Node</generator><lastBuildDate>Tue, 12 May 2026 21:12:17 GMT</lastBuildDate><atom:link href="http://discuss.colyseus.io/topic/107.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 24 Jun 2018 09:57:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to requestJoin called twice on Invalid Date]]></title><description><![CDATA[<p>Hi,</p>
<p>I was testing the example <code>04-create-or-join-room</code> from <code>colyseus-examples</code>. I added some <code>console.log</code>s around and I noticed that <code>requestJoin</code> is not behaving as I would expect.</p>
<p>Always referring to that example, if I ask to create one room from client <code>client.join('create_or_join', { create: true })</code>, I see one <code>requestJoin</code>, with <code>option.create</code> and <code>isNewRoom</code> both set to <code>true</code>. So far so good. Then using another client (or browser tab, the outcome is the same in both cases), I ask to join <code>client.join('create_or_join')</code>. I see that <code>requestJoin</code> is called twice for the same <code>roomId</code> (I assume that means the same <code>CreateOrJoinRoom</code> instance), both times with <code>option.create</code> set to <code>undefined</code>, as expected, and with <code>isNewRoom</code> set to <code>false</code>. Then I see one <code>onJoin</code> event associated to that <code>roomId</code>. colyseus/monitor lists one room with two clients connected.</p>
<p>The question is: why is <code>requestJoin</code> called twice? The first (and only one) instance is never being locked and <code>maxClient</code> is set to <code>4</code>. Funny thing, both <code>requestJoin</code>s return <code>true</code>.</p>
<p>I'm not sure I fully understood rooms and their interactions with clients, but I really want to make sure this is not a colyseus issue that might influence other parts of the code.</p>
]]></description><link>http://discuss.colyseus.io/post/353</link><guid isPermaLink="true">http://discuss.colyseus.io/post/353</guid><dc:creator><![CDATA[OrangeNote]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to requestJoin called twice on Invalid Date]]></title><description><![CDATA[<p>Hi <a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/106">@orangenote</a>,</p>
<p>I've recorded a video using the example you mentioned and it seems to be working as expected:</p>
<p><div class="video-embed"><iframe src="//www.youtube.com/embed/BwMkGGv1z5o" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div></p>
<p>One caveat, though, is when you're testing using multiple tabs, you'd need to wait for the join room request to complete before requesting another one (you can see I'm waiting for the logs to appear during the video). This is a current limitation when reserving room seats for clients with the same id (<a href="https://github.com/gamestdio/colyseus/issues/151" rel="nofollow">see GitHub issue</a>)</p>
]]></description><link>http://discuss.colyseus.io/post/354</link><guid isPermaLink="true">http://discuss.colyseus.io/post/354</guid><dc:creator><![CDATA[endel]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to requestJoin called twice on Invalid Date]]></title><description><![CDATA[<p>Thanks for the quick response and for the heads up about the join issue.</p>
<p>But unfortunately that didn't answer my question. I'll explain my situation more clearly.</p>
<p>I have added one <code>console.log</code> line to <code>CreateOrJoinRoom.requestJoin</code> method:</p>
<pre><code>requestJoin (options, isNewRoom: boolean) {
  console.log(`roomId: ${this.roomId}, create: ${options.create}, isNewRoom: ${isNewRoom}`);
  return (options.create)
    ? (options.create &amp;&amp; isNewRoom)
    : this.clients.length &gt; 0;
}
</code></pre>
<p>Then went to <code>http://localhost:2567/04-create-or-join-room.html</code> and pressed <code>Create</code> once, then <code>Join</code> once.</p>
<p>This is what I got in the server console:</p>
<pre><code>Listening on http://localhost:2567
JOINING ROOM
roomId: BJl3OCrCWX, create: true, isNewRoom: true
CREATING NEW ROOM
roomId: BJl3OCrCWX, create: undefined, isNewRoom: false --
roomId: BJl3OCrCWX, create: undefined, isNewRoom: false -- why is requestJoin called twice?
CREATING NEW ROOM
</code></pre>
]]></description><link>http://discuss.colyseus.io/post/356</link><guid isPermaLink="true">http://discuss.colyseus.io/post/356</guid><dc:creator><![CDATA[OrangeNote]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to requestJoin called twice on Invalid Date]]></title><description><![CDATA[<p>Hi <a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/1">@endel</a><br />
In the video, you explain about create and join rooms.<br />
Can I get your source code about create and join rooms in the video? Because 04-create-or-join-room.html file is no longer available on your github (colyseus-examples).</p>
<p>I want to create a new room, but I'm a little confused by the workings of the create room, whether the room name or id can be changed according to the user input or not.</p>
<p><img src="/assets/uploads/files/1587461601250-createroom.png" alt="0_1587461601204_createroom.PNG" class="img-responsive img-markdown" /><br />
For example, if a user enters &quot;myroom&quot; in the input text, then a new room with the name &quot;myroom&quot; will automatically be created in the server.<br />
And if user B is entered &quot;myroom&quot; in the input text, then the user B will automatically join the existing room.</p>
<p>Sorry for my bad English. Thank you.</p>
]]></description><link>http://discuss.colyseus.io/post/1173</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1173</guid><dc:creator><![CDATA[defort]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to requestJoin called twice on Invalid Date]]></title><description><![CDATA[<p>Hi <a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/662">@defort</a>, welcome! I think you're probably looking for this: <a href="https://discuss.colyseus.io/topic/345/is-it-possible-to-run-joinorcreatebyid" rel="nofollow">https://discuss.colyseus.io/topic/345/is-it-possible-to-run-joinorcreatebyid</a></p>
<p>There no such thing as creating an identifier for a room by the client, what you can play with are the filters of the defined rooms.</p>
]]></description><link>http://discuss.colyseus.io/post/1174</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1174</guid><dc:creator><![CDATA[endel]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to requestJoin called twice on Invalid Date]]></title><description><![CDATA[<p>Cool. It really works!<br />
<img src="/assets/uploads/files/1587533898584-colyseuscreateroom-resized.png" alt="0_1587533899042_colyseuscreateroom.PNG" class="img-responsive img-markdown" /><br />
Thanks for your help <a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/1">@endel</a></p>
]]></description><link>http://discuss.colyseus.io/post/1175</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1175</guid><dc:creator><![CDATA[defort]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>