Merge branch 'main' of https://github.com/viastolfi/maettleship into docker-deployment

ftech last features
docker-deployment
Vincent ASTOLFI 10 months ago
commit fc98c8c49a

@ -66,6 +66,7 @@ The current state of maettleship is the following one
- [X] End game (partially handled) - [X] End game (partially handled)
- [X] Create an account and add it on the database - [X] Create an account and add it on the database
- [X] Connection to your account - [X] Connection to your account
- [X] Rematch
# TODO # TODO
@ -73,7 +74,6 @@ Those point are the feature I still need to introduce
- [ ] Security improvement (hashed password, sql injection handling) - [ ] Security improvement (hashed password, sql injection handling)
- [ ] Fix all the problems linked to my rooms implementation - [ ] Fix all the problems linked to my rooms implementation
- [ ] Rematch
- [ ] Player historic (link to its account) - [ ] Player historic (link to its account)
- [ ] Global scoreboard - [ ] Global scoreboard
- [ ] General error handling - [ ] General error handling

@ -202,11 +202,19 @@ io.on("connection", (socket) => {
if (room == null) { if (room == null) {
callack({ callack({
status: false status: false,
message: "No room for this code"
}) })
return return
} }
if (room.players.length >= 2) {
callack({
status: false,
message: "Room is full"
})
}
callack({ callack({
status: true status: true
}) })

@ -177,9 +177,7 @@ function onJoinRoom() {
socket.emit("ask for room", roomKey, socket.id, (response) => { socket.emit("ask for room", roomKey, socket.id, (response) => {
if (response.status !== true) { if (response.status !== true) {
if (errorHolder.textContent == "") { errorHolder.textContent = "Error : " + response.message
errorHolder.append("Error : Room Id don't exist")
}
} else { } else {
loader.style.display = "none"; loader.style.display = "none";
roomkeyHolder.innerHTML += `Your room key is : <strong>` + roomId + `</strong>`; roomkeyHolder.innerHTML += `Your room key is : <strong>` + roomId + `</strong>`;

Loading…
Cancel
Save