mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-23 07:45:53 +02:00
Server: object scaling can be turned off
Server: object scaling can be turned off A dedicated server can stop players resizing the objects they place. - "allow_object_scaling" in the config's "players" section (default true), and "object-scaling on|off" from the console or an admin. A change is saved and applies at once. - Off: the server shares every player's objects at their own size, whatever that player's game sent. Admins can still resize theirs, as with the object limit. - The roster tells each game. In the park editor of a player on such a server the SCALE mode is not offered, its Y shortcut does nothing, the scale box is disabled with a note saying why, and what is placed or edited is its own size. - An object resized before the setting was turned off is its own size for everyone else straight away; its owner sees it resized until they edit it.
This commit is contained in:
1 parent
c8c6cf16f2
commit
9ab985e778
19 files changed
+1625
-1606
No files matched your search
@@ -619,6 +619,7 @@ std::vector<std::uint8_t> encode(const Packet &p, bool compact_pose, std::uint32
|
||||
w.integer(static_cast<std::uint8_t>(p.object_placement), 1);
|
||||
if (!valid_object_limit(p.object_limit)) throw std::invalid_argument("Invalid object limit");
|
||||
w.integer(p.object_limit, 2);
|
||||
w.integer(p.object_scaling ? 1 : 0, 1);
|
||||
w.integer(p.force_world_layers, 1);
|
||||
// One mode per world-layer catalog row; both peers read the same catalog
|
||||
// from the same game build.
|
||||
@@ -945,6 +946,9 @@ std::optional<Packet> decode(std::span<const std::uint8_t> bytes) noexcept {
|
||||
const auto object_limit = r.integer(2);
|
||||
if (!valid_object_limit(object_limit)) return {};
|
||||
p.object_limit = static_cast<unsigned>(object_limit);
|
||||
const auto scaling = r.integer(1);
|
||||
if (scaling > 1) return {};
|
||||
p.object_scaling = scaling != 0;
|
||||
const auto forced = r.integer(1);
|
||||
if (forced > 1) return {};
|
||||
p.force_world_layers = forced != 0;
|
||||
|
||||
Reference in new issue
Block a user