| @@ -128,7 +128,7 @@ int main(int argc, char* argv[]) { | |||||
| } | } | ||||
| // Log environment | // Log environment | ||||
| INFO("%s %s v%s", APP_NAME.c_str(), APP_EDITION.c_str(), APP_VERSION.c_str()); | |||||
| INFO("%s %s v%s", APP_NAME.c_str(), APP_EDITION_NAME.c_str(), APP_VERSION.c_str()); | |||||
| INFO("%s", system::getOperatingSystemInfo().c_str()); | INFO("%s", system::getOperatingSystemInfo().c_str()); | ||||
| std::string argsList; | std::string argsList; | ||||
| for (int i = 0; i < argc; i++) { | for (int i = 0; i < argc; i++) { | ||||
| @@ -169,7 +169,7 @@ def create_manifest(slug, plugin_dir="."): | |||||
| # Query manifest information | # Query manifest information | ||||
| manifest['name'] = input_default("Plugin name", manifest.get('name', slug)) | manifest['name'] = input_default("Plugin name", manifest.get('name', slug)) | ||||
| manifest['version'] = input_default("Version", manifest.get('version', "1.0.0")) | |||||
| manifest['version'] = input_default("Version", manifest.get('version', "2.0.0")) | |||||
| manifest['license'] = input_default("License (if open-source, use license identifier from https://spdx.org/licenses/)", manifest.get('license', "proprietary")) | manifest['license'] = input_default("License (if open-source, use license identifier from https://spdx.org/licenses/)", manifest.get('license', "proprietary")) | ||||
| manifest['brand'] = input_default("Brand (prefix for all module names)", manifest.get('brand', manifest['name'])) | manifest['brand'] = input_default("Brand (prefix for all module names)", manifest.get('brand', manifest['name'])) | ||||
| manifest['author'] = input_default("Author", manifest.get('author', "")) | manifest['author'] = input_default("Author", manifest.get('author', "")) | ||||
| @@ -71,6 +71,7 @@ struct Window { | |||||
| void setSize(math::Vec size); | void setSize(math::Vec size); | ||||
| void run(); | void run(); | ||||
| void step(); | void step(); | ||||
| void activateContext(); | |||||
| /** Takes a screenshot of the screen and saves it to a PNG file. */ | /** Takes a screenshot of the screen and saves it to a PNG file. */ | ||||
| void screenshot(const std::string& screenshotPath); | void screenshot(const std::string& screenshotPath); | ||||
| /** Saves a PNG image of all modules to `screenshotsDir/<plugin slug>/<module slug>.png`. | /** Saves a PNG image of all modules to `screenshotsDir/<plugin slug>/<module slug>.png`. | ||||
| @@ -154,6 +154,15 @@ void checkUpdates() { | |||||
| updateStatus = "Querying for updates..."; | updateStatus = "Querying for updates..."; | ||||
| // Check user token | |||||
| std::string userUrl = API_URL + "/user"; | |||||
| json_t* userResJ = network::requestJson(network::METHOD_GET, userUrl, NULL, getTokenCookies()); | |||||
| if (!userResJ) { | |||||
| DEBUG("User failed"); | |||||
| return; | |||||
| } | |||||
| DEFER({json_decref(userResJ);}); | |||||
| // Get user's plugins list | // Get user's plugins list | ||||
| std::string pluginsUrl = API_URL + "/plugins"; | std::string pluginsUrl = API_URL + "/plugins"; | ||||
| json_t* pluginsResJ = network::requestJson(network::METHOD_GET, pluginsUrl, NULL, getTokenCookies()); | json_t* pluginsResJ = network::requestJson(network::METHOD_GET, pluginsUrl, NULL, getTokenCookies()); | ||||
| @@ -219,9 +228,9 @@ void checkUpdates() { | |||||
| } | } | ||||
| update.version = json_string_value(versionJ); | update.version = json_string_value(versionJ); | ||||
| // Reject plugins with ABI mismatch | // Reject plugins with ABI mismatch | ||||
| // if (!string::startsWith(update.version, APP_VERSION_MAJOR + ".")) { | |||||
| // continue; | |||||
| // } | |||||
| if (!string::startsWith(update.version, APP_VERSION_MAJOR + ".")) { | |||||
| continue; | |||||
| } | |||||
| // Check if update is needed | // Check if update is needed | ||||
| plugin::Plugin* p = plugin::getPlugin(slug); | plugin::Plugin* p = plugin::getPlugin(slug); | ||||
| @@ -138,6 +138,8 @@ json_t* requestJson(Method method, const std::string& url, json_t* dataJ, const | |||||
| curl_easy_cleanup(curl); | curl_easy_cleanup(curl); | ||||
| curl_slist_free_all(headers); | curl_slist_free_all(headers); | ||||
| DEBUG("response: %s", resText.c_str()); | |||||
| if (res != CURLE_OK) { | if (res != CURLE_OK) { | ||||
| WARN("Could not request %s: %s", urlS.c_str(), curl_easy_strerror(res)); | WARN("Could not request %s: %s", urlS.c_str(), curl_easy_strerror(res)); | ||||
| return NULL; | return NULL; | ||||
| @@ -517,6 +517,11 @@ void Window::step() { | |||||
| } | } | ||||
| void Window::activateContext() { | |||||
| glfwMakeContextCurrent(win); | |||||
| } | |||||
| static void flipBitmap(uint8_t* pixels, int width, int height, int depth) { | static void flipBitmap(uint8_t* pixels, int width, int height, int depth) { | ||||
| for (int y = 0; y < height / 2; y++) { | for (int y = 0; y < height / 2; y++) { | ||||
| int flipY = height - y - 1; | int flipY = height - y - 1; | ||||