Skip to content

Commit

Permalink
Merge b73b195 into 2110b9b
Browse files Browse the repository at this point in the history
  • Loading branch information
RecklessBoon authored May 8, 2024
2 parents 2110b9b + b73b195 commit 55eaa6c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
10 changes: 7 additions & 3 deletions DiscordPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
Expand Down Expand Up @@ -59,13 +60,13 @@ public class VariableState

public void SetVariable(VariableState variableState)
{
VariableManager.SetValue(string.Format("discord_{0}", variableState.Name), variableState.Value, variableState.Type, this, variableState.Save);
VariableManager.SetValue(string.Format("discord_{0}", variableState.Name), variableState.Value, variableState.Type, this, []);
}

public string GetVariable(string key)
{
var name = String.Format("discord_{0}", key);
return VariableManager.Variables.Find(x => x.Name == name).Value;
return VariableManager.Variables.Where(x => x.Name == name).ToString();
}

public void SetVariable(VariableState[] variableStates)
Expand Down Expand Up @@ -362,7 +363,10 @@ protected void Client_OnVoiceStateUpdate(object sender, VoiceStateResponse paylo
{
try
{
UpdateVoiceStateVariables(payload.VoiceState);
if (payload.User.Id == PluginInstance.cache.CurrentUser.Id)
{
UpdateVoiceStateVariables(payload.VoiceState);
}
}
catch (Exception ex)
{
Expand Down
5 changes: 3 additions & 2 deletions ExtensionManifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"author": "RecklessBoon",
"repository": "https://github.com/RecklessBoon/Macro-Deck-Discord-Plugin",
"packageId": "RecklessBoon.DiscordPlugin",
"version": "1.1.11",
"target-plugin-api-version": 36,
"version": "1.1.12",
"target-plugin-api-version": 40,
"target-macro-deck-version": "2.13.2",
"dll": "Discord Plugin.dll"
}
4 changes: 2 additions & 2 deletions RPC/RPCClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ protected async Task<TokenResponse> SwapForToken(string code)
{
http_response.EnsureSuccessStatusCode();
}
catch (Exception ex)
catch (Exception)
{
_logger?.Error("Error occured during RecklessBoon.MacroDeck.Discord.RPC.RPCClient.SwapForToken()");
return null;
Expand Down Expand Up @@ -399,7 +399,7 @@ protected async Task<TokenResponse> RefreshToken(AuthToken token)

json_response = JsonConvert.DeserializeObject<TokenResponse>(content);
}
catch (Exception ex)
catch (Exception)
{
_logger?.Error("Error occured during RecklessBoon.MacroDeck.Discord.RPC.RPCClient.RefreshToken()");
}
Expand Down
18 changes: 9 additions & 9 deletions RecklessBoon.MacroDeck.Discord.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0-windows10.0.22000.0</TargetFramework>
<RootNamespace>RecklessBoon.MacroDeck.Discord</RootNamespace>
<UseWindowsForms>true</UseWindowsForms>
<Version>1.1.11</Version>
<Version>1.1.12</Version>
<RepositoryUrl>https://github.com/RecklessBoon/Macro-Deck-Discord-Plugin</RepositoryUrl>
<Authors>RecklessBoon</Authors>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<PackageId>Discord Plugin</PackageId>
<AssemblyName>Discord Plugin</AssemblyName>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
</PropertyGroup>

<ItemGroup>
Expand All @@ -21,13 +22,12 @@
<ItemGroup>
<PackageReference Include="Discord.Net" Version="3.8.1" />
<PackageReference Include="DiscordRichPresence" Version="1.1.1.14" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
<Reference Include="Macro Deck 2">
<HintPath>C:\Program Files\Macro Deck\Macro Deck 2.dll</HintPath>
<HintPath>$(SolutionDir)..\Macro-Deck\MacroDeck\bin\$(ConfigurationName)\$(TargetFramework)\win-x64\Macro Deck 2.dll</HintPath>
</Reference>
</ItemGroup>

Expand All @@ -54,10 +54,10 @@
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="if not exist &quot;$(SolutionDir)..\Macro Deck 2\Macro-Deck\bin\$(ConfigurationName)\netcoreapp3.1\win-x64\Data\plugins\$(PackageId)&quot; mkdir &quot;$(SolutionDir)..\Macro Deck 2\Macro-Deck\bin\$(ConfigurationName)\netcoreapp3.1\win-x64\Data\plugins\$(PackageId)&quot;" />
<Exec Command="copy /Y &quot;$(ProjectDir)ExtensionManifest.json&quot; &quot;$(SolutionDir)..\Macro Deck 2\Macro-Deck\bin\$(ConfigurationName)\netcoreapp3.1\win-x64\Data\plugins\$(PackageId)\ExtensionManifest.json&quot;" />
<Exec Command="copy /Y &quot;$(ProjectDir)ExtensionIcon.png&quot; &quot;$(SolutionDir)..\Macro Deck 2\Macro-Deck\bin\$(ConfigurationName)\netcoreapp3.1\win-x64\Data\plugins\$(PackageId)\ExtensionIcon.png&quot;" />
<Exec Command="copy /Y &quot;$(TargetDir)*.dll&quot; &quot;$(SolutionDir)..\Macro Deck 2\Macro-Deck\bin\$(ConfigurationName)\netcoreapp3.1\win-x64\Data\plugins\$(PackageId)\&quot;" />
<Exec Command="if not exist &quot;$(SolutionDir)..\Macro-Deck\MacroDeck\bin\$(ConfigurationName)\$(TargetFramework)\win-x64\Data\plugins\$(PackageId)&quot; mkdir &quot;$(SolutionDir)..\Macro-Deck\MacroDeck\bin\$(ConfigurationName)\$(TargetFramework)\win-x64\Data\plugins\$(PackageId)&quot;" />
<Exec Command="copy /Y &quot;$(ProjectDir)ExtensionManifest.json&quot; &quot;$(SolutionDir)..\Macro-Deck\MacroDeck\bin\$(ConfigurationName)\$(TargetFramework)\win-x64\Data\plugins\$(PackageId)\ExtensionManifest.json&quot;" />
<Exec Command="copy /Y &quot;$(ProjectDir)ExtensionIcon.png&quot; &quot;$(SolutionDir)..\Macro-Deck\MacroDeck\bin\$(ConfigurationName)\$(TargetFramework)\win-x64\Data\plugins\$(PackageId)\ExtensionIcon.png&quot;" />
<Exec Command="copy /Y &quot;$(TargetDir)*.dll&quot; &quot;$(SolutionDir)..\Macro-Deck\MacroDeck\bin\$(ConfigurationName)\$(TargetFramework)\win-x64\Data\plugins\$(PackageId)\&quot;" />
</Target>

</Project>

0 comments on commit 55eaa6c

Please sign in to comment.