Create and send close message
# TODO - Show error or wait room
This commit is contained in:
parent
326c2e4183
commit
7ac4a2b849
17 changed files with 700 additions and 1846 deletions
|
@ -2,6 +2,7 @@ import {RoomConnection} from "../front/src/Connexion/RoomConnection";
|
|||
import {connectionManager} from "../front/src/Connexion/ConnectionManager";
|
||||
import * as WebSocket from "ws"
|
||||
|
||||
|
||||
function sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
@ -11,15 +12,18 @@ RoomConnection.setWebsocketFactory((url: string) => {
|
|||
});
|
||||
|
||||
async function startOneUser(): Promise<void> {
|
||||
const connection = await connectionManager.connectToRoomSocket();
|
||||
connection.emitPlayerDetailsMessage('foo', ['male3']);
|
||||
await connectionManager.anonymousLogin(true);
|
||||
const connection = await connectionManager.connectToRoomSocket(process.env.ROOM_ID ? process.env.ROOM_ID : '_/global/maps.workadventure.localhost/Floor0/floor0.json', 'TEST', ['male3'],
|
||||
{
|
||||
x: 783,
|
||||
y: 170
|
||||
}, {
|
||||
top: 0,
|
||||
bottom: 200,
|
||||
left: 500,
|
||||
right: 800
|
||||
});
|
||||
|
||||
await connection.joinARoom('global__maps.workadventure.localhost/Floor0/floor0', 783, 170, 'down', true, {
|
||||
top: 0,
|
||||
bottom: 200,
|
||||
left: 500,
|
||||
right: 800
|
||||
});
|
||||
console.log(connection.getUserId());
|
||||
|
||||
let angle = Math.random() * Math.PI * 2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue