Skip to content

Commit

Permalink
fix: backend returning moves incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
thehowl committed Sep 23, 2023
1 parent 7673298 commit 7da3a8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions realm/lobby.gno
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ var (
lobbyPlayer2Game avl.Tree // player addr -> *Game. set after a user is matched; reset when joining again.
)

// XXX: REMOVE BEFORE PRODUCTION
func LobbyData() ([tcLobbyMax][]lobbyPlayer, avl.Tree) {
return lobby, lobbyPlayer2Game
}

func LobbyJoin(seconds, increment int) {
std.AssertOriginCall()

Expand Down Expand Up @@ -228,6 +233,7 @@ func LobbyQuit() {
}
}
}
lobbyPlayer2Game.Remove(caller.String())

panic("you are not in the lobby")
}
1 change: 1 addition & 0 deletions realm/rules.gno
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ func (oldp Position) validateMove(m Move) (_ Position, ok bool) {
capture := p.B[m.To] != PieceEmpty
p.B[m.From], p.B[m.To] = PieceEmpty, p.B[m.From]
p.Flags = newFlags
p.Moves = append([]Move{}, p.Moves...)
p.Moves = append(p.Moves, m)

// halfmove clock + hashes logic
Expand Down

0 comments on commit 7da3a8d

Please sign in to comment.