32 lines
		
	
	
		
			721 B
		
	
	
	
		
			JavaScript
		
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			721 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: false,
 | 
						|
        notifyActionInvite: false,
 | 
						|
        notifyActionJoined: false
 | 
						|
    });
 | 
						|
    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)
 | 
						|
    })
 | 
						|
} |