Просмотр исходного кода

FlipWorld v0.6.1

- Switched the server backend to prepare for multiplayer in version 0.8.
jblanked 10 месяцев назад
Родитель
Сommit
dde0875e4d
8 измененных файлов с 17 добавлено и 14 удалено
  1. 3 3
      app.c
  2. 1 1
      application.fam
  3. BIN
      assets/01-home.png
  4. 3 0
      assets/CHANGELOG.md
  5. 7 7
      callback/callback.c
  6. 1 1
      flip_world.h
  7. 1 1
      game/storage.c
  8. 1 1
      game/world.c

+ 3 - 3
app.c

@@ -44,9 +44,9 @@ int32_t flip_world_main(void *p)
         easy_flipper_dialog("FlipperHTTP Error", "Ensure your WiFi Developer\nBoard or Pico W is connected\nand the latest FlipperHTTP\nfirmware is installed.");
 
     // save app version
-    char app_version[16];
-    snprintf(app_version, sizeof(app_version), "%f", (double)VERSION);
-    save_char("app_version", app_version);
+    // char app_version[16];
+    // snprintf(app_version, sizeof(app_version), "%f", (double)VERSION);
+    save_char("app_version", VERSION);
 
     // Run the view dispatcher
     view_dispatcher_run(app->view_dispatcher);

+ 1 - 1
application.fam

@@ -17,5 +17,5 @@ App(
     ),
     fap_author="JBlanked",
     fap_weburl="https://github.com/jblanked/FlipWorld",
-    fap_version="0.6",
+    fap_version="0.6.1",
 )

BIN
assets/01-home.png


+ 3 - 0
assets/CHANGELOG.md

@@ -1,3 +1,6 @@
+## 0.6.1 (2025-03-15)
+- Switched the server backend to prepare for multiplayer in version 0.8.
+
 ## 0.6 (2025-03-10)
 - Fixed saving of player attributes so that it works as intended.
 - Updated the player's level and strength as XP increases.

+ 7 - 7
callback/callback.c

@@ -762,7 +762,7 @@ static bool fetch_world_list(FlipperHTTP *fhttp)
     snprintf(fhttp->file_path, sizeof(fhttp->file_path), STORAGE_EXT_PATH_PREFIX "/apps_data/flip_world/worlds/world_list.json");
 
     fhttp->save_received_data = true;
-    return flipper_http_request(fhttp, GET, "https://www.flipsocial.net/api/world/v5/list/10/", "{\"Content-Type\":\"application/json\"}", NULL);
+    return flipper_http_request(fhttp, GET, "https://www.jblanked.com/flipper/api/world/v5/list/10/", "{\"Content-Type\":\"application/json\"}", NULL);
 }
 // we will load the palyer stats from the API and save them
 // in player_spawn game method, it will load the player stats that we saved
@@ -782,7 +782,7 @@ static bool fetch_player_stats(FlipperHTTP *fhttp)
         return false;
     }
     char url[128];
-    snprintf(url, sizeof(url), "https://www.flipsocial.net/api/user/game-stats/%s/", username);
+    snprintf(url, sizeof(url), "https://www.jblanked.com/flipper/api/user/game-stats/%s/", username);
 
     // ensure the folders exist
     char directory_path[128];
@@ -809,7 +809,7 @@ static bool fetch_player_stats(FlipperHTTP *fhttp)
 //         return false;
 //     }
 
-//     return flipper_http_get_request_with_headers(fhttp, "https://www.flipsocial.net/api/app/last-updated/flip_world/", "{\"Content-Type\":\"application/json\"}");
+//     return flipper_http_get_request_with_headers(fhttp, "https://www.jblanked.com/flipper/api/app/last-updated/flip_world/", "{\"Content-Type\":\"application/json\"}");
 // }
 
 // static bool parse_app_update(FlipperHTTP *fhttp)
@@ -921,7 +921,7 @@ static bool _fetch_game(DataLoaderModel *model)
         }
         char payload[256];
         snprintf(payload, sizeof(payload), "{\"username\":\"%s\",\"password\":\"%s\"}", username, password);
-        return flipper_http_request(model->fhttp, POST, "https://www.flipsocial.net/api/user/login/", "{\"Content-Type\":\"application/json\"}", payload);
+        return flipper_http_request(model->fhttp, POST, "https://www.jblanked.com/flipper/api/user/login/", "{\"Content-Type\":\"application/json\"}", payload);
     }
     else if (model->request_index == 1)
     {
@@ -959,7 +959,7 @@ static bool _fetch_game(DataLoaderModel *model)
             char payload[172];
             snprintf(payload, sizeof(payload), "{\"username\":\"%s\",\"password\":\"%s\"}", username, password);
             model->title = "Registering...";
-            return flipper_http_request(model->fhttp, POST, "https://www.flipsocial.net/api/user/register/", "{\"Content-Type\":\"application/json\"}", payload);
+            return flipper_http_request(model->fhttp, POST, "https://www.jblanked.com/flipper/api/user/register/", "{\"Content-Type\":\"application/json\"}", payload);
         }
         else
         {
@@ -1014,7 +1014,7 @@ static bool _fetch_game(DataLoaderModel *model)
 
         model->fhttp->save_received_data = true;
         char url[128];
-        snprintf(url, sizeof(url), "https://www.flipsocial.net/api/world/v5/get/world/%s/", furi_string_get_cstr(first_world));
+        snprintf(url, sizeof(url), "https://www.jblanked.com/flipper/api/world/v5/get/world/%s/", furi_string_get_cstr(first_world));
         furi_string_free(world_list);
         furi_string_free(first_world);
         return flipper_http_request(model->fhttp, GET, url, "{\"Content-Type\":\"application/json\"}", NULL);
@@ -1628,7 +1628,7 @@ static bool _fetch_worlds(DataLoaderModel *model)
     furi_record_close(RECORD_STORAGE);
     snprintf(model->fhttp->file_path, sizeof(model->fhttp->file_path), STORAGE_EXT_PATH_PREFIX "/apps_data/flip_world/worlds/world_list_full.json");
     model->fhttp->save_received_data = true;
-    return flipper_http_request(model->fhttp, GET, "https://www.flipsocial.net/api/world/v5/get/10/", "{\"Content-Type\":\"application/json\"}", NULL);
+    return flipper_http_request(model->fhttp, GET, "https://www.jblanked.com/flipper/api/world/v5/get/10/", "{\"Content-Type\":\"application/json\"}", NULL);
 }
 static char *_parse_worlds(DataLoaderModel *model)
 {

+ 1 - 1
flip_world.h

@@ -15,7 +15,7 @@
 //
 
 #define TAG "FlipWorld"
-#define VERSION 0.6
+#define VERSION "0.6.1"
 #define VERSION_TAG TAG " " FAP_VERSION
 
 // Define the submenu items for our FlipWorld application

+ 1 - 1
game/storage.c

@@ -376,7 +376,7 @@ bool save_player_context_api(PlayerContext *player_context)
     furi_string_free(json);
 
     // save the json_data to the API
-    if (!flipper_http_request(fhttp, POST, "https://www.flipsocial.net/api/user/update-game-stats/", "{\"Content-Type\": \"application/json\"}", furi_string_get_cstr(json_data)))
+    if (!flipper_http_request(fhttp, POST, "https://www.jblanked.com/flipper/api/user/update-game-stats/", "{\"Content-Type\": \"application/json\"}", furi_string_get_cstr(json_data)))
     {
         FURI_LOG_E(TAG, "Failed to save player context to API");
         furi_string_free(json_data);

+ 1 - 1
game/world.c

@@ -146,7 +146,7 @@ FuriString *fetch_world(const char *name)
     }
 
     char url[256];
-    snprintf(url, sizeof(url), "https://www.flipsocial.net/api/world/v5/get/world/%s/", name);
+    snprintf(url, sizeof(url), "https://www.jblanked.com/flipper/api/world/v5/get/world/%s/", name);
     snprintf(fhttp->file_path, sizeof(fhttp->file_path), STORAGE_EXT_PATH_PREFIX "/apps_data/flip_world/worlds/%s.json", name);
     fhttp->save_received_data = true;
     if (!flipper_http_request(fhttp, GET, url, "{\"Content-Type\": \"application/json\"}", NULL))