Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import of .ark.gz files (from Nitrado FTP) #1289

Open
TinkerTob opened this issue Sep 27, 2022 · 5 comments
Open

Import of .ark.gz files (from Nitrado FTP) #1289

TinkerTob opened this issue Sep 27, 2022 · 5 comments

Comments

@TinkerTob
Copy link

Hi,

I have the same issue as previously discussed in #883 (ASB import via FTP always gets savegame from last server restart).

The reason is that Nitrado doesn't update the actual save file (e.g. Fjordur.ark) while the server is running, but instead creates compressed backup files (e.g. Fjordur_27.09.2022_10.09.03.ark.gz).

I have contacted Nitrado support and they are unable (or unwilling) to change this.

This could be accounted for by a simple workaround in ASB which:

  1. Connects to the specified FTP folder
  2. Downloads the newest .ark.gz file in the folder
  3. Decompresses it (resulting in an .ark file)
  4. Imports the file as usual

It would be great if someone could look into this... I would be willing to do so myself, but I'd have to learn C# first and I don't think I'll find the time.

Thank you!

nitrado_FTP

@TinkerTob TinkerTob changed the title Support Import of .ark.gz files (from Nitrado FTP) Import of .ark.gz files (from Nitrado FTP) Sep 27, 2022
@TinkerTob
Copy link
Author

TinkerTob commented Sep 27, 2022

Update:

While scrolling through a7c5540 (the commit which originally added the FTP functionality), i noticed that this workaround is already implemented!

However, it is neither apparent nor documented, and even throws an error when using it:
The way I understand it (and applied it successfully), if you use an asterisk in the file name when entering an FTP path, it treats the filename as a pattern and searches the most recent match. But ASB doesn't seem to like that.
asb_save

Also, it looks as if the file change date doesn't always match the time denoted in the file name. E.g., in the above screenshot, the save from 10:09 seems to be newer than the one from 12:01. Maybe it would be possible to extract the date from the file name and use the file info as a fallback? I don't know if C# has the ability to reliably recognize and parse different time formats, but it should work in theory.

@cadon
Copy link
Owner

cadon commented Sep 28, 2022

Hi, thanks for pointing this out! The messagebox is only a warning (which will be removed when there's an asterix in the filepath in the next release), you can still enter what you want and it should fetch the latest file that matches the pattern.
In your case ftp://…/arkse/ShooterGame/Saved/SavedArk/Fjordur_*.ark.gz should work.
Regarding the issue that the newest file by the file timestamp is in fact not the newest file can certainly resolved by a more advanced pattern input, I'll put that on the todo list.

@cadon
Copy link
Owner

cadon commented Oct 9, 2022

So with the latest release (v0.50.5) you should be able to use ftp://…/Fjordur_(?<g3>\d+)\.(?<g2>\d+)\.(?<g1>\d+)_(?<g4>[\d\.]+)\.ark.gz to import the latest file (only the part after the last / is parsed as a regex, so slashes, dots etc before don't need to be escaped). Let me know if that's not working.

@TinkerTob
Copy link
Author

Thank you for looking into this so quickly!

There seems to be one little bug left: The last / of the path seems to get caught up in the regex.
ftp://.../Fjordur_(?<g3>\d+)\.(?<g2>\d+)\.(?<g1>\d+)_(?<g4>[\d+\.]*)\.ark.gz
doesn't work (and neither does ftp://.../Fjordur_*.ark.gz, which kinda worked before)

But ftp://...//Fjordur_(?<g3>\d+)\.(?<g2>\d+)\.(?<g1>\d+)_(?<g4>[\d+\.]*)\.ark.gz (using an additional / for the target directory) works.

@cadon
Copy link
Owner

cadon commented Oct 9, 2022

When testing this on a local ftp server it works fine. I haven't tested it on a remote ftp-server, maybe the path parts work differently then.

@cadon cadon reopened this Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants