overhaul provider structure
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OwnChar\OwnChar\OwnChar.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace OwnChar.Data.ClientDataProvider
|
||||
{
|
||||
public class Plugin
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OwnChar.Server\OwnChar.Server.csproj" />
|
||||
<ProjectReference Include="..\OwnChar\OwnChar\OwnChar.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace OwnChar.Server.Data.ServerDataProvider
|
||||
{
|
||||
public class Plugin
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,12 +5,6 @@ VisualStudioVersion = 17.9.34714.143
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OwnChar.Server", "OwnChar.Server\OwnChar.Server.csproj", "{9EEFF2B5-270E-4DB4-8ED8-DEDDCDF0035C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OwnChar.Data.ClientDataProvider", "OwnChar.Data.ClientDataProvider\OwnChar.Data.ClientDataProvider.csproj", "{B5F6CB0B-1624-4C98-BB7C-FB762EA07257}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OwnChar.Server.Data.ServerDataProvider", "OwnChar.Server.Data.ServerDataProvider\OwnChar.Server.Data.ServerDataProvider.csproj", "{DE1EFB56-A657-4B90-9E88-721516D3F9A5}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataProvider", "DataProvider", "{5B7E538D-2487-49D5-BFD9-EBD9CD6C07F4}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OwnChar", "OwnChar\OwnChar\OwnChar.csproj", "{BAD88A97-650D-493B-BAC3-3510B6F354B6}"
|
||||
EndProject
|
||||
Global
|
||||
@@ -23,14 +17,6 @@ Global
|
||||
{9EEFF2B5-270E-4DB4-8ED8-DEDDCDF0035C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9EEFF2B5-270E-4DB4-8ED8-DEDDCDF0035C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9EEFF2B5-270E-4DB4-8ED8-DEDDCDF0035C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B5F6CB0B-1624-4C98-BB7C-FB762EA07257}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B5F6CB0B-1624-4C98-BB7C-FB762EA07257}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B5F6CB0B-1624-4C98-BB7C-FB762EA07257}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B5F6CB0B-1624-4C98-BB7C-FB762EA07257}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DE1EFB56-A657-4B90-9E88-721516D3F9A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DE1EFB56-A657-4B90-9E88-721516D3F9A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DE1EFB56-A657-4B90-9E88-721516D3F9A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DE1EFB56-A657-4B90-9E88-721516D3F9A5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{BAD88A97-650D-493B-BAC3-3510B6F354B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BAD88A97-650D-493B-BAC3-3510B6F354B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BAD88A97-650D-493B-BAC3-3510B6F354B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
@@ -39,10 +25,6 @@ Global
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{B5F6CB0B-1624-4C98-BB7C-FB762EA07257} = {5B7E538D-2487-49D5-BFD9-EBD9CD6C07F4}
|
||||
{DE1EFB56-A657-4B90-9E88-721516D3F9A5} = {5B7E538D-2487-49D5-BFD9-EBD9CD6C07F4}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {D0794B9A-6A8C-469B-AADA-B8932F72E62C}
|
||||
EndGlobalSection
|
||||
|
||||
17
OwnChar.Server/Commands/CmdSave.cs
Normal file
17
OwnChar.Server/Commands/CmdSave.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Pilz.Plugins.Advanced;
|
||||
|
||||
namespace OwnChar.Server.Commands
|
||||
{
|
||||
public class CmdSave() : PluginFunction(IServerCommand.FeatureCode, "ownchar.save"), IPluginFeatureProvider<CmdSave>, IServerCommand
|
||||
{
|
||||
public static CmdSave Instance { get; } = new();
|
||||
|
||||
public string Command => "save";
|
||||
public string Description => "Saves the current state to disk.";
|
||||
|
||||
protected override object? ExecuteFunction(PluginFunctionParameter? @params)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
15
OwnChar.Server/Commands/IServerCommand.cs
Normal file
15
OwnChar.Server/Commands/IServerCommand.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Pilz.Plugins.Advanced;
|
||||
|
||||
namespace OwnChar.Server.Commands
|
||||
{
|
||||
public interface IServerCommand
|
||||
{
|
||||
// Shared
|
||||
public const string FeatureCode = "ownchar.server.command";
|
||||
public IEnumerable<IServerCommand> Commands => PluginFeatureController.Instance.Features.Get(FeatureCode).Cast<PluginFunction>().Select(f => (IServerCommand)f.Execute()!);
|
||||
|
||||
// Interface
|
||||
public string Command { get; }
|
||||
public string Description { get; }
|
||||
}
|
||||
}
|
||||
17
OwnChar.Server/Data/ClientServerDataProvider.cs
Normal file
17
OwnChar.Server/Data/ClientServerDataProvider.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Pilz.Plugins.Advanced;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OwnChar.Server.Data
|
||||
{
|
||||
public class ClientServerDataProvider() : PluginFunction(IServerDataProvider.FeatureCode, "ownchar.clientserver"), IServerDataProvider
|
||||
{
|
||||
protected override object? ExecuteFunction(PluginFunctionParameter? @params)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Pilz.Plugins.Advanced;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -8,5 +9,11 @@ namespace OwnChar.Server.Data
|
||||
{
|
||||
public interface IServerDataProvider
|
||||
{
|
||||
// Shared
|
||||
public const string FeatureCode = "ownchar.server.dataprovider";
|
||||
public IEnumerable<IServerDataProvider> DataProviders => PluginFeatureController.Instance.Features.Get(FeatureCode).Cast<PluginFunction>().Select(f => (IServerDataProvider)f.Execute()!);
|
||||
|
||||
// Interface
|
||||
// ...
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OwnChar.Data.ClientDataProvider
|
||||
namespace OwnChar.Server.Network
|
||||
{
|
||||
public class DataProvider : ILocalDataProvider
|
||||
public class NetworkHandler
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,9 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OwnChar.Server.Data.ServerDataProvider
|
||||
namespace OwnChar.Server.Network
|
||||
{
|
||||
public class DataProvider : IServerDataProvider
|
||||
public class NetworkManager
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,4 @@
|
||||
<PackageReference Include="Pilz.Plugins.Advanced" Version="2.7.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Network\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user