quick question ICC/FICS protocol

Discussion of chess software programming and technical issues.

Moderator: Ras

Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

quick question ICC/FICS protocol

Post by Daniel Shawul »

Do you know where I can find the protocol specification. Using telnet I was able to see it uses a character stream not necessarily terminated by a line feed. It also seems to send the board literally :) I mean what I see is the board drawn with characters while I was expecting a FEN or so. Is that correct ? These things make parsing difficult and I want to see what the protocol says about it. I read that ICC uses a different protocol than FICS. But it seems I can not even invoke one worthwhile command as a guest on that server.
Thanks
User avatar
JuLieN
Posts: 2949
Joined: Mon May 05, 2008 12:16 pm
Location: Bordeaux (France)
Full name: Julien Marcel

Re: quick question ICC/FICS protocol

Post by JuLieN »

Hi Daniel. I started playing on FICS in 1996, with just a telnet terminal and no graphic interface, so I kind of got used to it (it made playing blitzs impossible against people who had a graphic interface ^^). You have megabytes of help files in fics that you' ll probably have to read. Just type "help" in your telnet session and browse them :)
"The only good bug is a dead bug." (Don Dailey)
[Blog: http://tinyurl.com/predateur ] [Facebook: http://tinyurl.com/fbpredateur ] [MacEngines: http://tinyurl.com/macengines ]
TonyJH
Posts: 183
Joined: Tue Jun 20, 2006 4:41 am
Location: USA

Re: quick question ICC/FICS protocol

Post by TonyJH »

If I remember correctly, most ICC/FICS clients request style12 protocol:
http://www.freechess.org/Help/HelpFiles/style12.html
Last edited by TonyJH on Sat Jun 11, 2011 3:56 pm, edited 1 time in total.
Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: quick question ICC/FICS protocol

Post by Daniel Shawul »

That seems much better. But what I get from observing from console is shown below. I thought I have to parse that. Is there a way to switch to the style12 format (for parsing) than the awkward default format (used at least for observing I think)

Code: Select all


Game 119: GMCarlsen (2815) GMNakamura (2774) unrated standard 120 0

Game 119 (GMCarlsen vs. GMNakamura)

       ---------------------------------
    8  | *R|   |   | *Q| *K|   |   | *R|     Move # : 13 (White)
       |---+---+---+---+---+---+---+---|
    7  | *P|   |   | *N| *B| *P| *P|   |     Black Moves : 'b5      (31:28)'
       |---+---+---+---+---+---+---+---|
    6  |   |   | *P|   |   | *N| *P|   |
       |---+---+---+---+---+---+---+---|
    5  |   | *P|   | *P|   |   |   |   |     Black Clock : 1:00:00
       |---+---+---+---+---+---+---+---|
    4  |   |   |   | P |   | B |   |   |     White Clock : 1:39:18
       |---+---+---+---+---+---+---+---|
    3  |   |   | N |   | P | P |   |   |     Black Strength : 35
       |---+---+---+---+---+---+---+---|
    2  | P | P | Q |   | N |   | P | P |     White Strength : 35
       |---+---+---+---+---+---+---+---|
    1  |   |   | K | R |   |   |   | R |
       ---------------------------------
         a   b   c   d   e   f   g   h
fics%
TonyJH
Posts: 183
Joined: Tue Jun 20, 2006 4:41 am
Location: USA

Re: quick question ICC/FICS protocol

Post by TonyJH »

In your telnet session, after you connect, you can try the command "set style 12".
Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: quick question ICC/FICS protocol

Post by Daniel Shawul »

Ok great ! I suppose this is the format I will try to parse if I want to make an iterface. I hope it suppresses all fics output with no line feed so that i would use readline instead of read.
Thanks a lot.
Michel
Posts: 2292
Joined: Mon Sep 29, 2008 1:50 am

Re: quick question ICC/FICS protocol

Post by Michel »

Beware that FICS uses LF-CR as line terminator. ICC uses CR-LF.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: quick question ICC/FICS protocol

Post by bob »

Daniel Shawul wrote:Do you know where I can find the protocol specification. Using telnet I was able to see it uses a character stream not necessarily terminated by a line feed. It also seems to send the board literally :) I mean what I see is the board drawn with characters while I was expecting a FEN or so. Is that correct ? These things make parsing difficult and I want to see what the protocol says about it. I read that ICC uses a different protocol than FICS. But it seems I can not even invoke one worthwhile command as a guest on that server.
Thanks
I think it is in "help style12"
Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: quick question ICC/FICS protocol

Post by Daniel Shawul »

Yes. Another problem is that fics sends formatted text which is cool to have for instance the FICS logo at startup. If I remove all the LF & CRs to parse the data (using readLine), I can't have the original formatted text. Also prompts such as login: , fics% etc ... will have to be typed blindfold since since they are displaced one command late due to lack of line terminators. My bot now does a read() not to loose format for displaying, then it splits by line terminators and parse data..
Daniel Shawul
Posts: 4186
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: quick question ICC/FICS protocol

Post by Daniel Shawul »

So I spent some time working on it and I have a working standalone java app. But my goal was to have an applet like the java interfaces at ICC. Problem is I am using sockets and it seems I can not use that in applets.. I can't open files, I can't add the user from System.property etc... How do the ICC interfaces connect to the server ? Newbie to java but I am lovin it :)