Commit graph

31 commits

Author SHA1 Message Date
David Négrier e9ca8721a6 Migrating userId to "int32" to save some space and adding userMoves message in protobuf 2020-09-18 13:57:38 +02:00
David Négrier f6458a8335 Removing useless group callbacks at the World level 2020-09-16 16:13:47 +02:00
David Négrier f5f9dcac04 Making groups part of zones 2020-09-16 16:06:43 +02:00
David Négrier 3a9196fb82 Merge 2020-09-16 11:41:03 +02:00
David Négrier d24ec0bd75 Plugin PositionNotifier into the main application. 2020-09-15 16:21:41 +02:00
David Négrier 9b702c75e3 Adding batched messages + the notion of notifier / zones (not plugged in the system yet) 2020-09-15 10:06:11 +02:00
David Négrier df7b5cc2e3 Adding a "silent" notion (triggered in Jitsi meets) 2020-08-31 14:03:40 +02:00
David Négrier ee612f6585 Adding event support to items 2020-07-27 22:36:58 +02:00
David Négrier 31846d1640 Using a Set for groups 2020-06-29 22:21:11 +02:00
David Négrier 4fee1ac206 Refactoring World and Group to use Map and Set instead of arrays 2020-06-29 22:10:23 +02:00
David Négrier 9bdcc9da98 Deleting world when empty. 2020-06-29 19:14:54 +02:00
David Négrier ac0b7a7361 Turning let into const where applicable 2020-06-09 15:54:54 +02:00
Gregoire Parant 0c9cbca765 Use userId generated by back end in all message 2020-05-23 15:04:25 +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 e934015d87 Refactoring searchClientById
searchClientById was scanning through all open sockets to find the right one (which is inefficient if we have many).
Instead, I created a new Map that directly maps ids to sockets.
Furthermore, this solves a long-standing issue (when a socket is disconnected, we cannot find it anymore in the sockets list but it is still available in the disconnect callback from the map)
As a result, we should not have any remaining circles any more.
2020-05-18 18:33:04 +02:00
David Négrier cdfa9acf01 JoinRoom now ONLY sends the roomId. 2020-05-15 23:24:04 +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
David Négrier 4cca1c1e58 Displaying circle on join
So far, someone joining a map would not see the circles of groups already formed until someone moves in the group (because the "circle_moved_or_updated" event was not fired when someone arrives)

This commit fixes this behaviour. Someone entering a room will receive an event for each and every group currently formed.
2020-05-13 23:11:10 +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
David Négrier 9c32c930a0 Merge 2020-05-03 17:47:54 +02:00
David Négrier 3b27f8b000 Making the group radius distinct from the minimum distance to connect 2 players
Also, changed default settings from 160px for Group Radius to 120px
(minimum distance to connect 2 players remains 160px)
2020-05-03 16:57:17 +02:00
David Négrier 58565a7f45 Refactoring events to connect/disconnect a user to a group 2020-05-03 16:08:04 +02:00
David Négrier c778afcbca Adding support for leaving the group if the socket is closed 2020-04-29 23:18:42 +02:00
David Négrier bf0fa516d4 First working version with disconnection 2020-04-29 23:12:55 +02:00
David Négrier 2a8e3ea323 Switching connection to a barycenter approach 2020-04-29 22:41:48 +02:00
David Négrier 5ffc5a420e Merge branch 'feature/back-players-proximity' into barycenter_based_groups 2020-04-29 22:06:37 +02:00
gparant 2bfa57b0ba Merge world and webrtc conexion 2020-04-29 01:40:32 +02:00
David Négrier abeac558fd Adding TODO comment 2020-04-28 23:23:50 +02:00
David MAECHLER 4bc23ede90 unit test on connect is working, lets start the worst .... 2020-04-09 23:26:19 +02:00
David MAECHLER e3b0f99f04 blocked on some logic...WIP commit 2020-04-08 20:40:44 +02:00
David MAECHLER fbfc208129 BIG WIP of refactoring my work in TS 2020-04-07 10:08:04 +02:00