Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Room, FossilDeltaSerializer, serialize } from "colyseus";
@serialize(FossilDeltaSerializer)
export class ChatRoom extends Room {
maxClients = 4;
onInit (options) {
this.setState({ messages: [] });
}
async onAuth (options) {
return { success: true };
}
onJoin (client, options, auth) {
this.state.messages.push(`${ client.id } joined.`);
}
requestJoin (options, isNewRoom: boolean) {