You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In lua I am executing the callback in a thread (not important) and I am passing as an argument to the export a function so that C# executes it, if I execute it without having the Wait inside the function there is no problem, but if there is a Wait inside From the function I get an error.
[ script:testing-cs] SCRIPT ERROR in reference call: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
[ script:testing-cs] Parameter name: index
[ script:testing-cs]
[ script:test-lua] SCRIPT ERROR: error object is not a string
I added a try catch to the exact line that is giving the error so I can provide more detail info:
[ script:testing-cs] Error invoking callback: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
[ script:testing-cs] Parameter name: index
[ script:testing-cs] at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <fbc4ec45371543bfba3678ebb82caf6d>:0
[ script:testing-cs] at (wrapper dynamic-method) System.Object.CallSite.Target(System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,int)
[ script:testing-cs] at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1) [0x0011d] in <cf8f429092f345a6bd742c3476e00e06>:0
[ script:testing-cs] at CitizenFX.Core.MsgPackDeserializer+<>c__DisplayClass36_1.<CreateRemoteFunctionReference>b__1 (System.Object res, System.Object err) [0x0025f] in C:\fivem\code\client\clrcore\MsgPackDeserializer.cs:285
[ script:testing-cs] at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
[ script:testing-cs] at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <fbc4ec45371543bfba3678ebb82caf6d>:0
[ script:testing-cs] Exception_EndOfInnerExceptionStack
[ script:testing-cs] at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00083] in <fbc4ec45371543bfba3678ebb82caf6d>:0
[ script:testing-cs] at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <fbc4ec45371543bfba3678ebb82caf6d>:0
[ script:testing-cs] at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000e7] in <fbc4ec45371543bfba3678ebb82caf6d>:0
[ script:testing-cs] at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00008] in <fbc4ec45371543bfba3678ebb82caf6d>:0
[ script:testing-cs] at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <fbc4ec45371543bfba3678ebb82caf6d>:0
[ script:testing-cs] at CitizenFX.Core.FunctionReference.Invoke (System.Int32 reference, System.Byte[] arguments) [0x000ad] in C:\fivem\code\client\clrcore\FunctionReference.cs:72
What happened?
Currently in C# v1 I have created an export that takes a callback as an argument, and directly invokes it.
In lua I am executing the callback in a thread (not important) and I am passing as an argument to the export a function so that C# executes it, if I execute it without having the Wait inside the function there is no problem, but if there is a Wait inside From the function I get an error.
Error:
I added a try catch to the exact line that is giving the error so I can provide more detail info:
This is the exact line that is giving the error.
The behavior is a little strange, everything works perfectly, the only thing that happens is that the error is displayed.
Expected result
Error not shown
Reproduction steps
Importancy
Slight inconvenience
Area(s)
FiveM, ScRT: C#
Specific version(s)
FiveM 7900 & build from source
Additional information
The error occurs on server and client
The text was updated successfully, but these errors were encountered: