mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-17 18:37:07 +02:00
Map downloader - A host or dedicated server now tells joiners which Thunderstore package its map comes from (the Mods folder name plus manifest.json). - A player without the map gets a card: icon, name, author, version and description, with DOWNLOAD and CANCEL. It works with mouse, keyboard and controller. - Only packages listed as Maps in the ReSkate community are offered, and never deprecated, rejected or NSFW ones. - On yes the package is downloaded, installed into Mods and applied as a live mod, then the session loads the map. A small card on the right shows the progress, so the player can keep skating. - The player stays connected while it downloads: the host gives a player who says they are fetching the map up to 45 minutes instead of the usual load time. - When the server changes map with the player in it, the card says so. - Protocol version 47: map package on map_offer and world_state, and a "fetching the map" flag on map_request and world_ready. Joining - The pause-menu server browser shows a CONNECTING card over the page while a join is under way, and a COULDN'T CONNECT card with the reason when it does not get in. - The session and voice tabs no longer show before the player is in. - Leaving without the map (declined or cancelled download) no longer counts towards the failed-join limit, on servers and player hosts. Input - A card that asks something holds the game's input until the buttons are released. - Steam's overlay hooks XInput in front of ReSkate and answers the game itself, so a controller reached the game behind menus. ReSkate now hooks that hook as well. Mod merging - Mods are read on several threads, at launch and for live merges. A live merge runs below the game's priority. - The paid-cosmetics check reads the game's files and the mods on several threads. - A live merge reuses the paid-cosmetics verdicts it already has and reports its progress and timings. Launcher - NSFW mods and their categories are not shown in the mod browser.
30 lines
1.2 KiB
C++
30 lines
1.2 KiB
C++
#pragma once
|
|
#include <atomic>
|
|
#include <cstdint>
|
|
#include <filesystem>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
namespace dingosdk::https {
|
|
struct Download {
|
|
bool ok{};
|
|
unsigned long http_status{}, error{};
|
|
};
|
|
// A long download as another thread sees it: how far it is (`total` 0 when the server does
|
|
// not say), and a way to stop it (the download then fails with ERROR_CANCELLED).
|
|
struct Watch {
|
|
std::atomic<std::uint64_t> received{}, total{};
|
|
std::atomic<bool> cancel{};
|
|
};
|
|
// Streams an HTTPS GET into `destination`, which must not exist yet. Follows
|
|
// redirects that stay on HTTPS; refuses bodies over `max_bytes` or transfers
|
|
// that take longer than `timeout_seconds` in total.
|
|
Download get(std::wstring_view url, const std::filesystem::path& destination,
|
|
std::uint64_t max_bytes, std::uint32_t timeout_seconds, const wchar_t* agent, Watch* watch = nullptr);
|
|
// The body of the same GET, for an answer small enough to hold: nothing when it
|
|
// fails, and `result`, when given, says how.
|
|
std::optional<std::string> get_text(std::wstring_view url, std::uint64_t max_bytes,
|
|
std::uint32_t timeout_seconds, const wchar_t* agent, Download* result = nullptr);
|
|
}
|