mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-23 17:35:57 +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.
44 lines
2.0 KiB
C++
44 lines
2.0 KiB
C++
#pragma once
|
|
|
|
#include <optional>
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
// One Thunderstore package looked up by name, for the game: the map a multiplayer host is on
|
|
// and this player does not have (Extension/Assets/map_download.h). No network here; the caller
|
|
// fetches details_url() and hands the answer to choose().
|
|
namespace dingosdk::thunderstore_package {
|
|
|
|
struct Name {
|
|
std::string owner, name;
|
|
std::string version; // "1.2.3", or empty for the newest
|
|
// The Mods folder the package installs as, and how its files name it.
|
|
[[nodiscard]] std::string folder() const { return owner + '-' + name; }
|
|
bool operator==(const Name&) const = default;
|
|
};
|
|
// "Owner-Name" or "Owner-Name-1.2.3", as a host names a map's package
|
|
// (Extension/Multiplayer/Net/protocol.h: valid_map_package). Nothing for anything else.
|
|
std::optional<Name> parse_name(std::string_view package);
|
|
|
|
// /api/experimental/package/<owner>/<name>/: what Thunderstore says of the package.
|
|
std::wstring details_url(const Name& name);
|
|
// Where a version of it downloads from. Always thunderstore.io, whatever an answer says.
|
|
std::wstring download_url(const Name& name, std::string_view version);
|
|
|
|
struct Choice {
|
|
bool ok{};
|
|
std::string version; // the one to download: the one asked for, else the newest
|
|
std::string newest; // the newest, to fall back on when the one asked for is gone
|
|
// What its page says of it, for the player: one line of plain text, cut to a few lines' worth.
|
|
std::string description;
|
|
// Its picture, a PNG on Thunderstore's own hosts; empty when the answer names anything else.
|
|
std::string icon;
|
|
std::string reason; // why not, for the player
|
|
};
|
|
// Reads that answer. The package is taken only when it is the one asked for, is listed in
|
|
// `community` as a map (the "Maps" category), is not deprecated or marked NSFW there and was
|
|
// not rejected by the community's moderators.
|
|
Choice choose(std::string_view json, const Name& wanted, std::string_view community);
|
|
|
|
} // namespace dingosdk::thunderstore_package
|