L1nkZ / rpatchur

A customizable, cross-platform patcher for Ragnarok Online clients.
https://l1nkz.github.io/rpatchur/
Apache License 2.0
50 stars 34 forks source link

a couple questions regarding the code #16

Closed olsonpm closed 3 years ago

olsonpm commented 3 years ago

https://github.com/L1nkZ/rpatchur/blob/c40f5e756471a7023a2bf94aec2955c8829f4282/gruf/src/thor/reader.rs#L50

  1. (updated) Ah nvm, I'm assuming it's so that after a lot of patches you don't need to store them all in a single plist.txt ? i.e. you can remove old patches and just start from the number where you left off.

(original question)

I was wondering why you chose to format plist as {idx} {file name} rather than infer the index based off the line number ? Basically I'm not understanding why you'd want an out of order plist e.g.

2 some-file.thor
1 other-file.thor
  1. also do you mind explaining why you return none in the case of a failure instead of letting the error bubble up ?

Thanks

L1nkZ commented 3 years ago

Hi,

  1. I didn't actually choose the format plist.txt uses, I just supported the already existing format the THOR patcher was using. I agree that, to some extent, a simple ordered list, indexed by line number, would work well while being simpler to handle as a human.

  2. The main reason for that was to be able to use this method in a call to filter_map. The error handling in filter_map is "silent" which should be avoided in general, but I figured it was not too bad in this case and it had the benefit of transparently allowing for any type of inline comments (#, //, etc.) without making the code more complex.

olsonpm commented 3 years ago
  1. gosh I swore when I looked for documentation on the thor patcher the plist.txt syntax was just a list of the patches. Googling again I'm seeing the indexes at the beginning. My bad

  2. gotcha, thanks much

and fwiw I finally got it working last night. Mostly stupid mistakes on my part. I'll try to release the client side code in herc.ws in case others want to use a different skin.