Closed reithegoat closed 2 years ago
Hmm, this is not something I was expecting. When I originally wrote this library, IL2CPP were only for game consoles which couldn't obviously run Discord.
I will look at this over the weekend.
When I originally wrote this library, IL2CPP were only for game consoles which couldn't obviously run Discord.
Oh? It's available for Windows which increases performance and code security, which is why I am trying to use it.
UPDATE!! IL2CPP seems to strip the coding for DiscordRPC and adding an exception within a link.xml file, you could get a different and less worse (assumption) error code.
WARN: Client has not yet initialized, but events are being subscribed too. Storing them as state instead.
WARN: The client is not yet initialized, storing the presence as a state instead.
TRCE: Enqueue Command: DiscordRPC.RPC.Commands.PresenceCommand
INFO: Attempting a new connection
INFO: RPC Connection Started
TRCE: ============================
TRCE: Assembly: DiscordRPC, Version=1.0.152.0, Culture=neutral, PublicKeyToken=null
TRCE: Pipe: DiscordRPC.Unity.UnityNamedPipe
TRCE: Platform: Microsoft Windows NT 10.0.18363.0
TRCE: applicationID: 673382310820839434
TRCE: targetPipe: -1
TRCE: POLL_RATE: 1000
TRCE: _maxRtQueueSize: 512
TRCE: _maxRxQueueSize: 128
TRCE: ============================
\/\/\/\/\/ LOOP BEGINS \/\/\/\/\/
TRCE: Connecting to the pipe through the DiscordRPC.Unity.UnityNamedPipe
TRCE: PIPE WIN
INFO: Connecting to discord-ipc-0 ()
INFO: Connected
TRCE: Connected to the pipe. Attempting to establish handshake...
TRCE: Enqueue Message: ConnectionEstablished
TRCE: Attempting to establish a handshake...
TRCE: Sending Handshake...
TRCE: Writing frame
TRCE: Setting the connection state to CONNECTING
TRCE: Connection Established. Starting reading loop...
TRCE: Read 0 bytes
TRCE: Enqueue Command: DiscordRPC.RPC.Commands.PresenceCommand
TRCE: Read 54 bytes
TRCE: Read pipe frame!
TRCE: Read Payload: Close
WARN: We have been told to terminate by discord: (0)
TRCE: Enqueue Message: Close
TRCE: Left main read loop for some reason. Aborting: False, Shutting Down: False
TRCE: Waiting 1095ms before attempting to connect again
TRCE: Closing the named pipe.
TRCE: Closing stream
TRCE: Setting the connection state to DISCONNECTED
EDIT: This is where I found the workaround: https://github.com/jilleJr/Newtonsoft.Json-for-Unity/wiki/Fix-AOT-using-link.xml
I downloaded and currently using a fork of Newtonsoft.JSON that has compatibility with Unity's IL2CPP (the original does not have this kind of support). However, I am getting this error and DiscordRPC is stuck in an endless loop. It is repeating this error.
Unity version: 2019.4 LTS Newtonsoft.JSON Fork: https://github.com/jilleJr/Newtonsoft.Json-for-Unity