English Amiga Board


Go Back   English Amiga Board > Support > support.FS-UAE

 
 
Thread Tools
Old 30 January 2015, 00:30   #1
Enverex
Fantasy Man!
 
Enverex's Avatar
 
Join Date: Apr 2002
Location: UK
Posts: 1,353
WHDLoad Game Name Lookup

Is there anything (site or even FS-UAE itself) that I can query to turn a WHDLoad game name, e.g. "3001OConnorsFight" into the game's real name?

I noticed the game's real name is included in the games ".Slave" file, but unfortunately directly before the game's name there are random characters before the game's name each time (different for each game) meaning I can't automatically read the data from there.

How does FS-UAE track down which WHDLoad games you own and can I tap into that data somehow?
Enverex is offline  
Old 30 January 2015, 10:49   #2
jbl007
Registered User
 
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 466
Quote:
Originally Posted by Enverex View Post
Is there anything (site or even FS-UAE itself) that I can query to turn a WHDLoad game name, e.g. "3001OConnorsFight" into the game's real name?
I don't think it can be done. At least not without too much guessing. Fsuae-launcher recognizes games by checksum, not by name. You can view the data online, for example: http://oagd.net/amiga/pinball-dreams...7-e97d7b12394f -> No name for the .zip

Quote:
How does FS-UAE track down which WHDLoad games you own and can I tap into that data somehow?
Are you trying to solve your problem?
You may need a launcher for the launcher which does the following:
  1. Search your .zip for the .slave file
  2. Search the database for the .slave file and get the game uuid
  3. Run "fs-uae-launcher $uuid"
Are you using Linux? If so, maybe I could quickly hack something together (already played around with the database some time ago).
jbl007 is offline  
Old 30 January 2015, 11:20   #3
Enverex
Fantasy Man!
 
Enverex's Avatar
 
Join Date: Apr 2002
Location: UK
Posts: 1,353
Quote:
Originally Posted by jbl007 View Post
I don't think it can be done. At least not without too much guessing. Fsuae-launcher recognizes games by checksum, not by name. You can view the data online, for example: http://oagd.net/amiga/pinball-dreams...7-e97d7b12394f -> No name for the .zip
If there's an API for looking up by hash then I could use that, I just can't find it documented anywhere though.

Quote:
Originally Posted by jbl007 View Post
Are you trying to solve your problem?
You may need a launcher for the launcher which does the following:
  1. Search your .zip for the .slave file
  2. Search the database for the .slave file and get the game uuid
  3. Run "fs-uae-launcher $uuid"
Are you using Linux? If so, maybe I could quickly hack something together (already played around with the database some time ago).
This is a separate issue but tied into the same end goal. I need the game's proper names so that they are listed nicely in the launcher I'm using and then in turn I need to be able to launch those WHDLoad games from the launcher with FS-UAE.

The key "how do I" part here is "Search the database for the .slave file and get the game uuid". Is there an API or something public that can be queried?

EDIT: I can see the key information on the page you've linked to, but only in Edit mode. None of that shows up in normal browsing (or search) mode...
Enverex is offline  
Old 30 January 2015, 15:02   #4
jbl007
Registered User
 
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 466
Quote:
Originally Posted by Enverex View Post
Is there an API or something public that can be queried?
You can't query oagd.net online. Data is also stored in "FS-UAE/Data/Game Database.sqlite" on your hard disk. Unfortunately you can't access it using simple sql statements because it is compressed/json-encoded. You need to loop through all the entries to find stuff. There is no "official" documentation. I asked Frode about it some time ago, he posted a code snippet (which was helpful). The rest I needed to figure out by myself.
http://eab.abime.net/showthread.php?t=71258
jbl007 is offline  
Old 30 January 2015, 15:15   #5
Enverex
Fantasy Man!
 
Enverex's Avatar
 
Join Date: Apr 2002
Location: UK
Posts: 1,353
Well I've managed to scrape the real game names from the WHDLoad page (http://www.whdload.de/games/all.html) which gives me the proper names.

The FS-UAE database is confusing me though. It stores the ID of a game (I assume this isn't of relevance, it's just the internal ID), the UUID and then the compressed "misc" data field. That's all fine, but what does FS-UAE use to find the game in the database in the first place? Is it hashing the Slave file to create the UUID and using that, or is it doing something else?
Enverex is offline  
Old 30 January 2015, 15:25   #6
Enverex
Fantasy Man!
 
Enverex's Avatar
 
Join Date: Apr 2002
Location: UK
Posts: 1,353
I'm wondering if something's changed since you did all that. There is no data or value field in the "game" database anymore...

Code:
sqlite> .schema game
CREATE TABLE game (
                id INTEGER PRIMARY KEY,
                uuid TEXT,
                name TEXT,
                platform TEXT,
                year INTEGER,
                publisher TEXT,
                front_image TEXT,
                title_image TEXT,
                screen1_image TEXT,
                screen2_image TEXT,
                screen3_image TEXT,
                screen4_image TEXT,
                screen5_image TEXT,
                sort_key TEXT,
                have INTEGER,
                path TEXT,
                update_stamp INTEGER
        , adult INT);
EDIT: Found it, it's in the Games.sqlite file in the Cache folder now. It's like JSON inception in this database!

Last edited by Enverex; 30 January 2015 at 16:13.
Enverex is offline  
Old 30 January 2015, 16:49   #7
jbl007
Registered User
 
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 466
Quote:
Originally Posted by Enverex View Post
I'm wondering if something's changed since you did all that. There is no data or value field in the "game" database anymore...
Looks like you're right. Last modified timestamp for "Data/Game Database.sqlite" is 2014-01-05. Means: I used an outdated database without even noticing.

Quote:
EDIT: Found it, it's in the Games.sqlite file in the Cache folder now. It's like JSON inception in this database!
I don't have Games.sqlite in the Cache dir.
I have Files.sqlite Locker.sqlite and oagd.net.sqlite.
I think I need to wipe all and start from scratch.
jbl007 is offline  
Old 30 January 2015, 19:17   #8
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Quote:
Originally Posted by Enverex View Post
Is there anything (site or even FS-UAE itself) that I can query to turn a WHDLoad game name, e.g. "3001OConnorsFight" into the game's real name?
The WHDLoad game/variant entries contains a couple of fields which may be of interest:
- file_list (contains the list of files for the slave, including .slave files)
- whdload_args (contains the name of the slave FS-UAE will execute)
- whdload_url (link to the installer on the WHDLoad page, URL includes some kind of "WHDLoad name").

(As an example, you can see the key-value pairs for Lotus 2 WHDLoad here: http://oagd.net/amiga/lotus-turbo-ch...f-4133db25f62e).

Quote:
Originally Posted by Enverex View Post
How does FS-UAE track down which WHDLoad games you own and can I tap into that data somehow?
FS-UAE Launcher checks the file entries in file_list for the WHDLoad variant against the local file database. If all files are found, the variant is marked as found.

Quote:
Originally Posted by jbl007 View Post
Looks like you're right. Last modified timestamp for "Data/Game Database.sqlite" is 2014-01-05. Means: I used an outdated database without even noticing.

I don't have Games.sqlite in the Cache dir.
I have Files.sqlite Locker.sqlite and oagd.net.sqlite.
The database layout have changed somewhat since the start. Currently, the relevant files for the development version are:
- Cache/oagd.net.sqlite (contains detailed game/variant information from oagd.net)
- Cache/Files.sqlite (database of scanned files)
- Data/Database.sqlite (high-level information about games - what games you have, etc)

These databases are not an "API", so I will reserve the right to change database layout whenever there's a reason for it
FrodeSolheim is offline  
Old 30 January 2015, 19:22   #9
Enverex
Fantasy Man!
 
Enverex's Avatar
 
Join Date: Apr 2002
Location: UK
Posts: 1,353
Looks like I'm on the (older) 2.4 version which is why I'm not seeing what JBL is seeing. I'll update to the dev version and check again, then we'll be on the same page :P
Enverex is offline  
Old 30 January 2015, 20:09   #10
jbl007
Registered User
 
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 466
Quote:
Originally Posted by FrodeSolheim View Post
These databases are not an "API", so I will reserve the right to change database layout whenever there's a reason for it
Got it!


I pushed whdload-launch.py for Linux to github:
https://github.com/sonnenscheinchen/...load-launch.py

Usage: whdload-launch.py /path/to/whdloadgame.zip

But there's a bug, who can find it?
If a game has more than 1 variant with the same slave-name (eg. Alien Breed 3D) the launcher might pick the wrong one. I think I'll add sha1-checking for the slaves too (and hope there are no variants with the (byte-)exact same slave.
jbl007 is offline  
Old 30 January 2015, 21:21   #11
Enverex
Fantasy Man!
 
Enverex's Avatar
 
Join Date: Apr 2002
Location: UK
Posts: 1,353
Mine's working fine now, I thought there was something wrong with it for ages but it turns out the OAGD is actually just missing a -lot- of games so of course they don't have SHA sums for FS-UAE.

Would a list be useful to anyone?
Enverex is offline  
Old 01 February 2015, 12:42   #12
jbl007
Registered User
 
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 466
I spotted an error in oagd.net.sqlite. In one row the data cell is empty and the uuid is invalid
Code:
SELECT * FROM game WHERE (SELECT typeof(data) IS NOT 'blob');
or just
SELECT * FROM game WHERE data="";
Anyone else have this, or is it just me?
jbl007 is offline  
Old 02 February 2015, 21:17   #13
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
I have an entry with empty data, but there's a valid UUID there... -what's the content of the uuid field?
FrodeSolheim is offline  
Old 03 February 2015, 18:20   #14
jbl007
Registered User
 
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 466
Quote:
Originally Posted by FrodeSolheim View Post
what's the content of the uuid field?
Code:
'\x8b\xbb\x00Y\x8bqM\x15\x972\xa8-t_\xb2\xfd'
Quotes '' are included. Perhaps it's not really an invalid uuid, but only stored with wrong type (encoded byte-)string instead of binary.
jbl007 is offline  
Old 03 February 2015, 22:19   #15
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Quote:
Originally Posted by jbl007 View Post
Code:
'\x8b\xbb\x00Y\x8bqM\x15\x972\xa8-t_\xb2\xfd'
This is a valid UUID (8bbb0059-8b71-4d15-9732-a82d745fb2fd) -It's just converted to a 128-bit number and stored binary in the database, and the sqlite3 interactive shell (or Python) will print the binary data it like that.

You can test the following in a Python interpreter:
Code:
import binascii
binascii.hexlify(b'\x8b\xbb\x00Y\x8bqM\x15\x972\xa8-t_\xb2\xfd')
Anyway, an empty data field might be a feature, I cannot remember right now. I suggest you just interpret this game/UUID has having no key-value pairs.
FrodeSolheim is offline  
Old 03 February 2015, 22:31   #16
FrodeSolheim
FS-UAE Developer
 
FrodeSolheim's Avatar
 
Join Date: Dec 2011
Location: Førde, Norway
Age: 43
Posts: 4,043
Btw, I checked the source code, and I'm doing:
Code:
SELECT id, uuid FROM game WHERE data != '';
(so allowing empty data fields is/was intentional, and is supposed to be skipped when looking for valid variants )
FrodeSolheim is offline  
Old 06 February 2015, 01:10   #17
staropram
Registered User
 
Join Date: Jul 2011
Location: Sweden
Posts: 15
A dream I have, a datfile extracted from oagd, I dont care of names, just want to know
what it wants
staropram is offline  
Old 06 February 2015, 10:36   #18
Enverex
Fantasy Man!
 
Enverex's Avatar
 
Join Date: Apr 2002
Location: UK
Posts: 1,353
Quote:
Originally Posted by staropram View Post
A dream I have, a datfile extracted from oagd, I dont care of names, just want to know
what it wants
That's what oagd.net.sqlite is, isn't it?
Enverex is offline  
Old 07 February 2015, 23:22   #19
staropram
Registered User
 
Join Date: Jul 2011
Location: Sweden
Posts: 15
And with Locker.sqlite gives us what ?
staropram is offline  
Old 07 February 2015, 23:33   #20
staropram
Registered User
 
Join Date: Jul 2011
Location: Sweden
Posts: 15
Simple question as first post say

Is there a dat for all whdload games that fs swallow ?

All crc32 and size in one dat, don't care of names, it could be whatever
Thats later.
staropram is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
help me executing an whdload-installed game without whdload Gaula92 support.Games 7 26 January 2011 21:44
DEATHTRAP Whdload game... sebmacfly request.Old Rare Games 4 08 July 2009 10:21
have u got a whdload game? jibos71 support.Games 6 11 May 2007 23:27
Lookup by SPS ID jotd HOL suggestions and feedback 2 02 August 2006 00:45
Automatic Game Database Lookup !? AmiGer Retrogaming General Discussion 6 03 October 2002 11:30

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:09.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13751 seconds with 14 queries