Compare commits

...

185 Commits

Author SHA1 Message Date
Thomas CHAZOT 509c95c2b8 Mise à jour de 'cryptide_project/src/model/DataManagers/DbUserService.ts'
continuous-integration/drone/push Build is failing Details
6 months ago
Thomas CHAZOT c7925ad300 Mise à jour de 'cryptide_project/src/model/DataManagers/DbUserService.ts'
continuous-integration/drone/push Build is failing Details
6 months ago
Thomas CHAZOT 03bf4881c1 Mise à jour de 'cryptide_project/Dockerfile'
continuous-integration/drone/push Build is failing Details
6 months ago
Thomas CHAZOT ba7ab92ce5 Mise à jour de 'cryptide_project/package.json'
continuous-integration/drone/push Build is failing Details
6 months ago
Thomas CHAZOT cb6a540673 Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 1e5bc54fa1 Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT e340436158 Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 09048e8531 icon pour download
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 804eb670b8 évite doublons
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 425cdfaf79 évite doublons
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 9d082bb5d5 Merge branch 'master' into CI/CD
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 4f8cacebca fix pdf
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 2c6d9d08db fix des titres pour online
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot c8c33c5e2e fix des titres pour online
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas Chazot f5f0a56c5e fix d'un bug
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 9b4213ac32 Merge branch 'master' into CI/CD
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 78e35c446c Mise à jour de 'cryptide_project/server/api/controllers/SessionController.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT b86d513a54 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 1ad0e74b70 ratio victoire
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas Chazot 7bc1a7059f ratio victoire
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 27444a2f4e ratio victoire
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot c49a547861 test pour être connecté direct après login
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 28139f96b0 test pour être connecté direct après login
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 9448857bc6 enigme intermédiaire
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 688634ac8b enigme intermédiaire dans bdd'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 350fcbf0b0 fix de toutes les requêtes pour marcher avec mysql2
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 638fd465b9 fix de toutes les requêtes pour marcher avec mysql2
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 84304ee1b5 fix de toutes les requêtes pour marcher avec mysql2
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 26ca450c16 fix de toutes les requêtes pour marcher avec mysql2
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 9447149ff7 fix de toutes les requêtes pour marcher avec mysql2
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 0b471d0eac fix pb api
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot c21a971601 fix pb api
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot f606711cb6 fix pb api
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 3ec900b2d6 fix pb api
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 710e1bbd53 fix pb api
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot c2fae58875 fix pb api
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot bfc2f377cc fix pb api
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 5b7f57b1aa fix pb api
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot d2c776a043 fix pb api
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot c0372051e0 fix addMastermindStats
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 33b4f7368f fix addMastermindStats
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot f30035600c fix addMastermindStats
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 72fc8b4f37 fix addMastermindStats
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 5731a3f582 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot d59753def6 fix addMastermindStats
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas Chazot aaa0a5ee87 remove des console.log
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot f97751c7a4 test pour voir si on passe dans les stats
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT b62d567cbb Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 774e4c92b7 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas Chazot f0e5ec7128 oups
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas Chazot e560346ce3 Merge branch 'master' into CI/CD
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 0fdfdc4da6 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT bb2cf53ee8 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 898bbf787d Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT b954641e81 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas Chazot 5901d8eb00 fix scoreboard ?
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 6264f6192c Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 7fb3770aa8 fix ?
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas Chazot 48f0fe44a5 fix getWeeklyOnlineStats?
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 31818f5b17 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT f7099da36f Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 49a5890b6d Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 83bba8fa0b Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT aa43e21d71 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 197c706b90 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 4e450c3449 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT d75ba65f84 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 3bd75b520e Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 58388609ba Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 14fd2d23a0 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas Chazot b08be2bb45 fix
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas Chazot 8527824948 fix
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 1720499018 fix
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 24b0d7702b fix
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 8ec3ca9f4c euh
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 3e74b76898 euh
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot bce6ac6ff7 euh
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 8fbebd1d2c fix petit bug
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 69532fc170 fix petit bug
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas Chazot 6c7c81a5a0 fix de toutes les requêtes pour marcher avec mysql2
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas Chazot 96e4d50db4 tjrs la CI/CD
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 11365b06a4 fix
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot acf4258d58 fix
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT bd6ef389e1 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT efc66f59a4 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot c92ec668aa fix
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot c788952c7b test pour voir les tables créées
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT c481373f5e Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 58e39a4b6b Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT b78b4811a4 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 7019820cdc Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot e4af27c6f3 Test get users
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT 8ffa44a89d Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 3eddd9abf9 Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 5bab2ff478 Mise à jour de 'cryptide_project/server/api/services/DatabaseService.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 64d842224c Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 4a17230e04 ci/cd
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 9793c4117a Mise à jour de 'cryptide_project/server/api/services/DatabaseService.js'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 92d346a6d3 Mise à jour de 'cryptide_project/server/api/services/DatabaseService.js'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 5d458d0169 Mise à jour de 'cryptide_project/server/api/services/DatabaseService.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT eaed32c250 Mise à jour de 'cryptide_project/server/api/services/DatabaseService.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT af0e04f0d1 Mise à jour de 'cryptide_project/Dockerfile'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 86d8f16726 Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 3d67c9a864 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas Chazot 3b2e876af2 fonction pour créer les tables
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas Chazot 80d774e7f3 fix des bugs pour les scoreboards avec mysql
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot cd7dd233e8 test pour les stats
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot ca511b1b73 test pour les stats
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 93e054d477 revert celui d'avant
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 87ba7f92da test
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 70128251f8 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 01c08e0214 Mise à jour de 'cryptide_project/server/api/controllers/AuthController.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 878080bf34 Mise à jour de 'cryptide_project/server/api/controllers/AuthController.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 6c8e797740 Mise à jour de 'cryptide_project/server/api/services/DatabaseService.js'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT aa795d1d61 Mise à jour de 'cryptide_project/server/api/server.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 41217810fe changement pour mysql
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 51fd2d51ef Mise à jour de 'cryptide_project/server/api/server.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 868562839b Mise à jour de 'cryptide_project/server/api/server.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT aae1019360 Mise à jour de 'cryptide_project/server/api/server.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 12f76e928c fix
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 1092fc36d0 nysql maj
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT df20a416a1 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 5cc4ca31a5 Mise à jour de 'cryptide_project/server/api/Dockerfile'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 3b21819a9d Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT eab829191d Mise à jour de '.drone.yml'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas Chazot 01f7918430 test
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot 5cbc92834c dockerfile + package.json pour serveur bdd
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot b7eeff29f8 dockerfile + package.json pour les serveurs
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT cf255534cf Mise à jour de 'cryptide_project/server/socket_io/Dockerfile'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT debb8776da Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 4ebad1d11f Mise à jour de 'cryptide_project/src/Components/GraphContainer.tsx'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 6818eb8f02 Mise à jour de 'cryptide_project/src/Components/GraphContainer.tsx'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 8befaa53c2 Mise à jour de 'cryptide_project/src/Components/GraphContainer.tsx'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 330a0ad525 Mise à jour de 'cryptide_project/src/Components/GraphContainer.tsx'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 6c3a92cc22 Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT a773956c34 Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas Chazot fcbb77dcf5 merge a buggé
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas Chazot a41a0821f5 Merge branch 'master' into CI/CD
7 months ago
Thomas CHAZOT 3407d0d291 Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 24821e4f27 Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 50bf9a7f6b Mise à jour de 'cryptide_project/server/socket_io/Dockerfile'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT c008089aa1 Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT ca164707a8 Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT e35232fc5e Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT fa71a8d103 Mise à jour de 'cryptide_project/server/socket_io/Dockerfile'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT 4e0dea5621 Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT cdb262ca5f Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 84e8a3605e Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT cc86ea9ecc Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT c36328a9f0 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 75ccf78c4e Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 7d6021c44f Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT 7d71d6ec81 Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build is failing Details
7 months ago
Thomas CHAZOT c3d217f422 Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 79ef5b07e3 Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT 0282bad2cc Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 81063023f8 Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 5735b5a947 Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 2f8f0f1032 Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT f79e8b6312 Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 9bef039161 Mise à jour de 'cryptide_project/server/socket_io/Dockerfile'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT 43dfa56c9d Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT 6affd439d0 Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 78d79a7514 Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT f1734b7d6b Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 99b6250ec0 Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 629363200d Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 0f6ad89476 Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT 1d9bb237d7 Mise à jour de 'cryptide_project/server/socket_io/Dockerfile'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT 72e88a0c09 Mise à jour de 'cryptide_project/server/socket_io/Dockerfile'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 636ab43089 Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT 6743afdac6 Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT b9395620df Mise à jour de 'cryptide_project/src/SocketConfig.ts'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT d2d2855eba Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 476129c01e Mise à jour de 'cryptide_project/src/SocketConfig.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT bc7a999ba9 Mise à jour de 'cryptide_project/src/SocketConfig.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 7d3a02549c Mise à jour de 'cryptide_project/server/socket_io/Dockerfile'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 2e5c4dc98f Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT 5307512078 Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT 3722f55f2f Mise à jour de 'cryptide_project/src/AdressSetup.ts'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 437bc9327b Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT 1b0ee4688c Mise à jour de 'cryptide_project/server/socket_io/server.js'
continuous-integration/drone/push Build was killed Details
7 months ago
Thomas CHAZOT 28186ae6ef Mise à jour de '.drone.yml'
continuous-integration/drone/push Build is passing Details
7 months ago
Thomas CHAZOT 5310c47344 Ajouter 'cryptide_project/server/socket_io/Dockerfile'
continuous-integration/drone/push Build encountered an error Details
7 months ago
Thomas CHAZOT 69049b0e24 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build encountered an error Details
7 months ago

@ -33,7 +33,6 @@ steps:
sonar_token:
from_secret: SECRET_SONAR_LOGIN_CRYPTIDE
#
- name: deploy-container-mysql
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
build:
@ -42,8 +41,8 @@ steps:
IMAGENAME: mysql:latest
CONTAINERNAME: mysql
COMMAND: create
#OVERWRITE: true
PRIVATE: false
#OVERWRITE: false
PRIVATE: true
CODEFIRST_CLIENTDRONE_ENV_MYSQL_ROOT_PASSWORD:
from_secret: MYSQL_ROOT_PASSWORD
CODEFIRST_CLIENTDRONE_ENV_MYSQL_DATABASE:
@ -68,16 +67,15 @@ steps:
from_secret: SECRET_REGISTRY_USERNAME
password:
from_secret: SECRET_REGISTRY_PASSWORD
environment:
BASEPATH: "/containers/Crypteam-website"
#depends_on: [ build ]
when:
branch:
- CI/CD
- CI/CD
#container deployment
- name: deploy-server-containers
- name: deploy-container-web
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
environment:
IMAGENAME: hub.codefirst.iut.uca.fr/thomas.chazot2/cryptide/web:latest
@ -85,8 +83,81 @@ steps:
COMMAND: create
OVERWRITE: true
#PRIVATE: true
CODEFIRST_CLIENTDRONE_ENV_BASEPATH: "/containers/Crypteam-website"
ADMINS: thomaschazot2,pierreferreira,baptistemarcel
depends_on: [ container-web ]
when:
branch:
- master
- CI/CD
- name: container-api
image: plugins/docker
settings:
dockerfile: ./cryptide_project/server/api/Dockerfile
context: ./cryptide_project/server/api
registry: hub.codefirst.iut.uca.fr
repo: hub.codefirst.iut.uca.fr/thomas.chazot2/cryptide/api
username:
from_secret: SECRET_REGISTRY_USERNAME
password:
from_secret: SECRET_REGISTRY_PASSWORD
#depends_on: [ build ]
when:
branch:
- CI/CD
- name: deploy-api-containers
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
environment:
IMAGENAME: hub.codefirst.iut.uca.fr/thomas.chazot2/cryptide/api:latest
CONTAINERNAME: api
COMMAND: create
OVERWRITE: true
#PRIVATE: true
CODEFIRST_CLIENTDRONE_ENV_MYSQL_HOST:
from_secret: MYSQL_HOST
CODEFIRST_CLIENTDRONE_ENV_MYSQL_USER:
from_secret: MYSQL_USER
CODEFIRST_CLIENTDRONE_ENV_MYSQL_PASSWORD:
from_secret: MYSQL_PASSWORD
CODEFIRST_CLIENTDRONE_ENV_MYSQL_DATABASE:
from_secret: MYSQL_DATABASE
CODEFIRST_CLIENTDRONE_ENV_CREATETABLES: "false"
ADMINS: thomaschazot2,pierreferreira,baptistemarcel
depends_on: [ container-api ]
when:
branch:
- CI/CD
#
- name: container-server
image: plugins/docker
settings:
dockerfile: ./cryptide_project/server/socket_io/Dockerfile
context: ./cryptide_project
registry: hub.codefirst.iut.uca.fr
repo: hub.codefirst.iut.uca.fr/thomas.chazot2/cryptide/server
username:
from_secret: SECRET_REGISTRY_USERNAME
password:
from_secret: SECRET_REGISTRY_PASSWORD
#depends_on: [ build ]
when:
branch:
- CI/CD
#container deployment
- name: deploy-server-containers
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
environment:
IMAGENAME: hub.codefirst.iut.uca.fr/thomas.chazot2/cryptide/server:latest
CONTAINERNAME: server
COMMAND: create
OVERWRITE: true
#PRIVATE: true
ADMINS: thomaschazot2,pierreferreira,baptistemarcel
depends_on: [ container-server ]
when:
branch:
- CI/CD

@ -1,9 +1,9 @@
# Utilisez l'image Node.js LTS comme base
FROM node:14-alpine
#
# Définissez le répertoire de travail dans le conteneur
WORKDIR /app
#
# Copiez le package.json et le package-lock.json dans le conteneur
COPY package*.json ./

@ -1,6 +1,7 @@
{
"name": "cryptide",
"version": "1.0.0",
"homepage": ".",
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.4.2",
"@fortawesome/free-regular-svg-icons": "^6.4.2",

@ -0,0 +1,20 @@
# Use the official Node.js image
FROM node:14
# Set the working directory in the container
WORKDIR /usr/src/app
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# Expose the port that the application will run on
EXPOSE 3003
# Command to run the application
CMD ["node", "server.js"]

@ -13,6 +13,8 @@ class AuthController {
try {
await databaseService.connect();
console.log("Test: ")
console.log(req.body)
// Vérifier que le pseudo n'existe pas déjà
const verif = await databaseService.getUserByPseudo(pseudo);
@ -193,6 +195,47 @@ class AuthController {
db.disconnect();
}
}
static async getUsers(req, res){
const db = new DatabaseService();
try{
await db.connect();
const users = await db.getUsers();
console.log(users)
res.status(200).json({ tab : users });
}
catch(error){
console.error(error);
res.status(500).json({ error: 'Erreur lors de la récupération des stats users.' });
}
finally{
await db.disconnect();
}
}
static async getGames(req, res){
const db = new DatabaseService();
try{
await db.connect();
const users = await db.getGames();
console.log(users)
res.status(200).json({ tab : users });
}
catch(error){
console.error(error);
res.status(500).json({ error: 'Erreur lors de la récupération des stats games.' });
}
finally{
await db.disconnect();
}
}
}
module.exports = AuthController;

@ -14,11 +14,13 @@ class SessionController {
const db = new DatabaseService();
try{
await db.connect();
const dailyMastermindStats = await db.getDailyMastermindStats();
console.log(dailyMastermindStats)
res.status(200).json({ tab : dailyMastermindStats });
res.status(200).json({ tab : dailyMastermindStats});
}
catch(error){
console.error(error);
@ -94,6 +96,9 @@ class SessionController {
const dailyOnlineStats = await db.getDailyOnlineStats();
res.status(200).json({ tab : dailyOnlineStats });
}
catch(error){
@ -116,7 +121,7 @@ class SessionController {
await db.connect();
const weeklyMastermindStats = await db.getWeeklyMastermindStats();
console.log(weeklyMastermindStats)
res.status(200).json({ tab : weeklyMastermindStats });
}
catch(error){

@ -25,7 +25,7 @@ class SessionController {
nbGamesMM = nbGamesMM.nbGames || 0;
let bestScoreMM = await db.getBestScoreMastermindByUserId(req.session.user.idUser);
bestScoreMM = bestScoreMM.bestScore || 0;
let avgNbTryMM = await db.getAvgNbTryMastermindByUserId(req.session.user.idUser);
let avgNbTryMM= await db.getAvgNbTryMastermindByUserId(req.session.user.idUser);
avgNbTryMM = avgNbTryMM.avgNbTry || 0;
req.session.user.mastermindStats = {nbGames: nbGamesMM,
@ -37,7 +37,7 @@ class SessionController {
nbGamesEF = nbGamesEF.nbGames || 0;
let nbWinsEF = await db.getNbWinsEnigmeByUserId(req.session.user.idUser, ENIGME_FACILE);
nbWinsEF = nbWinsEF.nbWins || 0;
let ratioEF = (nbWinsEF.nbWins / nbGamesEF.nbGames) * 100 || 0;
let ratioEF = (nbWinsEF / nbGamesEF) * 100 || 0;
let bestTimeEF = await db.getBestTimeEnigmeByUserId(req.session.user.idUser, ENIGME_FACILE);
bestTimeEF = bestTimeEF.bestTime || 0;
let avgTimeEF = await db.getAvgTimeEnigmeByUserId(req.session.user.idUser, ENIGME_FACILE);
@ -66,10 +66,10 @@ class SessionController {
nbGamesED = nbGamesED.nbGames || 0;
let nbWinsED = await db.getNbWinsEnigmeByUserId(req.session.user.idUser, ENIGME_DIFFICILE);
nbWinsED = nbWinsED.nbWins || 0;
let ratioED = (nbWinsED.nbWins / nbGamesED.nbGames) * 100 || 0;
let ratioED = (nbWinsED / nbGamesED) * 100 || 0
let bestTimeED = await db.getBestTimeEnigmeByUserId(req.session.user.idUser, ENIGME_DIFFICILE);
bestTimeED = bestTimeED.bestTime || 0;
let avgTimeED = await db.getAvgTimeEnigmeByUserId(req.session.user.idUser, ENIGME_DIFFICILE);
let avgTimeED = await db.getAvgTimeEnigmeByUserId(req.session.user.idUser, ENIGME_DIFFICILE);
avgTimeED = avgTimeED.avgTime || 0;
req.session.user.hardEnigmaStats = {nbGames: nbGamesED,
@ -83,7 +83,7 @@ class SessionController {
nbGamesOL = nbGamesOL.nbGames || 0;
let nbWinsOL = await db.getNbWinsOnlineByUserId(req.session.user.idUser);
nbWinsOL = nbWinsOL.nbWins || 0;
let ratioOL = (nbWinsOL.nbWins / nbGamesOL.nbGames) * 100 || 0;
let ratioOL = (nbWinsOL / nbGamesOL) * 100 || 0
req.session.user.onlineStats = {nbGames: nbGamesOL,
nbWins: nbWinsOL,
ratio: ratioOL};
@ -131,6 +131,7 @@ class SessionController {
static async addMastermindStats(req, res){
const db = new DatabaseService();
console.log(req.body)
try{
await db.connect();
@ -140,7 +141,7 @@ class SessionController {
res.status(200).json({ error: "true", message: 'User not found' });
return;
}
console.log(user)
await db.addMastermindStats(user.idUser, req.body.score, req.body.time);
res.status(200).json({ user: req.session.user }); //verif rep
@ -179,7 +180,30 @@ class SessionController {
}
}
// static async addMediumEnigmaStats(req, res)
static async addMediumEnigmaStats(req, res){
const db = new DatabaseService();
try{
await db.connect();
const user = await db.getUserByPseudo(req.body.pseudo);
if (!user) {
res.status(200).json({ error: "true", message: 'User not found' });
return;
}
await db.addMediumEnigmaStats(user.idUser, ENIGME_MOYEN, req.body.score, req.body.time);
res.status(200).json({ user: req.session.user }); //verif rep
}
catch(error){
console.error(error);
res.status(500).json({ error: 'Erreur lors de la modification des stats de l\'énigme moyenne de l\'utilisateur.' });
}
finally{
await db.disconnect();
}
}
static async addHardEnigmaStats(req, res){
const db = new DatabaseService();
@ -187,7 +211,7 @@ class SessionController {
try{
await db.connect();
const user = await db.getUserByPseudo(req.body.pseudo);
const user = await db.getUserByPseudo(req.body.pseudo);
if (!user) {
res.status(200).json({ error: "true", message: 'User not found' });
return;
@ -212,7 +236,7 @@ class SessionController {
try{
await db.connect();
const user = await db.getUserByPseudo(req.body.pseudo);
const user = await db.getUserByPseudo(req.body.pseudo);
if (!user) {
res.status(200).json({ error: "true", message: 'User not found' });
return;

@ -0,0 +1,13 @@
{
"name": "cryptide",
"version": "1.0.0",
"dependencies": {
"bcrypt": "^5.1.1",
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"express": "^4.18.2",
"express-session": "^1.17.3",
"mysql": "^2.18.1",
"mysql2": "^3.6.5"
}
}

@ -13,11 +13,15 @@ router.post('/auth/validatePassword', AuthController.validatePassword);
router.put('/auth/updatePassword', AuthController.updatePassword);
router.put('/session/updateNbNodes', AuthController.UpdateNbNodesIndices);
router.get('/auth/getAllUsers', AuthController.getUsers)
router.get('/auth/games', AuthController.getGames)
// Routes pour les sessions
router.get('/session', SessionController.getUserInformation);
router.post('/session/addMastermindStats', SessionController.addMastermindStats);
router.post('/session/addEasyEnigmaStats', SessionController.addEasyEnigmaStats);
// router.post('/session/addMediumEnigmaStats', SessionController.addMediumEnigmaStats);
router.post('/session/addMediumEnigmaStats', SessionController.addMediumEnigmaStats);
router.post('/session/addHardEnigmaStats', SessionController.addHardEnigmaStats);
router.post('/session/addOnlineStats', SessionController.addOnlineStats);
router.put('/session/updatePseudo', SessionController.UpdatePseudo);

@ -4,17 +4,16 @@ const cors = require('cors');
const bodyParser = require('body-parser');
const crypto = require('crypto');
const path = require('path');
const authRoutes = require(path.resolve(__dirname, './routes/authRoutes'));
const authRoutes = require(path.resolve(__dirname, './routes/AuthRoutes'));
const DatabaseService = require(path.resolve(__dirname, './services/DatabaseService'));
const app = express();
const port = 3003;
// Middleware
app.use(cors(
{
origin: ["http://172.20.10.4:3000", "http://localhost:3000"],
origin: ["http://172.20.10.4:3000", "http://localhost:8080", "*"],
credentials: true
}
)); // Autoriser les requêtes cross-origin
@ -43,6 +42,7 @@ app.use((err, req, res, next) => {
// Middleware pour la gestion des erreurs 404
app.use((req, res) => {
console.log(req.url)
res.status(404).send('Page non trouvée');
});

@ -1,36 +1,99 @@
const sqlite3 = require('sqlite3');
const mysql = require('mysql2');
const path = require('path');
const { rejects } = require('assert');
class DatabaseService {
constructor(){
this.db_name = "socialgraph";
}
// ----------------------------------------------------
// ------------------- UTILITAIRE ---------------------
// ----------------------------------------------------
async connect(client){
const dbPath = path.resolve(__dirname, `../../../db/${this.db_name}.db`)
async connect() {
const mysqlHost = process.env.MYSQL_HOST;
const mysqlUser = process.env.MYSQL_USER;
const mysqlPassword = process.env.MYSQL_PASSWORD;
const mysqlDatabase = process.env.MYSQL_DATABASE;
const createTables = process.env.CREATETABLES
const dbConfig = {
host: mysqlHost,
user: mysqlUser,
password: mysqlPassword,
database: mysqlDatabase
};
return new Promise((resolve, reject) => {
this.client = new sqlite3.Database(dbPath,
sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE,
(err) => {
if(err){
this.client = mysql.createConnection(dbConfig);
this.client.connect(async (err) => {
if (err) {
console.log(err)
reject(err);
}
else{
} else {
if (createTables === "true"){
await this.createTables()
}
resolve();
}
});
});
}
async createTables(){
try {
// Requête SQL pour créer la table 'users'
const createTableQuery = `
CREATE TABLE IF NOT EXISTS users (
idUser INT AUTO_INCREMENT PRIMARY KEY,
pseudo VARCHAR(50) NOT NULL,
password VARCHAR(60) NOT NULL,
profilePicture LONGBLOB,
createdDate TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
`;
// Exécuter la requête SQL
this.client.query(createTableQuery, (err, result) => {
if(err){
console.log(err)
}
else{
console.log("Table users créée")
}
});
const createTableGameQuery = `
CREATE TABLE IF NOT EXISTS games (
idGame INT AUTO_INCREMENT PRIMARY KEY,
idUser INT NOT NULL,
gameType VARCHAR(50) CHECK(gameType IN ('mastermind','enigme_facile','enigme_moyenne','enigme_difficile','multijoueur')),
win INT CHECK(win IN (0,1)) DEFAULT 0,
score INT NOT NULL DEFAULT 0,
time REAL NOT NULL DEFAULT 0,
playedDate TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (idUser) REFERENCES users(idUser)
);
`;
this.client.query(createTableGameQuery, (err, result) => {
if(err){
console.log(err)
}
else{
console.log("Table games créée")
}
});
}
catch(error){
console.log(error)
}
}
async disconnect(){
return new Promise((resolve, reject) => {
this.client.close((err) => {
this.client.end((err) => {
if(err){
reject(err);
}
@ -48,83 +111,86 @@ class DatabaseService {
// Récupère l'utilisateur par son id
async getUserByID(id){
return new Promise((resolve, reject) => {
this.client.get('SELECT * FROM users WHERE idUser = ?', id, (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('SELECT * FROM users WHERE idUser = ?', [id])
return rows[0];
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
// Récupère l'utilisateur par son pseudo
async getUserByPseudo(pseudo){
return new Promise((resolve, reject) => {
this.client.get('SELECT * FROM users WHERE pseudo = ?', pseudo, (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('SELECT * FROM users WHERE pseudo = ?', [pseudo])
return rows[0];
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async getUsers(){
try {
const [rows] = await this.client.promise().query('SELECT * FROM users');
return rows;
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async getGames(){
try {
const [rows] = await this.client.promise().query('SELECT * FROM games');
return rows;
} catch (err) {
throw new Error(`Error fetching games: ${err.message}`);
}
}
// insère un utilisateur dans la base de données
async insertUser(user) {
return new Promise((resolve, reject) => {
try {
const { pseudo, password } = user;
this.client.run('INSERT INTO users (pseudo, password) VALUES (?, ?)', [pseudo, password], (err, result) => {
if (err) {
reject(err);
} else {
resolve(result);
}
});
});
const [rows] = await this.client.promise().query('INSERT INTO users (pseudo, password) VALUES (?, ?)', [pseudo, password])
return rows;
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async deleteUser(userId){
return new Promise((resolve, reject) => {
this.client.run('DELETE FROM users WHERE idUser=?', userId, (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('DELETE FROM users WHERE idUser=?', [userId])
return rows;
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async updatePseudo(userId, newPseudo){
return new Promise((resolve, reject) => {
this.client.run('UPDATE users SET pseudo = ? WHERE idUser = ?', newPseudo, userId, (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('UPDATE users SET pseudo = ? WHERE idUser = ?', [newPseudo, userId])
return rows;
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async updatePassword(userId, newPassword){
return new Promise((resolve, reject) => {
this.client.run('UPDATE users SET password = ? WHERE idUser = ?', newPassword, userId, (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('UPDATE users SET password = ? WHERE idUser = ?', [newPassword, userId])
return rows;
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
// ---------------------------------------------------------------
@ -132,61 +198,39 @@ class DatabaseService {
// ---------------------------------------------------------------
async getDailyMastermindStats() {
return new Promise((resolve, reject) => {
// Obtenez la date actuelle au format AAAA-MM-JJ
try {
const currentDate = new Date().toISOString().slice(0, 10);
// Récupérer les 5 meilleurs scores de la journée
this.client.all(
'SELECT pseudo, score FROM users INNER JOIN games ON users.idUser = games.idUser WHERE gameType = ? AND SUBSTR(playedDate, 1, 10) = ? ORDER BY score ASC LIMIT 10',
"mastermind",
currentDate,
(err, result) => {
if (err) {
reject(err);
} else {
resolve(result);
}
}
);
});
const [rows] = await this.client.promise().query('SELECT pseudo, score FROM users INNER JOIN games ON users.idUser = games.idUser WHERE gameType = ? AND SUBSTR(playedDate, 1, 10) = ? ORDER BY score ASC LIMIT 10',
["mastermind",
currentDate])
return rows;
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async getDailyEnigmaStats(enigmaLevel) {
return new Promise((resolve, reject) => {
try {
const currentDate = new Date().toISOString().slice(0, 10);
this.client.all(
'SELECT pseudo, time FROM users INNER JOIN games ON users.idUser = games.idUser WHERE gameType = ? AND SUBSTR(playedDate, 1, 10) = ? ORDER BY time ASC LIMIT 10',
enigmaLevel,
currentDate,
(err, result) => {
if (err) {
reject(err);
} else {
resolve(result);
}
}
);
});
const [rows] = await this.client.promise().query('SELECT pseudo, time FROM users INNER JOIN games ON users.idUser = games.idUser WHERE gameType = ? AND SUBSTR(playedDate, 1, 10) = ? ORDER BY time ASC LIMIT 10',
[enigmaLevel,
currentDate])
return rows;
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async getDailyOnlineStats() {
return new Promise((resolve, reject) => {
try {
const currentDate = new Date().toISOString().slice(0, 10);
this.client.all(
'SELECT pseudo, COUNT(*) AS wins FROM users INNER JOIN games ON users.idUser = games.idUser WHERE gameType = ? AND SUBSTR(playedDate, 1, 10) = ? AND win = ? GROUP BY users.idUser ORDER BY wins ASC LIMIT 10',
"multijoueur", currentDate, 1,
(err, result) => {
if (err) {
reject(err);
} else {
resolve(result);
}
}
);
});
const [rows] = await this.client.promise().query('SELECT pseudo, COUNT(*) AS wins FROM users INNER JOIN games ON users.idUser = games.idUser WHERE gameType = ? AND SUBSTR(playedDate, 1, 10) = ? AND win = ? GROUP BY users.idUser ORDER BY wins ASC LIMIT 10',
["multijoueur", currentDate, 1])
return rows;
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
@ -195,70 +239,57 @@ class DatabaseService {
// ---------------------------------------------------------------
async getWeeklyMastermindStats() {
return new Promise((resolve, reject) => {
try {
const currentDate = new Date().toISOString().slice(0, 10);
const currentDay = new Date().getDay();
const firstDayOfWeek = new Date(new Date().setDate(new Date().getDate() - currentDay)).toISOString().slice(0, 10);
this.client.all(
'SELECT pseudo, score FROM users INNER JOIN games ON users.idUser = games.idUser WHERE gameType = ? AND SUBSTR(playedDate, 1, 10) BETWEEN ? AND ? ORDER BY score ASC LIMIT 10',
"mastermind",
firstDayOfWeek,
currentDate,
(err, result) => {
if (err) {
reject(err);
} else {
resolve(result);
}
}
);
});
const [rows] = await this.client.promise().query('SELECT pseudo, score FROM users INNER JOIN games ON users.idUser = games.idUser WHERE gameType = ? AND SUBSTR(playedDate, 1, 10) BETWEEN ? AND ? ORDER BY score ASC LIMIT 10',
["mastermind",
firstDayOfWeek,
currentDate])
return rows;
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async getWeeklyEnigmaStats(enigmaLevel) {
return new Promise((resolve, reject) => {
try {
const currentDate = new Date().toISOString().slice(0, 10);
const currentDay = new Date().getDay();
const firstDayOfWeek = new Date(new Date().setDate(new Date().getDate() - currentDay)).toISOString().slice(0, 10);
this.client.all(
'SELECT pseudo, time FROM users INNER JOIN games ON users.idUser = games.idUser WHERE gameType = ? AND SUBSTR(playedDate, 1, 10) BETWEEN ? AND ? ORDER BY time ASC LIMIT 10',
enigmaLevel,
firstDayOfWeek,
currentDate,
(err, result) => {
if (err) {
reject(err);
} else {
resolve(result);
}
}
);
});
const [rows] = await this.client.promise().query('SELECT pseudo, time FROM users INNER JOIN games ON users.idUser = games.idUser WHERE gameType = ? AND SUBSTR(playedDate, 1, 10) BETWEEN ? AND ? ORDER BY time ASC LIMIT 10',
[enigmaLevel,
firstDayOfWeek,
currentDate])
return rows;
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async getWeeklyOnlineStats() {
return new Promise((resolve, reject) => {
try {
const currentDate = new Date().toISOString().slice(0, 10);
const currentDay = new Date().getDay();
const firstDayOfWeek = new Date(new Date().setDate(new Date().getDate() - currentDay)).toISOString().slice(0, 10);
this.client.all(
'SELECT pseudo, COUNT(*) as wins FROM users INNER JOIN games ON users.idUser = games.idUser WHERE gameType = ? AND SUBSTR(playedDate, 1, 10) BETWEEN ? AND ? AND win = ? ORDER BY wins ASC LIMIT 10',
"multijoueur",
firstDayOfWeek,
currentDate,
1,
(err, result) => {
if (err) {
reject(err);
} else {
resolve(result);
}
}
);
});
const [rows] = await this.client.promise().query(`
SELECT users.pseudo, COUNT(*) as wins
FROM users
INNER JOIN games ON users.idUser = games.idUser
WHERE gameType = ? AND SUBSTR(playedDate, 1, 10) BETWEEN ? AND ? AND win = ?
GROUP BY users.pseudo
ORDER BY wins ASC
LIMIT 10;
`,
["multijoueur",
firstDayOfWeek,
currentDate,
1])
return rows;
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
// -------------------------------------------------------------
@ -266,97 +297,69 @@ class DatabaseService {
// -------------------------------------------------------------
async getNbGamesMastermindByUserId(userId){
return new Promise((resolve, reject) => {
this.client.get('SELECT COUNT(*) AS nbGames FROM games WHERE idUser = ? AND gameType = ?', userId, "mastermind", (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('SELECT COUNT(*) AS nbGames FROM games WHERE idUser = ? AND gameType = ?', [userId, "mastermind"])
return rows[0];
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async getBestScoreMastermindByUserId(userId){
return new Promise((resolve, reject) => {
this.client.get('SELECT MIN(score) AS bestScore FROM games WHERE idUser = ? AND gameType = ?', userId, "mastermind", (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('SELECT MIN(score) AS bestScore FROM games WHERE idUser = ? AND gameType = ?', [userId, "mastermind"])
return rows[0];
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async getAvgNbTryMastermindByUserId(userId){
return new Promise((resolve, reject) => {
this.client.get('SELECT AVG(score) AS avgNbTry FROM games WHERE idUser = ? AND gameType = ?', userId, "mastermind", (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('SELECT AVG(score) AS avgNbTry FROM games WHERE idUser = ? AND gameType = ?', [userId, "mastermind"])
return rows[0];
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async addMastermindStats(userId, score, time){
return new Promise((resolve, reject) => {
this.client.run('INSERT INTO games (idUser, gameType, win, score, time) VALUES (?, ?, ?, ?, ?)', userId, "mastermind", 1, score, time, (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('INSERT INTO games (idUser, gameType, win, score, time) VALUES (?, ?, ?, ?, ?)', [userId, "mastermind", 1, score, time])
return rows[0];
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
// -------------------------------------------------------------
// ------------------- STATS EN LIGNE --------------------------
// -------------------------------------------------------------
async getNbGamesOnlineByUserId(userId){
return new Promise((resolve, reject) => {
this.client.get('SELECT COUNT(*) AS nbGames FROM games WHERE idUser = ? AND gameType = ?', userId, "multijoueur", (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('SELECT COUNT(*) AS nbGames FROM games WHERE idUser = ? AND gameType = ?', [userId, "multijoueur"])
return rows[0];
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async getNbWinsOnlineByUserId(userId){
return new Promise((resolve, reject) => {
this.client.get('SELECT COUNT(*) AS nbWins FROM games WHERE idUser = ? AND gameType = ? AND win = ?', userId, "multijoueur", 1, (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('SELECT COUNT(*) AS nbWins FROM games WHERE idUser = ? AND gameType = ? AND win = ?', [userId, "multijoueur", 1])
return rows[0];
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async addOnlineStats(userId, win, time){
return new Promise((resolve, reject) => {
this.client.run('INSERT INTO games (idUser, gameType, win, score, time) VALUES (?, ?, ?, ?, ?)', userId, "multijoueur", win, 0, time, (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('INSERT INTO games (idUser, gameType, win, score, time) VALUES (?, ?, ?, ?, ?)', [userId, "multijoueur", win, 0, time])
return rows;
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
// -------------------------------------------------------------
@ -364,109 +367,84 @@ class DatabaseService {
// -------------------------------------------------------------
async getNbGamesEnigmeByUserId(userId, enigmaLevel){
return new Promise((resolve, reject) => {
this.client.get('SELECT COUNT(*) AS nbGames FROM games WHERE idUser = ? AND gameType = ?', userId, enigmaLevel, (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('SELECT COUNT(*) AS nbGames FROM games WHERE idUser = ? AND gameType = ?', [userId, enigmaLevel])
return rows[0];
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async getNbWinsEnigmeByUserId(userId, enigmaLevel){
return new Promise((resolve, reject) => {
this.client.get('SELECT COUNT(*) AS nbWins FROM games WHERE idUser = ? AND gameType = ? AND win = ?', userId, enigmaLevel, 1, (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('SELECT COUNT(*) AS nbWins FROM games WHERE idUser = ? AND gameType = ? AND win = ?', [userId, enigmaLevel, 1])
return rows[0];
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async getBestScoreEnigmeByUserId(userId, enigmaLevel){
return new Promise((resolve, reject) => {
this.client.get('SELECT MAX(score) AS bestScore FROM games WHERE idUser = ? AND gameType = ?', userId, enigmaLevel, (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('SELECT MAX(score) AS bestScore FROM games WHERE idUser = ? AND gameType = ?', [userId, enigmaLevel])
return rows[0];
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async getAvgScoreEnigmeByUserId(userId, enigmaLevel){
return new Promise((resolve, reject) => {
this.client.get('SELECT AVG(score) AS avgScore FROM games WHERE idUser = ? AND gameType = ?', userId, enigmaLevel, (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('SELECT AVG(score) AS avgScore FROM games WHERE idUser = ? AND gameType = ?', [userId, enigmaLevel])
return rows[0];
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async getBestTimeEnigmeByUserId(userId, enigmaLevel){
return new Promise((resolve, reject) => {
this.client.get('SELECT MIN(time) AS bestTime FROM games WHERE idUser = ? AND gameType = ?', userId, enigmaLevel, (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('SELECT MIN(time) AS bestTime FROM games WHERE idUser = ? AND gameType = ?', [userId, enigmaLevel])
return rows[0];
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async getAvgTimeEnigmeByUserId(userId, enigmaLevel){
return new Promise((resolve, reject) => {
this.client.get('SELECT AVG(time) AS avgTime FROM games WHERE idUser = ? AND gameType = ?', userId, enigmaLevel, (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('SELECT AVG(time) AS avgTime FROM games WHERE idUser = ? AND gameType = ?', [userId, enigmaLevel])
return rows[0];
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async addEasyEnigmaStats(userId, enigmaLevel, win, time){
return new Promise((resolve, reject) => {
this.client.run('INSERT INTO games (idUser, gameType, win, score, time) VALUES (?, ?, ?, ?, ?)', userId, enigmaLevel, win, 0, time, (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('INSERT INTO games (idUser, gameType, win, score, time) VALUES (?, ?, ?, ?, ?)', [userId, enigmaLevel, win, 0, time])
return rows;
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
// async addMediumEnigmaStats(userId, enigmaLevel, score)
async addMediumEnigmaStats(userId, enigmaLevel, score, time){
try {
const [rows] = await this.client.promise().query('INSERT INTO games (idUser, gameType, win, score, time) VALUES (?, ?, ?, ?, ?)', [userId, enigmaLevel, 1, score, time])
return rows;
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
async addHardEnigmaStats(userId, enigmaLevel, win, time){
return new Promise((resolve, reject) => {
this.client.run('INSERT INTO games (idUser, gameType, win, score, time) VALUES (?, ?, ?, ?, ?)', userId, enigmaLevel, win, 0, time, (err, result) => {
if(err){
reject(err);
}
else{
resolve(result);
}
});
});
try {
const [rows] = await this.client.promise().query('INSERT INTO games (idUser, gameType, win, score, time) VALUES (?, ?, ?, ?, ?)', [userId, enigmaLevel, win, 0, time])
return rows;
} catch (err) {
throw new Error(`Error fetching users: ${err.message}`);
}
}
}

@ -2,6 +2,7 @@ const bcrypt = require('bcrypt');
class UserService {
static async createUser(userData) {
console.log(userData)
// Hacher le mot de passe avant de le stocker dans la base de données
const hashedPassword = await bcrypt.hash(userData.password, 10);

@ -0,0 +1,20 @@
# Use the official Node.js image
FROM node:14
# Set the working directory in the container
WORKDIR /usr/src/app
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY ./server.js .
# Expose the port that the application will run on
EXPOSE 3002
# Command to run the application
CMD ["node", "server.js"]

@ -0,0 +1,11 @@
{
"name": "cryptide",
"version": "1.0.0",
"dependencies": {
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"express": "^4.18.2",
"express-session": "^1.17.3",
"socket.io": "^4.7.2"
}
}

@ -1,5 +1,6 @@
const express = require('express');
const http = require('http');
const https = require('https');
const socketIO = require('socket.io');
const cors = require('cors');
@ -21,6 +22,10 @@ server.listen(3002, () => {
console.log('Serveur Socket.IO écoutant sur le port 3002');
});
app.get('/', (req, res) => {
res.send('Bienvenue sur votre application !'); // Envoyez la réponse souhaitée ici
});
io.on('connection', (socket) => {
console.log(socket.id);

@ -1,15 +1,16 @@
// const ADRESSE_WEBSERVER = "http://172.20.10.4:3002"
const ADRESSE_WEBSERVER = "http://localhost:3002"
const ADRESSE_WEBSERVER = "https://193.49.118.205:21116"
// const ADRESSE_DBSERVER = "http://172.20.10.4:3003"
const ADRESSE_DBSERVER = "http://localhost:3003"
const ADRESSE_DBSERVER = "https://codefirst.iut.uca.fr/containers/Crypteam-api"
const tmp = ADRESSE_DBSERVER
const tmp2 = ADRESSE_WEBSERVER
console.log(ADRESSE_WEBSERVER + " wesh")
const ADRESSE_WEBSITE = ""
const basePath = process.env.REACT_APP_BASE_PATH || '';
const basePath = process.env.REACT_APP_BASEPATH || '/containers/Crypteam-website';
const tmp3 = basePath

@ -26,6 +26,9 @@ import Stub from "../model/Stub";
import EnigmeDuJourCreator from "../model/EnigmeDuJourCreator";
import { useIntl } from "react-intl";
import { io } from "socket.io-client";
import { ADRESSE_WEBSERVER } from "../AdressSetup";
interface MyGraphComponentProps {
onNodeClick: (shouldShowChoiceBar: boolean) => void;
handleShowTurnBar: (shouldShowTurnBar: boolean) => void
@ -143,7 +146,6 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
return () => clearInterval(intervalId);
}, []);
useEffect(() => {
testPlayers = players
}, [players])
@ -357,11 +359,11 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
});
pdf.addImage(canvas.toDataURL('image/png'), 'PNG', 0, 0, pdf.internal.pageSize.getWidth(), pdf.internal.pageSize.getHeight());
if (isDaily){
if (solo){
pdf.addPage();
let text = ""
if (difficulty === "easy"){
if (difficulty === "easy" || !isDaily){
indices.forEach((indice, index) => {
text += `Indice ${index + 1} : ${indice.ToString('fr')}.\n`
})
@ -436,14 +438,7 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
setIndicesData(choosenIndices)
const map = EnigmeDuJourCreator.createEnigme(networkPerson, choosenIndices, choosenPerson, Stub.GenerateIndice())
setDailyEnigmeData(map)
if (solo && (difficulty === "intermediate" || !isDaily)){
addToHistory("<----- ["+ intl.formatMessage({ id: 'turn' }) +" " + 1 +"/"+networkPerson.getPersons().length + "] ----->");
}
else{
choosenIndices.forEach((indice, index) => {
addToHistory(intl.formatMessage({ id: 'indice' }) + positionToEmoji(index, true) + " : " + indice.ToString(lang))
})
}
changecptTour(1)
testTemps=0
}
@ -816,14 +811,6 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
})
}
else {
if (firstLap){
firstLap=false
if (solo && (difficulty === "intermediate" || !isDaily)){
addToHistory("<----- ["+ intl.formatMessage({ id: 'turn' }) +" " + 1 +"/"+networkData.nodes.length + "] ----->");
}
}
}
const putCorrectBackground = () => {
@ -972,9 +959,7 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
network.on("click", async (params) => {
if(params.nodes.length > 0){
console.log(touchedPlayer)
setNodeIdData(params.nodes[0])
console.log(players)
// addToHistory("Le joueur a cliqué") //! TEST DEBUG
if (!solo){
if (askedWrongLocal){
@ -1120,16 +1105,14 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
setNbCoupData(cptTour)
try{
console.log("time: " + testTemps)
if(user && isLoggedIn && !downloaded){
if(solo){
if(isDaily){
// TODO: verif difficulté et add les stats
// TODO: verif pour facile et difficile, si réussi en one shot ou non
if(difficulty==="easy"){
manager.userService.addEasyEnigmaStats(user.pseudo, 1, testTemps - 0.5);
}
else if (difficulty === "intermediate"){
manager.userService.addMediumEnigmaStats(user.pseudo, cptTour, testTemps - 0.5);
}
else{
manager.userService.addHardEnigmaStats(user.pseudo, 1, testTemps - 0.5);
@ -1164,7 +1147,7 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
if (difficulty==="intermediate"){
addToHistory(personTest.getName() + intl.formatMessage({ id: 'history.NotCoupable' }));
cptTour ++; // On Incrémente le nombre de tour du joueur
addToHistory("<----- ["+ intl.formatMessage({ id: 'turn' }) + " " + cptTour +"/"+networkData.nodes.length + "] ----->");
addToHistory("<----- ["+ intl.formatMessage({ id: 'turn' }) + " " + cptTour +"/"+networkData.nodes.length);
changecptTour(cptTour); // On le transmet a la page précédente avec la fonction
}
else if (difficulty==="easy"){
@ -1172,9 +1155,13 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
changecptTour(cptTour); // On le transmet a la page précédente avec la fonction
}
else{
navigate(`${basePath}/endgame?solo=true&daily=true`)
setNetworkDataData(networkData)
setWinnerData(null)
if (user) {
manager.userService.addHardEnigmaStats(user.pseudo, 0, testTemps - 0.5);
}
navigate(`${basePath}/endgame?solo=true&daily=true`)
}
}
else{

@ -135,39 +135,39 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => {
<hr />
<p><FormattedMessage id='score.nbPlayed'/> : {Player.mastermindStats.nbGames}</p>
<p><FormattedMessage id='score.best'/>: {Player.mastermindStats.bestScore}</p>
<p><FormattedMessage id='score.moy'/>: {Player.mastermindStats.avgNbTry.toFixed(2)}</p>
<p><FormattedMessage id='score.moy'/>: {parseFloat(Player.mastermindStats.avgNbTry).toFixed(2)}</p>
</div>
<div className="stats">
<h5><FormattedMessage id='score.titre.easy'/></h5>
<hr />
<p><FormattedMessage id='score.nbPlayed'/>: {Player.easyEnigmaStats.nbGames}</p>
<p><FormattedMessage id='score.NbWin'/>: {Player.easyEnigmaStats.nbWins}</p>
<p><FormattedMessage id='score.ratio'/>: {Player.easyEnigmaStats.ratio.toFixed(2) + "%"}</p>
<p><FormattedMessage id='score.ratio'/>: {parseFloat(Player.easyEnigmaStats.ratio).toFixed(2) + "%"}</p>
<p><FormattedMessage id='score.bestTmp'/>: {Player.easyEnigmaStats.bestTime + "s"}</p>
<p><FormattedMessage id='score.moyTmp'/>: {Player.easyEnigmaStats.avgTime.toFixed(2) + "s"}</p>
<p><FormattedMessage id='score.moyTmp'/>: {parseFloat(Player.easyEnigmaStats.avgTime).toFixed(2) + "s"}</p>
</div>
<div className="stats">
<h5><FormattedMessage id='score.titre.int'/></h5>
<hr />
<p><FormattedMessage id='score.nbPlayed'/>: {Player.mediumEnigmaStats.nbGames}</p>
<p><FormattedMessage id='score.best'/>: {Player.mediumEnigmaStats.bestScore}</p>
<p><FormattedMessage id='score.moy'/>: {Player.mediumEnigmaStats.avgNbTry.toFixed(2)}</p>
<p><FormattedMessage id='score.moy'/>: {parseFloat(Player.mediumEnigmaStats.avgNbTry).toFixed(2)}</p>
</div>
<div className="stats">
<h5><FormattedMessage id='score.titre.hard'/></h5>
<hr />
<p><FormattedMessage id='score.nbPlayed'/>: {Player.hardEnigmaStats.nbGames}</p>
<p><FormattedMessage id='score.NbWin'/>: {Player.hardEnigmaStats.nbWins}</p>
<p><FormattedMessage id='score.ratio'/>: {Player.hardEnigmaStats.ratio.toFixed(2) + "%"}</p>
<p><FormattedMessage id='score.ratio'/>: {parseFloat(Player.hardEnigmaStats.ratio).toFixed(2) + "%"}</p>
<p><FormattedMessage id='score.bestTmp'/>: {Player.hardEnigmaStats.bestTime + "s"}</p>
<p><FormattedMessage id='score.moyTmp'/>: {Player.hardEnigmaStats.avgTime.toFixed(2) + "s"}</p>
<p><FormattedMessage id='score.moyTmp'/>: {parseFloat(Player.hardEnigmaStats.avgTime).toFixed(2) + "s"}</p>
</div>
<div className="stats">
<h5><FormattedMessage id='score.online'/></h5>
<h5><FormattedMessage id='score.titre.online'/></h5>
<hr />
<p><FormattedMessage id='score.nbPlayed'/>: {Player.onlineStats.nbGames}</p>
<p><FormattedMessage id='score.NbWin'/>: {Player.onlineStats.nbWins}</p>
<p><FormattedMessage id='score.ratio'/>: {Player.onlineStats.ratio.toFixed(2) + "s"}</p>
<p><FormattedMessage id='score.ratio'/>: {parseFloat(Player.onlineStats.ratio).toFixed(2) + "s"}</p>
</div>
</Carousel>
</Tab.Content>
@ -178,7 +178,7 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => {
<div className="stats">
<h5><FormattedMessage id='info.mdj.mastermind'/></h5>
<hr />
{dailyMastermindStats !== null ? (dailyMastermindStats.tab.length !== 0 ? dailyMastermindStats.tab.map((stats: any, index: number) => (
{(dailyMastermindStats && dailyMastermindStats.tab) ? (dailyMastermindStats.tab.length !== 0 ? dailyMastermindStats.tab.map((stats: any, index: number) => (
<>
<Row>
<Col>
@ -198,7 +198,7 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => {
<div className="stats">
<h5><FormattedMessage id='score.titre.easy'/></h5>
<hr />
{dailyEasyEnigmaStats !== null ? (dailyEasyEnigmaStats.tab.length !== 0 ? dailyEasyEnigmaStats.tab.map((stats: any, index: number) => (
{(dailyEasyEnigmaStats && dailyEasyEnigmaStats.tab) ? (dailyEasyEnigmaStats.tab.length !== 0 ? dailyEasyEnigmaStats.tab.map((stats: any, index: number) => (
<>
<Row>
<Col>
@ -218,7 +218,7 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => {
<div className="stats">
<h5><FormattedMessage id='score.titre.int'/></h5>
<hr />
{dailyMediumEnigmaStats !== null ? (dailyMediumEnigmaStats.tab.length !== 0 ? dailyMediumEnigmaStats.tab.map((stats: any, index: number) => (
{(dailyMediumEnigmaStats && dailyMediumEnigmaStats.tab) ? (dailyMediumEnigmaStats.tab.length !== 0 ? dailyMediumEnigmaStats.tab.map((stats: any, index: number) => (
<>
<Row>
<Col>
@ -238,7 +238,7 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => {
<div className="stats">
<h5><FormattedMessage id='score.titre.hard'/></h5>
<hr />
{dailyHardEnigmaStats !== null ? (dailyHardEnigmaStats.tab.length !== 0 ? dailyHardEnigmaStats.tab.map((stats: any, index: number) => (
{(dailyHardEnigmaStats && dailyHardEnigmaStats.tab) ? (dailyHardEnigmaStats.tab.length !== 0 ? dailyHardEnigmaStats.tab.map((stats: any, index: number) => (
<>
<Row>
<Col>
@ -256,9 +256,9 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => {
)}
</div>
<div className="stats">
<h5><FormattedMessage id='score.online'/></h5>
<h5><FormattedMessage id='score.titre.online'/></h5>
<hr />
{dailyOnlineStats !== null ? (dailyOnlineStats.tab.length !== 0 ? dailyOnlineStats.tab.map((stats: any, index: number) => (
{(dailyOnlineStats && dailyOnlineStats.tab) ? (dailyOnlineStats.tab.length !== 0 ? dailyOnlineStats.tab.map((stats: any, index: number) => (
<>
<Row>
<Col>
@ -284,7 +284,7 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => {
<div className="stats">
<h5><FormattedMessage id='info.mdj.mastermind'/></h5>
<hr />
{weeklyMastermindStats !== null ? (weeklyMastermindStats.tab.length !== 0 ? weeklyMastermindStats.tab.map((stats: any, index: number) => (
{(weeklyMastermindStats && weeklyMastermindStats.tab) ? (weeklyMastermindStats.tab.length !== 0 ? weeklyMastermindStats.tab.map((stats: any, index: number) => (
<>
<Row>
<Col>
@ -304,7 +304,7 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => {
<div className="stats">
<h5><FormattedMessage id='score.titre.easy'/></h5>
<hr />
{weeklyEasyEnigmaStats !== null ? (weeklyEasyEnigmaStats.tab.length !== 0 ? weeklyEasyEnigmaStats.tab.map((stats: any, index: number) => (
{(weeklyEasyEnigmaStats && weeklyEasyEnigmaStats.tab) ? (weeklyEasyEnigmaStats.tab.length !== 0 ? weeklyEasyEnigmaStats.tab.map((stats: any, index: number) => (
<>
<Row>
<Col>
@ -324,7 +324,7 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => {
<div className="stats">
<h5><FormattedMessage id='score.titre.int'/></h5>
<hr />
{weeklyMediumEnigmaStats !== null ? (weeklyMediumEnigmaStats.tab.length !== 0 ? weeklyMediumEnigmaStats.tab.map((stats: any, index: number) => (
{(weeklyMediumEnigmaStats && weeklyMediumEnigmaStats.tab) ? (weeklyMediumEnigmaStats.tab.length !== 0 ? weeklyMediumEnigmaStats.tab.map((stats: any, index: number) => (
<>
<Row>
<Col>
@ -344,7 +344,7 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => {
<div className="stats">
<h5><FormattedMessage id='score.titre.hard'/></h5>
<hr />
{weeklyHardEnigmaStats !== null ? (weeklyHardEnigmaStats.tab.length !== 0 ? weeklyHardEnigmaStats.tab.map((stats: any, index: number) => (
{(weeklyHardEnigmaStats && weeklyHardEnigmaStats.tab) ? (weeklyHardEnigmaStats.tab.length !== 0 ? weeklyHardEnigmaStats.tab.map((stats: any, index: number) => (
<>
<Row>
<Col>
@ -364,7 +364,7 @@ const ScoreBoard: React.FC<{ Player: User }> = ({ Player }) => {
<div className="stats">
<h5><FormattedMessage id='score.titre.online'/></h5>
<hr />
{weeklyOnlineStats !== null ? (weeklyOnlineStats.tab.length !== 0 ? weeklyOnlineStats.tab.map((stats: any, index: number) => (
{(weeklyOnlineStats && weeklyOnlineStats.tab) ? (weeklyOnlineStats.tab.length !== 0 ? weeklyOnlineStats.tab.map((stats: any, index: number) => (
<>
<Row>
<Col>

@ -23,6 +23,8 @@ const AuthProvider: React.FC<{ children: ReactNode }> = ({ children }) => {
const [manager] = useState<Manager>(new Manager(new DbUserService()))
const login = async () => {
const [u, bool] = await manager.userService.fetchUserInformation()
setUser(u)
setIsLoggedIn(true);
};

@ -14,14 +14,12 @@ import PlayerList from '../Components/PlayerList';
import TurnBar from '../Components/TurnBar';
/* Icon */
import Leave from "../res/icon/leave.png";
import Param from "../res/icon/param.png";
import Replay from "../res/icon/replay.png";
import Info from "../res/icon/infoGreen.png";
import Check from "../res/icon/checkboxGreen.png";
import Alpha from "../res/GreekLetters/alphaW.png";
import MGlass from "../res/icon/magnifying-glass.png";
import Download from "../res/icon/download.png"
import Pdf from "../res/icon/pdf.png"
import Tex from "../res/icon/tex.png"
import Reset from "../res/icon/reset.png";
import Oeye from "../res/icon/eye.png";
import Ceye from "../res/icon/hidden.png";
@ -559,7 +557,7 @@ const handleBlurIndice = () => {
backgroundColor: theme.colors.tertiary,
borderColor: theme.colors.secondary
}}>
<img src={Download} alt="indice" height="40"/>
<img src={Tex} alt="indice" height="40"/>
</button>
}
@ -569,7 +567,7 @@ const handleBlurIndice = () => {
backgroundColor: theme.colors.tertiary,
borderColor: theme.colors.secondary
}}>
<img src={Download} alt="indice" height="40"/>
<img src={Pdf} alt="indice" height="40"/>
</button>
}
</div>

@ -85,7 +85,8 @@ function Lobbies() {
handleSetCptNavigation();
if (first){
handleSetFirst();
setFirst(false)
socket.emit("request lobbies")
}

@ -31,9 +31,7 @@ const SignIn = () => {
setError(null);
const result = await AuthService.signIn(data);
console.log(result);
console.log(result)
setShowConfirmation(true);
setTimeout(async () => {
await login();

@ -1,6 +1,9 @@
import { io } from "socket.io-client";
import { ADRESSE_WEBSERVER } from "./AdressSetup";
const socket = io(ADRESSE_WEBSERVER);
const socket = io(ADRESSE_WEBSERVER, {transports: ['websocket'], reconnection: false});
console.log(ADRESSE_WEBSERVER)
console.log(socket.id)
export {socket}

@ -137,7 +137,7 @@
"score.titre.easy": "Easy Enigma",
"score.titre.int": "Intermediate Enigma",
"score.titre.hard": "Hard Enigma",
"score.online": "Online",
"score.titre.online": "Online",
"score.tab.stat" : "Your Stats",
"score.tab.quoti" : "Daily",

@ -135,7 +135,7 @@
"score.titre.easy" : "Énigme facile",
"score.titre.int" : "Énigme intermédiaire",
"score.titre.hard" : "Énigme difficile",
"score.online" : "En ligne",
"score.titre.online" : "En ligne",
"score.tab.stat" : "Vos Stats",
"score.tab.quoti" : "Quotidien",

@ -10,8 +10,12 @@ class DbUserService implements IUserService{
const sessionData = await SessionService.getSession();
// Vérifie si il y a une session
const id = socket.id;
if (!id){
return [null, false]
}
if (sessionData.user) {
const currentUser = new User(socket.id, sessionData.user.pseudo, sessionData.profilePicture,
const currentUser = new User(id, sessionData.user.pseudo, sessionData.profilePicture,
{
nbGames: sessionData.user.mastermindStats.nbGames,
bestScore: sessionData.user.mastermindStats.bestScore,
@ -115,18 +119,18 @@ class DbUserService implements IUserService{
}
}
// async addMediumEnigmaStats(pseudo: string, win: number, time: number): Promise<void> {
// try {
// const result = await SessionService.addMediumEnigmaStats(pseudo, win, time);
// if (result) {
// console.log("Stats medium updated");
// } else {
// console.log("Stats medium not updated");
// }
// } catch (error) {
// console.error(error);
// }
// }
async addMediumEnigmaStats(pseudo: string, score: number, time: number): Promise<void> {
try {
const result = await SessionService.addMediumEnigmaStats(pseudo, score, time);
if (result) {
console.log("Stats medium updated");
} else {
console.log("Stats medium not updated");
}
} catch (error) {
console.error(error);
}
}
async addHardEnigmaStats(pseudo: string, win: number, time: number): Promise<void> {
try {

@ -5,7 +5,7 @@ interface IUserService{
changeNodesIndices(nbNodes: number, nbIndices: number): Promise<void>
addMastermindStats(pseudo: string, score: number, time: number): Promise<void>
addEasyEnigmaStats(pseudo: string, win: number, time: number): Promise<void>
// addMediumEnigmaStats(pseudo: string, win: number, time: number): Promise<void>
addMediumEnigmaStats(pseudo: string, score: number, time: number): Promise<void>
addHardEnigmaStats(pseudo: string, win: number, time: number): Promise<void>
addOnlineStats(pseudo: string, win: number, time: number): Promise<void>
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

After

Width:  |  Height:  |  Size: 822 B

@ -108,7 +108,33 @@ class SessionService {
}
}
// static async addMediumEnigmaStats(pseudo: string, win: number, time: number)
static async addMediumEnigmaStats(pseudo: string, score: number, time: number){
try {
const response = await fetch(ADRESSE_DBSERVER + '/session/addMediumEnigmaStats', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
credentials: 'include',
body: JSON.stringify({
pseudo,
score,
time
}),
});
if (response.ok) {
const result = await response.json();
return result;
} else {
const errorResponse = await response.json();
throw new Error(errorResponse.error);
}
} catch (error) {
console.error(error);
throw error;
}
}
static async addHardEnigmaStats(pseudo: string, win: number, time: number){
try {

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save