<?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[Local schema mismatch using Unity client]]></title><description><![CDATA[<p>Hello.</p>
<p>I'm trying to use the Unity Client right now. My server has a &quot;GameRoom&quot; which has the following Schema for its state</p>
<pre><code>export class GameState extends Schema 
{
  @type([ &quot;int16&quot; ])
  pipes = new ArraySchema&lt;number&gt;();
}
</code></pre>
<p>I then use schema-codegen to generate the following C# class</p>
<pre><code>public class GameState: Schema
{
    [Colyseus.Schema.Type(0, &quot;array&quot;, &quot;int16&quot;)]
    public ArraySchema&lt;short&gt; pipes = new ArraySchema&lt;short&gt;();
}
</code></pre>
<p>When trying to connect to the room using</p>
<pre><code>        client = new Client(&quot;ws://localhost:2567&quot;);
        try
        {
            room = await client.JoinOrCreate&lt;GameState&gt;(&quot;game&quot;);
        }
        catch(Exception ex)
        {
            Debug.Log(&quot;Exception: &quot; + ex.Message);
        }
</code></pre>
<p>I get the error: <code>Exception: Local schema mismatch from server. Use &quot;schema-codegen&quot; to generate up-to-date local definitions.</code></p>
<p>I'm not sure if I am doing something wrong or if this is a bug, but I am using schema-codegen to generate the schema class and I am still getting the error. What could be the source of this? Thank you!</p>
]]></description><link>http://discuss.colyseus.io/topic/393/local-schema-mismatch-using-unity-client</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 19:51:44 GMT</lastBuildDate><atom:link href="http://discuss.colyseus.io/topic/393.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 07 Aug 2020 17:36:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Local schema mismatch using Unity client on Invalid Date]]></title><description><![CDATA[<p>Hello.</p>
<p>I'm trying to use the Unity Client right now. My server has a &quot;GameRoom&quot; which has the following Schema for its state</p>
<pre><code>export class GameState extends Schema 
{
  @type([ &quot;int16&quot; ])
  pipes = new ArraySchema&lt;number&gt;();
}
</code></pre>
<p>I then use schema-codegen to generate the following C# class</p>
<pre><code>public class GameState: Schema
{
    [Colyseus.Schema.Type(0, &quot;array&quot;, &quot;int16&quot;)]
    public ArraySchema&lt;short&gt; pipes = new ArraySchema&lt;short&gt;();
}
</code></pre>
<p>When trying to connect to the room using</p>
<pre><code>        client = new Client(&quot;ws://localhost:2567&quot;);
        try
        {
            room = await client.JoinOrCreate&lt;GameState&gt;(&quot;game&quot;);
        }
        catch(Exception ex)
        {
            Debug.Log(&quot;Exception: &quot; + ex.Message);
        }
</code></pre>
<p>I get the error: <code>Exception: Local schema mismatch from server. Use &quot;schema-codegen&quot; to generate up-to-date local definitions.</code></p>
<p>I'm not sure if I am doing something wrong or if this is a bug, but I am using schema-codegen to generate the schema class and I am still getting the error. What could be the source of this? Thank you!</p>
]]></description><link>http://discuss.colyseus.io/post/1293</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1293</guid><dc:creator><![CDATA[VanillaDevelop]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Local schema mismatch using Unity client on Invalid Date]]></title><description><![CDATA[<p>Hi <a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/705">@VanillaDevelop</a>, welcome! 👋</p>
<p>The Unity client tries to validate all the schema structures locally, based on the &quot;handshake&quot; that comes from the server. What's not very well documented is that, right now, every <code>@type()</code> annotation is going to attach the structures into a &quot;global&quot; context - putting all your room's schemas into the same &quot;global&quot; context, therefore the client will receive schemas from multiple rooms and throw the <code>&quot;mismatch&quot;</code> error in case some of them cannot be found.</p>
<p>I suggest you create your own <code>@type()</code>  to avoid this problem in Unity, as suggested here: <a href="https://discuss.colyseus.io/topic/390/schema-handshake-problem-between-server-and-unity-client/2" rel="nofollow">https://discuss.colyseus.io/topic/390/schema-handshake-problem-between-server-and-unity-client/2</a></p>
<p>I need to provide more documentation about this on the next release that's coming up (0.14)</p>
<p>Let me know if that works for you</p>
]]></description><link>http://discuss.colyseus.io/post/1294</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1294</guid><dc:creator><![CDATA[endel]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Local schema mismatch using Unity client on Invalid Date]]></title><description><![CDATA[<p>This solves the issue. Thank you!</p>
]]></description><link>http://discuss.colyseus.io/post/1295</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1295</guid><dc:creator><![CDATA[VanillaDevelop]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Local schema mismatch using Unity client on Invalid Date]]></title><description><![CDATA[<p>this what I searching for several weeks, thanks man that really halping me to<br />
<a href="https://roomme.id/jakarta/jakarta-pusat" rel="nofollow">jakarta selatan</a>best regards</p>
]]></description><link>http://discuss.colyseus.io/post/1435</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1435</guid><dc:creator><![CDATA[gunturhakim]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>