diff --git a/Assets/Plugins/Colyseus/Room.cs b/Assets/Plugins/Colyseus/Room.cs index 27571d56..190c7329 100644 --- a/Assets/Plugins/Colyseus/Room.cs +++ b/Assets/Plugins/Colyseus/Room.cs @@ -274,10 +274,13 @@ protected async void ParseMessage (byte[] bytes) } else if (code == Protocol.ROOM_DATA_SCHEMA) { - Type messageType = Schema.Context.GetInstance().Get(bytes[1]); + Schema.Iterator it = new Schema.Iterator { Offset = 1 }; + var typeId = Decode.DecodeNumber(bytes, it); + Type messageType = Schema.Context.GetInstance().Get(typeId); var message = (Schema.Schema) Activator.CreateInstance(messageType); - message.Decode(bytes, new Schema.Iterator { Offset = 2 }); + + message.Decode(bytes, it); IMessageHandler handler = null; OnMessageHandlers.TryGetValue("s" + message.GetType(), out handler); diff --git a/Server/package.json b/Server/package.json index 2e6c63d5..6a17d416 100644 --- a/Server/package.json +++ b/Server/package.json @@ -14,7 +14,7 @@ }, "dependencies": { "@colyseus/social": "^0.10.0", - "colyseus": "^0.14.0-alpha.16", + "colyseus": "^0.14.0-alpha.19", "cors": "^2.8.5", "express": "^4.13.3", "express-jwt": "^5.3.1",