Thanks for reporting @banool, I've replied to your post on the Defold forums as it might involve their WebSocket extension: https://forum.defold.com/t/colyseus-error-failed-to-setup-callback-when-player-joins-room/68165
-
RE: [Defold] ERROR:WEBSOCKET: Failed to setup callback when player joins room
-
RE: How to reset callbacks for state changes?
Hi @TeeTeeHaa!
The
.listen()
method returns a callback that is going to unregister itself.Example:
const removeListener = state.listen("currentTurn", () => { /* do stuff */ }); // call `removeListener()` to remove it! removeListener();
Thanks for the heads-up, this has been included in the docs now: https://github.com/colyseus/docs/commit/945a4043ce8655756d9912a12be0bc4ae9c0eea5
Hope this helps! Cheers!
-
RE: Godot Support?
Hi @antv199, eventually we would like to have an SDK available for Godot users, but no action is being taken on it so far. A public roadmap is going to be announced soon.
-
RE: Schema mismatch server-unity
@niaina perhaps you're also facing what has been just documented here? https://github.com/colyseus/colyseus-unity3d/issues/131#issuecomment-814308572
-
RE: Schema mismatch server-unity
Hi @niaina, I see you posted here that you're still getting this error :(
Can you share your schemas/room structures you have on the server? There are two things you could try that will potentially fix this:
- Remove any unnecessary room/schema structures that you are not using
- Use
const type = Context.create()
, and use the sametype
reference for annotating your schema classes.
Looking forward to hear from you!
-
RE: Schema mismatch server-unity
Hi @niaina,
I'm sorry you're getting this, there is an explanation and how to fix this here: https://github.com/colyseus/colyseus-unity3d/issues/131
This usually happens when you have multiple state/room definitions and use the global
type
imported from@colyseus/schema
. We'd like to fix this on a next version to display warnings instead of throwing errors when this happens!Let me know if the solution described on GitHub works for you! Cheers!
-
RE: room list update
Hi @niaina, welcome! 👋
Currently we don't have examples of the built-in LobbyRoom usage written in C# - but there is a room listing example inside the "Shooting Gallery" tech demo using the
GetAvailableRooms()
method here: https://docs.colyseus.io/demo/shooting-gallery/ -
RE: How to integrate colyseus with nestjs
Hi @b-thanapat, welcome! 👋
I've just managed to get NestJS (7.6.15) + Colyseus (0.14.x) working together by doing this:
import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import { Room, Server } from "colyseus"; import { MyRoom } from "./MyRoom"; async function bootstrap() { const app = await NestFactory.create(AppModule); const gameServer = new Server(); gameServer.define("my_room", MyRoom); // attach Colyseus into the existing http server from NestJS gameServer.attach({ server: app.getHttpServer() }); await app.listen(2567); } bootstrap();
Hope this helps, cheers!
-
RE: How to deserialize stored state snapshot?
Hi @AllNamesRTaken, welcome! 👋
You should be able to do the following:
const snapshot = this.state.toJSON(); // ...store snapshot JSON into the database // ...let's restore the snapshot this.state.assign(snapshot);
Let me know if that works for you!
-
RE: it's possible to use nginx instead of colyseus/proxy
Hi @ttcong194, you're probably facing the same memory leak problem I have on a live project: https://github.com/OptimalBits/redbird/issues/237
Unfortunately, I could not properly identify the issue myself, but it seems to come from http-proxy.
Fazri wants to open-source the proxy being used for Colyseus Arena in a few weeks - it has a different approach than
@colyseus/proxy
.