Navigation

    Colyseus
    • Login
    • Search
    • Recent
    • Tags
    • Users
    1. Home
    2. VanillaDevelop
    VanillaDevelop

    VanillaDevelop

    @VanillaDevelop

    Chat Follow Unfollow
    0
    Reputation
    2
    Posts
    1205
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    • Profile
    • More
      • Continue chat with VanillaDevelop
      • Flag Profile
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    VanillaDevelop Follow

    Posts made by VanillaDevelop

    RE: Local schema mismatch using Unity client

    This solves the issue. Thank you!

    posted in Questions & Help •
    Local schema mismatch using Unity client

    Hello.

    I'm trying to use the Unity Client right now. My server has a "GameRoom" which has the following Schema for its state

    export class GameState extends Schema 
    {
      @type([ "int16" ])
      pipes = new ArraySchema<number>();
    }
    

    I then use schema-codegen to generate the following C# class

    public class GameState: Schema
    {
        [Colyseus.Schema.Type(0, "array", "int16")]
        public ArraySchema<short> pipes = new ArraySchema<short>();
    }
    

    When trying to connect to the room using

            client = new Client("ws://localhost:2567");
            try
            {
                room = await client.JoinOrCreate<GameState>("game");
            }
            catch(Exception ex)
            {
                Debug.Log("Exception: " + ex.Message);
            }
    

    I get the error: Exception: Local schema mismatch from server. Use "schema-codegen" to generate up-to-date local definitions.

    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!

    posted in Questions & Help •