PDA

View Full Version : Current Patch/Version Download Link/JSON


Shakoboy
08-09-2015, 11:02 AM
I just thought this might be a good idea to throw out there:

Instead of posting a new link for every version of a patch that's released, how about one static link that always redirects to the most current version of the patch ZIP file? Such as: www.project1999.com/downloads/patch?version=current . Then have a corresponding page with a URL that returns some JSON that lists what the most current patch version is? Something like: www.project1999.com/api/getPatchVersion . Which could return something like this:

{
"currentVersion": "39"
"oldVersions": {
/* Some list here */
}
}

If I had something to get this kind of information I could easily create some sort of self-patching launcher to eliminate manually updating the files each time (and reduce possible errors!). Anyway, just something I thought I'd put out there as an idea.

Zaela
08-10-2015, 12:45 AM
There is a bit of a ghetto/unreliable way to find the most recent version in a reasonable amount of time. Not perfect, but seems like it would have worked for the past year and a half, and reasonable to think it might continue to work in the future.

If you look at http://www.project1999.com/forums/forumdisplay.php?f=11, all the threads with patch downloads in them have the standard spiel ("The latest patch contains new required files. Download and extract the Project 1999 Files (V##) to your EQ Titanium Directory.") in their tooltip. A single simple http request will net you those tooltips, and a regex for "V\d+" or somesuch over the entire http response should get you the most recent version number along with a few recent but outdated ones. Should take less than a second. Don't need to be logged in to the forums or anything, either. And once you have the highest version, you can work backwards from that to the patch file url.

Relies on several assumptions being true, like the most recent patch being on the first page of that subforum (pretty likely), the post with the most recent patch having that standard spiel in its first line so it ends up in the tooltip (again, seems consistent over the past year and a half as far as I can tell), etc... but there you go.

Not ideal obviously, but something you could jump on right now rather than waiting for an official response and action that may never come.

Shakoboy
08-10-2015, 09:35 AM
There is a bit of a ghetto/unreliable way to find the most recent version in a reasonable amount of time. Not perfect, but seems like it would have worked for the past year and a half, and reasonable to think it might continue to work in the future.

If you look at http://www.project1999.com/forums/forumdisplay.php?f=11, all the threads with patch downloads in them have the standard spiel ("The latest patch contains new required files. Download and extract the Project 1999 Files (V##) to your EQ Titanium Directory.") in their tooltip. A single simple http request will net you those tooltips, and a regex for "V\d+" or somesuch over the entire http response should get you the most recent version number along with a few recent but outdated ones. Should take less than a second. Don't need to be logged in to the forums or anything, either. And once you have the highest version, you can work backwards from that to the patch file url.

Relies on several assumptions being true, like the most recent patch being on the first page of that subforum (pretty likely), the post with the most recent patch having that standard spiel in its first line so it ends up in the tooltip (again, seems consistent over the past year and a half as far as I can tell), etc... but there you go.

Not ideal obviously, but something you could jump on right now rather than waiting for an official response and action that may never come.

Yeah, that's just the sort of hackish thing I'd like to avoid :/ I'd rather have a less error prone way of getting the latest patch in a programmatic way. I'd be more than willing to share the results of my work once I get something working.

The other way I thought of doing it, rather than trying to parse through the forum posts, was just working off the somewhat predictable ZIP file name and location. Currently it seems to look like this: http://www.project1999.com/files/P99FilesXX.zip (with XX being the patch number). I could probably just scan for that pattern and get the highest patch number I can find, then cache the result locally and use that as a starting reference point for future checks.

But I'd rather have a less error prone way of doing this. I wouldn't think that setting up and master URL for the most current version and a simple JSON response (or even just a page that returns only a version number) would be very time consuming. And it could be used to build a tool that would eliminate a lot of frustration and inevitable forum posts with people having issues copying the ZIP to their directories each patch cycle.

webrunner5
08-10-2015, 10:01 AM
We are not talking Rocket Science to drop un zipped files to the main header of the everquest folder. Duh. :D

If someone can figure out how to get this game going in the first place, I am sure they can do a Update! :p

Shakoboy
08-10-2015, 10:22 AM
We are not talking Rocket Science to drop un zipped files to the main header of the everquest folder. Duh. :D

If someone can figure out how to get this game going in the first place, I am sure they can do a Update! :p

No, but that's not exactly an ideal way to patch a game. I can't think of any other game I've had to patch by copy-pasting the contents of a ZIP file. And it actually caused me issues a few times because I play via Wine on Linux and the case sensitivity bit me a few times. I'm just trying to make the process easier/automated :)