32 lines
719 B
JavaScript
32 lines
719 B
JavaScript
let mwse = new MWSE({
|
|
endpoint: "ws://localhost:7707"
|
|
});
|
|
|
|
mwse.scope(beginEngine);
|
|
|
|
async function beginEngine()
|
|
{
|
|
room = mwse.room({
|
|
name: "Naber",
|
|
joinType: "free",
|
|
accessType: "private",
|
|
description: "Private free joined room",
|
|
ifexistsJoin: false,
|
|
notifyActionEjected: true,
|
|
notifyActionInvite: false,
|
|
notifyActionJoined: true
|
|
});
|
|
try{
|
|
await room.createRoom();
|
|
let time = 0;
|
|
setInterval(()=>{
|
|
room.info.set("set time",time);
|
|
time++;
|
|
},1000);
|
|
}catch{
|
|
await room.join();
|
|
}
|
|
room.on('updateinfo',(name, value) => {
|
|
console.log("read",name,value)
|
|
})
|
|
} |