mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-24 09:26:13 +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
42 lines
1.4 KiB
C++
42 lines
1.4 KiB
C++
#pragma once
|
|
#include <cstdint>
|
|
#include <filesystem>
|
|
#include <string>
|
|
|
|
namespace dingosdk::server {
|
|
// What the server browser shows. Players behind a NAT often cannot query the
|
|
// server directly, so everything a browser row needs also rides in the game
|
|
// tags that Steam's master list returns (see server_tags).
|
|
struct Advertisement {
|
|
std::string name, map;
|
|
unsigned players{}, max_players{};
|
|
bool password{}, listed{true};
|
|
std::uint64_t secret{};
|
|
};
|
|
std::string server_tags(const Advertisement &);
|
|
|
|
// A Steam game server for Skate's app. Signed in anonymously its SteamID is new each
|
|
// start, so invite codes last only while the server runs; signed in with a game server
|
|
// login token it is the token's account, with the same SteamID every start.
|
|
class SteamServer {
|
|
public:
|
|
~SteamServer();
|
|
// Loads steam_api64.dll from `folder`, next to the Steam client files it needs.
|
|
// `token`: a game server login token, or empty to sign in anonymously.
|
|
bool start(const std::filesystem::path &folder, std::uint16_t port, std::uint16_t query_port, const std::string &token,
|
|
std::string &error);
|
|
void run_callbacks();
|
|
bool logged_on();
|
|
std::uint64_t steam_id();
|
|
std::string public_ip();
|
|
void advertise(const Advertisement &);
|
|
void stop();
|
|
void *module() const { return module_; }
|
|
|
|
private:
|
|
void *module_{}, *server_{};
|
|
bool started_{};
|
|
std::string tags_;
|
|
};
|
|
} // namespace dingosdk::server
|