Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
Beta Release
Browse files Browse the repository at this point in the history
Project added to version control.
  • Loading branch information
talisraeli committed Jul 29, 2018
1 parent 21f6b6b commit dd5fb8e
Show file tree
Hide file tree
Showing 74 changed files with 6,588 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Discord RPC/Configuration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RPC
{
public class Configuration
{
[JsonProperty("api_endpoint")]
public string ApiEndpoint { get; set; }

[JsonProperty("cdn_host")]
public string CdnHost { get; set; }

[JsonProperty("enviroment")]
public string Enviroment { get; set; }
}
}
43 changes: 43 additions & 0 deletions Discord RPC/Converters/EnumSnakeCaseConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using RPC.Helper;
using Newtonsoft.Json;
using System;
using System.Linq;

namespace RPC.Converters
{
public class EnumSnakeCaseConverter : JsonConverter
{
public override bool CanConvert(Type objectType)
{
return objectType.IsEnum;
}

public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
if (reader.Value == null) return null;
return TryParseEnum(objectType, (string)reader.Value);
}

public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
var enumtype = value.GetType();
var name = Enum.GetName(enumtype, value);
writer.WriteValue(name.ToSnakeCase());
}


public object TryParseEnum(Type enumType, string str)
{
if (str == null)
return null;

Type type = enumType;
if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
type = type.GetGenericArguments().First();

string line = str.ToCamelCase();
return Enum.Parse(type, line, ignoreCase: true);
}

}
}
28 changes: 28 additions & 0 deletions Discord RPC/Discord RPC.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata xmlns="http://schemas.microsoft.com/packaging/21.0.07/nuspec.xsd">
<id>DiscordRichPresence</id>
<version>0.0.0</version>
<authors>Lachee</authors>
<owners>Lachee</owners>
<title>Discord Rich Presence</title>
<description>This is a C# implementation of the Discord RPC library which was originally written in C++. You will be able to set the Rich Presence of your game directly in C# without an DllImport nonsence.</description>
<summary>This is a C# implementation of the Discord RPC library which was originally written in C++. You will be able to set the Rich Presence of your game directly in C# without an DllImport nonsence.</summary>
<licenseUrl>https://raw.githubusercontent.com/Lachee/discord-rpc-csharp/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/Lachee/discord-rpc-csharp</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<copyright>Copyright (c) Lachee 2018</copyright>
<releaseNotes></releaseNotes>
<tags>C# Discord Discord Rich Presence</tags>

<dependencies>
<dependency id="Newtonsoft.Json" version="11.0.1" />
</dependencies>
</metadata>

<files>
<file src="./bin/Release/Discord RPC.dll" target="lib\net35" />
<file src="./bin/Release/Discord RPC.pdb" target="lib\net35" />
<file src="./bin/Release/Discord RPC.xml" target="lib\net35" />
</files>
</package>
64 changes: 64 additions & 0 deletions Discord RPC/Discord RPC.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscordRPC", "DiscordRPC.csproj", "{819D20D6-8D88-45C1-A4D2-AA21F10ABD19}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscordRPC.Example", "..\DiscordRPC.Example\DiscordRPC.Example.csproj", "{37FEE3CF-72FE-4450-A71A-373D3B298F0F}"
ProjectSection(ProjectDependencies) = postProject
{E3FE712D-373B-410F-80E0-0CD22AA35B68} = {E3FE712D-373B-410F-80E0-0CD22AA35B68}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DiscordRPC.Native", "..\DiscordRPC.Native\DiscordRPC.Native.vcxproj", "{E3FE712D-373B-410F-80E0-0CD22AA35B68}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{819D20D6-8D88-45C1-A4D2-AA21F10ABD19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{819D20D6-8D88-45C1-A4D2-AA21F10ABD19}.Debug|Any CPU.Build.0 = Debug|Any CPU
{819D20D6-8D88-45C1-A4D2-AA21F10ABD19}.Debug|x64.ActiveCfg = Debug|x64
{819D20D6-8D88-45C1-A4D2-AA21F10ABD19}.Debug|x64.Build.0 = Debug|x64
{819D20D6-8D88-45C1-A4D2-AA21F10ABD19}.Debug|x86.ActiveCfg = Debug|x86
{819D20D6-8D88-45C1-A4D2-AA21F10ABD19}.Debug|x86.Build.0 = Debug|x86
{819D20D6-8D88-45C1-A4D2-AA21F10ABD19}.Release|Any CPU.ActiveCfg = Release|Any CPU
{819D20D6-8D88-45C1-A4D2-AA21F10ABD19}.Release|Any CPU.Build.0 = Release|Any CPU
{819D20D6-8D88-45C1-A4D2-AA21F10ABD19}.Release|x64.ActiveCfg = Release|Any CPU
{819D20D6-8D88-45C1-A4D2-AA21F10ABD19}.Release|x64.Build.0 = Release|Any CPU
{819D20D6-8D88-45C1-A4D2-AA21F10ABD19}.Release|x86.ActiveCfg = Release|Any CPU
{819D20D6-8D88-45C1-A4D2-AA21F10ABD19}.Release|x86.Build.0 = Release|Any CPU
{37FEE3CF-72FE-4450-A71A-373D3B298F0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{37FEE3CF-72FE-4450-A71A-373D3B298F0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37FEE3CF-72FE-4450-A71A-373D3B298F0F}.Debug|x64.ActiveCfg = Debug|x64
{37FEE3CF-72FE-4450-A71A-373D3B298F0F}.Debug|x64.Build.0 = Debug|x64
{37FEE3CF-72FE-4450-A71A-373D3B298F0F}.Debug|x86.ActiveCfg = Debug|x86
{37FEE3CF-72FE-4450-A71A-373D3B298F0F}.Debug|x86.Build.0 = Debug|x86
{37FEE3CF-72FE-4450-A71A-373D3B298F0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37FEE3CF-72FE-4450-A71A-373D3B298F0F}.Release|Any CPU.Build.0 = Release|Any CPU
{37FEE3CF-72FE-4450-A71A-373D3B298F0F}.Release|x64.ActiveCfg = Release|Any CPU
{37FEE3CF-72FE-4450-A71A-373D3B298F0F}.Release|x64.Build.0 = Release|Any CPU
{37FEE3CF-72FE-4450-A71A-373D3B298F0F}.Release|x86.ActiveCfg = Release|Any CPU
{37FEE3CF-72FE-4450-A71A-373D3B298F0F}.Release|x86.Build.0 = Release|Any CPU
{E3FE712D-373B-410F-80E0-0CD22AA35B68}.Debug|Any CPU.ActiveCfg = Debug|x64
{E3FE712D-373B-410F-80E0-0CD22AA35B68}.Debug|Any CPU.Build.0 = Debug|x64
{E3FE712D-373B-410F-80E0-0CD22AA35B68}.Debug|x64.ActiveCfg = Debug|x64
{E3FE712D-373B-410F-80E0-0CD22AA35B68}.Debug|x64.Build.0 = Debug|x64
{E3FE712D-373B-410F-80E0-0CD22AA35B68}.Debug|x86.ActiveCfg = Debug|Win32
{E3FE712D-373B-410F-80E0-0CD22AA35B68}.Debug|x86.Build.0 = Debug|Win32
{E3FE712D-373B-410F-80E0-0CD22AA35B68}.Release|Any CPU.ActiveCfg = Release|Win32
{E3FE712D-373B-410F-80E0-0CD22AA35B68}.Release|x64.ActiveCfg = Release|x64
{E3FE712D-373B-410F-80E0-0CD22AA35B68}.Release|x64.Build.0 = Release|x64
{E3FE712D-373B-410F-80E0-0CD22AA35B68}.Release|x86.ActiveCfg = Release|Win32
{E3FE712D-373B-410F-80E0-0CD22AA35B68}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
191 changes: 191 additions & 0 deletions Discord RPC/DiscordRPC.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{819D20D6-8D88-45C1-A4D2-AA21F10ABD19}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DiscordRPC</RootNamespace>
<AssemblyName>DiscordRPC</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>5</LangVersion>
<DocumentationFile>bin\Debug\DiscordRPC.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\DiscordRPC.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug Unity|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Unity\</OutputPath>
<DefineConstants>TRACE;DEBUG;UNITY</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>5</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\x86\Debug\DiscordRPC.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\x86\Release\DiscordRPC.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug Unity|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug Unity\</OutputPath>
<DefineConstants>TRACE;DEBUG;UNITY</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\x86\Debug Unity\DiscordRPC.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>5</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\x64\Debug\DiscordRPC.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug Unity|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug Unity\</OutputPath>
<DefineConstants>TRACE;DEBUG;UNITY</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>$(SolutionDir)\packages\Newtonsoft.Json.11.0.1\lib\net35\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Configuration.cs" />
<Compile Include="Converters\EnumSnakeCaseConverter.cs" />
<Compile Include="DiscordRpcClient.cs" />
<Compile Include="Events.cs" />
<Compile Include="EventType.cs" />
<Compile Include="Exceptions\BadPresenceException.cs" />
<Compile Include="Exceptions\InvalidConfigurationException.cs" />
<Compile Include="Exceptions\StringOutOfRangeException.cs" />
<Compile Include="Helper\BackoffDelay.cs" />
<Compile Include="Helper\StringTools.cs" />
<Compile Include="IO\Handshake.cs" />
<Compile Include="IO\InvalidPipeException.cs" />
<Compile Include="IO\NativeNamedPipeClient.cs" />
<Compile Include="IO\INamedPipeClient.cs" />
<Compile Include="IO\ManagedNamedPipeClient.cs" />
<Compile Include="IO\Opcode.cs" />
<Compile Include="IO\PipeFrame.cs" />
<Compile Include="Logging\FileLogger.cs" />
<Compile Include="Logging\ConsoleLogger.cs" />
<Compile Include="Logging\ILogger.cs" />
<Compile Include="Logging\LogLevel.cs" />
<Compile Include="Logging\NullLogger.cs" />
<Compile Include="Message\ConnectionFailedMessage.cs" />
<Compile Include="Message\ConnectionEstablishedMessage.cs" />
<Compile Include="Message\PresenceMessage.cs" />
<Compile Include="Message\CloseMessage.cs" />
<Compile Include="Message\JoinMessage.cs" />
<Compile Include="Message\JoinRequestMessage.cs" />
<Compile Include="Message\SpectateMessage.cs" />
<Compile Include="Message\UnsubscribeMsesage.cs" />
<Compile Include="Message\SubscribeMessage.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Registry\UriScheme.cs" />
<Compile Include="RichPresence.cs" />
<Compile Include="RPC\Commands\ICommand.cs" />
<Compile Include="RPC\Commands\CloseCommand.cs" />
<Compile Include="RPC\Commands\RespondCommand.cs" />
<Compile Include="RPC\Commands\PresenceCommand.cs" />
<Compile Include="RPC\Commands\SubscribeCommand.cs" />
<Compile Include="Message\ReadyMessage.cs" />
<Compile Include="RPC\Payload\ClosePayload.cs" />
<Compile Include="RPC\Payload\Command.cs" />
<Compile Include="Message\IMessage.cs" />
<Compile Include="Message\MessageType.cs" />
<Compile Include="Message\ErrorMessage.cs" />
<Compile Include="RPC\Payload\PayloadArgument.cs" />
<Compile Include="RPC\Payload\IPayload.cs" />
<Compile Include="RPC\Payload\PayloadEvent.cs" />
<Compile Include="RPC\RpcConnection.cs" />
<Compile Include="RPC\Payload\ServerEvent.cs" />
<Compile Include="Web\WebRPC.cs" />
<Compile Include="User.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Discord RPC.nuspec" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>mkdir "$(ProjectDir)\..\Unity Example\Assets\Discord RPC\Plugins\"
copy /Y "$(TargetPath)" "$(ProjectDir)\..\Unity Example\Assets\Discord RPC\Plugins\x86_64\$(TargetFileName)"
copy /Y "$(TargetDir)$(TargetName).XML" "$(ProjectDir)\..\Unity Example\Assets\Discord RPC\Plugins\x86_64\$(TargetName).XML"
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Loading

0 comments on commit dd5fb8e

Please sign in to comment.