mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-17 19:47:08 +02:00
Server browser - Official servers (the backend's "official_servers") sort first and are drawn in ReSkate blue - Servers Steam friends are skating in sort next, drawn in green with the friends' names; searching a friend's name finds their server - A player in a session they joined can join another server straight from the list; hosts still end their session first, and a Steam friend's join offer never replaces a session - Joining a dedicated server from the list records it as the player's public session, so friends see it and the row shows HERE - Blocked servers (the backend's "blocked_servers") are hidden and cannot be joined, by code either - When the backend sets "server_tokens_required", dedicated servers that signed in without a login token are hidden, except on the player's own network - A search that gets no internet list from Steam keeps the last list for two minutes, and waits six seconds before treating it as empty Roles - New Staff tag from the backend's "staff" list: green name, badge and item animation, ranked after Dev - Staff can pick a rainbow for their items on the Special page; it is sent as a solid colour older builds can show, so the protocol is unchanged Dedicated server - steam_token: sign in with a Steam game server login token and keep the same Steam ID every start; empty signs in anonymously as before - A listed server without a token says so at startup, and when the token rule starts or stops hiding it - Linux servers update themselves from the release's "server_linux" tarball, with the machine's curl and tar, pinned by SHA-256, and carry on in the same process Launcher - Only create the MiniDumpWriteDump API-set shim under Wine/Proton
38 lines
1.8 KiB
C++
38 lines
1.8 KiB
C++
#pragma once
|
|
#include <filesystem>
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
// Self-update for release builds of the dedicated server. The latest GitHub
|
|
// release's launcher.json pins the server zip (size and SHA-256) and the
|
|
// SHA-256 of the ReSkateServer.exe inside it; a server whose own exe differs
|
|
// installs that zip over its folder and starts again. Its own files
|
|
// (ReSkateServer.json, Mods, logs) are not in the zip, so they are kept.
|
|
// The Linux server does the same from the release's tarball ("server_linux" in
|
|
// launcher.json, server_release.h), using the machine's curl and tar.
|
|
namespace dingosdk::server {
|
|
// Release builds only: a local build never replaces itself.
|
|
bool updates_enabled() noexcept;
|
|
|
|
struct UpdateCheck {
|
|
bool available{};
|
|
std::string version; // the release's server version, e.g. "0.3.8"
|
|
std::string problem; // why the check could not finish, or empty
|
|
};
|
|
// Asks GitHub for the latest release; blocks for a few seconds at most.
|
|
UpdateCheck check_for_update();
|
|
// Downloads the pinned zip into `folder` and unpacks it there. Throws on any
|
|
// failure, before anything in the folder has changed.
|
|
void install_update(const std::filesystem::path& folder);
|
|
// Starts a new copy of this exe with the same command line. On Linux the new copy takes
|
|
// this process's place, so this only returns (false) when that failed.
|
|
bool relaunch();
|
|
// Deletes the files a previous update renamed aside.
|
|
void remove_previous_update(const std::filesystem::path& folder) noexcept;
|
|
#ifndef _WIN32
|
|
// The second half of install_update, for a tarball already downloaded and verified: checks
|
|
// what is in it, that its ReSkateServer has this SHA-256, and puts its files in `folder`.
|
|
void install_archive(const std::filesystem::path& archive, const std::filesystem::path& folder, std::string_view exe_sha256);
|
|
#endif
|
|
} // namespace dingosdk::server
|