News:

click the little + - buttons to customise your Fibsboard (unclick them sometimes to see what you're missing :)

Main Menu

user file formats

Started by sixty_something, April 03, 2007, 06:04:52 AM

Previous topic - Next topic

sixty_something

I've been looking at the user files in the user subdirectory in Java FIBS. They are the files that drive user specific information such as match statistics, ratings history, friends tables, villains, programmable buttons, and preferences.

I'd like to input my match history information into my own programs or spreadsheets to generate tables and reports more specific and customizable than those found in the Tools>Statistics menu.

Other uses of these files may be possible and include:
   - merging user files from two different platforms
   - sharing programmable buttons
   - tracking ratings changes vs. individual opponents (requiring an additional relational database)
   - summary reports of matches by criteria including date, time, opponent, and match length

Direct editing of these text files is possible, but should not be attempted. Any such changes would only effect the useability of user statistics. Master ratings and match files are maintained at the fibs server, not in these files.

The user files in the Java FIBS user subdirectory are:

   buttons
   friends
   matches
   preferences
   ratings
   villains

They are all readable with Windows Notepad, WordPad, or any other text editor. Only the preferences file appears to have non-printable characters in it. The ratings and matches files are best viewed with WordPad which recognizes the line feed record terminator in both those files.

Here are examples of individual records in each of the files. Individual records are all variable length with spaces serving as field separators. End-of-record delimiters are carriage return and line feed for friends, villains, and buttons, line feed only for ratings and matches. Examples, below contain individual records separated and aligned for readability from my user files.

matches
--------
DeaDice 1 11 11 1175321367062 0
DeaDice 11 0 11 1175323206390 1
DeaDice 11 10 11 1175327738578 1

<opponent_name> <W> <L> <match_length> <fibs_match_timestamp> <invite_flag>

In these three 11 point matches, I won the last two, 11-0, and 11-10; DeaDice won the first, 1-11. The match scores are the first two fields following player name. DeaDice invited me to the first match, (the 0 code at the end of record), I invited her to the second, (coded 1),  in the third she invited me, but when we resumed, I invited her and the original 0 value of the <invite_flag> was over-writen by a 1.

The long string toward the end of each record is the match time-date stamp in milliseconds past January 1, 1970, a seconds-since-epoch format, as returned by the Unix time() function. However, I've found that for accurate conversion in Excel one must add 2 days and 4 hours (in milliseconds) to this time. Why, I haven't a clue, but it works. Patti provided me with a link describing basic timestamp conversion techniques (http://wiki.apache.org/jakarta-jmeter/LogAnalysis). The 2 day 4 hour adjustment came from simple trial and error testing.

buttons
-------
Tell RepBot ask %Player
images\info.gif
kibitz  nice cube
images\cube.gif

Simply the programmed command and its associated icon in a two line couplet:

<programmed_fibs_command>
<button_icon_file_name>



friends
------
lrb -16776961 1713.5 (1713.5)
goats_milk -16776961 1595.49
Trilli_e -65281 1420.36
Flara -65281 1743.73

<friends_name> <color_code> <rating> <unkown>

Simply the friends name, their associated color code and rating (the negative numbers are the
color codes for blue and fuchia) ... I don't know what the parenthetical entry indicates

ratings
-------
1153085828796 1500.00 0
1153087485437 1500.00 0
1153091432078 1477.57 3
1153091685000 1477.57 3
1153095212609 1456.04 8
1153095742296 1456.04 8
1153096844625 1439.73 11
1153096921687 1439.73 11
1153098316484 1439.73 11
1153098419125 1439.73 11
1153099775671 1464.57 16
1153099843531 1464.57 16

<fibs_match_timestamp> <rating> <total_game_count>

These first few records in my ratings file indicate my starting date and initial rating, followed by start and end of match records with associated ratings before and after each match and a total games counter. Thus my first match was a 3 pointer, followed by a 5, another 3, and another 5. The 4 records associated with the match to 11 total games indicate a start, two, resumes, and its finish. I had bad connection problems when first signing up on FIBS and multiple resumes were common for a while.

villains
------
Ya***
MO**
Ho****_****
art*****
alb*****

<villian_name>

Simply a name list with names edited to protect the identity of the scum droppers.

preferences
-----------

Not shown as it contains non-printable characters but it is viewable with any text editor.

A little inaccuracy sometimes saves tons of explanation. -- Unknown
e-mail me

Patti

Try this:

http://exceltips.vitalnews.com/Pages/T0096_Converting_UNIX_DateTime_Stamps.html

It's a simplified formula and seems to give a better answer.  I bet the 4 hours is your timezone?

sixty_something

:cool: thanks, Patti ...  :thumbsup2:

that makes the conversion work without the obscure adjustment of two days and 4 hours ...

thus, the formula in Excel for converting the Fibs match-id timestamp is:

                  = match_id /1000 / 86400 + 25569

division by 1000 is required to convert the match_id to seconds, as it is expressed in milliseconds ... 86400 is the number of seconds in a day, thus converting the match_id to days since 01-Jan-1970 ... to that we add 25569 which is the number of days in the range 01-Jan-1900 (Excel's base time) and 31-Dec-1969 ... the result gives us a number expressed correctly as an Excel date ... adjustments then need to be made for time zone, in my case -5 hours or -5/24 days, resulting in an Excel formula that calculates a correct date and time corresponding to the Fibs match_id:

                  = match_id /1000 / 86400 + 25569 -5/24

thanks, again, Patti for helping figure this out

btw, i haven't confirmed it, but i suspect the 2 day adjustment required using the previous technique may have been due to an incorrect accounting for leap years ... 1900 was not a leap year and 2000 was due to obscure astronomical requirements to keep earth time consistent with solar time and the 4 hour adjustment was likely for my time zone ... why 4 with the first method and 5 with this one is another mystery, particularly since i'm in US CDT or UTC - 9 ... but it works, i ain't gonna break it by over analysis ...  :yes:
A little inaccuracy sometimes saves tons of explanation. -- Unknown
e-mail me

cthulhu

Quote

friends
------
lrb -16776961 1713.5 (1713.5)
goats_milk -16776961 1595.49
Trilli_e -65281 1420.36
Flara -65281 1743.73

<friends_name> <color_code> <rating> <unkown>

Simply the friends name, their associated color code and rating (the negative numbers are the
color codes for blue and fuchia) ... I don't know what the parenthetical entry indicates


Nice guide! The number in parenthesis is the rating the friend had last time you were in so one can see how much the person has improved since last. IIRC.  B)