<?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[Client left room before receiving session id]]></title><description><![CDATA[<p>Hi everyone,<br />
From time to time and very random I'm getting:<br />
colyseus.js: client left room before receiving session id.<br />
It's really weird, everything works 8 or even 9 of 10 times, and suddenly... crashes...</p>
<p>I'm assigning the game client into a global variable:<br />
<code>window.gameClient = new Colyseus.Client(location.protocol.replace('http', 'ws')+host+(location.port ? ':'+location.port : ''));</code></p>
<p>And then on document ready, when the user submit the form I try to join the first room:<br />
<code>window.gameClient = new Colyseus.Client(location.protocol.replace('http', 'ws')+host+(location.port ? ':'+location.port : ''));</code></p>
<p>You can see the code here:<br />
<a href="https://github.com/damian-pastorini/dwdgame/blob/dwdgame-master/client/client.js" rel="nofollow">https://github.com/damian-pastorini/dwdgame/blob/dwdgame-master/client/client.js</a></p>
<p>Any ideas why it could be happening?</p>
<p>Thanks!</p>
]]></description><link>http://discuss.colyseus.io/topic/163/client-left-room-before-receiving-session-id</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 13:03:15 GMT</lastBuildDate><atom:link href="http://discuss.colyseus.io/topic/163.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 19 Oct 2018 23:11:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Client left room before receiving session id on Invalid Date]]></title><description><![CDATA[<p>Hi everyone,<br />
From time to time and very random I'm getting:<br />
colyseus.js: client left room before receiving session id.<br />
It's really weird, everything works 8 or even 9 of 10 times, and suddenly... crashes...</p>
<p>I'm assigning the game client into a global variable:<br />
<code>window.gameClient = new Colyseus.Client(location.protocol.replace('http', 'ws')+host+(location.port ? ':'+location.port : ''));</code></p>
<p>And then on document ready, when the user submit the form I try to join the first room:<br />
<code>window.gameClient = new Colyseus.Client(location.protocol.replace('http', 'ws')+host+(location.port ? ':'+location.port : ''));</code></p>
<p>You can see the code here:<br />
<a href="https://github.com/damian-pastorini/dwdgame/blob/dwdgame-master/client/client.js" rel="nofollow">https://github.com/damian-pastorini/dwdgame/blob/dwdgame-master/client/client.js</a></p>
<p>Any ideas why it could be happening?</p>
<p>Thanks!</p>
]]></description><link>http://discuss.colyseus.io/post/546</link><guid isPermaLink="true">http://discuss.colyseus.io/post/546</guid><dc:creator><![CDATA[dpastorini]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Client left room before receiving session id on Invalid Date]]></title><description><![CDATA[<p>If anyone has this issue and you are trying to use multiple join / left rooms like I was doing, make sure to always be joined in one room.<br />
In my case I was leaving one room before join the next one, so I moved the oldroom.leave() action inside the newroom.onJoin() and now everything works fine.<br />
Note, this was happening randomly at the beginning until I overloaded the room onInit with data, then I got the issue all the time because the second room was delayed on load.<br />
Best,</p>
]]></description><link>http://discuss.colyseus.io/post/550</link><guid isPermaLink="true">http://discuss.colyseus.io/post/550</guid><dc:creator><![CDATA[dpastorini]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>