jhonnold / node-tlcv

Tom's Live Chess Viewer for CCRL Broadcasts on the web!
https://ccrl.live
MIT License
23 stars 8 forks source link

Investigate PGN resets #54

Closed jhonnold closed 1 year ago

jhonnold commented 1 year ago

Moves are failing to parse when the board state is reset to 0 on a valid startpos move coming later in the game.


2023-07-11T09:17:51.382Z [DEBUG] [P16065] Message received from 122.58.163.86:16065: < 216619>FEN: rn1qk2r/pp2bppp/4pn2/3p4/4P3/3P1BP1/PP3P1P/RNBQ1RK1 b kq
2023-07-11T09:17:51.382Z [DEBUG] [P16065] Sending message ACK: 216619 to 122.58.163.86:16065
2023-07-11T09:17:51.382Z [DEBUG] [P16065] Message received from 122.58.163.86:16065: < 216620>WMOVE: 9. e4
2023-07-11T09:17:51.382Z [DEBUG] [P16065] Sending message ACK: 216620 to 122.58.163.86:16065
2023-07-11T09:17:51.382Z [DEBUG] [P16065] Message received from 122.58.163.86:16065: < 216621>FMR:  0
2023-07-11T09:17:51.382Z [DEBUG] [P16065] Sending message ACK: 216621 to 122.58.163.86:16065
2023-07-11T09:17:51.440Z [DEBUG] [P16065] Processing a total of 3 message(s)
2023-07-11T09:17:51.440Z [ INFO] [P16065] Updated game 16065 - FEN: rn1qk2r/pp2bppp/4pn2/3p4/4P3/3P1BP1/PP3P1P/RNBQ1RK1 b kq - 0 1
2023-07-11T09:17:51.441Z [ INFO] [P16065] Updated game 16065 - Color: white, Last Move: e4
2023-07-11T09:17:51.441Z [ INFO] [P16065] Requesting opening for game 16065 from https://explorer.lichess.ovh/master?play=e2e4
…
2023-07-11T09:18:06.943Z [ WARN] [P16065] Failed to parse dxe4 for game 16065, fen rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1! Loading from FEN…
jhonnold commented 1 year ago

OnPlayer in the handler does a reset when the names are different. For some reason the server sent new players and then reverted them which resulted in the reset.

Will update the logic to only reset the board state on a 0 FEN rather than new player.