Commit Graph

1366 Commits

Author SHA1 Message Date
Gregoire Parant
f4ed2e52bf Fix CI 2020-05-23 16:50:17 +02:00
Gregoire Parant
57e8c0261c Fix test socket 2020-05-23 16:32:14 +02:00
David Négrier
e41eda9979 Prettifying lost connection screen 2020-05-23 16:13:37 +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
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
f44a44c109 Removing logs 2020-05-20 12:30:17 +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
1e6f9bb8d9 Merge branch 'master' of github.com:thecodingmachine/workadventure into remove_userid 2020-05-18 18:40:10 +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
ecd4c03b7c
Merge pull request #118 from thecodingmachine/remove_userid
Refactoring messages
2020-05-17 12:11:03 +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
2411a3f85a
Merge pull request #116 from thecodingmachine/remove_userid
Completely getting rid of "userid"
2020-05-15 21:34:12 +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
David Négrier
f8e6d6c94f
Merge pull request #115 from thecodingmachine/update-webrtc
Update media webrtc
2020-05-14 22:00:45 +02:00
David Négrier
34d3a292db
Removing log trace 2020-05-14 22:00:31 +02:00
gparant
b467adece9 Minor update floor0 and floor1 2020-05-14 21:00:52 +02:00
gparant
182882fded Fix border view 2020-05-14 20:54:34 +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
cf4fa8677f
Merge pull request #112 from thecodingmachine/debug/improve_message
More detailed error log to debug disconnect issue
2020-05-13 22:24:53 +02:00
David Négrier
ad70ecca74 Fixing CD 2020-05-13 22:20:34 +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
David Négrier
6e71d7f28a
Merge pull request #109 from thecodingmachine/Auto-reconnect
Auto-reconnect
2020-05-13 22:03:56 +02:00
David Négrier
4cd2141785
Merge pull request #108 from thecodingmachine/bugFixes
fixed a game crash on firefox on http
2020-05-13 21:48:09 +02:00
gparant
ec297e3912 Auto-reconnect 2020-05-13 20:22:42 +02:00
kharhamel
e2531343d1 fixed a game crash on firefox on http 2020-05-13 16:56:22 +02:00
David Négrier
dd5a0c9933 Fixing domain name 2020-05-13 16:17:58 +02:00
David Négrier
7d67b62cf9
Merge pull request #107 from thecodingmachine/domain_name
Deploying master on new workadventu.re domain
2020-05-13 16:07:06 +02:00
David Négrier
cc621c09cb Not adding comment on push (only pull_request) 2020-05-13 15:58:17 +02:00
David Négrier
c1659ecac4 Deploying master on new workadventu.re domain
... but still deploying in the test cluster.
2020-05-13 15:32: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