Lachee / discord-rpc-csharp

C# custom implementation for Discord Rich Presence. Not deprecated and still available!
MIT License
560 stars 94 forks source link

[BUG] 3 errors when implementing Logger #136

Open youknowedo opened 3 years ago

youknowedo commented 3 years ago

Describe the bug Don't know if the ILogger is your work or not but when I copied your code into my own I got three errors from it. Rich Presence was working fine both before and after the Logger implementation but it still throws these errors:

<IPC> Unhandled Exception: System.Threading.ThreadAbortException
UnityEngine.Debug:LogError (object)
DiscordRPC.Unity.UnityLogger:Error (string,object[]) (at Assets/Discord RPC/Scripts/Control/UnityLogger.cs:34)
DiscordRPC.RPC.RpcConnection:MainLoop ()
System.Threading.ThreadHelper:ThreadStart ()
<IPC> 
UnityEngine.Debug:LogError (object)
DiscordRPC.Unity.UnityLogger:Error (string,object[]) (at Assets/Discord RPC/Scripts/Control/UnityLogger.cs:34)
DiscordRPC.RPC.RpcConnection:MainLoop ()
System.Threading.ThreadHelper:ThreadStart ()
<IPC>   at (wrapper managed-to-native) System.Threading.WaitHandle.Wait_internal(intptr*,int,bool,int)
  at System.Threading.WaitHandle.WaitOneNative (System.Runtime.InteropServices.SafeHandle waitableSafeHandle, System.UInt32 millisecondsTimeout, System.Boolean hasThreadAffinity, System.Boolean exitContext) [0x00019] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at System.Threading.WaitHandle.InternalWaitOne (System.Runtime.InteropServices.SafeHandle waitableSafeHandle, System.Int64 millisecondsTimeout, System.Boolean hasThreadAffinity, System.Boolean exitContext) [0x00014] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at System.Threading.WaitHandle.WaitOne (System.Int64 timeout, System.Boolean exitContext) [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at System.Threading.WaitHandle.WaitOne (System.Int32 millisecondsTimeout, System.Boolean exitContext) [0x00019] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at System.Threading.WaitHandle.WaitOne (System.Int32 millisecondsTimeout) [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0 
  at DiscordRPC.RPC.RpcConnection.MainLoop () [0x004a2] in <3d5974ee23484939992859c5cc569e99>:0 
UnityEngine.Debug:LogError (object)
DiscordRPC.Unity.UnityLogger:Error (string,object[]) (at Assets/Discord RPC/Scripts/Control/UnityLogger.cs:34)
DiscordRPC.RPC.RpcConnection:MainLoop ()
System.Threading.ThreadHelper:ThreadStart ()

Code https://pastebin.com/rTbub8Xp

Expected behavior I guess not spitting out errors and actually log Rich Presence

Desktop (please complete the following information):

Additional context idk..