NullReferenceException at StopLiveChatError

I got the same problem: /calladmin is not available yet.
I think i would need to have Discord Core but i'm using rustcord atm and i would rather keep this one, is it possible to add support to it?

I use simply:
Discord Extention
Discord Rewards
Rustcord

Failed to call hook 'OnUserDisconnected' on plugin 'DiscordCallAdmin v0.3.0' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.DiscordCallAdmin.StopLiveChat (System.String playerID, System.String reason) [0x00000] in <18dd6ab894344b77997caf37953590bc>:0
  at Oxide.Plugins.DiscordCallAdmin.OnUserDisconnected (Oxide.Core.Libraries.Covalence.IPlayer player) [0x00007] in <18dd6ab894344b77997caf37953590bc>:0
  at Oxide.Plugins.DiscordCallAdmin.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x001d8] in <18dd6ab894344b77997caf37953590bc>:0
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <d09a1f46ca2f4432811bcfe45ad13c7b>:0
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <cf88a28c7fb44d36890d85a78331cc9d>:0
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <cf88a28c7fb44d36890d85a78331cc9d>:0
I get this everytime the user disconnects even though he does not have a chat opened.
(NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.DiscordCallAdmin.StopLiveChat (System.String playerID, System.String reason) [0x00000] in <f14bbbb5c0eb48b2856c1ab0fbdee28e>:0 
  at Oxide.Plugins.DiscordCallAdmin.OnUserDisconnected (Oxide.Core.Libraries.Covalence.IPlayer player) [0x00007] in <f14bbbb5c0eb48b2856c1ab0fbdee28e>:0 
  at Oxide.Plugins.DiscordCallAdmin.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x001d8] in <f14bbbb5c0eb48b2856c1ab0fbdee28e>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <80b90e8213db44b29ec2d4111764172c>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <ec05e0208c9149bba43236ca58fea105>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <ec05e0208c9149bba43236ca58fea105>:0​

Discord Call admin v0.3.1, Discord version build 74741

It was working fine till the latest oxide (umod) update

Failed to call hook 'OnUserDisconnected' on plugin 'DiscordCallAdmin v0.3.1' (NullReferenceException: Object reference not set to an instance of an object) at Oxide.Plugins.DiscordCallAdmin.StopLiveChat (System.String playerID, System.String reason) [0x00000] in <53a88c4df20f42218976cbdb54908e8c>:0 at Oxide.Plugins.DiscordCallAdmin.OnUserDisconnected (Oxide.Core.Libraries.Covalence.IPlayer player) [0x00007] in <53a88c4df20f42218976cbdb54908e8c>:0 at Oxide.Plugins.DiscordCallAdmin.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x001d8] in <53a88c4df20f42218976cbdb54908e8c>:0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <80b90e8213db44b29ec2d4111764172c>:0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in :0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in :0

Hi there, I'm getting the following error in console when users disconnect since the latest update:

Failed to call hook 'OnUserDisconnected' on plugin 'DiscordCallAdmin v0.3.1' (NullReferenceException: Object reference not set to an instance of an object)

  at Oxide.Plugins.DiscordCallAdmin.StopLiveChat (System.String playerID, System.String reason) [0x00000] in <8f9d51f7c2344a3cbf8f060c8f8b2458>:0 

  at Oxide.Plugins.DiscordCallAdmin.OnUserDisconnected (Oxide.Core.Libraries.Covalence.IPlayer player) [0x00007] in <8f9d51f7c2344a3cbf8f060c8f8b2458>:0 

  at Oxide.Plugins.DiscordCallAdmin.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x001d8] in <8f9d51f7c2344a3cbf8f060c8f8b2458>:0 

  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <31122a27a2414cd799150f8677cf39d4>:0 

  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in :0 

  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in :0  ​

Just updating here to say that the issue is still ongoing obviously but I forgot to follow what you said about posting my Discord Core and Extension Versions:
Discord Extension version is: v1.0.9
Discord Core version is: v0.17.0

Also having an issue recently when someone will disconnect, the plugin will take as much as 6 seconds to respond then everyone get kicked for packet flooding as the server does its best to catch up.

If you need any extra information to help you fix this please let me know and I'll do what I can.

I tried a fix in the latest version (0.3.3)

Awesome, thanks mate! I'll give it a try and report back how it goes

Merged post

I think you've sorted it mate, no error when people Disconnect but nobody has actually used the command as of yet but last I checked that was working fine. Happy for this to be closed and I can always comment again if the actual command no longer works. Thanks for your help man, really appreciate it!

Merged post

Looks like I spoke too soon buddy

11:02 [Error] Failed to call hook 'OnUserDisconnected' on plugin 'DiscordCallAdmin v0.3.3' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.DiscordCallAdmin.StopLiveChat (System.String playerID, System.String reason) [0x00000] in <6645478322874fe7a0f90e1a93d83e2d>:0 
  at Oxide.Plugins.DiscordCallAdmin.OnUserDisconnected (Oxide.Core.Libraries.Covalence.IPlayer player) [0x0000d] in <6645478322874fe7a0f90e1a93d83e2d>:0 
  at Oxide.Plugins.DiscordCallAdmin.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x001d8] in <6645478322874fe7a0f90e1a93d83e2d>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <31122a27a2414cd799150f8677cf39d4>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <c2afd8354b8b4f3ca451cf5a1aa111c3>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <c2afd8354b8b4f3ca451cf5a1aa111c3>:0 ​

If I can help in any way please let me know. Perhaps you need more information? I'm pretty new to coding myeslf so not sure how much help I can be there.

The problem comes from the hook sent by uMod, it's probably sending `null` instead of a `IPlayer`, there I cannot do anything, sorry

Oh okay, so the plugin is broken for now?

hopefully it's fixed in the latest version (0.3.4)

---

I changed the hook from `OnUserDisconnected` to `OnPlayerDisconnected`

Wow, that was quick. I'll give it a test and report back. Thanks for doing this so quickly and for your hard work!

Merged post

This works perfectly now, no errors, no lag, no player kicks. Great job man! Thank you 😁

Hi,

I'm getting this NRE

Failed to call hook 'OnPlayerDisconnected' on plugin 'DiscordCallAdmin v1.0.0' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.DiscordCallAdmin.StopLiveChat (System.String playerID, System.String reason) [0x00000] in :0 
  at Oxide.Plugins.DiscordCallAdmin.OnPlayerDisconnected (BasePlayer player, System.String reason) [0x0000d] in :0 
  at Oxide.Plugins.DiscordCallAdmin.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x003d4] in :0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <31122a27a2414cd799150f8677cf39d4>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <0fbce81d88d64454b3e7abb24df7026b>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <0fbce81d88d64454b3e7abb24df7026b>:0 ​

Discord Extension: v2.0.1
Discord Core: v2.0.1