Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d72cda5ff | ||
| 3ce2b133bc | |||
| 802b6bf764 | |||
|
|
410b4829f4 | ||
| 4b17af2c2f | |||
|
|
a163d9f8fe | ||
| dc3da9a75c | |||
|
|
4a4e9c48fc | ||
| 859dfce521 | |||
| 61ae9b5a5e |
22
CHANGELOG.md
22
CHANGELOG.md
@@ -321,3 +321,25 @@
|
|||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* Update knockoutwhistfrontend hash for consistency ([0e555cd](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/0e555cdfeb114464c9438bfd5dc397201a073867))
|
* Update knockoutwhistfrontend hash for consistency ([0e555cd](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/0e555cdfeb114464c9438bfd5dc397201a073867))
|
||||||
|
## (2026-01-07)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Implement PlayDogCard functionality in user session and update Vue component ([859dfce](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/859dfce521b193b9208d0c70fca88016f8fe08f4))
|
||||||
|
* Implement PlayDogCard functionality in user session and update Vue component ([61ae9b5](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/61ae9b5a5e7cd9fd82b77e9159814b0066874c2d))
|
||||||
|
## (2026-01-13)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **ui:** Tie selection ([#111](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/111)) ([dc3da9a](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/dc3da9a75c75597ce81ce4d023af5390197012c9))
|
||||||
|
## (2026-01-14)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* CORE-4 Rework the delay handler ([#113](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/issues/113)) ([4b17af2](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/4b17af2c2f50a9d67cf1cf49cafdaac8f807d4b6))
|
||||||
|
## (2026-01-14)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* CORE-4 Rework the delay handler ([3ce2b13](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/3ce2b133bccf4dd591b6d038d6fa0d409a907775))
|
||||||
|
* Update LobbyComponent to use icons for player removal buttons ([802b6bf](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Web/commit/802b6bf764eb41b806888e1b46a3e6d379d31f1b))
|
||||||
|
|||||||
Submodule knockoutwhist updated: 10fa4badf0...77a44fa17b
Submodule knockoutwhistfrontend updated: 02869fff8b...6b8488e7a4
@@ -9,6 +9,7 @@ import de.knockoutwhist.events.player.PlayerEvent
|
|||||||
import de.knockoutwhist.player.Playertype.HUMAN
|
import de.knockoutwhist.player.Playertype.HUMAN
|
||||||
import de.knockoutwhist.player.{AbstractPlayer, PlayerFactory}
|
import de.knockoutwhist.player.{AbstractPlayer, PlayerFactory}
|
||||||
import de.knockoutwhist.rounds.{Match, Round, Trick}
|
import de.knockoutwhist.rounds.{Match, Round, Trick}
|
||||||
|
import de.knockoutwhist.utils.DelayHandler
|
||||||
import de.knockoutwhist.utils.events.{EventListener, SimpleEvent}
|
import de.knockoutwhist.utils.events.{EventListener, SimpleEvent}
|
||||||
import events.{KickEvent, LeftEvent, LobbyUpdateEvent, UserEvent}
|
import events.{KickEvent, LeftEvent, LobbyUpdateEvent, UserEvent}
|
||||||
import exceptions.*
|
import exceptions.*
|
||||||
@@ -33,6 +34,7 @@ class GameLobby private(
|
|||||||
|
|
||||||
private val users: mutable.Map[UUID, UserSession] = mutable.Map()
|
private val users: mutable.Map[UUID, UserSession] = mutable.Map()
|
||||||
logic.addListener(this)
|
logic.addListener(this)
|
||||||
|
logic.addListener(DelayHandler)
|
||||||
logic.createSession()
|
logic.createSession()
|
||||||
|
|
||||||
def addUser(user: User): UserSession = {
|
def addUser(user: User): UserSession = {
|
||||||
|
|||||||
@@ -54,6 +54,16 @@ class UserSession(val user: User, val host: Boolean, val gameLobby: GameLobby) e
|
|||||||
case None =>
|
case None =>
|
||||||
println("Card Index not found or is not a number." + data)
|
println("Card Index not found or is not a number." + data)
|
||||||
}
|
}
|
||||||
|
case "PlayDogCard" =>
|
||||||
|
val maybeCardIndex: Option[Int] = (data \ "cardindex").asOpt[Int]
|
||||||
|
maybeCardIndex match {
|
||||||
|
case Some(index) =>
|
||||||
|
val session = gameLobby.getUserSession(user.id)
|
||||||
|
gameLobby.playDogCard(session, index)
|
||||||
|
case None =>
|
||||||
|
val session = gameLobby.getUserSession(user.id)
|
||||||
|
gameLobby.playDogCard(session, -1)
|
||||||
|
}
|
||||||
case "PickTrumpsuit" =>
|
case "PickTrumpsuit" =>
|
||||||
val maybeSuitIndex: Option[Int] = (data \ "suitIndex").asOpt[Int]
|
val maybeSuitIndex: Option[Int] = (data \ "suitIndex").asOpt[Int]
|
||||||
maybeSuitIndex match {
|
maybeSuitIndex match {
|
||||||
@@ -63,6 +73,15 @@ class UserSession(val user: User, val host: Boolean, val gameLobby: GameLobby) e
|
|||||||
case None =>
|
case None =>
|
||||||
println("Card Index not found or is not a number.")
|
println("Card Index not found or is not a number.")
|
||||||
}
|
}
|
||||||
|
case "PickTie" =>
|
||||||
|
val maybeCardIndex: Option[Int] = (data \ "cardIndex").asOpt[Int]
|
||||||
|
maybeCardIndex match {
|
||||||
|
case Some(index) =>
|
||||||
|
val session = gameLobby.getUserSession(user.id)
|
||||||
|
gameLobby.selectTie(session, index)
|
||||||
|
case None =>
|
||||||
|
println("Card Index not found or is not a number.")
|
||||||
|
}
|
||||||
case "KickPlayer" =>
|
case "KickPlayer" =>
|
||||||
val maybePlayerId: Option[String] = (data \ "playerId").asOpt[String]
|
val maybePlayerId: Option[String] = (data \ "playerId").asOpt[String]
|
||||||
maybePlayerId match {
|
maybePlayerId match {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ object WebsocketEventMapper {
|
|||||||
|
|
||||||
// Register all custom mappers here
|
// Register all custom mappers here
|
||||||
registerCustomMapper(ReceivedHandEventMapper)
|
registerCustomMapper(ReceivedHandEventMapper)
|
||||||
registerCustomMapper(GameStateEventMapper)
|
//registerCustomMapper(GameStateEventMapper)
|
||||||
registerCustomMapper(CardPlayedEventMapper)
|
registerCustomMapper(CardPlayedEventMapper)
|
||||||
registerCustomMapper(NewRoundEventMapper)
|
registerCustomMapper(NewRoundEventMapper)
|
||||||
registerCustomMapper(NewTrickEventMapper)
|
registerCustomMapper(NewTrickEventMapper)
|
||||||
@@ -54,6 +54,7 @@ object WebsocketEventMapper {
|
|||||||
}else {
|
}else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
//println(s"This is getting sent to client: EVENT: ${obj.id}, STATE: ${session.gameLobby.getLogic.getCurrentState.toString}, STATEDATA: ${stateToJson(session)}, DATA: ${data}")
|
||||||
Json.obj(
|
Json.obj(
|
||||||
"id" -> ("request-" + java.util.UUID.randomUUID().toString),
|
"id" -> ("request-" + java.util.UUID.randomUUID().toString),
|
||||||
"event" -> obj.id,
|
"event" -> obj.id,
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
MAJOR=4
|
MAJOR=4
|
||||||
MINOR=26
|
MINOR=30
|
||||||
PATCH=0
|
PATCH=0
|
||||||
|
|||||||
Reference in New Issue
Block a user