Commit graph

63 commits

Author SHA1 Message Date
arp 3f9659ef3c improvments 2020-09-28 15:40:34 +02:00
arp af4611ed29 rewrote the login workflow 2020-09-25 19:23:33 +02:00
David Négrier 24fb605f50 Switching to definitely assigned parameters
This allows us to go in "full strict mode" (yeah!)
See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#strict-class-initialization
2020-08-07 23:39:06 +02:00
David Négrier 84529d6e99 Propagating customized sprites all over the game 2020-07-28 17:45:55 +02:00
David Négrier 6d0bccc0e1 Making a nice "customize" button 2020-07-28 15:53:44 +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 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 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 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 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 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 111bfcfe8c More strict typecheck fixes 2020-06-04 18:56:22 +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 36858f8747 Adding a special scene to wait for server reconnection 2020-05-23 15:43:26 +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 125a4d11af Refactored and optimized messages
Now, when a user moves, only his/her position is sent back to the other users. The position of all users is not sent each time.

The messages sent to the browser are now:

- the list of all users as a return to the join_room event (you can send responses to events in socket.io)
- a "join_room" event sent when a new user joins the room
- a "user_moved" event when a user moved
- a "user_left" event when a user left the room

The GameScene tracks all these events and reacts accordingly.

Also, I made a number of refactoring in the classes and removed the GameSceneInterface that was useless (it was implemented by the LogincScene for no reason at all)
2020-05-19 19:11:12 +02:00
David Négrier 4d1c3517ec When sharing user position, only position is sent now! 2020-05-15 23:47:00 +02:00
David Négrier b80e3e07d8 Sending player details (name + character selected) on connection 2020-05-15 22:49:50 +02:00
David Négrier 4de552437d Completely getting rid of "userid"
Previously, userid was generated by the "/login" route and passed along.
This commit completely removes the uuid "userid" (and disables the LoginController too and any Jwt check).

"userid" is replaced by the "socket id" of the connection.
So a user is now identified using a socket id, which is unique for a given connection.
2020-05-14 23:20:43 +02:00
gparant 787e1c463c Media webrtcA
- Update peerConnexion manage
 - Add muted microphone logo
 - Add icon user
 - Sound when user enter in room webrtc
2020-05-14 20:39:30 +02:00
David Négrier faadacddb6 Redirecting to the correct map after login screen based on URL provided 2020-05-13 00:06:58 +02:00
David Négrier 9417e4a4d2 Refactoring/centralizing map loading in GameManager 2020-05-12 22:38:44 +02:00
gparant d3ff717f9e Minor Fix overflow css style 2020-05-12 00:22:55 +02:00
gparant 58b65030bd Fix feedback @moufmouf strategy of maps managing by back. 2020-05-10 18:34:55 +02:00
gparant 5f11b065e1 Permit to dissociate data by room
- Update share room id.
 - Join room when a scene is loaded.
 - Add a room in constant variable.
2020-05-10 13:58:32 +02:00
gparant 27c6034661 Manage multi scene
- Create position and check if user is in position to switch in the next scene.
 - When scene is load, we load all scene in the layer of name "exit".
 - Layer "exit" of map.json have a parametter "exitSceneKey" to identify next scene.
 - Add layer "start", the player could start in the scene on the object present in the layer of name "start".
2020-05-09 21:28:50 +02:00
gparant fb8d9bf9a8 Multi Scene in back end
- Change maps url to get maps
 - Change GameScene to create scene with file since back end
 - Change LoginScene to upload scene and start game
2020-05-09 19:41:21 +02:00
David Négrier c59d693f6e
Merge pull request #83 from thecodingmachine/cleanup_rename_frame
Cleanup: renaming "frame" to "character"
2020-05-08 16:21:16 +02:00
David Négrier 492196b333 Cleanup: renaming "frame" to "character"
The "frame" variable actually contains a string pointing to the character selected.
It has nothing to do with a frame which is usually a particular image in an animation.

I'm renaming the variable accross the application to avoid confusion.
2020-05-08 15:18:22 +02:00
David Négrier 02e6b50b16 Adding the display of a circle around the group
This PR adds the display of a circle around groups. This is useful to view where you need to go to speak to someone but also to debug.

Note: implementation is suboptimal, relying on a "graphics" object that is known to be slow. In the future, we need to use a circle as a sprite instead.
2020-05-08 00:35:36 +02:00
gparant 5a6415607d Send event and play animation with user frame 2020-05-06 01:50:01 +02:00
David Négrier df5b183cba Merge 2020-05-03 15:51:16 +02:00
David Négrier 76b745ebea Putting the name in GameManager rather than passing it from scene to scene. 2020-05-03 15:29:40 +02:00
kharhamel ad65de75fd used the vent system to remove the dependency of Player on Connexion 2020-05-02 16:56:36 +02:00