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:
AyeZeeBB committed 2026-10-08 22:21:00 -05:00
1 parent c8c6cf16f2
commit 9ab985e778
19 files changed
+1625 -1606

No files matched your search

+5
View File
@@ -576,6 +576,7 @@ void Host::send_roster() {
p.distances = config_.distances;
p.object_placement = config_.object_placement;
p.object_limit = config_.object_limit;
p.object_scaling = config_.object_scaling;
p.guest_noclip = config_.noclip;
p.guest_no_bail = config_.no_bail;
p.guest_boosts = config_.boosts;
@@ -1113,6 +1114,10 @@ void Host::sync_objects() {
std::erase_if(layout, [&](const auto &object) { return guest->cleared.contains(object.id); });
// No more of a player's objects than the server allows each of them; admins are not limited.
if (!is_admin(id)) layout = limited_layout(std::move(layout), guest->shared.objects(), config_.object_limit);
// With scaling off, a player's objects reach everyone else at their own size, whatever
// that player's game made of them.
if (!config_.object_scaling && !is_admin(id))
for (auto &object : layout) object.scale = 1.f;
if (config_.activity_log) activity_.objects(id, guest->shared.layout(), layout);
guest->shared.replace(layout);
guest->shared_from = guest->objects.revision();