<?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[Sending Objects to Construct 3]]></title><description><![CDATA[<p>I am having a issue. I am trying to create an array of objects and trying to get that array of objects and break it down in construct 3. I dont know how to read the objects in construct 3 can anyone help?</p>
<p>onJoin(client, options){<br />
this.playerCount ++;</p>
<pre><code>    let newPlayer = {
        id: client.sessionId,
        x: 100,
        y: 100
    }

    this.players.push(newPlayer);

    this.players.forEach(player=&gt;{console.log(player)});
    this.send(client,{
        type: &quot;players&quot;,
        list: this.players
    })
}
</code></pre>
<p>How will i be able to read this list of objects in construct 3?</p>
]]></description><link>http://discuss.colyseus.io/topic/75/sending-objects-to-construct-3</link><generator>RSS for Node</generator><lastBuildDate>Fri, 11 Sep 2026 09:59:51 GMT</lastBuildDate><atom:link href="http://discuss.colyseus.io/topic/75.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 06 May 2018 15:14:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Sending Objects to Construct 3 on Invalid Date]]></title><description><![CDATA[<p>I am having a issue. I am trying to create an array of objects and trying to get that array of objects and break it down in construct 3. I dont know how to read the objects in construct 3 can anyone help?</p>
<p>onJoin(client, options){<br />
this.playerCount ++;</p>
<pre><code>    let newPlayer = {
        id: client.sessionId,
        x: 100,
        y: 100
    }

    this.players.push(newPlayer);

    this.players.forEach(player=&gt;{console.log(player)});
    this.send(client,{
        type: &quot;players&quot;,
        list: this.players
    })
}
</code></pre>
<p>How will i be able to read this list of objects in construct 3?</p>
]]></description><link>http://discuss.colyseus.io/post/235</link><guid isPermaLink="true">http://discuss.colyseus.io/post/235</guid><dc:creator><![CDATA[NycGio]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Sending Objects to Construct 3 on Invalid Date]]></title><description><![CDATA[<p>Hi <a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/58">@NycGio</a>,</p>
<p>It's recommended to keep your map of users in the state (using plain <code>Object</code> instead of <code>Array</code>'s), and listen for changes in the state.</p>
<p><strong>Example:</strong></p>
<pre><code>this.state.players = {};
this.state.players[client.sessionId] = { x: 100, y: 100 };
</code></pre>
<p>You'd then need to listen for additions and changes on players, using the <code>Listen</code> condition:</p>
<ul>
<li><code>Listen</code>: operation = <code>any</code>, path = <code>&quot;players/:id&quot;</code> (listens for add/remove operations)</li>
<li><code>Listen</code>: operation = <code>replace</code>, path = <code>&quot;players/:id/:attribute&quot;</code> (listen for changes on attributes)</li>
</ul>
<p>There's <a href="https://github.com/gamestdio/colyseus-construct3/issues/3#issuecomment-385224979" rel="nofollow">a discussion on the repository</a> about storing and retrieving entities/players by an id string. I'm not sure yet how to keep that reference on Construct3. Maybe you have some idea?</p>
]]></description><link>http://discuss.colyseus.io/post/236</link><guid isPermaLink="true">http://discuss.colyseus.io/post/236</guid><dc:creator><![CDATA[endel]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Sending Objects to Construct 3 on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/1">@endel</a> thank you so much</p>
]]></description><link>http://discuss.colyseus.io/post/238</link><guid isPermaLink="true">http://discuss.colyseus.io/post/238</guid><dc:creator><![CDATA[NycGio]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>