If 2 maps share the same tileset name (even if they use 2 different URLs for the tileset), the tileset image will be reused wrongly.
This commit fixes the tileset key to make it equal to the image URL.
The listeners from MediaManager and SimplePeer were never removed, leading to a huge amount of listeners all over the applications when switching regularly of scene.
Most of the refactoring issues we are seeing are probably due to the fact that we are trying to manipulate a ScenePlugin out of a Scene (the GameManager is not a Scene and holds a reference to a ScenePlugin coming from a Scene that might get invalidated by Phaser 3).
Furthermore, if we want in the future to be able to scale, scenes could be hosted on different servers. Therefore, it makes no sense to have one connexion for the whole application.
Instead, we should have one connexion for each scene.
In the case the reconnect event was triggered on "wake-up", the disconnect event was not sent. But because of a bug in the way we handle the setTimeout, the reconnection to the GameScene never happened after we forced the disconnect scene.
This fixes the issue.
Callbacks for socket.io events were registered each time a disconnect was called, leading to message being dispatched plenty of times if there was several disconnections.
In case we suspend a laptop and resume it, the RECONNECT event is called by socket.io without any error being thrown (so without us being redirected to the Reconnect Scene).
This fix makes sure we go to the reconnect scene before going back to the main scene.
If more than one tile was set in the "start" layer, the last tile would be selected.
Now, the tile is selected at random among available tiles.
Also, a message is issued if no tiles have been put on the "start" layer.
This is important because when we come back to the GameScene later, some properties of the GameScene object might be initialized with the values of the previous GameScene.
Like the position if the user previously disconnected.
Closes#146
Remvoing messages that were no more used in the new messaging system (the code used to handle the message that sent the position of all users on the front side)
The URL signature becomes:
https://workadventu.re/_/[instance]/[path_to_map.json]
This allows us to create many instances of the same map (and therefore to create several different worlds for different people)
An exit on a map can target another "instance" by passing the "exitInstance" property.