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 313 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

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post