Commit Graph

142 Commits

Author SHA1 Message Date
Gregoire Parant
57e8c0261c Fix test socket 2020-05-23 16:32:14 +02:00
Gregoire Parant
0c9cbca765 Use userId generated by back end in all message 2020-05-23 15:04:25 +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
fb8d7b5d59 Removing dead code 2020-05-19 19:53:26 +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
2628373b56 Stricter compiler 2020-05-16 16:11:58 +02:00
David Négrier
1bbd0866cb Code cleaning 2020-05-16 16:07:57 +02:00
David Négrier
57adc6b21c Cleaning up tests 2020-05-16 15:58:20 +02:00
David Négrier
87707bc814 Removing broken import 2020-05-16 15:51:00 +02:00
David Négrier
b20357c1ee Removing the Message class and merging it with MessageUserPosition (since it is only ever used it in MessageUserPosition)
Taking advantage of the TypeScript Constructor Assignment too to reduce the amount of code!
2020-05-16 15:44:45 +02:00
David Négrier
3b6ace03fa Getting rid of roomId in Message class (this is not needed since all messages sent are for the room we are currently in) 2020-05-16 00:19:27 +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
cdfa9acf01 JoinRoom now ONLY sends the roomId. 2020-05-15 23:24:04 +02:00
David Négrier
7e00d61f94 Fixing test 2020-05-15 23:17:58 +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
fff0e13a2e More code removal 2020-05-15 22:09:21 +02:00
David Négrier
4e745f20f7 More code removal 2020-05-15 22:08:53 +02:00
David Négrier
5a3668a12e Refactoring messages
Socket.io can stringify JSON messages itself, so there is no need to pass a string to "emit". You can pass a serializable object!

This commit removes all the useless toJson() methods, JSON.serialize and JSON.parse!

Woot!
2020-05-15 22:04:49 +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
76b43245c5
Merge pull request #113 from thecodingmachine/display_circle_on_startup
Displaying circle on join
2020-05-14 22:02:41 +02:00
gparant
b467adece9 Minor update floor0 and floor1 2020-05-14 21:00:52 +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
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
gparant
517d3981d1 Minor changes map floor 0 2020-05-13 22:36:34 +02:00
David Négrier
2e34b76a77
Merge pull request #111 from thecodingmachine/new-floor0
New map floor0
2020-05-13 22:28:17 +02:00
David Négrier
11972555ee More detailed error log to debug disconnect issue 2020-05-13 22:11:05 +02:00
gparant
b4e720b00a New map floor0 2020-05-13 22:09:02 +02:00
gparant
ec297e3912 Auto-reconnect 2020-05-13 20:22:42 +02:00
David Négrier
23a12ea652
Merge pull request #99 from thecodingmachine/map_history
Adding support for history API
2020-05-13 11:03:49 +02:00
David Négrier
59ee78275e Removing limitation to allow up to 4 players in a group 2020-05-13 09:39:48 +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
256fa51e24 Catching errors in socket callbacks
Catching errors in socket callbacks to avoid having the server crashing when an error occurs.
2020-05-12 11:49:55 +02:00
gparant
b50f28176e Minor update layer position in map floor0 and floor1 2020-05-12 02:01:18 +02:00
David Négrier
872fa8c750 Fixing exit points 2020-05-12 00:38:24 +02:00
David Négrier
cf49f7de00 Merge branch 'master' of github.com:thecodingmachine/workadventure into map-v1
# Conflicts:
#	back/src/Assets/Maps/Floor0/floor0.json
2020-05-12 00:24:05 +02:00
NIP
98e73582c8 Add KEN office to the map 2020-05-11 23:42:10 +02:00
David Négrier
0daddb3669
Merge pull request #93 from thecodingmachine/fix-recette-grp
Fix recette GRP
2020-05-11 22:59:22 +02:00
gparant
7ccd84d941 Fix depth error in the first floor 2020-05-11 21:16:14 +02:00
gparant
bd2ffde4c4 Fix CI lint 2020-05-11 20:55:17 +02:00
gparant
c41e88370d Fix position layer in map lyon 2020-05-11 20:53:23 +02:00
David Négrier
98628957a4 Refactoring "exit" to allow multiple maps
Adding several layers named "exit" causes issues with Phaser 3.
This PR makes any possible layer being an exit layer (it only depends on the exitUrl property)

Also, fixing start position (it takes into account the layer width now)
2020-05-11 18:49:20 +02:00
William
e9d3a7d169 use start and exit layers on map 2020-05-11 14:00:15 +02:00
gparant
099961b818 Delete params not used 2020-05-11 13:19:48 +02:00
gparant
e35c188854 Fix update world back end and deleting group in front end 2020-05-11 13:17:02 +02:00
gparant
45370e6391 Fix exit tile map of floot1 2020-05-11 00:32:37 +02:00
gparant
f4af824cf9 Fix error mapping refresh in back & the end of this feature development 2020-05-10 23:49:08 +02:00
gparant
8b9c36e3be Refactor leave and join room 2020-05-10 19:54:41 +02:00
gparant
8a91190d8c Change to update world by scene and room id 2020-05-10 19:45:17 +02:00