Kuribo64
Views: 19,853,283 Home | Forums | Uploader | Wiki | Object databases | IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search
03-29-24 01:12 AM
Guest:

0 users reading Using the object database in your tools | 1 bot

Main - Archived forums - SMG hacking tools development - Using the object database in your tools Hide post layouts | New reply


Arisotura
Posted on 07-24-12 01:20 AM (rev. 3 of 04-10-13 09:13 AM) Link | #422
If you wish to make your tools use the ObjectDB, here's a quick guide about how to download it from your code. There are two possible methods.

1. Raw download
Download from https://kuribo64.net/whitehole/objectdb.php. This gives you the XML file.

2. Clever download
This is the technique used by Whitehole. For this, you download from https://kuribo64.net/whitehole/objectdb.php?whitehole&ts=<timestamp>.

<timestamp> should be set to the timestamp of the local file if it exists ('timestamp' attribute of the root 'database' element), otherwise zero. If the latest ObjectDB edit is less recent than the provided timestamp, the server will return the string 'noupdate'. Otherwise it will return a CRC32 of the XML file, followed by a '|' character and the XML file itself. The CRC32 can be used to check that the received data is valid.

If you add &gzip to your URL, the data past the CRC will be compressed using gzip (and the CRC will be on the compressed data).


In both methods, the server sends Content-length headers that you can use to determine the length of the data to download.


Have fun :)

____________________
NSMBHD - Kafuka - Jul
melonDS the most fruity DS emulator there is

zafkflzdasd

Nadia
Posted on 07-26-12 01:30 PM Link | #439
Doesn't the object DB keep objects' revisions?

If it does, you could even make the update (with a timestamp) only send the differences, resulting in faster updates and less bandwidth consumption.

Dirbaio
Posted on 07-26-12 01:33 PM Link | #440
...and resulting in a code that's a mess to maintain, and resulting in databases being corrupted staying corrupted even if the user does an update.

I already told Mega-Mario this isn't a good idea IMO.

:)

____________________
Cool Stuff: Dirbaio.net (my boring site) - The NSMB Hacking Domain - Kuribo64 - ABXD DevBoard

Arisotura
Posted on 07-26-12 02:10 PM Link | #441
Well basically the ObjectDB download script used to support that, until Dirbaio came up with these very arguments.

Supporting it on the server side is really easy. It's just matter of only selecting the objects that were edited past the local timestamp.

Supporting it on the client side, however, gets tricky. Instead of just being able to copy the received data right into the new file, you have to parse it and merge the XML tree with the existing one. Nothing impossible, it's just uh, trickier.

As for the 'corrupt database stays corrupt' part, there can be an option to redownload the whole database...

____________________
NSMBHD - Kafuka - Jul
melonDS the most fruity DS emulator there is

zafkflzdasd

Dirbaio
Posted on 07-26-12 02:21 PM Link | #442
Posted by Mega-Mario
As for the 'corrupt database stays corrupt' part, there can be an option to redownload the whole database...


Yea but then it could get confusing for users...
I'd say keep it the way it is now. You can always implement this later if there's lots of people complaining that updates are slow. (Which probably won't happen)

____________________
Cool Stuff: Dirbaio.net (my boring site) - The NSMB Hacking Domain - Kuribo64 - ABXD DevBoard

Arisotura
Posted on 07-26-12 03:11 PM Link | #443
>which probably won't happen

Not everyone has tons of money and an uberfast connection. Here, a full ObjectDB download takes around 10s (the file is 791KB). Yes, it is done in the background, but hey, it still takes a while...

____________________
NSMBHD - Kafuka - Jul
melonDS the most fruity DS emulator there is

zafkflzdasd

Dirbaio
Posted on 07-26-12 03:38 PM Link | #444
If you gzip the file it gets down to 53kb.
That's more than a 10x compression ratio :)
Maybe you should take into account. Also there's a class on Java for gzip/ungzip I think.

____________________
Cool Stuff: Dirbaio.net (my boring site) - The NSMB Hacking Domain - Kuribo64 - ABXD DevBoard

Arisotura
Posted on 07-26-12 04:05 PM Link | #445
Compression is an interesting idea. I'll look into it :)

____________________
NSMBHD - Kafuka - Jul
melonDS the most fruity DS emulator there is

zafkflzdasd


Main - Archived forums - SMG hacking tools development - Using the object database in your tools Hide post layouts | New reply

Page rendered in 0.075 seconds. (2048KB of memory used)
MySQL - queries: 28, rows: 208/208, time: 0.012 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.