From 86bc916c4936d8cbd463fab842cda3629967cc4a Mon Sep 17 00:00:00 2001 From: Matt F Date: Tue, 14 Jul 2026 20:22:00 -0700 Subject: [PATCH] Fix NGO RequireOwnership deprecation warnings; add VFX script metas Replace deprecated [Rpc(..., RequireOwnership = true)] with InvokePermission = RpcInvokePermission.Owner on the owner-submitted draft/buff RPCs (PlayerDraft, PlayerBuffManager), matching the pattern already used elsewhere. Also commits the .meta files Unity generated for the new sell-VFX scripts so their GUIDs are stable across machines. Co-Authored-By: Claude Opus 4.8 --- Assets/_Project/Scripts/Gameplay/Draft/PlayerDraft.cs | 4 ++-- Assets/_Project/Scripts/Gameplay/PlayerBuffManager.cs | 2 +- Assets/_Project/Scripts/VFX/CoinBurstVfx.cs.meta | 2 ++ Assets/_Project/Scripts/VFX/SellEffectSpawner.cs.meta | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 Assets/_Project/Scripts/VFX/CoinBurstVfx.cs.meta create mode 100644 Assets/_Project/Scripts/VFX/SellEffectSpawner.cs.meta diff --git a/Assets/_Project/Scripts/Gameplay/Draft/PlayerDraft.cs b/Assets/_Project/Scripts/Gameplay/Draft/PlayerDraft.cs index 3fd7350..41a7c04 100644 --- a/Assets/_Project/Scripts/Gameplay/Draft/PlayerDraft.cs +++ b/Assets/_Project/Scripts/Gameplay/Draft/PlayerDraft.cs @@ -137,7 +137,7 @@ namespace TD.Gameplay.Draft // ----- Owner → server RPCs ---------------------------------------- /// Owning client: pick one of the offered options by id. - [Rpc(SendTo.Server, RequireOwnership = true)] + [Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Owner)] public void RequestPickRpc(int optionId) { ServerResolve(optionId); @@ -148,7 +148,7 @@ namespace TD.Gameplay.Draft /// afford it or already has an unresolved draft (resolve the current one first so a /// free pick is never silently overwritten). /// - [Rpc(SendTo.Server, RequireOwnership = true)] + [Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Owner)] public void RequestBuyRerollRpc() { if (HasActiveDraft) return; // resolve the pending draft before buying another diff --git a/Assets/_Project/Scripts/Gameplay/PlayerBuffManager.cs b/Assets/_Project/Scripts/Gameplay/PlayerBuffManager.cs index 506791e..52efbdc 100644 --- a/Assets/_Project/Scripts/Gameplay/PlayerBuffManager.cs +++ b/Assets/_Project/Scripts/Gameplay/PlayerBuffManager.cs @@ -146,7 +146,7 @@ namespace TD.Gameplay /// a random buff from the category at . /// The server validates gold and adds the buff if the purchase succeeds. /// - [Rpc(SendTo.Server, RequireOwnership = true)] + [Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Owner)] public void RequestPurchaseBuffRpc(int categoryIndex) { if (categories == null || categoryIndex < 0 || categoryIndex >= categories.Length) diff --git a/Assets/_Project/Scripts/VFX/CoinBurstVfx.cs.meta b/Assets/_Project/Scripts/VFX/CoinBurstVfx.cs.meta new file mode 100644 index 0000000..58bc699 --- /dev/null +++ b/Assets/_Project/Scripts/VFX/CoinBurstVfx.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: bdff685029f23004796671150c7cf39b \ No newline at end of file diff --git a/Assets/_Project/Scripts/VFX/SellEffectSpawner.cs.meta b/Assets/_Project/Scripts/VFX/SellEffectSpawner.cs.meta new file mode 100644 index 0000000..7ae5f2a --- /dev/null +++ b/Assets/_Project/Scripts/VFX/SellEffectSpawner.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e2708c6bac8136f45b48c899d3d40630 \ No newline at end of file