News:

Remember if you wish to share a pic or a story, with just a selected few, use the new extended profile with custom buddy list http://www.fibsboard.com/announcements/new-ultimate-profile-a-biopicdocumentsounds-area-that-can-only-be-seen-by-b/

Main Menu

How to write a client

Started by erl, December 03, 2002, 05:45:56 PM

Previous topic - Next topic

erl

I'm considering writing a special client for FIBS.

However, I'm a bit concerned that reliably parsing the text coming from the FIBS server might be difficult, since for instance log in messages seem to be interspersed with other output (even on the same line, if recall correctly).

I've seen the rawboard format which seems like the thing to use.

Is there any sample code available (preferably in Java or C) for communicating with the FIBS server? I suppose 'bot code would do.

Is there any way to turn off log in messages, or messages about games starting or ending? Toggle silent didn't seem to turn everything off...

Does anyone have any tips for writing a program to communicate with the FIBS server?

Thanks for any help!
                   

tucsonAZ

mpgnu rolls 3 and 6.
board:mpgnu:buster:17:0:2:0:0:0:2: 1: 4: 3: 0: 1: 0: 1: 0: 0: 2: 0: 0: 0: 0: 0: 1: -2: -2: -1: -4: -4: 0: -1: 3: 6: 0: 0: 1: 1: 1: 0: -1: 1: 25: 0: 2: 0: 0: 0: 2: 2: 0: 0
1     2     3      4  5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27  28  29  30  31  32 33  34 35 36 37 38 39 40 41 42 43  44  45 46 47 48 49 50 51 52 53                                                            


96571
+ name
the player's name
name
the opponent's name
match length
match length or 9999 for unlimited matches
player got
player's points in the match so far
opponent got
opponent's points in the match so far
board
26 numbers giving the board. Positions 0 and 25 represent the bars for the players (see below). Positive numbers represent O's pieces negative numbers represent X's pieces
turn
-1 if it's X's turn, +1 if it's O's turn 0 if the game is over
dice
2 numbers giving the player's dice. If it's the players turn and she or he hasn't rolled, yet both numbers are 0
+ dice
the opponent's dice (2 numbers)
cube
the number on the doubling cube
may double
1 if player is allowed to double, 0 otherwise
+ may double
the same for the opponent
was doubled
1 if your opponent has just doubled, 0 otherwise
color
-1 if you are X, +1 if you are O
direction
-1 if you play from position 24 to position 1 +1 if you play from position 1 to position 24
home
0 or 25 depending on direction (obsolete but included anyway)
bar
25 or 0 (see home)
on home
number of pieces already removed from the board by player
+ on home
same for opponent
on bar
number of player's pieces on the bar
+ on bar
same for opponent
can move
a number between 0 and 4. This is the number of pieces you can move. This token is valid if it's your turn and you have already rolled.
forced move
don't use this token
did crawford
don't use this token
+ redoubles
maximum number of instant redoubles in unlimited matches
                   

tucsonAZ

Hi,

If you want to write a client for FIBS you will want to look at the CLIP specification by the author of the server Andreas Schnieder.
http://www.fibs.demon.co.uk/CLIP/clip.html

A list of server command can also be found on fibs.com
http://www.fibs.com/CommandReference/index.html

There used to be a page with details about the board data but i dont see it anywhere. Here is a text file i had saved .. I dont know how accurate it is though..
                   

erl

Thanks for the info! Especially the CLIP specification which I hadn't found.

I did find the board description; It's available online as \"help rawboard\".

                   

cthulhu

QuoteIs there any way to turn off log in messages, or messages about games starting or ending? Toggle silent didn't seem to turn everything off...
Logins/outs: toggle notify
Games starting/ending: toggle report

/Peter                    

burper

Example code that is LGPL'd can be found on repbot.sourceforge.net. It's bot code, but depending on what you are trying to do it might be useful...
BTW, I'd love to see an open source java fibs client emerge, if that's your inclination. At the least, make the thing skannable so people can create and publish their own GUI theme's in the style of mozilla and board styles etc...                              

fergy

You should also check out the code in FIBS Cookie Monster, which is based on the parser code used by MacFIBS.

webrunner

"There is a difference between knowing the path and walking the path."
Bruce Lee
===================================
Orion Pax |