Added MonoDevelop support

This commit is contained in:
Brandon Smith
2015-09-25 22:01:30 -03:00
parent dd19a625e3
commit 7e3ad11a8b
5 changed files with 54 additions and 44 deletions

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?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')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -11,6 +11,7 @@
<AssemblyName>Discord.Net.Commands</AssemblyName> <AssemblyName>Discord.Net.Commands</AssemblyName>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<UseMSBuildEngine>False</UseMSBuildEngine>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@@ -20,6 +21,7 @@
<DefineConstants>TRACE;DEBUG;NET45</DefineConstants> <DefineConstants>TRACE;DEBUG;NET45</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<LangVersion>6</LangVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
@@ -29,6 +31,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<LangVersion>6</LangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
@@ -59,4 +62,10 @@
<Target Name="AfterBuild"> <Target Name="AfterBuild">
</Target> </Target>
--> -->
<ItemGroup>
<ProjectReference Include="..\Discord.Net.Net45\Discord.Net.csproj">
<Project>{8D71A857-879A-4A10-859E-5FF824ED6688}</Project>
<Name>Discord.Net</Name>
</ProjectReference>
</ItemGroup>
</Project> </Project>

View File

@@ -21,11 +21,11 @@ namespace Discord
public CommandEventArgs(Message message, Command command, string commandText, int? permissions, string[] args) public CommandEventArgs(Message message, Command command, string commandText, int? permissions, string[] args)
{ {
Message = message; this.Message = message;
Command = command; this.Command = command;
CommandText = commandText; this.CommandText = commandText;
Permissions = permissions; this.Permissions = permissions;
Args = args; this.Args = args;
} }
} }
public class CommandErrorEventArgs : CommandEventArgs public class CommandErrorEventArgs : CommandEventArgs
@@ -35,7 +35,7 @@ namespace Discord
public CommandErrorEventArgs(CommandEventArgs baseArgs, Exception ex) public CommandErrorEventArgs(CommandEventArgs baseArgs, Exception ex)
: base(baseArgs.Message, baseArgs.Command, baseArgs.CommandText, baseArgs.Permissions, baseArgs.Args) : base(baseArgs.Message, baseArgs.Command, baseArgs.CommandText, baseArgs.Permissions, baseArgs.Args)
{ {
Exception = ex; this.Exception = ex;
} }
} }
public partial class DiscordBotClient : DiscordClient public partial class DiscordBotClient : DiscordClient

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?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')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -13,6 +13,7 @@
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp> </NuGetPackageImportStamp>
<UseMSBuildEngine>False</UseMSBuildEngine>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@@ -22,8 +23,8 @@
<DefineConstants>TRACE;DEBUG;NET45</DefineConstants> <DefineConstants>TRACE;DEBUG;NET45</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>2</WarningLevel> <WarningLevel>2</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>6</LangVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
@@ -34,6 +35,7 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>6</LangVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'FullDebug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'FullDebug|AnyCPU'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@@ -45,18 +47,18 @@
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Optimize>false</Optimize>
<LangVersion>6</LangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<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">
<HintPath>..\..\..\DiscordBot\packages\RestSharp.105.2.3\lib\net45\RestSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Net.Http" /> <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>
</Reference>
<Reference Include="RestSharp, Version=105.2.3.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\DiscordBot\packages\RestSharp.105.2.3\lib\net45\RestSharp.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="lib\libopus.so"> <Content Include="lib\libopus.so">

View File

@@ -25,7 +25,12 @@ namespace Discord
{ {
public readonly bool WasUnexpected; public readonly bool WasUnexpected;
public readonly Exception Error; 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 public sealed class LogMessageEventArgs : EventArgs
{ {
@@ -33,7 +38,12 @@ namespace Discord
public LogMessageSource Source { get; } public LogMessageSource Source { get; }
public string Message { 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 public sealed class ServerEventArgs : EventArgs
@@ -41,7 +51,7 @@ namespace Discord
public Server Server { get; } public Server Server { get; }
public string ServerId => Server.Id; public string ServerId => Server.Id;
internal ServerEventArgs(Server server) { Server = server; } internal ServerEventArgs(Server server) { this.Server = server; }
} }
public sealed class ChannelEventArgs : EventArgs public sealed class ChannelEventArgs : EventArgs
{ {
@@ -50,14 +60,14 @@ namespace Discord
public Server Server => Channel.Server; public Server Server => Channel.Server;
public string ServerId => Channel.ServerId; public string ServerId => Channel.ServerId;
internal ChannelEventArgs(Channel channel) { Channel = channel; } internal ChannelEventArgs(Channel channel) { this.Channel = channel; }
} }
public sealed class UserEventArgs : EventArgs public sealed class UserEventArgs : EventArgs
{ {
public User User { get; } public User User { get; }
public string UserId => User.Id; public string UserId => User.Id;
internal UserEventArgs(User user) { User = user; } internal UserEventArgs(User user) { this.User = user; }
} }
public sealed class MessageEventArgs : EventArgs public sealed class MessageEventArgs : EventArgs
{ {
@@ -71,7 +81,7 @@ namespace Discord
public User User => Member.User; public User User => Member.User;
public string UserId => Message.UserId; public string UserId => Message.UserId;
internal MessageEventArgs(Message msg) { Message = msg; } internal MessageEventArgs(Message msg) { this.Message = msg; }
} }
public sealed class RoleEventArgs : EventArgs public sealed class RoleEventArgs : EventArgs
{ {
@@ -80,7 +90,7 @@ namespace Discord
public Server Server => Role.Server; public Server Server => Role.Server;
public string ServerId => Role.ServerId; public string ServerId => Role.ServerId;
internal RoleEventArgs(Role role) { Role = role; } internal RoleEventArgs(Role role) { this.Role = role; }
} }
public sealed class BanEventArgs : EventArgs public sealed class BanEventArgs : EventArgs
{ {
@@ -91,9 +101,9 @@ namespace Discord
internal BanEventArgs(User user, string userId, Server server) internal BanEventArgs(User user, string userId, Server server)
{ {
User = user; this.User = user;
UserId = userId; this.UserId = userId;
Server = server; this.Server = server;
} }
} }
public sealed class MemberEventArgs : EventArgs public sealed class MemberEventArgs : EventArgs
@@ -104,7 +114,7 @@ namespace Discord
public Server Server => Member.Server; public Server Server => Member.Server;
public string ServerId => Member.ServerId; public string ServerId => Member.ServerId;
internal MemberEventArgs(Member member) { Member = member; } internal MemberEventArgs(Member member) { this.Member = member; }
} }
public sealed class UserTypingEventArgs : EventArgs public sealed class UserTypingEventArgs : EventArgs
{ {
@@ -117,8 +127,8 @@ namespace Discord
internal UserTypingEventArgs(User user, Channel channel) internal UserTypingEventArgs(User user, Channel channel)
{ {
User = user; this.User = user;
Channel = channel; this.Channel = channel;
} }
} }
public sealed class UserIsSpeakingEventArgs : EventArgs public sealed class UserIsSpeakingEventArgs : EventArgs
@@ -134,21 +144,10 @@ namespace Discord
internal UserIsSpeakingEventArgs(Member member, bool isSpeaking) internal UserIsSpeakingEventArgs(Member member, bool isSpeaking)
{ {
Member = member; this.Member = member;
IsSpeaking = isSpeaking; 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 public partial class DiscordClient
{ {

View File

@@ -102,7 +102,7 @@ namespace Discord.WebSockets.Voice
_isClearing = false; _isClearing = false;
_udp = new UdpClient(new IPEndPoint(IPAddress.Any, 0)); _udp = new UdpClient(new IPEndPoint(IPAddress.Any, 0));
#if !DNX451 #if !DNX451 && !__MonoCS__
_udp.AllowNatTraversal(true); _udp.AllowNatTraversal(true);
#endif #endif