Skip to content

Commit

Permalink
Fix: Fix all the previous issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MbarkT3STO committed Apr 5, 2024
1 parent b32f5fc commit 9a410b4
Show file tree
Hide file tree
Showing 171 changed files with 1,986 additions and 538 deletions.
Binary file modified .vs/OfficeDRPC/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .vs/OfficeDRPC/v17/.futdcache.v2
Binary file not shown.
Binary file modified .vs/OfficeDRPC/v17/.suo
Binary file not shown.
47 changes: 7 additions & 40 deletions .vs/OfficeDRPC/v17/DocumentLayout.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,12 @@
"WorkspaceRootPath": "C:\\Users\\MBARK.AzureAD\\source\\repos\\MbarkT3STO\\OfficeDRPC\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{56AD1A2F-F1B9-4B14-993E-7BDE13E5FDBA}|OfficeDRPCCommander\\OfficeDRPCCommander.csproj|c:\\users\\mbark.azuread\\source\\repos\\mbarkt3sto\\officedrpc\\officedrpccommander\\worker.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"AbsoluteMoniker": "D:0:0:{56AD1A2F-F1B9-4B14-993E-7BDE13E5FDBA}|OfficeDRPCCommander\\OfficeDRPCCommander.csproj|C:\\Users\\MBARK.AzureAD\\source\\repos\\MbarkT3STO\\OfficeDRPC\\officedrpccommander\\worker.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{56AD1A2F-F1B9-4B14-993E-7BDE13E5FDBA}|OfficeDRPCCommander\\OfficeDRPCCommander.csproj|solutionrelative:officedrpccommander\\worker.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{A0BC55D0-6A1E-4F58-9224-7A1D70F934F0}|DRPCWorker\\DRPCWorker.csproj|c:\\users\\mbark.azuread\\source\\repos\\mbarkt3sto\\officedrpc\\drpcworker\\worker.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{A0BC55D0-6A1E-4F58-9224-7A1D70F934F0}|DRPCWorker\\DRPCWorker.csproj|solutionrelative:drpcworker\\worker.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{56AD1A2F-F1B9-4B14-993E-7BDE13E5FDBA}|OfficeDRPCCommander\\OfficeDRPCCommander.csproj|C:\\Users\\MBARK.AzureAD\\source\\repos\\MbarkT3STO\\OfficeDRPC\\officedrpccommander\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"AbsoluteMoniker": "D:0:0:{56AD1A2F-F1B9-4B14-993E-7BDE13E5FDBA}|OfficeDRPCCommander\\OfficeDRPCCommander.csproj|c:\\users\\mbark.azuread\\source\\repos\\mbarkt3sto\\officedrpc\\officedrpccommander\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{56AD1A2F-F1B9-4B14-993E-7BDE13E5FDBA}|OfficeDRPCCommander\\OfficeDRPCCommander.csproj|solutionrelative:officedrpccommander\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{A0BC55D0-6A1E-4F58-9224-7A1D70F934F0}|DRPCWorker\\DRPCWorker.csproj|c:\\users\\mbark.azuread\\source\\repos\\mbarkt3sto\\officedrpc\\drpcworker\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{A0BC55D0-6A1E-4F58-9224-7A1D70F934F0}|DRPCWorker\\DRPCWorker.csproj|solutionrelative:drpcworker\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
Expand All @@ -26,7 +18,7 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 5,
"SelectedChildIndex": 3,
"Children": [
{
"$type": "Bookmark",
Expand All @@ -36,43 +28,18 @@
"$type": "Bookmark",
"Name": "ST:130:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Users\\MBARK.AzureAD\\source\\repos\\MbarkT3STO\\OfficeDRPC\\DRPCWorker\\Program.cs",
"RelativeDocumentMoniker": "DRPCWorker\\Program.cs",
"ToolTip": "C:\\Users\\MBARK.AzureAD\\source\\repos\\MbarkT3STO\\OfficeDRPC\\DRPCWorker\\Program.cs",
"RelativeToolTip": "DRPCWorker\\Program.cs",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAA0AAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-04-04T20:37:37.972Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "Worker.cs",
"DocumentMoniker": "C:\\Users\\MBARK.AzureAD\\source\\repos\\MbarkT3STO\\OfficeDRPC\\DRPCWorker\\Worker.cs",
"RelativeDocumentMoniker": "DRPCWorker\\Worker.cs",
"ToolTip": "C:\\Users\\MBARK.AzureAD\\source\\repos\\MbarkT3STO\\OfficeDRPC\\DRPCWorker\\Worker.cs",
"RelativeToolTip": "DRPCWorker\\Worker.cs",
"ViewState": "AQIAAFgAAAAAAAAAAAAwwGAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-04-04T17:04:56.877Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Users\\MBARK.AzureAD\\source\\repos\\MbarkT3STO\\OfficeDRPC\\OfficeDRPCCommander\\Program.cs",
"RelativeDocumentMoniker": "OfficeDRPCCommander\\Program.cs",
"ToolTip": "C:\\Users\\MBARK.AzureAD\\source\\repos\\MbarkT3STO\\OfficeDRPC\\OfficeDRPCCommander\\Program.cs",
"RelativeToolTip": "OfficeDRPCCommander\\Program.cs",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAA0AAAAmAAAA",
"ViewState": "AQIAABAAAAAAAAAAAAAqwCMAAAAcAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-04-04T20:37:46.95Z"
"WhenOpened": "2024-04-05T14:34:46.605Z",
"EditorCaption": ""
},
{
"$type": "Document",
Expand All @@ -82,7 +49,7 @@
"RelativeDocumentMoniker": "OfficeDRPCCommander\\Worker.cs",
"ToolTip": "C:\\Users\\MBARK.AzureAD\\source\\repos\\MbarkT3STO\\OfficeDRPC\\OfficeDRPCCommander\\Worker.cs",
"RelativeToolTip": "OfficeDRPCCommander\\Worker.cs",
"ViewState": "AQIAADAAAAAAAAAAAAAwwDcAAAAMAAAA",
"ViewState": "AQIAABkAAAAAAAAAAAA1wCQAAAAiAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-04-05T07:28:35.81Z",
"EditorCaption": ""
Expand Down
Binary file modified .vs/ProjectEvaluation/officedrpc.metadata.v7.bin
Binary file not shown.
Binary file modified .vs/ProjectEvaluation/officedrpc.projects.v7.bin
Binary file not shown.
2 changes: 2 additions & 0 deletions AccessDRPC/AccessDRPC.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Core\Presence.cs" />
<Compile Include="DRPCCore\DiscordRpc.cs" />
<Compile Include="PresenceWorker.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
101 changes: 101 additions & 0 deletions AccessDRPC/Core/Presence.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
using AccessDRPC.DRPCCore;

using System;

namespace AccessDRPC.Core
{

public class Presence : IDisposable
{
private DiscordRpc.EventHandlers handlers = default;
private DiscordRpc.RichPresence presence;


/// <summary>
/// Initializes the Rich Presence to the specified application ID.
/// </summary>
/// <param name="appId"></param>
public void InitializePresence(string appId)
{
DiscordRpc.Initialize(appId, ref handlers, true, null);
presence = new DiscordRpc.RichPresence();
}


/// <summary>
/// Updates the Rich Presence instance.
/// </summary>
public void UpdatePresence()
{
DiscordRpc.UpdatePresence(ref presence);
}


/// <summary>
/// Updates the Large Image in the Rich Presence instance.
/// </summary>
/// <param name="largeImageKey">Large Image Key</param>
/// <param name="largeImageText">Large Image Text</param>
public void UpdateLargeImage(string largeImageKey, string largeImageText = "")
{
presence.largeImageKey = largeImageKey;
presence.largeImageText = largeImageText;

UpdatePresence();
}


/// <summary>
/// Updates the Small Image in the Rich Presence instance.
/// </summary>
/// <param name="smallImageKey">Small Image Key</param>
/// <param name="smallImageText">Small Image Text</param>
public void UpdateSmallImage(string smallImageKey, string smallImageText = "")
{
presence.smallImageKey = smallImageKey;
presence.smallImageText = smallImageText;

UpdatePresence();
}


/// <summary>
/// Updates the State in the Rich Presence instance.
/// </summary>
/// <param name="state">The new state</param>
public void UpdateState(string state)
{
presence.state = state;

UpdatePresence();
}


/// <summary>
/// Updates the Details in the Rich Presence instance.
/// </summary>
/// <param name="details">The new details</param>
public void UpdateDetails(string details)
{
presence.details = details;

UpdatePresence();
}


/// <summary>
/// Shuts down the Rich Presence instance.
/// </summary>
public void ShutDown()
{
DiscordRpc.Shutdown();
}

public void Dispose()
{
DiscordRpc.Shutdown();

GC.SuppressFinalize(this);
}
}
}
104 changes: 104 additions & 0 deletions AccessDRPC/DRPCCore/DiscordRpc.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
using System;
using System.Runtime.InteropServices;

namespace AccessDRPC.DRPCCore
{

public class DiscordRpc
{

[DllImport("Access-discord-rpc.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Discord_Initialize")]
public static extern void Initialize(string applicationId, ref DiscordRpc.EventHandlers handlers, bool autoRegister, string optionalSteamId);


[DllImport("Access-discord-rpc.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Discord_RunCallbacks")]
public static extern void RunCallbacks();


[DllImport("Access-discord-rpc.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Discord_Shutdown")]
public static extern void Shutdown();


[DllImport("Access-discord-rpc.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Discord_UpdatePresence")]
public static extern void UpdatePresence(ref DiscordRpc.RichPresence presence);

internal static void Initialize(string v1, ref object handlers, bool v2, object p)
{
throw new NotImplementedException();
}

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void DisconnectedCallback(int errorCode, string message);


[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void ErrorCallback(int errorCode, string message);


public struct EventHandlers
{

public DiscordRpc.ReadyCallback readyCallback;


public DiscordRpc.DisconnectedCallback disconnectedCallback;


public DiscordRpc.ErrorCallback errorCallback;
}


[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void ReadyCallback();


[Serializable]
public struct RichPresence
{

public string state;


public string details;


public long startTimestamp;


public long endTimestamp;


public string largeImageKey;


public string largeImageText;


public string smallImageKey;


public string smallImageText;


public string partyId;


public int partySize;


public int partyMax;


public string matchSecret;


public string joinSecret;


public string spectateSecret;


public bool instance;
}
}
}
9 changes: 6 additions & 3 deletions AccessDRPC/PresenceWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.IO;
using System.Linq;
using System.Threading;
using MBDRPC.Core;
using AccessDRPC.Core;
using MBDRPC.Helpers;

namespace AccessDRPC
Expand Down Expand Up @@ -151,9 +151,12 @@ private void UpdatePresence()
}
else
{
var windowName = openWindowNames[0];
if ( openWindowNames.Length > 0 )
{
var windowName = openWindowNames[0];

presence.UpdateDetails($"Managing database: {windowName}");
presence.UpdateDetails($"Managing database: {windowName}");
}
}


Expand Down
Binary file modified AccessDRPC/bin/Debug/AccessDRPC.exe
Binary file not shown.
Binary file modified AccessDRPC/bin/Debug/AccessDRPC.pdb
Binary file not shown.
Binary file modified AccessDRPC/obj/Debug/AccessDRPC.csproj.AssemblyReference.cache
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
831009eac79026b661fe68c402772e66bce9f3974a58f05b2503be66ce5860d4
4a3b25d60ed521ac477465e38d9bb9048c975053ca9db614d3588f90c364ebc1
Binary file modified AccessDRPC/obj/Debug/AccessDRPC.exe
Binary file not shown.
Binary file modified AccessDRPC/obj/Debug/AccessDRPC.pdb
Binary file not shown.
Binary file modified DRPCWorker/bin/Debug/net8.0-windows10.0.17763.0/AccessDRPC.exe
Binary file not shown.
Binary file not shown.
Binary file modified DRPCWorker/bin/Debug/net8.0-windows10.0.17763.0/DRPCWorker.dll
Binary file not shown.
Binary file modified DRPCWorker/bin/Debug/net8.0-windows10.0.17763.0/DRPCWorker.exe
Binary file not shown.
Binary file modified DRPCWorker/bin/Debug/net8.0-windows10.0.17763.0/DRPCWorker.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified DRPCWorker/bin/Debug/net8.0-windows10.0.17763.0/PowerBiDRPC.exe
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("DRPCWorker")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+4dc000bdfc5709e55f9f6b2f9d51636f34b81e0a")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+b32f5fcd82ec1bedfdef56b988079069f4e68edf")]
[assembly: System.Reflection.AssemblyProductAttribute("DRPCWorker")]
[assembly: System.Reflection.AssemblyTitleAttribute("DRPCWorker")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c21ad214fff60cddf0b64dabea0ec2f8267861f0e8fcdb46dbe8de2c2ba3719e
73211cf8b82b87d063e125379118844910aa130a05a7b48cb5875022064addc3
Binary file not shown.
Binary file modified DRPCWorker/obj/Debug/net8.0-windows10.0.17763.0/DRPCWorker.dll
Binary file not shown.
Binary file modified DRPCWorker/obj/Debug/net8.0-windows10.0.17763.0/DRPCWorker.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documents":{"C:\\Users\\MBARK.AzureAD\\source\\repos\\MbarkT3STO\\OfficeDRPC\\*":"https://raw.githubusercontent.com/MbarkT3STO/OfficeDRPC/4dc000bdfc5709e55f9f6b2f9d51636f34b81e0a/*"}}
{"documents":{"C:\\Users\\MBARK.AzureAD\\source\\repos\\MbarkT3STO\\OfficeDRPC\\*":"https://raw.githubusercontent.com/MbarkT3STO/OfficeDRPC/b32f5fcd82ec1bedfdef56b988079069f4e68edf/*"}}
Binary file modified DRPCWorker/obj/Debug/net8.0-windows10.0.17763.0/apphost.exe
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 9a410b4

Please sign in to comment.