add: matchmaking
This commit is contained in:
@ -1,13 +1,30 @@
|
||||
import { client, navigateTo } from "../index.js";
|
||||
import AbstractView from "./AbstractView.js";
|
||||
|
||||
function game_found(game_id)
|
||||
{
|
||||
navigateTo(`/games/${game_id}`)
|
||||
}
|
||||
|
||||
export default class extends AbstractView {
|
||||
constructor(params) {
|
||||
super(params, "Dashboard");
|
||||
}
|
||||
|
||||
async postInit()
|
||||
{
|
||||
await client.matchmaking.start(game_found)
|
||||
console.log("start matchmaking")
|
||||
}
|
||||
|
||||
async getHtml() {
|
||||
return `
|
||||
<h1>finding<h1>
|
||||
`;
|
||||
}
|
||||
|
||||
async leavePage()
|
||||
{
|
||||
await client.matchmaking.stop();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user