Skip to content

Commit

Permalink
Add example rue plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaioru committed Aug 17, 2024
1 parent 82dfc11 commit 2bada4b
Show file tree
Hide file tree
Showing 8 changed files with 1,066 additions and 2 deletions.
14 changes: 14 additions & 0 deletions Edelstein.sln
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Protocol.Plugin.L
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Application.Server", "src\app\Edelstein.Application.Server\Edelstein.Application.Server.csproj", "{982EAFDE-0785-4542-BB6C-0716DFC6B0DA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "plugin", "plugin", "{E037F392-38D9-43ED-86EA-740EB51A475B}"
ProjectSection(SolutionItems) = preProject
src\plugin\Directory.Build.targets = src\plugin\Directory.Build.targets
src\plugin\Directory.Build.props = src\plugin\Directory.Build.props
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edelstein.Plugin.Rue", "src\plugin\Edelstein.Plugin.Rue\Edelstein.Plugin.Rue.csproj", "{AAFAAEFF-090E-4AE5-B278-BD33F8BEA841}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -76,6 +84,8 @@ Global
{917FCEED-4FA0-4C55-A66A-5E5B4FB6F220} = {E50DFCDF-39D5-4D0D-A46E-94D11D795087}
{C70A28BF-4EFD-4EB7-94BA-DF59BA415B71} = {82D7864B-19AD-484C-BD2E-897F05B5852C}
{982EAFDE-0785-4542-BB6C-0716DFC6B0DA} = {FED60761-FD6B-4EBD-B896-FAFB2D991E13}
{E037F392-38D9-43ED-86EA-740EB51A475B} = {0C8602E7-AED6-43A4-BA0F-165EAB963D07}
{AAFAAEFF-090E-4AE5-B278-BD33F8BEA841} = {E037F392-38D9-43ED-86EA-740EB51A475B}
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AF5AC908-62BB-48CE-99E8-83388738CCB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -130,5 +140,9 @@ Global
{982EAFDE-0785-4542-BB6C-0716DFC6B0DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{982EAFDE-0785-4542-BB6C-0716DFC6B0DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{982EAFDE-0785-4542-BB6C-0716DFC6B0DA}.Release|Any CPU.Build.0 = Release|Any CPU
{AAFAAEFF-090E-4AE5-B278-BD33F8BEA841}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AAFAAEFF-090E-4AE5-B278-BD33F8BEA841}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AAFAAEFF-090E-4AE5-B278-BD33F8BEA841}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AAFAAEFF-090E-4AE5-B278-BD33F8BEA841}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public async Task StopAsync(CancellationToken cancellationToken)

if (Context != null)
await Context.Close();

await plugins.InvokeStop();

logger.LogSystemHostServiceStopped(info.ID);

await plugins.InvokeStop();
}
}
17 changes: 17 additions & 0 deletions src/plugin/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />

<PropertyGroup>
<IsPackable>false</IsPackable>
<IsPublishable>true</IsPublishable>
</PropertyGroup>

<ItemGroup>
<None Update="manifest.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
</None>
</ItemGroup>

</Project>
12 changes: 12 additions & 0 deletions src/plugin/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />

<ItemGroup>
<None Update="manifest.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
</None>
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions src/plugin/Edelstein.Plugin.Rue/Edelstein.Plugin.Rue.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<ProjectReference Include="..\..\protocol\Edelstein.Protocol.Plugin.Login\Edelstein.Protocol.Plugin.Login.csproj" />
</ItemGroup>
</Project>
24 changes: 24 additions & 0 deletions src/plugin/Edelstein.Plugin.Rue/TestPlugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Threading.Tasks;
using Edelstein.Protocol.Gameplay.Login.Contexts;
using Edelstein.Protocol.Plugin;
using Edelstein.Protocol.Plugin.Login;

namespace Edelstein.Plugin.Rue;

public class TestPlugin : ILoginPlugin
{
public string ID => "Rue";

public Task OnStart(IPluginHost<LoginContext> host, LoginContext ctx)
{
Console.WriteLine("Started");
return Task.CompletedTask;
}

public Task OnStop()
{
Console.WriteLine("Stopped");
return Task.CompletedTask;
}
}
6 changes: 6 additions & 0 deletions src/plugin/Edelstein.Plugin.Rue/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"Name": "Rue",
"Description": "A collection of sensible additions to Edelstein",

"EntryPoint": "Edelstein.Plugin.Rue.dll"
}
Loading

0 comments on commit 2bada4b

Please sign in to comment.