workadventure/back
2020-11-13 12:15:58 +01:00
..
src HOTFIX: fixed a server when trying to connect to the adminRoomSocket 2020-11-13 12:15:58 +01:00
tests Renaming test file 2020-10-22 16:14:32 +02:00
.dockerignore
.eslintrc.json
.gitignore
Dockerfile Fixing messages copy 2020-09-24 11:54:00 +02:00
jasmine.json
LICENSE.txt
package.json Bump systeminformation from 4.27.5 to 4.27.11 in /back 2020-10-27 20:55:36 +00:00
position-test.js
README.md Fix typo 2020-04-04 23:29:36 +02:00
server.ts Migrating to uWS 2020-09-28 18:52:54 +02:00
tsconfig.json Merge branch 'develop' of github.com:thecodingmachine/workadventure into feature/global-message 2020-10-01 14:11:34 +02:00
yarn.lock Bump systeminformation from 4.27.5 to 4.27.11 in /back 2020-10-27 20:55:36 +00:00

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