Dominion Strategy Forum

Please login or register.

Login with username, password and session length
Pages: [1] 2  All

Author Topic: Format of the logfilename  (Read 8941 times)

0 Members and 1 Guest are viewing this topic.

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Format of the logfilename
« on: March 21, 2013, 06:00:57 pm »
+2

So, obviously the filename of the log on goko is something like
Code: [Select]
log\.[0-9a-z]{24}\.[0-9]*\.txt
The [0-9a-z]{24} is non-unique, I was wondering what it means, and it is probably encodes the username (tested for 2 different numbers on a single day, so what can possibly go wrong?).  So if you are looking for your games, you probably only need to find out your hash (or whatever this is) and look for these games.
The [0-9]* is also not unique but doesn't have many dublicates, on 20130320 I have 47817 different numbers on 47859 games.

edit: The number is probably the timestamp, on 20130320 I have two games with 1363763058763 , both dated to 20-Mar-2013 07:04, and 1363763058 is 20-Mar-2013 07:04:18 unixtime (according to wolfram alpha), so that would mean they would finish the same millisecond. Which is not unlikely to have 40times/day with 50k games and birthday paradox.

Edit2: Assuming uniform distribution over the day of finishing of the games you would expect on average ~14 collisions for 50k games.  As uniform is clearly not realistic, and every other distribution should give a higher rate of collision, 40 collsions a day sounds fine.

« Last Edit: March 21, 2013, 06:26:52 pm by DStu »
Logged

Watno

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2745
  • Shuffle iT Username: Watno
  • Respect: +2983
    • View Profile
Re: Format of the logfilename
« Reply #1 on: March 21, 2013, 06:23:19 pm »
0

Just ask Goko?
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: Format of the logfilename
« Reply #2 on: March 21, 2013, 06:24:08 pm »
+2

Just ask Goko?
where is the fun in that?
Logged

AdamH

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2833
  • Shuffle iT Username: Adam Horton
  • You make your own shuffle luck
  • Respect: +3879
    • View Profile
    • My Dominion Videos
Re: Format of the logfilename
« Reply #3 on: March 21, 2013, 06:43:05 pm »
0

This is an amazing idea. I want to know everything about it.

Unfortunately the only things I've discovered so far have to do with the timestamp, which you've already figured out.

The first part, I see only lowercase letters and numbers, which makes me think base32 or something similar. Are there any "0" "1" "8" or "9" characters in there?

OK there are... Scratch that

...but there are no letters past F which means this is hex. OK so we have 12 bytes.

Probably a hash of some stuff. My initial observations are that I played several games in one day with the same opponent (werothegreat) and they all had the same hash. Another log of a game with wero on a different day gives the same hash. He hosted all the games so maybe a different host would change it.

Unfortunately this is where my current knowledge of hashes ceases to become useful. Perhaps some more poking is in order...
Logged
Visit my blog for links to a whole bunch of Dominion content I've made.

Polk5440

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1708
  • Respect: +1788
    • View Profile
Re: Format of the logfilename
« Reply #4 on: March 21, 2013, 08:48:35 pm »
0

probably encodes the username

I think encodes the username of the person who created the table. This was my guess when I was looking for my past logs.

Quote
edit: The number is probably the timestamp

This is also my guess for this part.
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: Format of the logfilename
« Reply #5 on: March 22, 2013, 03:04:49 am »
0

probably encodes the username
I think encodes the username of the person who created the table. This was my guess when I was looking for my past logs.
Assuming which is true (which I don't doubt), that should let give a pretty good estimates on how many sets goko has sold at which point.  I don't have the time for this, at least not for the next week, but should not be too difficult.  Only takes ages to download all the logs...
Logged

Polk5440

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1708
  • Respect: +1788
    • View Profile
Re: Format of the logfilename
« Reply #6 on: March 22, 2013, 08:28:15 am »
0

probably encodes the username
I think encodes the username of the person who created the table. This was my guess when I was looking for my past logs.
Assuming which is true (which I don't doubt), that should let give a pretty good estimates on how many sets goko has sold at which point.  I don't have the time for this, at least not for the next week, but should not be too difficult.  Only takes ages to download all the logs...

Except some people start tables of only base games or do the base adventure for free. 
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: Format of the logfilename
« Reply #7 on: March 22, 2013, 10:01:27 am »
0

probably encodes the username
I think encodes the username of the person who created the table. This was my guess when I was looking for my past logs.
Assuming which is true (which I don't doubt), that should let give a pretty good estimates on how many sets goko has sold at which point.  I don't have the time for this, at least not for the next week, but should not be too difficult.  Only takes ages to download all the logs...

Except some people start tables of only base games or do the base adventure for free.

But if you can download the logs, you can see which people open which boards, and assuming that most of the people who board a set will also open a game with it, you can at least get a lower bound on how many sets have been bought, and it should not be that bad.
Logged

AdamH

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2833
  • Shuffle iT Username: Adam Horton
  • You make your own shuffle luck
  • Respect: +3879
    • View Profile
    • My Dominion Videos
Re: Format of the logfilename
« Reply #8 on: March 26, 2013, 12:24:36 pm »
0

I can confirm that the hash is tied to the user who hosts the game. I've hosted many games with different opponents and all of the hashes are the same (5085f5130cf270038ff92212). Knowing exactly what the hashing algorithm is is not the most important thing to me, but it really does help when I'm trying to find game logs on Goko :-)
Logged
Visit my blog for links to a whole bunch of Dominion content I've made.

SCSN

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2227
  • Respect: +7140
    • View Profile
Re: Format of the logfilename
« Reply #9 on: April 03, 2013, 03:27:27 am »
0

So how do I find the logs of my games? I want to find one particular game I hosted yesterday (2nd of April) that I botched horribly with Bishop, Upgrade and City on a Colony board.
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: Format of the logfilename
« Reply #10 on: April 03, 2013, 03:40:52 am »
+3

So how do I find the logs of my games? I want to find one particular game I hosted yesterday (2nd of April) that I botched horribly with Bishop, Upgrade and City on a Colony board.

Difficult part is to find your hash. I think there is the possibilitiy to get a gamelink in goko when you just finished playing?  So host a new game and let it give you the link. [Wasn't that difficult after all...] Remember (or better copy to clipboard) the hexnumber at log.NUMBER.ignorethis.txt of the filename in the url. Should be 24 instances of 0-9 and a-f.

So now you have your hash, go to dominionlogs.goko.com/$DATE [with $DATE=20130402] , this gives you a list of all the games of the day.  Might take a while to load, it's about 10MB.  ctrl+f ctrl+v for your hash, open all the files and search for the one your a looking for.
Logged

SCSN

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2227
  • Respect: +7140
    • View Profile
Re: Format of the logfilename
« Reply #11 on: April 03, 2013, 08:28:48 am »
0

Thank you, found it :)
Logged

Qvist

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2400
  • Shuffle iT Username: Qvist
  • Respect: +4085
    • View Profile
Re: Format of the logfilename
« Reply #12 on: April 03, 2013, 10:29:55 am »
+1

This is really interesting. I did just some 10min analysis on this.
I parsed the 46187 hashes from April 2nd and this is the result with the most interesting part in bold:



Every hash is 24 chars long and is a hexadecimal string.
Every hash starts with a "5". Why? This is redundant!
73% start with "50" and the other 27% start with "51".


The third and fourth characters aren't evenly distributed.
Nearly the half of the hashes have a "5" on third position while "7" or "9" have less than 500 occurances.
On forth position "a" and "b" occur way more often than every other character.

The fifth to eigth character are evenly distributed.
The nineth to twelth characters are either "e4b0" (94%) or "0cf2", "fca2", "a236", "51c3", "f93b".
Characters 13-21 aren't evenly distributed, but character 22-24 are.



My guess is that it might contain some sort of coded info about the user like which sets he has or if he was beta user or not.
But the hash definitely consists of separate parts which are added together at the end.

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: Format of the logfilename
« Reply #13 on: April 03, 2013, 10:36:45 am »
0

Every hash starts with a "5". Why? This is redundant!
5=Dominion? But that would limit them to 16 games without changing the format...
Logged

Qvist

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2400
  • Shuffle iT Username: Qvist
  • Respect: +4085
    • View Profile
Re: Format of the logfilename
« Reply #14 on: April 03, 2013, 10:50:38 am »
0

This is a strange format.

The user "dorlain" for example has "509add58e4b0399d8db58049".
Either "Jan Kalo" or "Philipp Czora" has "509bba9ee4b0399d8db58364".
Either "Gecks42" or "mrn1376" has "509bd490e4b0399d8db583c3".

So, they all have "509xxxxxe4b0399d8db58xxx".
This matches with the analysis. Characters 5-8 and 22-24 seem random or real hashes. The rest is something else.

Qvist

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2400
  • Shuffle iT Username: Qvist
  • Respect: +4085
    • View Profile
Re: Format of the logfilename
« Reply #15 on: April 03, 2013, 10:56:25 am »
0

Ok, I think I got the first 8 characters. This is the join date as hex presentation of the unix timestamp. Can anyone confirm that?

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: Format of the logfilename
« Reply #16 on: April 03, 2013, 11:41:04 am »
0

Ok, I think I got the first 8 characters. This is the join date as hex presentation of the unix timestamp. Can anyone confirm that?
It's a little bit peaky to the high numbers, or?
Frequency of first 2 bytes converted to base10 because of gnuplot
Logged

Qvist

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2400
  • Shuffle iT Username: Qvist
  • Respect: +4085
    • View Profile
Re: Format of the logfilename
« Reply #17 on: April 03, 2013, 11:49:47 am »
0

I guess that are all the guests that play on the same day they just registered.

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: Format of the logfilename
« Reply #18 on: April 03, 2013, 11:56:38 am »
0

I guess that are all the guests that play on the same day they just registered.
makes sense. The ranges fits very well, I have hashes from
Mo 1. Apr 16:11:30 CEST 2013
back to
Di 18. Sep 22:47:46 CEST 2012
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: Format of the logfilename
« Reply #19 on: April 03, 2013, 12:04:22 pm »
0

After this are 4 letters which are almost constant as you said, and then a group of 9 which is also not unique, but doesn't have many repetitions.
Logged

Qvist

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2400
  • Shuffle iT Username: Qvist
  • Respect: +4085
    • View Profile
Re: Format of the logfilename
« Reply #20 on: April 03, 2013, 12:09:18 pm »
0

I just noticed that "e4b0" appears first on November 1st 2012. Before that "0cf2" is very often. Not sure what that means though.

SCSN

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2227
  • Respect: +7140
    • View Profile
Re: Format of the logfilename
« Reply #21 on: April 06, 2013, 05:53:02 am »
0

I wrote a short python script that asks me for a day and then downloads all the logs of games I hosted on that day.

If anyone else is interested I can share the source and/or compile it and have it read the userhash and savepath from a settings.txt file.
Logged

ftl

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2056
  • Shuffle iT Username: ftl
  • Respect: +1345
    • View Profile
Re: Format of the logfilename
« Reply #22 on: April 06, 2013, 01:18:48 pm »
0

Ooh! That sounds nice! Can you upload the source somewhere? I wanna find this epic scout game I played
Logged

SCSN

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2227
  • Respect: +7140
    • View Profile
Re: Format of the logfilename
« Reply #23 on: April 06, 2013, 01:51:57 pm »
0

Here it is. You need the Beautiful Soup library to run it. And don't forget to change the userhash variable to your own, which you can find using DSTu's instructions earlier in this thread.

Code: [Select]
import urllib2
import re
import os
import datetime
from bs4 import BeautifulSoup

savepath = "C:\Dominion\Logs"
userhash = "505d732a51c359e6597efeb8"
domain = "http://dominionlogs.goko.com/"

def daterange(start_date, end_date):
    if start_date <= end_date:
        for n in range((end_date - start_date).days + 1):
            yield start_date + datetime.timedelta(n)
    else:
        for n in range((start_date - end_date).days + 1):
            yield start_date - datetime.timedelta(n)

inputrange =  raw_input("\nDownload logs from daterange (YYMMDD-YYMMDD): ")

start = datetime.date( year = int("20" + inputrange[:2]), month = int(inputrange[2:4]), day = int(inputrange[4:6]))
end = datetime.date( year = int("20" + inputrange[7:9]), month = int(inputrange[9:11]), day = int(inputrange[11:13]) )
 
for date in daterange(start, end):
year = str(date)[:4]
month = str(date)[5:7]
day = str(date)[8:10]
url = domain + year + month + day + "/"

print "Loading Goko archive from " + str(date) + "...",

page = urllib2.urlopen(url).read()
soup = BeautifulSoup(page)
soup.prettify()

print "downloading logs...",

directory = savepath + "\\" + year + "\\" + month + "\\" + day + "\\"
if not os.path.exists(directory):
    os.makedirs(directory)

for logfile in soup.findAll('a', href=re.compile(userhash)):
    source = urllib2.urlopen(url + logfile['href'])
    target = open(directory + logfile['href'], 'wb')
    target.write(source.read())
    target.close()

print "done."
« Last Edit: April 06, 2013, 01:58:55 pm by SheCantSayNo »
Logged

dghunter79

  • Apprentice
  • *****
  • Offline Offline
  • Posts: 279
  • Respect: +320
    • View Profile
Re: Format of the logfilename
« Reply #24 on: May 03, 2013, 10:44:43 pm »
0

What if you're looking for a game you didn't host?
Pages: [1] 2  All
 

Page created in 0.143 seconds with 20 queries.