-
Notifications
You must be signed in to change notification settings - Fork 3
feat: read VPK files and version.txt migration support
#60
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
base: develop
Are you sure you want to change the base?
Changes from all commits
96a5514
7363052
1958369
24e62c0
7f68657
288dc71
9e0fd2e
d5a65f1
7ecbc68
b1dd8f2
6531b0e
3109735
bbf0b09
e1b540e
8073668
635b1a5
8a65f2d
99702e0
e763f37
b7de82c
702c92b
1286818
eac1ac2
d3134d0
46aee7c
eb8e516
8c456a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,12 @@ | ||
| { | ||
| "mod": { | ||
| "sm_name": "open_fortress", | ||
| "short_name": "of", | ||
| "name_stylized": "Open Fortress" | ||
| }, | ||
| "remote": { | ||
| "base_url": "https://of-proxy.kate.pet/", | ||
| "versions_url": "https://of-proxy.kate.pet/versions.json" | ||
| } | ||
| } | ||
| "mod": { | ||
| "sm_name": "open_fortress", | ||
| "short_name": "of", | ||
| "name_stylized": "Open Fortress" | ||
| }, | ||
| "remote": { | ||
| "base_url": "https://of-proxy.kate.pet/", | ||
| "versions_url": "https://of-proxy.kate.pet/versions.json", | ||
| "filemap_url": "" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,6 +59,7 @@ impl AppVarData | |
| .replace("$MOD_NAME", &self.mod_info.sourcemod_name) | ||
| .replace("$URL_BASE", &self.remote_info.base_url) | ||
| .replace("$URL_VERSIONS", &self.remote_info.versions_url) | ||
| .replace("$URL_FILEMAP", &self.remote_info.filemap_url) | ||
| } | ||
|
|
||
| /// Try and read the data from `AVD_INSTANCE` and return when some. | ||
|
|
@@ -174,5 +175,8 @@ pub struct AppVarRemote | |
| pub base_url: String, | ||
| /// url where the version details are stored. | ||
| /// e.g; `https://beans.adastral.net/versions.json` | ||
| pub versions_url: String | ||
| pub versions_url: String, | ||
| /// optional: url where the file mapping details are stored for upgrading | ||
| /// game versions from previous systems. e.g; `https://beans.adastral.net/filemap.json` | ||
| pub filemap_url: String | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the code support this being optional? Preferably it would be good for it to be |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -267,6 +267,36 @@ pub enum BeansError | |
| hresult_msg: String, | ||
| location: String, | ||
| backtrace: Backtrace | ||
| }, | ||
|
|
||
| #[error("Failed to open VPK file at {location} ({error:})")] | ||
| VpkOpenFailure | ||
| { | ||
| location: String, | ||
| error: anyhow::Error, | ||
| backtrace: Backtrace | ||
| }, | ||
|
|
||
| #[error("Failed to read VPK file contents at {location}. ({error:})")] | ||
| VpkReadFailure | ||
| { | ||
| location: String, | ||
| error: anyhow::Error, | ||
| backtrace: Backtrace | ||
| }, | ||
|
|
||
| #[error("Failed to read packed file inside of VPK file at {location}. ({error:})")] | ||
| VpkInternalFileReadFailure | ||
| { | ||
| location: String, | ||
| error: std::io::Error, | ||
| backtrace: Backtrace | ||
| }, | ||
|
|
||
| #[error("Failed to find local version '{expected}' in remote filemap.")] | ||
| RemoteFileMapLocalVersionNotFound | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could the remote |
||
| { | ||
| expected: String | ||
| } | ||
| } | ||
| #[derive(Debug)] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you put a comment here saying that
anyhowshould never be used for returning errors, and that it should only be used as the "source" for an errore.g:
Even though it's in the
CONTRIBUTING.mdfile, it's good to put it here anyways for future reference.