I’m currently trying to debug a problem in someone else’s code that occurs when you spam the shit out of NUI $.post
and SET_NUI_FOCUS
requests (it will always happen on nui focus = true, never on nui focus = false). AFAIK this would not occur until recent-ish. 0xD8 or 216 is the message type which indeed isn’t present in GetUnpacker()
. The resource completely crashes the client is in a NUI input lock until the resource is restarted. The thrown exception is not catchable at resource level unforunately:
throw new InvalidOperationException($"Tried to decode invalid MsgPack type {type}");
Would it be possible to catch the exception at public static object Deserialize(byte[] data, string netSource = null)
level and return a null
/ nil
object in case the type is not recognized, while printing the error to console instead?
[ 4163282] System.InvalidOperationException: Tried to decode invalid MsgPack type 216
[ 4163282] at CitizenFX.Core.MsgPackDeserializer.GetUnpacker (System.Byte type) [0x00232] in C:\gl\builds\aaf2d114\0\cfx\fivem\code\client\clrcore\MsgPackDeserializer.cs:387
[ 4163297] at CitizenFX.Core.MsgPackDeserializer.UnpackAny (System.IO.BinaryReader reader) [0x00007] in C:\gl\builds\aaf2d114\0\cfx\fivem\code\client\clrcore\MsgPackDeserializer.cs:30
[ 4163297] at CitizenFX.Core.MsgPackDeserializer.UnpackArray (System.IO.BinaryReader reader, System.Int32 length) [0x0000a] in C:\gl\builds\aaf2d114\0\cfx\fivem\code\client\clrcore\MsgPackDeserializer.cs:56
[ 4163297] at CitizenFX.Core.MsgPackDeserializer.UnpackFixArray (System.Byte a, System.IO.BinaryReader reader) [0x00005] in C:\gl\builds\aaf2d114\0\cfx\fivem\code\client\clrcore\MsgPackDeserializer.cs:217
[ 4163297] at CitizenFX.Core.MsgPackDeserializer.UnpackAny (System.IO.BinaryReader reader) [0x0000f] in C:\gl\builds\aaf2d114\0\cfx\fivem\code\client\clrcore\MsgPackDeserializer.cs:32
[ 4163297] at CitizenFX.Core.MsgPackDeserializer.Deserialize (System.Byte[] data, System.String netSource) [0x0001b] in C:\gl\builds\aaf2d114\0\cfx\fivem\code\client\clrcore\MsgPackDeserializer.cs:24
[ 4163313] at CitizenFX.Core.InternalManager.TriggerEvent (System.String eventName, System.Byte[] argsSerialized, System.String sourceString) [0x00021] in C:\gl\builds\aaf2d114\0\cfx\fivem\code\client\clrcore\InternalManager.cs:194