jerricha-and-friends / jerrichas

DB costume hacking app for ParagonChat
3 stars 1 forks source link

Jerrichas should be able to read tailor-saved .costume files #3

Open Jerricha opened 9 years ago

Jerricha commented 9 years ago

It's way easier for the end-user to design their costume in the tailor/character creator, and just save it in the GUI, than using the /access_level1; /costumesave <str> technique.

Let's solve this problem by parsing .costume files, and mapping it to ParagonChat.db schema. The tables that are relevant are costume and costumepart.

The data structure in these .costume files might be some kind of C-style struct data type. You might be able to use the Python struct library to parse this.

Criteria for ticket:

  1. Create a new TailorCostume class
  2. Create some methods that parses the whole .costume file, and maps it to a dict that corresponds to table and column names.
  3. Use Python standard library only
  4. Write some tests that asserts you can use the class to update the ParagonChat.db (Jerricha can help with this), also manual testing
Jerricha commented 9 years ago

Arcana wrote a very basic parser in Python already: http://www.cohtitan.com/forum/index.php/topic,10956.msg187979.html#msg187979

However, I still think there's an easier way to do this.. Maybe inherit and override the struct class?

Jerricha commented 9 years ago

A few years back, someone also wrote a .costume converter in PHP: https://github.com/mcuznz/DEMOlition

Jerricha commented 9 years ago

@robokitty