bot4dofus / Datafus

📚🥚 The Dofus database and socket events in JSON files. Includes the source code and more...
https://discord.gg/kNHsFcbUGp
MIT License
50 stars 13 forks source link

[U1] Replace UIPath by python #37

Closed ledouxm closed 1 year ago

ledouxm commented 1 year ago

Hi,

This PR aims to replace the old U1 job (using UIPath) with a new one reproducing how the ankama launcher works. The CI seems to be working on my fork so i guess this is ready to merge.

I also added data folders into the gitignore file since they are automatically generated.

I look forward to seeing your critics on the code i wrote since i'm not used to code in python.

LucBerge commented 1 year ago

Hello @ledouxm , Thank you for this new PR, your contribution is welcomed!

Reverse engineering the Ankama Launcher is something I wanted to do a long time ago, it is much more convenient in python indeed.

  1. From what I understand, your script downloads the entire Dofus client. You cannot select the files you want to download. Is that right? It explains why the path under data/U/* have changed?
  2. Do you still need the U1.ps1 ? If no, remove it.
  3. Is your code inspired from https://github.com/drag0une/cytrus?

    I look forward to seeing your critics on the code i wrote since I'm not used to code in python.

  4. Don't worry, even though the code is not perfect and not clean as it can be, it is better than having a UIpath script I have to run manually... We can improve it later on. An object oriented script would be better (for U1py).
  5. I know a lot of people which could be interested about this script since it is the same process to download all the Ankama games. It could be a dedicated repo used as a submodule by Datafus.
  6. Why did you add data/A/*, data/B/* and data/C/* to the .gitignore ? Committing them is useful to compare between versions: example
  7. Is the Cytrus folder your code?

I will try this script on my computer soon. Good job 😃

ledouxm commented 1 year ago
  1. In the U1.py file, there is a function which is used to select d2o, d2i, DofusInvoker and VERSION files, we can add some or remove if not needed

    def is_file_interesting(file):
    name = file.Name().decode("utf-8")
    if "DofusInvoker.swf" in name or ".d2o" in name or".d2i" in name or "VERSION" in name:
        return True
    return False
  2. No, i'll remove it

  3. I haven't seen this lib before, it would have saved me some time of work on the Ankama Launcher lol. I've made an updater in nodeJS so i just translated it

  4. You tell me if u prefer to merge it and then enhance it or the opposite way

  5. I like the idea of building a second repo tho i'm not sure i know how to make a python library efficiently

  6. I'll add them back, i was annoyed by the git diff and... it didnt solve anything, let me clean it up.

  7. Ankama Launcher uses an RPC library called flatbuffers for its updater so i recreated their schema (U1/schema.fbs) and with a single command i can generate the Cytrus folder. This has been really handy since my nodejs updater uses the same schema file !

LucBerge commented 1 year ago

Merged #39 instead