aboutsummaryrefslogtreecommitdiffstats
path: root/src/version.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/version.h')
-rw-r--r--src/version.h35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/version.h b/src/version.h
index 7b02c21..c3448eb 100644
--- a/src/version.h
+++ b/src/version.h
@@ -4,6 +4,7 @@
#include "digest/digest.h"
#include <time.h>
#include <jansson.h>
+#include <stdbool.h>
enum {
VERSION_SUCCESS,
@@ -45,12 +46,7 @@ enum {
VERSION_DOWNLOAD_MAX
};
-#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)
+typedef bool (l2_version_feature_match_proc_t)(const char *name, json_t *val);
struct l2_version_download {
char *url;
@@ -58,6 +54,26 @@ struct l2_version_download {
size_t size;
};
+struct l2_version_library {
+ char *url;
+ char *artifactpath;
+
+ l2_sha1_digest_t digest;
+ bool has_digest;
+ size_t size;
+
+ struct {
+ enum {
+ EXTRACT_NONE, /* do not extract anything */
+ EXTRACT_OLD, /* extract whole jar, preserving entries that are not excluded */
+ EXTRACT_NEW /* extract only .dll, .so, .dylib from jar */
+ } extracttype;
+ char **exclude;
+ } extract;
+
+ struct l2_version_library *next;
+};
+
struct l2_version {
json_t *data;
struct l2_version *inherit;
@@ -73,4 +89,11 @@ unsigned l2_version_load_local(const char *name, json_t **ojs);
int l2_version_check_integrity(FILE *fp, l2_sha1_digest_t *digest, size_t sz);
+enum l2_version_check_result {
+ RULE_CHECK_ERROR = -1,
+ RULE_CHECK_DEFAULT,
+ RULE_CHECK_ALLOW,
+ RULE_CHECK_DISALLOW,
+} l2_version_check_rules(json_t *rules, l2_version_feature_match_proc_t *matcher);
+
#endif /* include guard */