Skip to content

Commit 1b48bab

Browse files
committed
send all move info
1 parent 5477807 commit 1b48bab

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

chess/engine.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,13 +1654,12 @@ def _parse_uci_info(arg: str, root_board: chess.Board, selector: Info = INFO_ALL
16541654
info: InfoDict = {}
16551655
if not selector:
16561656
return info
1657-
info["string"] = ""
16581657
tokens = arg.split(" ")
16591658
while tokens:
16601659
parameter = tokens.pop(0)
1661-
16621660
if parameter == "string":
1663-
info["string"] += " ".join(tokens) + "\n"
1661+
info["string"] = " ".join(tokens)
1662+
break
16641663
elif parameter in ["depth", "seldepth", "nodes", "multipv", "currmovenumber", "hashfull", "nps", "tbhits", "cpuload"]:
16651664
try:
16661665
info[parameter] = int(tokens.pop(0)) # type: ignore
@@ -2433,13 +2432,16 @@ def __init__(self, stop: Optional[Callable[[], None]] = None):
24332432
self._seen_kork = False
24342433
self._finished: asyncio.Future[BestMove] = asyncio.Future()
24352434
self.multipv = [{}]
2435+
self.string = ""
24362436

24372437
def post(self, info: InfoDict) -> None:
24382438
# Empty dictionary reserved for kork.
24392439
if not info:
24402440
return
2441-
2441+
string = info.get("string", "")
2442+
self.string += string
24422443
multipv = info.get("multipv", 1)
2444+
info["string"] = self.string
24432445
while len(self.multipv) < multipv:
24442446
self.multipv.append({})
24452447
self.multipv[multipv - 1].update(info)

0 commit comments

Comments
 (0)