The adapter could of course translate any of this to the omnipotent WB protocol. But nothing in the quoted text by Evert refers to WB protocol in any way, nor was any of it influenced by WB protocol, or has WinBoard played any role in its development. The only connection with WB protocol is that it also is a protocol for communication between a GUI and an AI pluging for a board game.
WinBoard tries to stay away from this mess as far as possible. This is why we use adapters to clean things up, so that WinBoard only has to deal with a neat and cwell-maintained protocol.
UCCI2WB
Moderators: hgm, Rebel, chrisw
-
- Posts: 27790
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
-
- Posts: 730
- Joined: Fri Oct 19, 2012 2:23 am
Re: UCCI2WB
Well he did quote you , just Evert's wall of text took up most of the page. Either way, I have no idea what he means.
It's nice that that CECP only has one current developer as part of a dedicated project, where as UCI has been very much a free for all molded to the needs of anyone who wanted to use it.
It's nice that that CECP only has one current developer as part of a dedicated project, where as UCI has been very much a free for all molded to the needs of anyone who wanted to use it.
-
- Posts: 730
- Joined: Fri Oct 19, 2012 2:23 am
Re: UCCI2WB
Anyway how do I know UCI2WB is indeed sending quit before it does in UCCI mode?
[EDIT]
weird, looks like it works..
perhaps you do have to say "bye" first?
[EDIT]
Code: Select all
52178 <first :
GameEnds(29, xboard exit, 2)
Interrupting first
52928 >first : result * {xboard exit}
53988 >first : quit
perhaps you do have to say "bye" first?
Last edited by JoshPettus on Wed Oct 29, 2014 6:29 pm, edited 1 time in total.
-
- Posts: 27790
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: UCCI2WB
You could add a printf statement in the last line of GUI2Engine(), like:
This should show up in the XBoard debug file. (At least, I hope that XBoard still keeps reading from the pipe to the engine until it breaks because the engine process exits.)
Code: Select all
else if(!strcmp(command, "quit")) fprintf(toE, "quit\n"), fflush(toE), printf("# quit sent\n"), exit(0);
-
- Posts: 730
- Joined: Fri Oct 19, 2012 2:23 am
Re: UCCI2WB
Code: Select all
GUI2Engine();
else if(!strcmp(command, "quit")) fprintf(toE, "quit\n"), fflush(toE), printf("# quit sent\n"), exit(0);
}
I get
Code: Select all
./UCI2WB.c:612:4: error: expected expression
else if(!strcmp(command, "quit")) fprintf(toE, "quit\n"), fflush(to...
^
-
- Posts: 27790
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: UCCI2WB
No, it should replace a very similar line (line 495 in my source).
-
- Posts: 730
- Joined: Fri Oct 19, 2012 2:23 am
Re: UCCI2WB
Sorry was confused by the second GUI2Engine()
Yah still the same in xboard.debug
I don't see "quit sent"
Yah still the same in xboard.debug
Code: Select all
27108 <first :
GameEnds(29, xboard exit, 2)
Interrupting first
28495 >first : result * {xboard exit}
29555 >first : quit
-
- Posts: 27790
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: UCCI2WB
I guess XBoard just stops listening to the 'engine' as soon as it sends 'quit'.
Then the only thing to make sure is to let UCI2WB create its own debug file.
Like just abuve Engine2GUI declare a FILE, and open it in Engine2GUI():
(you might want to use some suitable pathname in stead of just uci.debug).
You can then in GUI2engine(), just before the test for "new", write to the file what command was received:
In the "quit" line we altered before we now write
That should then make a log of everything UCI2WB received.
Then the only thing to make sure is to let UCI2WB create its own debug file.
Like just abuve Engine2GUI declare a FILE, and open it in Engine2GUI():
Code: Select all
FILE *dbg;
void *
Engine2GUI()
{
char line[1024], command[256];
dbg = fopen("uci.debug", "w");
You can then in GUI2engine(), just before the test for "new", write to the file what command was received:
Code: Select all
fprintf(dbg, "command read: %s\n", line);
if(!strcmp(command, "new")) {
Code: Select all
else if(!strcmp(command, "quit")) fprintf(toE, "quit\n"), fflush(toE), fprintf(dbg, "quit sent\n"), fflush(dbg), exit(0);
-
- Posts: 730
- Joined: Fri Oct 19, 2012 2:23 am
Re: UCCI2WB
Grr it generates the file at /Users/myself/UCI.debug but then quits in xboard. So nothing is there.
I tried opening it up and doing it manually ./UCI2WB debug -x ./dir/eleeye and it seems to work fine outputting my sent commands and saying quit sent
I tried opening it up and doing it manually ./UCI2WB debug -x ./dir/eleeye and it seems to work fine outputting my sent commands and saying quit sent
-
- Posts: 27790
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: UCCI2WB
Hmm, perhaps it was a bad idea to open the file in Engine2GUI, but print on it from GUI2Engine. As they are executed by different threads, it could write before the file was opened (which probably causes the crash).
Move the 'fopen' line from the top of Engine2GUI to the top of GUI2Engine (just before the "while(1) line)", and try again.
Move the 'fopen' line from the top of Engine2GUI to the top of GUI2Engine (just before the "while(1) line)", and try again.