May 19, 2007

[Bug] Both problems solved with one change (hopefully)

I found the problem with the Winboard interface, and I think it is the same with the Chessbase GUI (I will have to wait for Jim Abletts compiles to be sure, guess it is time I get a Java native compiler soon :).

In v0.32 and earlier when starting Mediocre without interface the welcome message and prompt did not show up until a dummy command was entered. This was due to Mediocre waiting for either uci or xboard to come as the first command to determine what protocol to use. If the first command was neither of those it went into line input mode.

I fixed this by always going into line input and if at any time uci or xboard was entered at the prompt, Mediocre switched to the protocol input instead.

But I forgot that I used print and not println for the prompt. This resulted in the feature line starting with the prompt (->feature ... instead of just feature ...), and apparently Winboard did not understand this and hence never received the feature command.

Which in turn resulted in the moves sent by the interface to the engine were on the form e2e4 and not usermove e2e4, so Mediocre could not recognize them.

The same happens in the UCI mode, only the second id command is received (the author one), while the name of the engine (id name Mediocre) is ignored since it is started with the prompt as well.

Hopefully this is why Chessbase GUI is having trouble. Shredder Classic only gives the author name and you have to input the engine name manually but at least it runs the engine afterwards.

Let us hope this takes care of both problems. :)

No comments: