Manage Local Storage customers player error
This commit is contained in:
parent
84de023d82
commit
f5dd5efc0e
@ -106,7 +106,9 @@ export abstract class Character extends Container {
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
// Needed, otherwise, animations are not handled correctly.
|
// Needed, otherwise, animations are not handled correctly.
|
||||||
|
if(this.scene) {
|
||||||
this.scene.sys.updateList.add(sprite);
|
this.scene.sys.updateList.add(sprite);
|
||||||
|
}
|
||||||
this.sprites.set(texture, sprite);
|
this.sprites.set(texture, sprite);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -229,8 +231,10 @@ export abstract class Character extends Container {
|
|||||||
this.scene.events.removeListener('postupdate', this.postupdate.bind(this));
|
this.scene.events.removeListener('postupdate', this.postupdate.bind(this));
|
||||||
}
|
}
|
||||||
for (const sprite of this.sprites.values()) {
|
for (const sprite of this.sprites.values()) {
|
||||||
|
if(this.scene) {
|
||||||
this.scene.sys.updateList.remove(sprite);
|
this.scene.sys.updateList.remove(sprite);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
super.destroy(fromScene);
|
super.destroy(fromScene);
|
||||||
this.playerName.destroy();
|
this.playerName.destroy();
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,7 @@ import {urlManager} from "../../Url/UrlManager";
|
|||||||
import {PresentationModeIcon} from "../Components/PresentationModeIcon";
|
import {PresentationModeIcon} from "../Components/PresentationModeIcon";
|
||||||
import {ChatModeIcon} from "../Components/ChatModeIcon";
|
import {ChatModeIcon} from "../Components/ChatModeIcon";
|
||||||
import {OpenChatIcon, openChatIconName} from "../Components/OpenChatIcon";
|
import {OpenChatIcon, openChatIconName} from "../Components/OpenChatIcon";
|
||||||
|
import {SelectCharacterScene, SelectCharacterSceneName} from "../Login/SelectCharacterScene";
|
||||||
|
|
||||||
export interface GameSceneInitInterface {
|
export interface GameSceneInitInterface {
|
||||||
initPosition: PointInterface|null,
|
initPosition: PointInterface|null,
|
||||||
@ -375,7 +376,13 @@ export class GameScene extends ResizableScene implements CenterListener {
|
|||||||
mediaManager.setUserInputManager(this.userInputManager);
|
mediaManager.setUserInputManager(this.userInputManager);
|
||||||
|
|
||||||
//notify game manager can to create currentUser in map
|
//notify game manager can to create currentUser in map
|
||||||
|
try {
|
||||||
this.createCurrentPlayer();
|
this.createCurrentPlayer();
|
||||||
|
}catch (err){
|
||||||
|
//permit to return on character custom if any there any changes frame in the new version
|
||||||
|
gameManager.leaveGame(this, SelectCharacterSceneName, new SelectCharacterScene());
|
||||||
|
throw 'characterLayers are not invalid';
|
||||||
|
}
|
||||||
|
|
||||||
//initialise camera
|
//initialise camera
|
||||||
this.initCamera();
|
this.initCamera();
|
||||||
@ -670,9 +677,13 @@ export class GameScene extends ResizableScene implements CenterListener {
|
|||||||
|
|
||||||
public cleanupClosingScene(): void {
|
public cleanupClosingScene(): void {
|
||||||
// We are completely destroying the current scene to avoid using a half-backed instance when coming back to the same map.
|
// We are completely destroying the current scene to avoid using a half-backed instance when coming back to the same map.
|
||||||
|
if(this.connection) {
|
||||||
this.connection.closeConnection();
|
this.connection.closeConnection();
|
||||||
|
}
|
||||||
|
if(this.simplePeer) {
|
||||||
this.simplePeer.unregister();
|
this.simplePeer.unregister();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private switchLayoutMode(): void {
|
private switchLayoutMode(): void {
|
||||||
//if discussion is activated, this layout cannot be activated
|
//if discussion is activated, this layout cannot be activated
|
||||||
|
Loading…
Reference in New Issue
Block a user