diff options
| author | 2023-12-30 01:26:54 -0600 | |
|---|---|---|
| committer | 2023-12-30 01:26:54 -0600 | |
| commit | e2f504523c0afa3db05e7e739f55e89266b1624c (patch) | |
| tree | 39c0f42aa0b59ed9c76643766775f1ddd69a23e2 /src/version.h | |
| parent | download (but not parse) version manifest (diff) | |
add a little version stuff
Diffstat (limited to 'src/version.h')
| -rw-r--r-- | src/version.h | 108 |
1 files changed, 107 insertions, 1 deletions
diff --git a/src/version.h b/src/version.h index 2c92796..01dcbb8 100644 --- a/src/version.h +++ b/src/version.h @@ -29,11 +29,117 @@ struct l2_version_remote { time_t release_time; }; +enum { + VERSION_ARG_ACTION_ALLOW, + VERSION_ARG_ACTION_DISALLOW +}; + +#define FEATURE_DEMO (1u << 0) +#define FEATURE_CUSTOM_RES (1u << 1) +#define FEATURE_QUICK_PLAY_SUPPORTED (1u << 2) +#define FEATURE_QUICK_PLAY_SINGLEPLAYER (1u << 3) +#define FEATURE_QUICK_PLAY_MULTIPLAYER (1u << 4) +#define FEATURE_QUICK_PLAY_REALMS (1u << 5) + +struct l2_version_download { + char *url; + l2_sha1_digest_t sha1; + size_t size; +}; + +struct l2_version_rule { + unsigned action; + unsigned features; + + struct l2_version_argument_rule_os { + char *name; /* exact match */ + char *arch; /* regex */ + char *version; /* regex */ + } os; + + struct l2_version_argument_rule *next; +}; + +struct l2_version_argument { + char **value; /* ends with NULL */ + + struct l2_version_rule *rules; + + struct l2_version_argument *next; +}; + +struct l2_version { + struct l2_version_argument *game; + struct l2_version_argument *jvm; + + struct l2_version_asset_index { + char *id; + struct l2_version_download download; + size_t total_size; + } asset_index; + + char *assets; /* should equal asset_index.id */ + json_int_t compliance_level; + + struct l2_version_jar_download { + char *id; + struct l2_version_jar { + char *name; + struct l2_version_download download; + struct l2_version_jar *next; + } *jars; + } downloads; + + struct l2_version_java_version { + char *component; + json_int_t major_version; + } java_version; + + struct l2_version_library { + char *name; + + struct l2_version_library_download { + struct l2_version_library_artifact { + char *path; + struct l2_version_download download; + } *artifact; + + struct l2_version_download_classifier { + char *name; + char *path; + struct l2_version_download download; + struct l2_version_download_classifier *next; + } *classifiers; + } downloads; + + struct l2_version_library_extract { + char **exclude; /* ends with NULL */ + } *extract; + + struct l2_version_rule *rules; + + struct l2_version_native { + char *os; + char *name; + struct l2_version_native *next; + } *natives; + } *libraries; + + char *main_class; + char *type; + time_t release_time; + time_t time; + + struct l2_version *inherits; + /* minecraftArguments, */ +}; + extern const char *const l2_version__messages[]; #define l2_version_strerror(_en) l2_version__messages[(_en)] unsigned l2_version_load_remote(void); -unsigned l2_version_load_local(void); + +unsigned l2_version_load_local(const char *name); #endif /* include guard */ |
