workadventure/back
David Négrier db3ef81842 Adding the ability to add several entry points
We can now have several start layers and choose an entry point using a # in the URL
2020-06-07 13:23:32 +02:00
..
src Adding the ability to add several entry points 2020-06-07 13:23:32 +02:00
tests Fix test socket 2020-05-23 16:32:14 +02:00
.dockerignore Fixing Dockerfiles 2020-04-11 15:11:22 +02:00
.eslintrc.json Create backend 2020-04-04 04:08:12 +02:00
.gitignore Add io socket message to share user position. 2020-04-04 12:42:02 +02:00
Dockerfile Triggerring CI rerun 2020-04-12 15:50:14 +02:00
README.md Fix typo 2020-04-04 23:29:36 +02:00
jasmine.json added jasmine in the back 2020-04-06 15:48:19 +02:00
package.json Adding a Yarn command to profile 2020-06-03 09:18:49 +02:00
position-test.js BIG WIP of refactoring my work in TS 2020-04-07 10:08:04 +02:00
server.ts Create backend 2020-04-04 04:08:12 +02:00
tsconfig.json Stricter compiler 2020-05-16 16:11:58 +02:00
yarn.lock Tracking nb users connected and server load 2020-05-28 22:00:56 +02:00

README.md

Back Features

Login

To start your game, you must authenticate on the server back. When you are authenticated, the back server return token and room starting.

POST => /login 
Params : 
    email: email of user.

Join a room

When a user is connected, the user can join a room. So you must send emit join-room with information user:

Socket.io => 'join-room'

    userId: user id of gamer
    roomId: room id when user enter in game
    position: {
        x: position x on map
        y: position y on map
    }

All data users are stocked on socket client.

Send position user

When user move on the map, you can share new position on back with event user-position. The information sent:

Socket.io => 'user-position'

    userId: user id of gamer
    roomId: room id when user enter in game
    position: {
        x: position x on map
        y: position y on map
    }

All data users are updated on socket client.

Receive positions of all users

The application sends position of all users in each room in every few 10 milliseconds. The data will pushed on event user-position:

Socket.io => 'user-position'

    [
        {
            userId: user id of gamer
            roomId: room id when user enter in game
            position: {
                x: position x on map
                y: position y on map
            }
        },
        ...
    ]

<<< back