Skip to content

Commit

Permalink
Merge pull request #52 from OsuSync/deliay/wip/lazer-pp-calc
Browse files Browse the repository at this point in the history
Lazer Pp Calculator
  • Loading branch information
Deliay authored Jul 26, 2020
2 parents adc3dfc + 411c9cd commit 2b07836
Show file tree
Hide file tree
Showing 46 changed files with 573 additions and 341 deletions.
14 changes: 14 additions & 0 deletions EmberTools.sln
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "osu", "osu", "{9AECDFA1-D8A
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "osu", "osu", "{9D36F2F2-FD54-4E5F-9C56-C478ADB3F288}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PpCalculator", "src\plugins\osu\PpCalculator\PpCalculator.csproj", "{1C20F8C2-30D7-4F7C-9DD2-4DF0C88970ED}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EmberMemoryReader.Abstract", "src\plugins\osu\EmberMemoryReader.Abstract\EmberMemoryReader.Abstract.csproj", "{91E9252C-FFBB-498A-83E3-BAB9D0C8D485}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -101,6 +105,14 @@ Global
{2A3B9BD0-A7B4-4CF2-8725-448606D2C0E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A3B9BD0-A7B4-4CF2-8725-448606D2C0E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A3B9BD0-A7B4-4CF2-8725-448606D2C0E7}.Release|Any CPU.Build.0 = Release|Any CPU
{1C20F8C2-30D7-4F7C-9DD2-4DF0C88970ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C20F8C2-30D7-4F7C-9DD2-4DF0C88970ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C20F8C2-30D7-4F7C-9DD2-4DF0C88970ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1C20F8C2-30D7-4F7C-9DD2-4DF0C88970ED}.Release|Any CPU.Build.0 = Release|Any CPU
{91E9252C-FFBB-498A-83E3-BAB9D0C8D485}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91E9252C-FFBB-498A-83E3-BAB9D0C8D485}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91E9252C-FFBB-498A-83E3-BAB9D0C8D485}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91E9252C-FFBB-498A-83E3-BAB9D0C8D485}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -119,6 +131,8 @@ Global
{2A3B9BD0-A7B4-4CF2-8725-448606D2C0E7} = {9AECDFA1-D8A9-4189-A390-625ADB7D06E8}
{9AECDFA1-D8A9-4189-A390-625ADB7D06E8} = {B93D5B77-B8CA-4B7A-B5BE-ABD27EB57D27}
{9D36F2F2-FD54-4E5F-9C56-C478ADB3F288} = {239B3BE6-770D-4BAD-AA11-FD91A2D62D02}
{1C20F8C2-30D7-4F7C-9DD2-4DF0C88970ED} = {9AECDFA1-D8A9-4189-A390-625ADB7D06E8}
{91E9252C-FFBB-498A-83E3-BAB9D0C8D485} = {9AECDFA1-D8A9-4189-A390-625ADB7D06E8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {57B800AC-CFE3-4081-8EC4-9BD1C74869B0}
Expand Down
43 changes: 19 additions & 24 deletions src/EmberKernel/EmberKernel.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>8.0</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="5.2.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.1.5" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
</ItemGroup>

<ItemGroup>
<Folder Include="Services\Statistic\Pattern\Lexical\" />
<Folder Include="Services\Statistic\Pattern\Parser\" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>8.0</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="5.2.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.1.5" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
</ItemGroup>

</Project>
24 changes: 19 additions & 5 deletions src/plugins/ExamplePlugin/EventHandlers/MemoryReaderHandler.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using EmberKernel.Services.Configuration;
using EmberKernel.Services.EventBus.Handlers;
using EmberMemoryReader.Abstract.Data;
using ExamplePlugin.Models;
using ExamplePlugin.Models.EventSubscription;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace ExamplePlugin.EventHandlers
Expand All @@ -14,7 +11,9 @@ public class MemoryReaderHandler :
IEventHandler<GameStatusInfo>,
IEventHandler<BeatmapInfo>,
IEventHandler<PlayingInfo>,
IEventHandler<MultiplayerBeatmapIdInfo>
IEventHandler<MultiplayerBeatmapIdInfo>,
IEventHandler<GameModeInfo>,
IEventHandler<GlobalGameModeratorInfo>
{
private readonly ILogger<MemoryReaderHandler> _logger;
private readonly IPluginOptions<MyPlugin, MyPluginConfiguration> _pluginOptions;
Expand Down Expand Up @@ -73,5 +72,20 @@ public ValueTask Handle(MultiplayerBeatmapIdInfo @event)
}
return default;
}

public ValueTask Handle(GameModeInfo @event)
{
if (@event.HasValue)
{
_logger.LogInformation($"[Event] Current GameMode = {@event.Mode}");
}
return default;
}

public ValueTask Handle(GlobalGameModeratorInfo @event)
{
_logger.LogInformation($"[Event] Current Moderator = {@event.GlobalRawModerator}");
return default;
}
}
}
1 change: 1 addition & 0 deletions src/plugins/ExamplePlugin/ExamplePlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
</ProjectReference>
<ProjectReference Include="..\osu\EmberMemoryReader.Abstract\EmberMemoryReader.Abstract.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
17 changes: 0 additions & 17 deletions src/plugins/ExamplePlugin/Models/EventSubscription/BeatmapInfo.cs

This file was deleted.

This file was deleted.

This file was deleted.

59 changes: 0 additions & 59 deletions src/plugins/ExamplePlugin/Models/EventSubscription/PlayingInfo.cs

This file was deleted.

118 changes: 58 additions & 60 deletions src/plugins/ExamplePlugin/MyPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,60 +1,58 @@
using Autofac;
using EmberKernel.Services.Command;
using EmberKernel.Services.Command.Attributes;
using EmberKernel.Services.Command.Components;
using EmberKernel;
using EmberKernel.Plugins;
using EmberKernel.Plugins.Attributes;
using EmberKernel.Plugins.Components;
using ExamplePlugin.Commands;
using ExamplePlugin.Components;
using ExamplePlugin.EventHandlers;
using Microsoft.Extensions.Logging;
using System;
using System.Threading;
using System.Threading.Tasks;
using ExamplePlugin.Models.EventSubscription;
using ExamplePlugin.Models;
using EmberKernel.Services.UI.Mvvm.ViewModel.Configuration.Extension;

namespace ExamplePlugin
{

[EmberPlugin(Author = "ZeroAsh", Name = "ExamplePlugin", Version = "1.0")]
public class MyPlugin : Plugin
{
public override ValueTask Initialize(ILifetimeScope scope)
{
scope.UseCommandContainer<MyCommandComponent>();
scope.Subscription<ExamplePluginPublishEvent, ExamplePluginPublishEventHandler>();
scope.Subscription<GameStatusInfo, MemoryReaderHandler>();
scope.Subscription<BeatmapInfo, MemoryReaderHandler>();
scope.Subscription<PlayingInfo, MemoryReaderHandler>();
scope.Subscription<MultiplayerBeatmapIdInfo, MemoryReaderHandler>();
scope.RegisterUIModel<MyPlugin, MyPluginConfiguration>();
return default;
}

public override ValueTask Uninitialize(ILifetimeScope scope)
{
scope.RemoveCommandContainer<MyCommandComponent>();
scope.Unsubscription<ExamplePluginPublishEvent, ExamplePluginPublishEventHandler>();
scope.Unsubscription<GameStatusInfo, MemoryReaderHandler>();
scope.Unsubscription<BeatmapInfo, MemoryReaderHandler>();
scope.Unsubscription<PlayingInfo, MemoryReaderHandler>();
scope.Unsubscription<MultiplayerBeatmapIdInfo, MemoryReaderHandler>();
scope.UnregisterUIModel<MyPlugin, MyPluginConfiguration>();
return default;
}

public override void BuildComponents(IComponentBuilder builder)
{
builder.UsePluginOptionsModel<MyPlugin, MyPluginConfiguration>();
builder.ConfigureUIModel<MyPlugin, MyPluginConfiguration>();
builder.ConfigureCommandContainer<MyCommandComponent>();
builder.ConfigureStaticEventHandler<MemoryReaderHandler>();
builder.ConfigureEventHandler<ExamplePluginPublishEvent, ExamplePluginPublishEventHandler>();
}

}
}
using Autofac;
using EmberKernel;
using EmberKernel.Plugins;
using EmberKernel.Plugins.Attributes;
using EmberKernel.Plugins.Components;
using EmberKernel.Services.UI.Mvvm.ViewModel.Configuration.Extension;
using EmberMemoryReader.Abstract.Data;
using ExamplePlugin.Components;
using ExamplePlugin.EventHandlers;
using ExamplePlugin.Models;
using ExamplePlugin.Models.EventSubscription;
using System.Threading.Tasks;

namespace ExamplePlugin
{

[EmberPlugin(Author = "ZeroAsh", Name = "ExamplePlugin", Version = "1.0")]
public class MyPlugin : Plugin
{
public override ValueTask Initialize(ILifetimeScope scope)
{
scope.UseCommandContainer<MyCommandComponent>();
scope.Subscription<ExamplePluginPublishEvent, ExamplePluginPublishEventHandler>();
scope.Subscription<GameStatusInfo, MemoryReaderHandler>();
scope.Subscription<BeatmapInfo, MemoryReaderHandler>();
scope.Subscription<PlayingInfo, MemoryReaderHandler>();
scope.Subscription<MultiplayerBeatmapIdInfo, MemoryReaderHandler>();
scope.Subscription<GameModeInfo, MemoryReaderHandler>();
scope.Subscription<GlobalGameModeratorInfo, MemoryReaderHandler>();
scope.RegisterUIModel<MyPlugin, MyPluginConfiguration>();
return default;
}

public override ValueTask Uninitialize(ILifetimeScope scope)
{
scope.RemoveCommandContainer<MyCommandComponent>();
scope.Unsubscription<ExamplePluginPublishEvent, ExamplePluginPublishEventHandler>();
scope.Unsubscription<GameStatusInfo, MemoryReaderHandler>();
scope.Unsubscription<BeatmapInfo, MemoryReaderHandler>();
scope.Unsubscription<PlayingInfo, MemoryReaderHandler>();
scope.Unsubscription<MultiplayerBeatmapIdInfo, MemoryReaderHandler>();
scope.Unsubscription<GameModeInfo, MemoryReaderHandler>();
scope.Unsubscription<GlobalGameModeratorInfo, MemoryReaderHandler>();
scope.UnregisterUIModel<MyPlugin, MyPluginConfiguration>();
return default;
}

public override void BuildComponents(IComponentBuilder builder)
{
builder.UsePluginOptionsModel<MyPlugin, MyPluginConfiguration>();
builder.ConfigureUIModel<MyPlugin, MyPluginConfiguration>();
builder.ConfigureCommandContainer<MyCommandComponent>();
builder.ConfigureStaticEventHandler<MemoryReaderHandler>();
builder.ConfigureEventHandler<ExamplePluginPublishEvent, ExamplePluginPublishEventHandler>();
}

}
}
1 change: 1 addition & 0 deletions src/plugins/osu/BeatmapDownloader/BeatmapDownloader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
</ProjectReference>
<ProjectReference Include="..\BeatmapDownloader.Abstract\BeatmapDownloader.Abstract.csproj" />
<ProjectReference Include="..\BeatmapDownloader.Database\BeatmapDownloader.Database.csproj" />
<ProjectReference Include="..\EmberMemoryReader.Abstract\EmberMemoryReader.Abstract.csproj" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/osu/BeatmapDownloader/BeatmapDownloaderPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
using BeatmapDownloader.Abstract.Services.DownloadProvider;
using BeatmapDownloader.Database.Database;
using BeatmapDownloader.Extension;
using BeatmapDownloader.Models;
using BeatmapDownloader.Services;
using EmberKernel;
using EmberKernel.Plugins;
using EmberKernel.Plugins.Attributes;
using EmberKernel.Plugins.Components;
using EmberMemoryReader.Abstract.Data;
using EmberMemoryReader.Abstract.Events;
using OsuSqliteDatabase.Database;
using System.Threading.Tasks;

Expand Down

This file was deleted.

Loading

0 comments on commit 2b07836

Please sign in to comment.