Skip to content

Commit 9b6fc83

Browse files
Fixed Discord RPC and GTK dialogs
1 parent c937424 commit 9b6fc83

29 files changed

Lines changed: 623 additions & 696 deletions
Binary file not shown.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<linker>
2+
<assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
3+
<type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" />
4+
</assembly>
5+
<assembly fullname="Unity.Localization, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
6+
<type fullname="UnityEngine.Localization.Locale" preserve="all" />
7+
<type fullname="UnityEngine.Localization.Tables.SharedTableData" preserve="all" />
8+
<type fullname="UnityEngine.Localization.Tables.StringTable" preserve="all" />
9+
<type fullname="UnityEngine.Localization.LocaleIdentifier" preserve="nothing" serialized="true" />
10+
<type fullname="UnityEngine.Localization.Metadata.MetadataCollection" preserve="nothing" serialized="true" />
11+
<type fullname="UnityEngine.Localization.Tables.TableEntryData" preserve="nothing" serialized="true" />
12+
<type fullname="UnityEngine.Localization.Tables.DistributedUIDGenerator" preserve="nothing" serialized="true" />
13+
<type fullname="UnityEngine.Localization.Tables.SharedTableData/SharedTableEntry" preserve="nothing" serialized="true" />
14+
</assembly>
15+
<assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
16+
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider" preserve="all" />
17+
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider" preserve="all" />
18+
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" />
19+
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneProvider" preserve="all" />
20+
</assembly>
21+
<assembly fullname="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
22+
<type fullname="UnityEngine.Object" preserve="all" />
23+
</assembly>
24+
</linker>

Assets/StreamingAssets/LLMManager.json.meta renamed to Assets/AddressableAssetsData/link.xml.meta

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/DiscordRPC.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/DiscordRPC/Runtime/Control/UnityNamedPipe.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private bool AttemptConnection(int pipe, bool doSandbox = false)
8585
//Attempt to connect
8686
Logger.Info("Connecting to " + pipename + " (" + sandbox +")");
8787
ConnectedPipe = pipe;
88-
_stream = new NamedPipeClientStream(".", pipename);
88+
_stream = new NamedPipeClientStream(".", pipename, Logger);
8989
_stream.Connect();
9090

9191
Logger.Info("Connected");
@@ -132,13 +132,14 @@ public bool ReadFrame(out PipeFrame frame)
132132

133133
//Try and read a frame
134134
int length = _stream.Read(_buffer, 0, _buffer.Length);
135-
Logger.Trace("Read {0} bytes", length);
136135

137136
if (length == 0)
138137
{
139138
frame = default(PipeFrame);
140139
return false;
141140
}
141+
142+
Logger.Trace("Read {0} bytes", length);
142143

143144
//Read the stream now
144145
using (MemoryStream memory = new MemoryStream(_buffer, 0, length))

Assets/DiscordRPC/Runtime/NamedPipeClient/IO/NamedPipeClientStream.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
using System;
33
using System.IO;
44
using System.Runtime.InteropServices;
5+
using DiscordRPC.Logging;
56

67
namespace Lachee.IO
78
{
89
public class NamedPipeClientStream : System.IO.Stream
910
{
1011
private IntPtr ptr;
1112
private bool _isDisposed;
13+
public ILogger Logger { get; set; }
1214

1315
/// <summary>
1416
/// Can the stream read? Always returns true.
@@ -51,11 +53,12 @@ public class NamedPipeClientStream : System.IO.Stream
5153
/// </summary>
5254
/// <param name="server">The remote to connect too</param>
5355
/// <param name="pipeName">The name of the pipe that will be connected too.</param>
54-
public NamedPipeClientStream(string server, string pipeName)
56+
public NamedPipeClientStream(string server, string pipeName, ILogger logger)
5557
{
5658
ptr = Native.CreateClient();
5759
PipeName = FormatPipe(server, pipeName);
58-
Console.WriteLine("Created new NamedPipeClientStream '{0}' => '{1}'", pipeName, PipeName);
60+
Logger = logger;
61+
Logger.Trace("Created new NamedPipeClientStream '{0}' => '{1}'", pipeName, PipeName);
5962
}
6063

6164
~NamedPipeClientStream()

0 commit comments

Comments
 (0)