Making sure that even is a user did not move, the reconnection can happen without issues and resume at the old position
This commit is contained in:
parent
ce7b4092a6
commit
77167c28a6
@ -232,6 +232,8 @@ export class Connection implements ConnectionInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
joinARoom(roomId: string, startX: number, startY: number, direction: string, moving: boolean): void {
|
joinARoom(roomId: string, startX: number, startY: number, direction: string, moving: boolean): void {
|
||||||
|
let point = new Point(startX, startY, direction, moving);
|
||||||
|
this.lastPositionShared = point;
|
||||||
this.getSocket().emit(EventMessage.JOIN_ROOM, { roomId, position: {x: startX, y: startY, direction, moving }}, (userPositions: MessageUserPositionInterface[]) => {
|
this.getSocket().emit(EventMessage.JOIN_ROOM, { roomId, position: {x: startX, y: startY, direction, moving }}, (userPositions: MessageUserPositionInterface[]) => {
|
||||||
this.GameManager.initUsersPosition(userPositions);
|
this.GameManager.initUsersPosition(userPositions);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user