Skip to content

Latest commit

 

History

History
87 lines (69 loc) · 1.42 KB

readme.md

File metadata and controls

87 lines (69 loc) · 1.42 KB

team project trampoline groep 2

prequisites

  • node.js
  • git
  • mysql

installation

download node.js: https://nodejs.org/en/download/
clone repository: git clone https://github.com/JarneDel/Trampoline_Groep2_backend.git
run the install script: ./install.bat with database credentials (root has to be username)

    ./install.bat <database password> <database name>

run server

run the start script: ./start.bat

    ./start.bat

Websocket data

button

index 0: button left
index 1: button right
index 2: both buttons

{
    "button": {
        "btn": [false, false, false]
    }
}

kinect

{
  "jump": "float",   // coordinat   e of highest point
  "player": "int"   // player index
}

send calibration events

calibration: {
    "status": "calibrating" | "finished",
    "player": "p1" | "p2"
}

end of calibration

calibrationSuccess: {
    "indices": [i1, i2]
}
calibrationJumpDetected : {
    kinectIndex: i,
    playerIndex: calibratingPlayer
}

Username Generation

URL: http://localhost:3000/username
Content-type: application/json
response-example: "LonelyHat"

avatar Generation

response: .png image

POST http://localhost:3000/username/avatar
Content-Type: application/json

{
"id": {{id}}
}

### get avatar

GET http://localhost:3000/username/avatar/{{id}}
Content-Type: application/json