Skip to content

Commit d8b3d97

Browse files
committed
fix discord being an ass
1 parent 8ee361a commit d8b3d97

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

DeCraftLauncher/DiscordRPCManager.cs

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using DeCraftLauncher.UIControls.Popup;
2+
using System;
23
using System.Collections.Generic;
34
using System.Data;
45
using System.Diagnostics;
@@ -43,29 +44,35 @@ public void Init(MainWindow caller)
4344
return;
4445
}
4546
initialTime = DateTime.UtcNow;
46-
discord = new Discord.Discord(1180408357782298624, (UInt64)Discord.CreateFlags.Default);
47-
activityManager = discord.GetActivityManager();
48-
rpcThread = new Thread(() =>
47+
try
4948
{
50-
while (true)
49+
discord = new Discord.Discord(1180408357782298624, (UInt64)Discord.CreateFlags.NoRequireDiscord);
50+
activityManager = discord.GetActivityManager();
51+
rpcThread = new Thread(() =>
5152
{
53+
while (true)
54+
{
5255
//activityMutex.WaitOne();
5356
//activityMutex.ReleaseMutex();
5457

5558
//RunCallbacks has to be done on main thread
5659
caller.Dispatcher.Invoke(delegate
57-
{
58-
if (discord != null)
5960
{
60-
discord.RunCallbacks();
61-
}
62-
});
63-
Thread.Sleep(200);
64-
}
65-
});
61+
if (discord != null)
62+
{
63+
discord.RunCallbacks();
64+
}
65+
});
66+
Thread.Sleep(200);
67+
}
68+
});
6669

67-
rpcThread.Start();
68-
inited = true;
70+
rpcThread.Start();
71+
inited = true;
72+
} catch (Discord.ResultException)
73+
{
74+
//don't fucking care lmao
75+
}
6976
}
7077

7178
public void Close()

0 commit comments

Comments
 (0)