Improving benchmark
This commit is contained in:
parent
54fd429952
commit
9ec5dc093c
@ -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 connection.joinARoom('global__maps.workadventure.localhost/Floor0/floor0', 783, 170, 'down', true, {
|
||||
await connectionManager.anonymousLogin(true);
|
||||
const connection = await connectionManager.connectToRoomSocket('_/global/maps.workadventure.localhost/Floor0/floor0.json', 'TEST', ['male3'],
|
||||
{
|
||||
x: 783,
|
||||
y: 170
|
||||
}, {
|
||||
top: 0,
|
||||
bottom: 200,
|
||||
left: 500,
|
||||
right: 800
|
||||
});
|
||||
|
||||
console.log(connection.getUserId());
|
||||
|
||||
let angle = Math.random() * Math.PI * 2;
|
||||
|
2274
benchmark/package-lock.json
generated
2274
benchmark/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -76,11 +76,13 @@ class ConnectionManager {
|
||||
await Axios.get(`${API_URL}/verify`, {params: {token}});
|
||||
}
|
||||
|
||||
private async anonymousLogin(): Promise<void> {
|
||||
public async anonymousLogin(isBenchmark: boolean = false): Promise<void> {
|
||||
const data = await Axios.post(`${API_URL}/anonymLogin`).then(res => res.data);
|
||||
this.localUser = new LocalUser(data.userUuid, data.authToken, []);
|
||||
if (!isBenchmark) { // In benchmark, we don't have a local storage.
|
||||
localUserStore.saveUser(this.localUser);
|
||||
}
|
||||
}
|
||||
|
||||
public initBenchmark(): void {
|
||||
this.localUser = new LocalUser('', 'test', []);
|
||||
|
@ -1,5 +1,5 @@
|
||||
const DEBUG_MODE: boolean = process.env.DEBUG_MODE == "true";
|
||||
const API_URL = (typeof(window) !== 'undefined' ? window.location.protocol : 'http:') + '//' + (process.env.API_URL || "api.workadventure.localhost");
|
||||
const API_URL = (process.env.API_PROTOCOL || (typeof(window) !== 'undefined' ? window.location.protocol : 'http:')) + '//' + (process.env.API_URL || "api.workadventure.localhost");
|
||||
const TURN_SERVER: string = process.env.TURN_SERVER || "turn:numb.viagenie.ca";
|
||||
const TURN_USER: string = process.env.TURN_USER || 'g.parant@thecodingmachine.com';
|
||||
const TURN_PASSWORD: string = process.env.TURN_PASSWORD || 'itcugcOHxle9Acqi$';
|
||||
|
Loading…
Reference in New Issue
Block a user