Files
AyeZeeBB 2833ab1f88 config in sections
Server config:
- Written in sections, in reading order: server, access, maps, players,
  anti_cheat, network, votes. A config from an older version, flat and
  under older names, is read as it is and written back this way on first
  start; only settings that are really new are reported as new.
- Renamed: no_bail, noclip, boosts, parties, voice_chat to allow_*;
  global_bans to use_global_bans; welcome to welcome_message; speed_check
  to speed_hack; score_check to modified_scoring; score_allow to
  allowed_scoring_mods; map_pool and map_rotation_minutes to maps.pool and
  maps.rotation_minutes. Console and admin commands are unchanged.
- Bans are kept in data/bans.json beside the config. A config that holds
  them has them moved there; a bans file that cannot be read stops the
  server from starting.
- Reserved slots are one list, "reserved_players_slots": a slot is kept
  for each listed player who is not on. "reserved_slots" and the
  "reserved slots <n>" command are gone; admins may take a kept slot but
  none is kept for them.
- "tps" is no longer in the file: dedicated servers run at 20.
- "bone_scale_limit" is 1 by default: resized body parts are off unless a
  server allows them.
- New: "pack_ms" (10), how long Steam may hold a message to pack it with
  others; "finger_distance" (25); "steam_debug", which logs what Steam's
  networking says, for connection faults.
2026-10-08 16:18:29 -05:00

43 lines
1.5 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::uint16_t direct_port{}; // players may connect straight to this UDP port; 0: relays only
};
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