@@ -165,20 +165,20 @@ | |||||
<Compile Include="..\Discord.Net\Net\API\Responses.cs"> | <Compile Include="..\Discord.Net\Net\API\Responses.cs"> | ||||
<Link>Net\API\Responses.cs</Link> | <Link>Net\API\Responses.cs</Link> | ||||
</Compile> | </Compile> | ||||
<Compile Include="..\Discord.Net\Net\HttpException.cs"> | |||||
<Link>Net\HttpException.cs</Link> | |||||
<Compile Include="..\Discord.Net\Net\API\RestClient.BuiltIn.cs"> | |||||
<Link>Net\API\RestClient.BuiltIn.cs</Link> | |||||
</Compile> | </Compile> | ||||
<Compile Include="..\Discord.Net\Net\RestClient.BuiltIn.cs"> | |||||
<Link>Net\RestClient.BuiltIn.cs</Link> | |||||
<Compile Include="..\Discord.Net\Net\API\RestClient.cs"> | |||||
<Link>Net\API\RestClient.cs</Link> | |||||
</Compile> | </Compile> | ||||
<Compile Include="..\Discord.Net\Net\RestClient.cs"> | |||||
<Link>Net\RestClient.cs</Link> | |||||
<Compile Include="..\Discord.Net\Net\API\RestClient.Events.cs"> | |||||
<Link>Net\API\RestClient.Events.cs</Link> | |||||
</Compile> | </Compile> | ||||
<Compile Include="..\Discord.Net\Net\RestClient.Events.cs"> | |||||
<Link>Net\RestClient.Events.cs</Link> | |||||
<Compile Include="..\Discord.Net\Net\API\RestClient.SharpRest.cs"> | |||||
<Link>Net\API\RestClient.SharpRest.cs</Link> | |||||
</Compile> | </Compile> | ||||
<Compile Include="..\Discord.Net\Net\RestClient.SharpRest.cs"> | |||||
<Link>Net\RestClient.SharpRest.cs</Link> | |||||
<Compile Include="..\Discord.Net\Net\HttpException.cs"> | |||||
<Link>Net\HttpException.cs</Link> | |||||
</Compile> | </Compile> | ||||
<Compile Include="..\Discord.Net\Net\WebSockets\Commands.cs"> | <Compile Include="..\Discord.Net\Net\WebSockets\Commands.cs"> | ||||
<Link>Net\WebSockets\Commands.cs</Link> | <Link>Net\WebSockets\Commands.cs</Link> | ||||
@@ -1,5 +1,4 @@ | |||||
#if DNXCORE50 | #if DNXCORE50 | ||||
using Discord.Net.API; | |||||
using System; | using System; | ||||
using System.Globalization; | using System.Globalization; | ||||
using System.IO; | using System.IO; | ||||
@@ -9,7 +8,7 @@ using System.Text; | |||||
using System.Threading; | using System.Threading; | ||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
namespace Discord.Net | |||||
namespace Discord.Net.API | |||||
{ | { | ||||
internal class BuiltInRestEngine : IRestEngine | internal class BuiltInRestEngine : IRestEngine | ||||
{ | { |
@@ -1,7 +1,7 @@ | |||||
using System; | using System; | ||||
using System.Net.Http; | using System.Net.Http; | ||||
namespace Discord.Net | |||||
namespace Discord.Net.API | |||||
{ | { | ||||
internal partial class RestClient | internal partial class RestClient | ||||
{ | { |
@@ -1,5 +1,4 @@ | |||||
#if !DNXCORE50 | #if !DNXCORE50 | ||||
using Discord.Net.API; | |||||
using RestSharp; | using RestSharp; | ||||
using System; | using System; | ||||
using System.IO; | using System.IO; | ||||
@@ -7,13 +6,13 @@ using System.Net.Http; | |||||
using System.Threading; | using System.Threading; | ||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
namespace Discord.Net | |||||
namespace Discord.Net.API | |||||
{ | { | ||||
internal class SharpRestEngine : IRestEngine | |||||
internal class RestSharpRestEngine : IRestEngine | |||||
{ | { | ||||
private readonly RestSharp.RestClient _client; | private readonly RestSharp.RestClient _client; | ||||
public SharpRestEngine(string userAgent) | |||||
public RestSharpRestEngine(string userAgent) | |||||
{ | { | ||||
_client = new RestSharp.RestClient(Endpoints.BaseApi) | _client = new RestSharp.RestClient(Endpoints.BaseApi) | ||||
{ | { |
@@ -1,5 +1,4 @@ | |||||
using Discord.Net.API; | |||||
using Newtonsoft.Json; | |||||
using Newtonsoft.Json; | |||||
using System; | using System; | ||||
using System.Diagnostics; | using System.Diagnostics; | ||||
using System.Net.Http; | using System.Net.Http; | ||||
@@ -7,7 +6,7 @@ using System.Reflection; | |||||
using System.Threading; | using System.Threading; | ||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
namespace Discord.Net | |||||
namespace Discord.Net.API | |||||
{ | { | ||||
internal interface IRestEngine | internal interface IRestEngine | ||||
{ | { | ||||
@@ -31,7 +30,7 @@ namespace Discord.Net | |||||
#if DNXCORE50 | #if DNXCORE50 | ||||
_engine = new BuiltInRestEngine(userAgent); | _engine = new BuiltInRestEngine(userAgent); | ||||
#else | #else | ||||
_engine = new SharpRestEngine(userAgent); | |||||
_engine = new RestSharpRestEngine(userAgent); | |||||
#endif | #endif | ||||
} | } | ||||
@@ -27,14 +27,18 @@ | |||||
"frameworks": { | "frameworks": { | ||||
"net45": { | "net45": { | ||||
"dependencies": { | "dependencies": { | ||||
"Microsoft.Net.Http": "2.2.29", | |||||
"RestSharp": "105.2.3" | "RestSharp": "105.2.3" | ||||
}, | |||||
"frameworkAssemblies": { | |||||
"System.Net.Http": "4.0.0.0" | |||||
} | } | ||||
}, | }, | ||||
"dnx451": { | "dnx451": { | ||||
"dependencies": { | "dependencies": { | ||||
"Microsoft.Net.Http": "2.2.29", | |||||
"RestSharp": "105.2.3" | "RestSharp": "105.2.3" | ||||
}, | |||||
"frameworkAssemblies": { | |||||
"System.Net.Http": "4.0.0.0" | |||||
} | } | ||||
}, | }, | ||||
"dnxcore50": { | "dnxcore50": { | ||||
@@ -62,6 +62,12 @@ | |||||
<ItemGroup> | <ItemGroup> | ||||
<None Include="packages.config" /> | <None Include="packages.config" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | |||||
<ProjectReference Include="..\..\src\Discord.Net.Net45\Discord.Net.csproj"> | |||||
<Project>{8d71a857-879a-4a10-859e-5ff824ed6688}</Project> | |||||
<Name>Discord.Net</Name> | |||||
</ProjectReference> | |||||
</ItemGroup> | |||||
<Choose> | <Choose> | ||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'"> | <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'"> | ||||
<ItemGroup> | <ItemGroup> | ||||
@@ -110,9 +110,9 @@ namespace Discord.Net.Tests | |||||
public static void Cleanup() | public static void Cleanup() | ||||
{ | { | ||||
WaitMany( | WaitMany( | ||||
_hostClient.IsConnected ? _hostClient.Servers.Select(x => _hostClient.LeaveServer(x)) : null, | |||||
_targetBot.IsConnected ? _targetBot.Servers.Select(x => _targetBot.LeaveServer(x)) : null, | |||||
_observerBot.IsConnected ? _observerBot.Servers.Select(x => _observerBot.LeaveServer(x)) : null); | |||||
_hostClient.State == DiscordClientState.Connected ? _hostClient.Servers.Select(x => _hostClient.LeaveServer(x)) : null, | |||||
_targetBot.State == DiscordClientState.Connected ? _targetBot.Servers.Select(x => _targetBot.LeaveServer(x)) : null, | |||||
_observerBot.State == DiscordClientState.Connected ? _observerBot.Servers.Select(x => _observerBot.LeaveServer(x)) : null); | |||||
WaitAll( | WaitAll( | ||||
_hostClient.Disconnect(), | _hostClient.Disconnect(), | ||||