Reorganized solution projects

Clear separation between what features will be available in the public
instance and additional features available for a self-hosted instance.
This commit is contained in:
Noikoio 2018-06-04 19:23:00 -07:00
parent f20a17e914
commit 2e178a2f2d
5 changed files with 94 additions and 19 deletions

View file

@ -5,7 +5,9 @@ VisualStudioVersion = 15.0.27428.2005
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kerobot", "Kerobot\Kerobot.csproj", "{6FA3A92F-F1FC-4BA8-8018-1A05CB4C7FA3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kerobot-Modules", "Kerobot-Modules\Kerobot-Modules.csproj", "{B33E57B4-2918-4552-8489-E0DB8BCE3126}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Modules-PublicInstance", "Modules-PublicInstance\Modules-PublicInstance.csproj", "{E06B76BE-E6F5-4803-BA02-DA8AF2A9705E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Modules-SelfHosted", "Modules-SelfHosted\Modules-SelfHosted.csproj", "{84390AD6-6906-4BD9-A948-578C21037D6C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -17,10 +19,14 @@ Global
{6FA3A92F-F1FC-4BA8-8018-1A05CB4C7FA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6FA3A92F-F1FC-4BA8-8018-1A05CB4C7FA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6FA3A92F-F1FC-4BA8-8018-1A05CB4C7FA3}.Release|Any CPU.Build.0 = Release|Any CPU
{B33E57B4-2918-4552-8489-E0DB8BCE3126}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B33E57B4-2918-4552-8489-E0DB8BCE3126}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B33E57B4-2918-4552-8489-E0DB8BCE3126}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B33E57B4-2918-4552-8489-E0DB8BCE3126}.Release|Any CPU.Build.0 = Release|Any CPU
{E06B76BE-E6F5-4803-BA02-DA8AF2A9705E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E06B76BE-E6F5-4803-BA02-DA8AF2A9705E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E06B76BE-E6F5-4803-BA02-DA8AF2A9705E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E06B76BE-E6F5-4803-BA02-DA8AF2A9705E}.Release|Any CPU.Build.0 = Release|Any CPU
{84390AD6-6906-4BD9-A948-578C21037D6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{84390AD6-6906-4BD9-A948-578C21037D6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{84390AD6-6906-4BD9-A948-578C21037D6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{84390AD6-6906-4BD9-A948-578C21037D6C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -2,26 +2,20 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<Product>Kerobot</Product>
<Company />
<Authors>Noikoio</Authors>
<AssemblyVersion>0.0.1</AssemblyVersion>
<Description>User-facing portions of Kerobot</Description>
<FileVersion>0.0.1</FileVersion>
<Company>Noikoio</Company>
<Product>Kerobot</Product>
<Version>0.0.1</Version>
<Description>Essential functions for Kerobot which are available in the public bot instance.</Description>
<RootNamespace>Kerobot.Modules</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Discord.Net" Version="2.0.0-beta" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Kerobot\Kerobot.csproj" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy /Y &quot;$(TargetDir)$(ProjectName).*&quot; &quot;$(SolutionDir)Kerobot\bin\$(ConfigurationName)\netcoreapp2.0\&quot;" />
</Target>
<ItemGroup>
<ProjectReference Include="..\Kerobot\Kerobot.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,27 @@
using System.Collections.Generic;
using Discord.WebSocket;
using Newtonsoft.Json.Linq;
using System.Threading.Tasks;
namespace Kerobot.Modules
{
[KerobotModule]
class TestMod : ModuleBase
{
public TestMod(Kerobot kb) : base(kb)
{
kb.DiscordClient.MessageReceived += DiscordClient_MessageReceived;
}
private async Task DiscordClient_MessageReceived(SocketMessage arg)
{
if (arg.Content.ToLower() == ".test")
{
await arg.Channel.SendMessageAsync("I respond to your test.");
}
}
public override Task<object> CreateGuildStateAsync(JToken config)
=> Task.FromResult<object>(new Dictionary<ulong, string>());
}
}

View file

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<Authors>Noikoio</Authors>
<Product>Kerobot</Product>
<Version>0.0.1</Version>
<Description>Kerobot modules with more specific purposes that may not work well in a public instance, but are manageable in self-hosted bot instances.</Description>
<RootNamespace>Kerobot.Modules</RootNamespace>
</PropertyGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy /Y &quot;$(TargetDir)$(ProjectName).*&quot; &quot;$(SolutionDir)Kerobot\bin\$(ConfigurationName)\netcoreapp2.0\&quot;" />
</Target>
<ItemGroup>
<ProjectReference Include="..\Kerobot\Kerobot.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,28 @@
using System.Collections.Generic;
using Discord.WebSocket;
using Newtonsoft.Json.Linq;
using System.Threading.Tasks;
namespace Kerobot.Modules
{
[KerobotModule]
class TestMod2 : ModuleBase
{
public TestMod2(Kerobot kb) : base(kb)
{
kb.DiscordClient.MessageReceived += DiscordClient_MessageReceived;
}
private async Task DiscordClient_MessageReceived(SocketMessage arg)
{
if (arg.Content.ToLower() == ".test2")
{
await arg.Channel.SendMessageAsync("I respond to your test too.");
}
}
public override Task<object> CreateGuildStateAsync(JToken config)
=> Task.FromResult<object>(new Dictionary<ulong, string>());
}
}