| @@ -1,5 +1,5 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
| <Project ToolsVersion="4.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> | |||
| @@ -11,6 +11,7 @@ | |||
| <AssemblyName>Discord.Net.Commands</AssemblyName> | |||
| <FileAlignment>512</FileAlignment> | |||
| <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | |||
| <UseMSBuildEngine>False</UseMSBuildEngine> | |||
| </PropertyGroup> | |||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |||
| <DebugSymbols>true</DebugSymbols> | |||
| @@ -20,6 +21,7 @@ | |||
| <DefineConstants>TRACE;DEBUG;NET45</DefineConstants> | |||
| <ErrorReport>prompt</ErrorReport> | |||
| <WarningLevel>4</WarningLevel> | |||
| <LangVersion>6</LangVersion> | |||
| </PropertyGroup> | |||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | |||
| <DebugType>pdbonly</DebugType> | |||
| @@ -29,6 +31,7 @@ | |||
| <ErrorReport>prompt</ErrorReport> | |||
| <WarningLevel>4</WarningLevel> | |||
| <TreatWarningsAsErrors>true</TreatWarningsAsErrors> | |||
| <LangVersion>6</LangVersion> | |||
| </PropertyGroup> | |||
| <ItemGroup> | |||
| <Reference Include="System" /> | |||
| @@ -59,4 +62,10 @@ | |||
| <Target Name="AfterBuild"> | |||
| </Target> | |||
| --> | |||
| <ItemGroup> | |||
| <ProjectReference Include="..\Discord.Net.Net45\Discord.Net.csproj"> | |||
| <Project>{8D71A857-879A-4A10-859E-5FF824ED6688}</Project> | |||
| <Name>Discord.Net</Name> | |||
| </ProjectReference> | |||
| </ItemGroup> | |||
| </Project> | |||
| @@ -21,11 +21,11 @@ namespace Discord | |||
| public CommandEventArgs(Message message, Command command, string commandText, int? permissions, string[] args) | |||
| { | |||
| Message = message; | |||
| Command = command; | |||
| CommandText = commandText; | |||
| Permissions = permissions; | |||
| Args = args; | |||
| this.Message = message; | |||
| this.Command = command; | |||
| this.CommandText = commandText; | |||
| this.Permissions = permissions; | |||
| this.Args = args; | |||
| } | |||
| } | |||
| public class CommandErrorEventArgs : CommandEventArgs | |||
| @@ -35,7 +35,7 @@ namespace Discord | |||
| public CommandErrorEventArgs(CommandEventArgs baseArgs, Exception ex) | |||
| : base(baseArgs.Message, baseArgs.Command, baseArgs.CommandText, baseArgs.Permissions, baseArgs.Args) | |||
| { | |||
| Exception = ex; | |||
| this.Exception = ex; | |||
| } | |||
| } | |||
| public partial class DiscordBotClient : DiscordClient | |||
| @@ -1,5 +1,5 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
| <Project ToolsVersion="4.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> | |||
| @@ -13,6 +13,7 @@ | |||
| <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | |||
| <NuGetPackageImportStamp> | |||
| </NuGetPackageImportStamp> | |||
| <UseMSBuildEngine>False</UseMSBuildEngine> | |||
| </PropertyGroup> | |||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |||
| <DebugSymbols>true</DebugSymbols> | |||
| @@ -22,8 +23,8 @@ | |||
| <DefineConstants>TRACE;DEBUG;NET45</DefineConstants> | |||
| <ErrorReport>prompt</ErrorReport> | |||
| <WarningLevel>2</WarningLevel> | |||
| <TreatWarningsAsErrors>false</TreatWarningsAsErrors> | |||
| <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |||
| <LangVersion>6</LangVersion> | |||
| </PropertyGroup> | |||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | |||
| <DebugType>pdbonly</DebugType> | |||
| @@ -34,6 +35,7 @@ | |||
| <WarningLevel>4</WarningLevel> | |||
| <TreatWarningsAsErrors>true</TreatWarningsAsErrors> | |||
| <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |||
| <LangVersion>6</LangVersion> | |||
| </PropertyGroup> | |||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'FullDebug|AnyCPU'"> | |||
| <DebugSymbols>true</DebugSymbols> | |||
| @@ -45,18 +47,18 @@ | |||
| <PlatformTarget>AnyCPU</PlatformTarget> | |||
| <ErrorReport>prompt</ErrorReport> | |||
| <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> | |||
| <Optimize>false</Optimize> | |||
| <LangVersion>6</LangVersion> | |||
| </PropertyGroup> | |||
| <ItemGroup> | |||
| <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | |||
| <Reference Include="System" /> | |||
| <Reference Include="System.Net.Http" /> | |||
| <Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed"> | |||
| <HintPath>..\..\..\DiscordBot\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> | |||
| <Private>True</Private> | |||
| </Reference> | |||
| <Reference Include="RestSharp, Version=105.2.3.0, Culture=neutral, processorArchitecture=MSIL"> | |||
| <Reference Include="RestSharp, Version=105.2.3.0, Culture=neutral, PublicKeyToken=null"> | |||
| <HintPath>..\..\..\DiscordBot\packages\RestSharp.105.2.3\lib\net45\RestSharp.dll</HintPath> | |||
| <Private>True</Private> | |||
| </Reference> | |||
| <Reference Include="System" /> | |||
| <Reference Include="System.Net.Http" /> | |||
| </ItemGroup> | |||
| <ItemGroup> | |||
| <Content Include="lib\libopus.so"> | |||
| @@ -25,7 +25,12 @@ namespace Discord | |||
| { | |||
| public readonly bool WasUnexpected; | |||
| public readonly Exception Error; | |||
| internal DisconnectedEventArgs(bool wasUnexpected, Exception error) { WasUnexpected = wasUnexpected; Error = error; } | |||
| internal DisconnectedEventArgs(bool wasUnexpected, Exception error) | |||
| { | |||
| this.WasUnexpected = wasUnexpected; | |||
| this.Error = error; | |||
| } | |||
| } | |||
| public sealed class LogMessageEventArgs : EventArgs | |||
| { | |||
| @@ -33,7 +38,12 @@ namespace Discord | |||
| public LogMessageSource Source { get; } | |||
| public string Message { get; } | |||
| internal LogMessageEventArgs(LogMessageSeverity severity, LogMessageSource source, string msg) { Severity = severity; Source = source; Message = msg; } | |||
| internal LogMessageEventArgs(LogMessageSeverity severity, LogMessageSource source, string msg) | |||
| { | |||
| this.Severity = severity; | |||
| this.Source = source; | |||
| this.Message = msg; | |||
| } | |||
| } | |||
| public sealed class ServerEventArgs : EventArgs | |||
| @@ -41,7 +51,7 @@ namespace Discord | |||
| public Server Server { get; } | |||
| public string ServerId => Server.Id; | |||
| internal ServerEventArgs(Server server) { Server = server; } | |||
| internal ServerEventArgs(Server server) { this.Server = server; } | |||
| } | |||
| public sealed class ChannelEventArgs : EventArgs | |||
| { | |||
| @@ -50,14 +60,14 @@ namespace Discord | |||
| public Server Server => Channel.Server; | |||
| public string ServerId => Channel.ServerId; | |||
| internal ChannelEventArgs(Channel channel) { Channel = channel; } | |||
| internal ChannelEventArgs(Channel channel) { this.Channel = channel; } | |||
| } | |||
| public sealed class UserEventArgs : EventArgs | |||
| { | |||
| public User User { get; } | |||
| public string UserId => User.Id; | |||
| internal UserEventArgs(User user) { User = user; } | |||
| internal UserEventArgs(User user) { this.User = user; } | |||
| } | |||
| public sealed class MessageEventArgs : EventArgs | |||
| { | |||
| @@ -71,7 +81,7 @@ namespace Discord | |||
| public User User => Member.User; | |||
| public string UserId => Message.UserId; | |||
| internal MessageEventArgs(Message msg) { Message = msg; } | |||
| internal MessageEventArgs(Message msg) { this.Message = msg; } | |||
| } | |||
| public sealed class RoleEventArgs : EventArgs | |||
| { | |||
| @@ -80,7 +90,7 @@ namespace Discord | |||
| public Server Server => Role.Server; | |||
| public string ServerId => Role.ServerId; | |||
| internal RoleEventArgs(Role role) { Role = role; } | |||
| internal RoleEventArgs(Role role) { this.Role = role; } | |||
| } | |||
| public sealed class BanEventArgs : EventArgs | |||
| { | |||
| @@ -91,9 +101,9 @@ namespace Discord | |||
| internal BanEventArgs(User user, string userId, Server server) | |||
| { | |||
| User = user; | |||
| UserId = userId; | |||
| Server = server; | |||
| this.User = user; | |||
| this.UserId = userId; | |||
| this.Server = server; | |||
| } | |||
| } | |||
| public sealed class MemberEventArgs : EventArgs | |||
| @@ -104,7 +114,7 @@ namespace Discord | |||
| public Server Server => Member.Server; | |||
| public string ServerId => Member.ServerId; | |||
| internal MemberEventArgs(Member member) { Member = member; } | |||
| internal MemberEventArgs(Member member) { this.Member = member; } | |||
| } | |||
| public sealed class UserTypingEventArgs : EventArgs | |||
| { | |||
| @@ -117,8 +127,8 @@ namespace Discord | |||
| internal UserTypingEventArgs(User user, Channel channel) | |||
| { | |||
| User = user; | |||
| Channel = channel; | |||
| this.User = user; | |||
| this.Channel = channel; | |||
| } | |||
| } | |||
| public sealed class UserIsSpeakingEventArgs : EventArgs | |||
| @@ -134,21 +144,10 @@ namespace Discord | |||
| internal UserIsSpeakingEventArgs(Member member, bool isSpeaking) | |||
| { | |||
| Member = member; | |||
| IsSpeaking = isSpeaking; | |||
| this.Member = member; | |||
| this.IsSpeaking = isSpeaking; | |||
| } | |||
| } | |||
| /*public sealed class VoiceServerUpdatedEventArgs : EventArgs | |||
| { | |||
| public Server Server { get; } | |||
| public string ServerId => Server.Id; | |||
| public string Endpoint { get; } | |||
| internal VoiceServerUpdatedEventArgs(Server server, string endpoint) | |||
| { | |||
| Server = server; | |||
| Endpoint = endpoint; | |||
| } | |||
| }*/ | |||
| public partial class DiscordClient | |||
| { | |||
| @@ -102,7 +102,7 @@ namespace Discord.WebSockets.Voice | |||
| _isClearing = false; | |||
| _udp = new UdpClient(new IPEndPoint(IPAddress.Any, 0)); | |||
| #if !DNX451 | |||
| #if !DNX451 && !__MonoCS__ | |||
| _udp.AllowNatTraversal(true); | |||
| #endif | |||