« || »

“wait” “-1″;”message” “help!”

Some information first: The Quaddicted map archive’s reviews/ratings/comments are nowadays stored in a SQLite database. I wrote the PHP code around it and it is terrible and a pain in the ass to maintain. The Quake Injector uses XML.

Previously everything was XML (one file per map), for updates I concatenated all files into one and then used XSLT to render the Quake Injector XML (who am I kidding, I manually edited when a new map came out). For the actual website I used XSLT to render HTML files and uploaded those. But then I did realised that a database would be better after all and actually needed for having proper ratings and comments. SQLite is nice because it is just one file. So I implemented the bare functionality needed for the site to appear working like before (plus the new features).

Now the site is stuck in between the old and the real new. Adding maps to the database must be done manually (and thus I don’t do it), the XML is not automatically created, etc. These next steps are over my head and I am procrastinating. So I worked on other things (you’ll see). negke probably hates me by now.

So, I hope to find some help from the community. These are the most important steps that need to be done:

  1. Get all the map information into the database. And create something that nicely (eg cached) exports the information needed by the Quake Injector into http://www.quaddicted.com/reviews/quaddicted_database.xml

    Currently there is a mixture. Some things are only in the database (eg the included files), others are only in the XML (eg the whole techinfo stuff).

    Where I got stuck: I could not decide if I rather have several new tables (eg for the startmaps and dependencies) or simply use comma-seperated fields.
    Done by myself!

  2. Write something that allows user authentication against a FluxBB installation (MySQL database) for the reviews and comments. Statistics about reviews/ratings/comments would still be stored in an independent table. But someone should be able to register in FluxBB and then be logged in to the reviews section with the same details/cookie. There really should only be one account needed for everything.

    Where I got stuck: I did not even start thinking how one could do this.
    Done by myself!

  3. Write an “add file” thing for me that scans the zip, asks for a screenshot, provides text fields for manual information. I have an old script by Sajt that I badly hacked for the changing needs but I would go mad if I tried to add sqlite support (currently it “only” renders a html/xml file), add functionality to the zip scanning (it already produces the “included files” list but now we need a CRC for each file too) or even add simple text fields the Injector needs.

    Where I got stuck: Not sure, I just avoid it as it would be a considerable chunk of work for me.
    Done by the amazing Sajt!

  4. Possibly rewrite the whole reviews/ratings/comments php code from scratch.

    Where I got stuck: My clueless spaghetti code of despair. MVC might have been a good idea I guess…

As you can see these tasks depend on each other which really is not motivating me at all.

We can definitely talk about some compensation.

08.10.2010 in quaddicted.com | 7 Comments »

7 Responses to ““wait” “-1″;”message” “help!””

  1. negke Says:
    09.10.2010 10:05

    As a matter of fact, I QUADHATE you now!!!!!! >:(

  2. dfsp_spirit Says:
    11.10.2010 11:01

    1) and 3) don’t sound very time consuming. My time is limited but I could have a look at these.

    If I got you right 1) is about parsing XML and writing the parsed info it into a DB. I should be able to do that in PHP or Perl in reasonable time.

    On your question about where to store the data: I don’t know whether you got a separate entry in a ‘maps’ table for every (start) map in your DB. But if you need nothing but the name of the map you should make it a field of the map/episode/release (whatever it’s called, I’ll assume ‘release’ here) table. (Or are there episodes with >1 start map?)

    The dependencies are more complicated since one release can depend on more than one other release I guess. I would suggest to create a new table ‘dependencies’ that has the fields ‘release_id’ and ‘dep_release_id’ (both are of type release.release_id). For each dependency of each map, write one entry into that table and you’re done.

    3) is a HTML upload form that one (you or the public?) can use to add new maps to the DB I guess. It needs to do CRC (which means simply calling md5() on the file I guess) and write to the DB instead of a text/HTML file, right?

    You can reply via email if you prefer that, I left a valid one.

  3. Spirit Says:
    14.10.2010 15:43

    1) The problem is mostly doing the xml export in a good way. I fear SQL joins for their complexity. And it would be quite slow in any case. So it is depending how to structure the data well. The rest should not be too hard.

    “start map” means “any included bsp file”. It is named badly. One can (or should be able to) select each included map in the Injector to directly load it. That’s very useful for map packs.

    The logic behind dependencies is easy, but again I have no idea if it would not be more simple to simply use one additional field in the maps table and store it as csv (eg “quoth;hipnotic”).

    3) Should be rather easy once 1) is decided.

  4. Spirit Says:
    23.10.2010 21:36

    Import is done. Export for the Injector not.

  5. The Injector database is now dynamically created from the main database Says:
    25.10.2010 18:48

    [...] “wait” “-1″;”message” “help!” [...]

  6. negke Says:
    16.11.2010 10:06

    I’m pessimistic about anyone stepping up to help soon. Still, since this is an important request, I suggest adding a permanent link to top of the front page, similar to the ad, so the chances of someone reading it are slightly increased. And with a better title.

  7. Spirit Says:
    16.11.2010 15:49

    Yeah, in retrospect the title is bollocks. I’ll probably make it a valuable bounty (I AM RICH!) and write exactly what is needed.

Leave a Reply