FAForever Forums
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Login

    I can't decompress replay files with zstd compression

    Scheduled Pinned Locked Moved I need help
    4 Posts 2 Posters 352 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      HideLord
      last edited by

      I looked through the faf client github. From what I can gather the replay header ends with the first '\n' character. Following the new line are the compressed bytes. I tried using the zstd terminal tool and even compiled the zstd library to try streaming decompression like the one used in the github (although there apache commons is used and I have no idea how that is implemented). I assume that maybe there is a byte at the start or the end which I'm not removing and that is causing the problem but I really don't know. Can anybody help?

      H 1 Reply Last reply Reply Quote 0
      • H Offline
        HideLord @HideLord
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • AskaholicA Offline
          Askaholic
          last edited by Askaholic

          I wrote a command line utility that can unpack replays. https://gitlab.com/Askaholic/faf-replay-parser#unpack

          It can do both the old version 1 format (base64 and inflate) and the new format (zstd). You can find a pre compiled Linux binary in the CI build artifacts. It can also be compiled for windows but I don’t have a ci for that.

          Also the source code for the conversion is here: https://gitlab.com/Askaholic/faf-replay-parser/-/blob/60b4db37016cbe81f0f02b547fd100ed91f70571/src/faf.rs#L15

          H 1 Reply Last reply Reply Quote 0
          • H Offline
            HideLord @Askaholic
            last edited by

            @askaholic Very nice! I'll try it tomorrow, thanks.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post