adding room service, joining room

adding nick password into model, stored in the Room
to allow more secure joining for repeated times
This commit is contained in:
efim
2023-04-25 11:41:32 +04:00
parent 2244f38348
commit 1b71c942ec
5 changed files with 53 additions and 12 deletions

View File

@@ -62,7 +62,8 @@ object Models {
owner: PlayerID,
password: String,
allowedCards: List[String],
round: RoundState
round: RoundState,
playersPasswords: Map[String, String] = Map.empty // nickname into password
) {
def toViewFor(playerId: PlayerID): RoomStateView = {
players

View File

@@ -4,6 +4,6 @@ import io.circe.generic.semiauto._
import io.circe._
object Requests {
final case class LogIn(roomName: String, nickname: String, password: String)
final case class LogIn(roomName: String, nickname: String, password: String, nickPassword: String)
derives Codec.AsObject
}