TGRHavoc / live_map

A FiveM addon for live maps
https://docs.tgrhavoc.co.uk/livemap-resource/
62 stars 38 forks source link

Socket times out, this exception occurs #24

Closed mbergwall2222 closed 6 years ago

mbergwall2222 commented 6 years ago
 Error invoking callback for event livemap:internal_UpdatePlayerData: System.Reflection.TargetInvocationException:                         Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: propertyName
at Newtonsoft.Json.Linq.JObject.get_Item (System.String propertyName) [0x0001d] in <90125bc3858247a4a5e3af0c303                        5e4aa>:0
at Havoc.Live_Map.SocketHandler.MakeSurePlayerExists (System.String identifier) [0x00014] in <9ca75ce7b3b24934a                        8aa8ba78af89566>:0
at Havoc.Live_Map.SocketHandler.UpdatePlayerData (System.String identifier, System.String key, System.Object ne                        wData) [0x0001b] in <9ca75ce7b3b24934a8aa8ba78af89566>:0
at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runti                        me.CompilerServices.CallSite,Havoc.Live_Map.SocketHandler,string,string,object)
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid4[T0,T1,T2,T3] (System.Runtime.CompilerServices.CallSite                         site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) [0x0011e] in <fb8f7831037a4d3481e7bbe63117e3d0>:0
at (wrapper delegate-invoke) System.Action`5[System.Runtime.CompilerServices.CallSite,Havoc.Live_Map.SocketHand                        ler,System.String,System.String,System.Object]:invoke_void_T1_T2_T3_T4_T5 (System.Runtime.CompilerServices.CallSite,Havoc.Live_Map.SocketHandler,st                        ring,string,object)
at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runti                        me.CompilerServices.CallSite,Havoc.Live_Map.SocketHandler,string,string,object)
at Havoc.Live_Map.LiveMap.InternalUpdatePlayerData (System.String identifier, System.String key, System.Object                         data) [0x0005c] in <9ca75ce7b3b24934a8aa8ba78af89566>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object                        ,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Re                        flection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <d7e663f2f7cd4ab6929018ec5233f09d>:0
  --- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Re                        flection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00048] in <d7e663f2f7cd4ab6929018ec5233f09d>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <d7e663f2f7                        cd4ab6929018ec5233f09d>:0
at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000e7] in <d7e663f2f7cd4ab6929018ec5233f09d>:0
 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00008] in <d7e663f2f7cd4ab6929018ec5233                        f09d>:0
at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <d7e663f2f7cd4ab6929018ec5233f09d>:0
 at CitizenFX.Core.EventHandlerEntry+<Invoke>d__5.MoveNext () [0x00122] in /src/code/client/clrcore/EventHandler                        Dictionary.cs:144

This was the exception that caused the livemap to essentially crash, it happened when we loaded the recource.

TGRHavoc commented 6 years ago

By looks of it the MakeSurPlayerExists function is being passed a null identifier.

So, either the player doesn't have an identifier or, you're calling one of the internal methods without passing it. Either way, I'll add some more null checks to make sure this doesn't happen.

mbergwall2222 commented 6 years ago

Okay great. What identifier is being used? On my server IP address are hidden from active idents, so only steam and licenses show.

TGRHavoc commented 6 years ago

What identifier is being used?

When calling the wrapper methods from the client, it's the first identifier (most likely steam). If the player doesn't have steam or a license (for whatever reason) it should default to their IP. Either way, the identifier shouldn't be null (unless the IP is being hidden from the FiveM native which, I doubt).

mbergwall2222 commented 6 years ago

When calling the wrapper methods from the client, it's the first identifier (most likely steam). If the player doesn't have steam or a license (for whatever reason) it should default to their IP. Either way, the identifier shouldn't be null (unless the IP is being hidden from the FiveM native which, I doubt).

Okay I appreciate it brother!