mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-23 09:45:53 +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.
49 lines
3.0 KiB
C++
49 lines
3.0 KiB
C++
#pragma once
|
|
#include "Engine/Game/Multiplayer/session_model.h"
|
|
#include <cstdint>
|
|
#include <optional>
|
|
#include <string>
|
|
|
|
namespace dingosdk::multiplayer {
|
|
// Commands and tick execute on the game's client thread. model() is thread-safe.
|
|
std::string command(std::string_view action, std::string_view argument = {}, std::string_view password = {});
|
|
// A dedicated server's vote is running and this player may answer it (queue_command "vote" yes|no).
|
|
bool server_vote_open() noexcept;
|
|
// A dedicated server's poll is running and this player may answer it: how many answers it has
|
|
// (queue_command "vote" 1 to that many). 0: no poll.
|
|
unsigned server_poll_answers() noexcept;
|
|
// Private menu queue: passwords never pass through console history/logging.
|
|
bool queue_command(std::string_view action, std::string_view argument, std::string_view password);
|
|
// Called just before the host's validated native load is submitted, on the client thread.
|
|
void host_map_change(std::string_view destination);
|
|
enum class MapLoadResult { waiting, queued, failed, missing }; // missing: the map is not installed
|
|
// Runs on the client thread; only catalog-registered destinations may be queued.
|
|
using MapLoader = MapLoadResult (*)(std::string_view map, bool submitted, std::string &detail);
|
|
void tick(std::uintptr_t base, std::uintptr_t client, bool gameplay_ready, std::string_view map,
|
|
MapLoader loader = nullptr);
|
|
MultiplayerModel model();
|
|
std::string take_leave_notice(); // why the session just ended over a missing map, once; client thread
|
|
// The same map when the host said which Thunderstore package it is from, so it can be offered
|
|
// for download instead (Extension/Assets/map_download.h): the session does not end. It tells
|
|
// the host the map is being fetched, which is given much longer than a load, and goes on
|
|
// trying the map, so it loads as soon as it is installed. Once per map; client thread.
|
|
// The downloader ends the session (queue_command "stop") when the player says no or the map
|
|
// cannot be had. Should the session end meanwhile for another reason,
|
|
// queue_command("rejoin", "", "") goes back to it, with the password it was joined with.
|
|
struct MapNeed {
|
|
std::string package; // protocol.h: valid_map_package, never empty
|
|
std::string map; // its name for people
|
|
bool server{}; // a dedicated server's map, not a player's lobby
|
|
bool moved{}; // the session changed to this map with the player in it (else: joining)
|
|
};
|
|
std::optional<MapNeed> take_map_need();
|
|
// Whether a session is waiting on a map being fetched right now. Thread-safe.
|
|
bool fetching_map() noexcept;
|
|
// How a host learns the package of the map it is on, to tell its guests: the level's asset in,
|
|
// the package (or nothing) out. Called on the client thread, often; it should be quick.
|
|
using MapPackageLookup = std::string (*)(std::string_view asset);
|
|
void set_map_package_lookup(MapPackageLookup lookup) noexcept;
|
|
// The session's chat lines for the overlay. Thread-safe and cheap: callable every frame.
|
|
MultiplayerChat chat();
|
|
} // namespace dingosdk::multiplayer
|