mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-26 23:16:41 +01:00
Plugins: a dedicated server's plugins hide a player from others, or mute them
Hide and Seek, tag, spectating and ghost runs need one player to be
gone for some others, which no plugin could do.
reskate.server.hide(target, viewers, {skater, name, voice, sound}) and
reskate.server.unhide(target, viewers?) do it per viewer; viewers is a
player, a list of players or "all" (everyone on now but the target).
Wholly (the default) the target leaves those viewers' rosters, so their
games take the skater, its name tag and its objects away as for a player
who left, and the server sends them nothing of the target: poses, sound,
voice, outfit, effects and objects. No protocol change: the roster per
viewer is the one the cards and polls use, and the server's introduce
already holds a player back until shown. Shown again, the target is
introduced anew (outfit, then whole poses, then all its objects).
Without the skater (skater = false), only the voice and/or the sound is
held back and the player stays. Name and skater go together: a game has
no skater without its player, and hiding one without the other would
need a protocol change.
Refused while the target shares a party or a throwdown with one of the
viewers, whose game would lose a party member or a player mid-way; while
hidden, the two cannot come into one party. A plugin that stops shows
everyone it hid; a player who leaves is dropped from every list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SYabE7FCPgj3SaWeF92EML
This commit is contained in:
1 parent
194942779c
commit
dd8e610482
10 files changed
+416
-13
No files matched your search
@@ -111,7 +111,17 @@ class ServerGame final : public Game {
|
||||
for (auto &n : host_.take_poll_news()) news.push_back({std::move(n.plugin), n.id, n.player, n.answer, std::move(n.text), std::move(n.why)});
|
||||
return news;
|
||||
}
|
||||
void release(std::string_view plugin) override { host_.plugin_screens_release(plugin); }
|
||||
// A player hidden from others, wholly or only their voice and sound (the roster and relay).
|
||||
std::string server_hide(std::string_view plugin, std::uint64_t target, const std::vector<std::uint64_t> &viewers, const Hiding &what) override {
|
||||
return host_.plugin_hide(plugin, target, viewers, what.skater, what.voice, what.sound);
|
||||
}
|
||||
std::string server_unhide(std::string_view plugin, std::uint64_t target, const std::vector<std::uint64_t> &viewers) override {
|
||||
return host_.plugin_unhide(plugin, target, viewers);
|
||||
}
|
||||
void release(std::string_view plugin) override {
|
||||
host_.plugin_screens_release(plugin);
|
||||
host_.plugin_hides_release(plugin);
|
||||
}
|
||||
// The skaters of the players in the world, as their latest poses put them. The server has
|
||||
// no skater of its own, so this is every player's.
|
||||
std::vector<PeerSkater> peer_skaters() override {
|
||||
|
||||
Reference in new issue
Block a user