We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React code:
import * as Colyseus from "colyseus.js"; function App() { var client = new Colyseus.Client("ws://localhost:2567"); let room: Colyseus.Room; const joinRoom = async () => { room = await client.joinOrCreate("cg_chess"); console.log(room.state); }; return ( <> <div> <button onClick={joinRoom}> Join Room </button> </div> </> ); }
Server code:
export class CGChess extends Room<CGChessState> { chess: Chess; constructor() { super(); this.chess = new Chess(); } maxClients = 2; onCreate (options: any) { this.setState(new CGChessState()); } onJoin (client: Client, options: any) { this.state.players.set(client.sessionId, new Player()); if (this.state.players.size === 2) { this.lock(); } } }
This might be related to #22 . I am using version 0.15.
"@colyseus/monitor": "^0.15.0", "@colyseus/playground": "^0.15.3", "@colyseus/tools": "^0.15.0", "colyseus": "^0.15.0",
Other notes:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In list view, it shows 2 clients in the room.
Upon inspection, room is undefined and there are 0 clients.
State showing 0 items:
Console output showing 2 clients joined:
Client correctly gets room state:
React code:
Server code:
This might be related to #22 . I am using version 0.15.
Other notes:
The text was updated successfully, but these errors were encountered: