Merge branch 'develop' of github.com:thecodingmachine/workadventure into outline

# Conflicts:
#	front/src/Phaser/Game/GameScene.ts
#	front/src/Phaser/Player/Player.ts
#	front/src/index.ts
#	front/yarn.lock
This commit is contained in:
David Négrier 2020-08-17 22:51:37 +02:00
commit 6b970adc6c
304 changed files with 2395 additions and 797 deletions

View file

@ -45,7 +45,7 @@ export class Point implements PointInterface{
export interface MessageUserPositionInterface {
userId: string;
name: string;
character: string;
characterLayers: string[];
position: PointInterface;
}
@ -57,7 +57,7 @@ export interface MessageUserMovedInterface {
export interface MessageUserJoined {
userId: string;
name: string;
character: string;
characterLayers: string[];
position: PointInterface
}
@ -122,7 +122,7 @@ export class Connection implements Connection {
})
}
public static createConnection(name: string, characterSelected: string): Promise<Connection> {
public static createConnection(name: string, characterLayersSelected: string[]): Promise<Connection> {
return Axios.post(`${API_URL}/login`, {name: name})
.then((res) => {
@ -136,7 +136,7 @@ export class Connection implements Connection {
connection.socket.emit(EventMessage.SET_PLAYER_DETAILS, {
name: name,
character: characterSelected
characterLayers: characterLayersSelected
} as SetPlayerDetailsMessage, (id: string) => {
connection.userId = id;
});
@ -148,7 +148,7 @@ export class Connection implements Connection {
// Let's retry in 4-6 seconds
return new Promise<Connection>((resolve, reject) => {
setTimeout(() => {
Connection.createConnection(name, characterSelected).then((connection) => resolve(connection))
Connection.createConnection(name, characterLayersSelected).then((connection) => resolve(connection))
.catch((error) => reject(error));
}, 4000 + Math.floor(Math.random() * 2000) );
});