Skip to content

Commit

Permalink
Merge pull request #132 from Mind-Sports-Games/pla-1065-show-game-sco…
Browse files Browse the repository at this point in the history
…re-on-live-miniboardminigame

pass full fen on game updates and via more actions
  • Loading branch information
JamesHeppell authored Dec 13, 2024
2 parents 9cafda3 + 43d8331 commit 61098cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/main/scala/LilaHandler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ final class LilaHandler(
val versioned = ClientIn.RoundVersioned(version, flags, tpe, data)
History.round.add(gameId, versioned)
publish(_ room gameId, versioned)
if (tpe == "move" || tpe == "drop") Fens.move(gameId, data, flags.moveBy)
if (List("move", "drop", "lift", "undo", "endturn", "pass", "diceroll").contains(tpe))
Fens.move(gameId, data, flags.moveBy)
case TellRoom(roomId, payload) => publish(_ room roomId, ClientIn.Payload(payload))
case RoundResyncPlayer(fullId) =>
publish(_ room RoomId(fullId.gameId), ClientIn.RoundResyncPlayer(fullId.playerId))
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/ipc/ClientIn.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ object ClientIn {
.obj(
"id" -> gameId.value,
"lm" -> position.lastUci,
"fen" -> position.fenWithPlayerIndex
"fen" -> position.fen.value
)
.add("p1" -> position.clock.map(_.p1))
.add("p2" -> position.clock.map(_.p2))
Expand Down
4 changes: 1 addition & 3 deletions src/main/scala/model.scala
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,4 @@ case class UserTv(value: User.ID) extends AnyVal with StringValue

// NOTE: byoyomi - Shogi removed this stuff, but we definitely need it.
case class Clock(p1: Int, p2: Int, p1Pending: Int, p2Pending: Int, p1Delay: Int, p2Delay: Int)
case class Position(lastUci: Uci, fen: FEN, clock: Option[Clock], turnPlayerIndex: PlayerIndex) {
def fenWithPlayerIndex = s"$fen ${turnPlayerIndex.letter}"
}
case class Position(lastUci: Uci, fen: FEN, clock: Option[Clock], turnPlayerIndex: PlayerIndex)

0 comments on commit 61098cb

Please sign in to comment.