Commit Graph

931 Commits

Author SHA1 Message Date
David Négrier
da0d9fed87 Adding a new SelectCharacterScene
Taking what was done in the LoginScene regarding character selection and putting it in its own scene.
Also, making character selection possible via the keyboard.
2020-05-25 23:26:27 +02:00
David Négrier
a0ce57e582
Merge pull request #127 from thecodingmachine/remove_dead_code
Removing dead code from previous messaging system
2020-05-25 22:44:33 +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
62cb8cca87 Also removing dead class 2020-05-25 22:36:44 +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
0ade4daa99
Merge pull request #126 from thecodingmachine/typos
Fixing typos.
2020-05-24 23:29:05 +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
b58eef6e7f
Merge pull request #124 from moufmouf/rename_maps_endpoint
Renaming /maps to /start-map
2020-05-24 22:58:06 +02:00
David Négrier
cd586a9e0c Renaming /maps to /start-map
Closes #90
2020-05-24 22:53:10 +02:00
David Négrier
cd7763770e Improving doc 2020-05-24 15:39:55 +02:00
David Négrier
7e6f34e780
Merge pull request #123 from thecodingmachine/map_instances
Adding a notion of instances per map
2020-05-23 21:48: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
1f2b33baec
Merge pull request #120 from thecodingmachine/refactor_messages
Refactored and optimized messages
2020-05-23 17:25:18 +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
David Négrier
948284ae5e
Merge pull request #121 from thecodingmachine/fix_mediatream_manage
Fix mediatream manage and connection server down
2020-05-23 17:12:10 +02:00
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