From 3b4c705d7db08e7672cf7f7271700f3bf47be9b4 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Sun, 4 Dec 2022 02:09:59 +0000 Subject: [PATCH] Add binding for avatar-specific world settings --- VpSharp/src/Entities/VirtualParadiseAvatar.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/VpSharp/src/Entities/VirtualParadiseAvatar.cs b/VpSharp/src/Entities/VirtualParadiseAvatar.cs index 789f879..66852b9 100644 --- a/VpSharp/src/Entities/VirtualParadiseAvatar.cs +++ b/VpSharp/src/Entities/VirtualParadiseAvatar.cs @@ -287,6 +287,23 @@ public sealed class VirtualParadiseAvatar : IEquatable return Task.CompletedTask; } + /// + /// Modifies the world settings for this avatar. + /// + /// The builder which defines parameters to change. + /// is . + /// The client does not have permission to modify world settings. + public async Task SendWorldSettings(Action action) + { + ArgumentNullException.ThrowIfNull(action); + + // ReSharper disable once InconsistentlySynchronizedField + var builder = new WorldSettingsBuilder(_client, Session); + await Task.Run(() => action(builder)).ConfigureAwait(false); + + builder.SendChanges(); + } + /// /// Teleports the avatar to another world. ///