From 2d72bf710b01a6e38f510888ba09056f2a5dee2e Mon Sep 17 00:00:00 2001 From: doxoh Date: Fri, 23 Feb 2024 13:18:35 +0100 Subject: [PATCH] fix(server): error as rpc answer --- api/AltV.Net.Async/AsyncCore.cs | 4 +++- runtime | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/AltV.Net.Async/AsyncCore.cs b/api/AltV.Net.Async/AsyncCore.cs index c064501cd..60570372a 100644 --- a/api/AltV.Net.Async/AsyncCore.cs +++ b/api/AltV.Net.Async/AsyncCore.cs @@ -986,12 +986,14 @@ public override void OnScriptRPCEvent(IntPtr eventpointer, IPlayer target, strin if (!ScriptRpcAsyncEventHandler.HasEvents()) return; - Task.Run(async () => + var task = Task.Run(async () => { var clientScriptRPCEvent = new AsyncScriptRpcEvent(target, answerId); await ScriptRpcAsyncEventHandler.CallAsync(@delegate => @delegate(clientScriptRPCEvent, target, name, objects, answerId)); }); + Task.WaitAll(task); + if (UnansweredServerRpcRequest.Contains(answerId)) { target.EmitRPCAnswer(answerId, null, "Answer not handled"); diff --git a/runtime b/runtime index 1831c4cb8..88a8e39bd 160000 --- a/runtime +++ b/runtime @@ -1 +1 @@ -Subproject commit 1831c4cb871c91ee9038e3611ea48cbe274f602e +Subproject commit 88a8e39bdd79f9c3a602017fc75e6285d6bf78c8