mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-24 18:16:27 +02:00
Plugins: server plugins spawn and remove the server's park mods
A dedicated server's park mods could only be spawned from its console, an admin's chat or a vote, so a server plugin could not bring out the park its game is played in. A new permission, server.parks, gives a server copy reskate.server.parks(), which lists the park mods set up with whether each fits the map running now and is spawned (its objects and minutes left), and reskate.server.park_spawn(name, minutes?) and park_remove(name), which return ok or false and why. They go through park-mod add and remove, so the park limits, the map check and the chat lines stay the server's. Their "[parks]" lines are logged "by plugin <id>". A name is a park mod's own (1 to 16 of a-z 0-9 - _) and minutes are 1 to 1440, or none for until removed. Reading the park files is not part of this: a plugin brings what it needs to know about a park in its own package. dingosdk_server_plugin_tests spawns and removes a park mod through a plugin and checks what it is refused; dingosdk_plugin_tests checks the API on a server copy, and that a player's copy and a plugin without server.parks cannot use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hs7xxJDf6SDcQUaXnzmtL5
This commit is contained in:
1 parent
fd5f95467f
commit
5b10469bad
9 files changed
+249
-13
No files matched your search
@@ -80,6 +80,15 @@ class ServerGame final : public Game {
|
||||
host_.set_locks(player, locks, "plugin " + std::string(plugin));
|
||||
return {};
|
||||
}
|
||||
std::vector<ServerPark> server_parks() override {
|
||||
std::vector<ServerPark> result;
|
||||
for (auto &p : host_.park_status()) result.push_back({std::move(p.name), std::move(p.map), p.here, p.spawned, p.objects, p.minutes_left});
|
||||
return result;
|
||||
}
|
||||
std::string spawn_park(std::string_view plugin, std::string_view name, unsigned minutes) override {
|
||||
return host_.plugin_park(plugin, true, name, minutes);
|
||||
}
|
||||
std::string remove_park(std::string_view plugin, std::string_view name) override { return host_.plugin_park(plugin, false, name, 0); }
|
||||
// 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