Colyseus 0.14 ref id not found
See original GitHub issueIssue Description
Hello
1
Sending a Schema
object to client which is part of the room state causes this error
but it’s not happening when sending a new object:
Example:
This causes error:
onCreate (options: any) {
var state = new MyRoomState()
state.player = new Player()
this.setState(state);
this.clock.setTimeout(() => {
this.broadcast(state.player)
}, 3000)
}
This doesn’t:
onCreate (options: any) {
var state = new MyRoomState()
state.player = new Player()
this.setState(state);
this.clock.setTimeout(() => {
this.broadcast(new Player())
}, 3000)
}
Steps to reproduce:
- Run this: https://github.com/doorbash/colyseus-ref-id-not-found
- Connect with any client and wait 3s
2
This one is reported to me by @vinsmain via email and I ran it with js
client and fortunately it happened there too!
Steps to reproduce:
- Run this: https://github.com/doorbash/colyseus-ref-id-not-found2
- Connect to it like this:
import { Client } from ".";
const client = new Client("ws://localhost:2567");
(async () => {
try {
const room = await client.joinOrCreate<any>("game");
room.state.selectedInvestigators.onAdd = ((value, key) => {
console.log("ADD INV " + key + " " + value.influence);
if (key == 0) room.send("inv", "null");
});
room.send("addCard")
} catch (e) {
console.error("couldn't join room:", e);
}
})()
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Troubleshooting / Issues - Colyseus & Arena Cloud ...
The following are the most commonly reported issues when deploying an application to Colyseus Arena. prelaunch-actions.sh - not found or bad variable name¶....
Read more >The Client Instance - Colyseus docs
Joins an existing room by its roomId . Private rooms can be joined by id. ... See getAvailableRooms() to retrieve a list of...
Read more >0.14 - Colyseus & Arena Cloud Documentation
Documentation for Colyseus Multiplayer Framework for Node.js.
Read more >Room - Colyseus & Arena Cloud Documentation
broadcast (type, message, options?) ¶. Send a message to all connected clients. Available options are: except : a Client instance not to ...
Read more >Schema - Colyseus & Arena Cloud Documentation
array.indexOf() ¶. Returns the first index at which a given element can be found in the array, or -1 if it is not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks a lot for reporting @doorbash ❤️ I’m in the process of releasing Colyseus 0.14 fixing this right now! 🎉
Hey @vinsmain, just published
@colyseus/schema@1.0.1
fixing this! Let me know if you face any other issues!