Commit Graph

135 Commits

Author SHA1 Message Date
David Négrier
d78006e106 Fixing memory leak with listeners
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.
2020-06-23 15:02:35 +02:00
David Négrier
a5514ce78a Code cleanup and removing exception in favor of console error 2020-06-22 18:42:54 +02:00
David Négrier
407c6db070 Fixing difference between MapKey and scene key (prevented proper caching of resources) 2020-06-22 17:18:24 +02:00
David Négrier
3f927280a6 Lint 2020-06-22 16:11:48 +02:00
David Négrier
9b174836cd Making sure connection is established again EVEN if the tab is not displayed 2020-06-22 16:11:02 +02:00
David Négrier
1e4ffa20ab Cleaning GameManager 2020-06-22 16:10:34 +02:00
David Négrier
f88f28db3f Refactoring reconnection: putting it into the GameScene directly. 2020-06-22 15:00:23 +02:00
David Négrier
d785a8a1bf Refactoring connection to be part of a GameScene
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.
2020-06-22 11:58:07 +02:00
David Négrier
4496c49621 Fix linting 2020-06-19 18:51:58 +02:00
David Négrier
2b820c7d56 Adding an event queue in the GameScene.
Events are processed only in the 'update' method.
We hope this will solve a number of null pointer errors. See #194
2020-06-19 18:18:43 +02:00
David Négrier
e2be99490b Finishing removing any reference to "any" in the front. 2020-06-19 16:36:40 +02:00
David Négrier
39928b46f9 Removing any in the front 2020-06-19 14:30:34 +02:00
David Négrier
8348d13bfe Fixing use const instead of let 2020-06-19 14:30:34 +02:00
David Négrier
54f2518b5e Enabling stricter lint on front 2020-06-19 14:29:29 +02:00
David Négrier
817b25b0be Fixing reconnect issue
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.
2020-06-17 16:06:02 +02:00
David Négrier
b1d39c4690 More logs 2020-06-11 14:13:13 +02:00
David Négrier
ea30a02762 Fixing reconnect issues 2020-06-11 14:12:03 +02:00
David Négrier
473c5aa052 Fixing events fired multiple times
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.
2020-06-11 13:34:25 +02:00
David Négrier
e50a4fd88b Fixing setTimeout being called several times 2020-06-11 11:34:22 +02:00
David Négrier
f7265c213e Patch 2020-06-11 10:40:43 +02:00
David Négrier
43c7c9ad07 Fixing null initialization 2020-06-11 10:29:11 +02:00
David Négrier
ce7b4092a6 Fixing suspend/resume
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.
2020-06-11 09:37:33 +02:00
David Négrier
80fddb3c69 Removing dead code 2020-06-10 16:01:01 +02:00
David Négrier
f518830073 Minor change to make sure the scene starts even if in background (does this really work?) 2020-06-10 16:00:54 +02:00
David Négrier
500dc83a85 Completely resetting GameScene on disconnect 2020-06-10 15:43:22 +02:00
David Négrier
43e4489d4d Fixing start position on disconnect 2020-06-10 14:57:32 +02:00
David Négrier
5042f2f82c Lint 2020-06-07 23:00:05 +02:00
David Négrier
c0809e28db Adding support for putting the hash in a map referenced in an exit scene. 2020-06-07 22:57:32 +02:00
David Négrier
db3ef81842 Adding the ability to add several entry points
We can now have several start layers and choose an entry point using a # in the URL
2020-06-07 13:23:32 +02:00
David Négrier
b82b13e351 Finalizing strict mode fixes 2020-06-04 18:56:59 +02:00
David Négrier
6f69a62d4d More strict fixes 2020-06-04 18:56:59 +02:00
David Négrier
082a11b0cd Allowing ill defined initializers (because of the way Phaser 3 is designed) 2020-06-04 18:56:59 +02:00
David Négrier
111bfcfe8c More strict typecheck fixes 2020-06-04 18:56:22 +02:00
David Négrier
82e2c0d985
Merge pull request #149 from thecodingmachine/multiple_start_positions_in_layer
Allowing several start positions in a given start layer
2020-06-03 11:20:57 +02:00
David Négrier
69d2fa6944 Allowing several start positions in a given start layer
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.
2020-06-03 11:14:04 +02:00
David Négrier
9ddf22d36b Removing GameScene from the list of known GameScene when leaving
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
2020-06-03 10:45:25 +02:00
David Négrier
d72e60610e Adding PlayersPositionInterpolator to interpolate/extrapolate players positions 2020-06-02 13:44:42 +02:00
David Négrier
d69ce8a6a6 Adding PlayerMovement class to interpolate/extrapolate position along tests (installing Jasmine) 2020-06-02 10:48:04 +02:00
David Négrier
077b29bfbd Sending position only every 200ms while moving 2020-06-01 22:42:18 +02:00
David Négrier
21576946f0 Commenting out the notion of status in the GameManager
It seems to be useless
2020-05-25 22:37:07 +02:00
David Négrier
17e7f1b37a Removing dead code from previous messaging system
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)
2020-05-25 22:36:44 +02:00
David Négrier
1fa39b0781 Fixing typos.
Replaced connexion with connection and LogincScene with LoginScene
2020-05-24 23:14:12 +02:00
David Négrier
cd586a9e0c Renaming /maps to /start-map
Closes #90
2020-05-24 22:53:10 +02:00
David Négrier
2448fef53a Adding a notion of instances per mapAdding a notion of instances to room
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.
2020-05-23 17:45:49 +02:00
David Négrier
080e08eeef
Merge pull request #122 from thecodingmachine/reconnecting_scene
Adding a special scene to wait for server reconnection
2020-05-23 17:12:36 +02:00
Gregoire Parant
f4ed2e52bf Fix CI 2020-05-23 16:50:17 +02:00
David Négrier
36858f8747 Adding a special scene to wait for server reconnection 2020-05-23 15:43:26 +02:00
Gregoire Parant
ab32021fc0 Fix mediam stream manage and server back down 2020-05-23 14:00:36 +02:00
David Négrier
ab798b1c09 Changing the "Point" notion to add a notion of "moving" in addition to the notion of direction.
Also, refactoring JOIN_ROOM event to add complete position.
2020-05-22 23:04:45 +02:00
David Négrier
f44a44c109 Removing logs 2020-05-20 12:30:17 +02:00