Skip to content

Commit

Permalink
refactor: update for local testing
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-is-cute committed Jun 1, 2024
1 parent 2ce17c6 commit 79089c0
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 38 deletions.
4 changes: 2 additions & 2 deletions DownloadTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
namespace Heliosphere;

internal class DownloadTask : IDisposable {
#if DEBUG
internal const string ApiBase = "http://192.168.174.222:42011";
#if LOCAL
internal const string ApiBase = "http://192.168.174.246:42011";
#else
internal const string ApiBase = "https://heliosphere.app/api";
#endif
Expand Down
10 changes: 6 additions & 4 deletions Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ namespace Heliosphere;
#pragma warning disable EXTEXP0001

public class Plugin : IDalamudPlugin {
internal static readonly string Name = "Heliosphere";
internal static readonly string InternalName = "heliosphere-plugin";
internal const string Name = "Heliosphere";
internal const string InternalName = "heliosphere-plugin";
internal static string? Version => typeof(Plugin).Assembly.GetName().Version?.ToString(3);
private static readonly ProductInfoHeaderValue UserAgent = new(InternalName, Version);

internal static HttpClient Client { get; }
internal static ResiliencePipeline Resilience = new ResiliencePipelineBuilder()
internal static readonly ResiliencePipeline Resilience = new ResiliencePipelineBuilder()
.AddRetry(new RetryStrategyOptions {
BackoffType = DelayBackoffType.Linear,
Delay = TimeSpan.FromSeconds(1),
Expand Down Expand Up @@ -96,11 +96,13 @@ public class Plugin : IDalamudPlugin {
private Stopwatch LimitTimer { get; } = Stopwatch.StartNew();

internal bool IntegrityFailed { get; private set; }

internal ICache<string, IDalamudTextureWrap?> CoverImages { get; } = new ConcurrentLruBuilder<string, IDalamudTextureWrap?>()
.WithConcurrencyLevel(1)
.WithCapacity(30)
.WithExpireAfterAccess(TimeSpan.FromMinutes(15))
.Build();

internal bool TracingEnabled { get; set; }

static Plugin() {
Expand Down Expand Up @@ -151,7 +153,7 @@ public Plugin() {
o.Release = $"plugin@{version}";
}
#if DEBUG
#if DEBUG || LOCAL
o.Environment = "development";
#else
o.Environment = "production";
Expand Down
4 changes: 2 additions & 2 deletions Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ await this.Plugin.AddDownloadAsync(new DownloadTask {
}

resp.StatusCode = statusCode;
#if DEBUG
resp.AddHeader("Access-Control-Allow-Origin", "http://192.168.174.222:5173");
#if LOCAL
resp.AddHeader("Access-Control-Allow-Origin", "https://192.168.174.246");
#else
resp.AddHeader("Access-Control-Allow-Origin", "https://heliosphere.app");
#endif
Expand Down
65 changes: 35 additions & 30 deletions heliosphere-plugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,35 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BitFaster.Caching" Version="2.5.0" />
<PackageReference Include="Blake3" Version="1.1.0" />
<PackageReference Include="DalamudPackager" Version="2.1.12" />
<PackageReference Include="DequeNet" Version="1.0.2" />
<PackageReference Include="BitFaster.Caching" Version="2.5.0"/>
<PackageReference Include="Blake3" Version="1.1.0"/>
<PackageReference Include="DalamudPackager" Version="2.1.12"/>
<PackageReference Include="DequeNet" Version="1.0.2"/>
<PackageReference Include="Fody" Version="6.8.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="gfoidl.Base64" Version="2.0.0" />
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="Konscious.Security.Cryptography.Argon2" Version="1.3.0" />
<PackageReference Include="Markdig" Version="0.37.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.5.0" />
<PackageReference Include="gfoidl.Base64" Version="2.0.0"/>
<PackageReference Include="Humanizer.Core" Version="2.14.1"/>
<PackageReference Include="Konscious.Security.Cryptography.Argon2" Version="1.3.0"/>
<PackageReference Include="Markdig" Version="0.37.0"/>
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0"/>
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0"/>
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.5.0"/>
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Penumbra.Api" Version="5.0.0" />
<PackageReference Include="Penumbra.Api" Version="5.0.0"/>
<PackageReference Include="Resourcer.Fody" Version="1.8.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Semver" Version="2.3.0" />
<PackageReference Include="Sentry" Version="4.7.0" />
<PackageReference Include="SimpleBase" Version="4.0.0" />
<PackageReference Include="StrawberryShake.Server" Version="13.9.5" />
<PackageReference Include="StrawberryShake.Transport.Http" Version="13.9.5" />
<PackageReference Include="WebPDotNet" Version="1.2.0.20210418" />
<PackageReference Include="ZstdSharp.Port" Version="0.8.1" />
<PackageReference Include="Semver" Version="2.3.0"/>
<PackageReference Include="Sentry" Version="4.7.0"/>
<PackageReference Include="SimpleBase" Version="4.0.0"/>
<PackageReference Include="StrawberryShake.Server" Version="13.9.5"/>
<PackageReference Include="StrawberryShake.Transport.Http" Version="13.9.5"/>
<PackageReference Include="WebPDotNet" Version="1.2.0.20210418"/>
<PackageReference Include="ZstdSharp.Port" Version="0.8.1"/>
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Release' and '$(IsCI)' == 'true' and '$(DisableSentry)' != 'true'">
Expand All @@ -92,17 +92,22 @@
<SentryUploadSources>true</SentryUploadSources>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' and '$(IsCI)' != 'true' ">
<Optimize Condition=" '$(Optimize)' == '' ">true</Optimize>
<DefineConstants>LOCAL</DefineConstants>
</PropertyGroup>

<ItemGroup>
<EmbeddedResource Include="Resources/check.png" />
<EmbeddedResource Include="Resources/clock.png" />
<EmbeddedResource Include="Resources/cloud-arrow-down.png" />
<EmbeddedResource Include="Resources/file-plus.png" />
<EmbeddedResource Include="Resources/hard-drives.png" />
<EmbeddedResource Include="Resources/magnifying-glass.png" />
<EmbeddedResource Include="Resources/package.png" />
<EmbeddedResource Include="Resources/prohibit-inset.png" />
<EmbeddedResource Include="Resources/trash-simple.png" />
<EmbeddedResource Include="Resources/warning.png" />
<EmbeddedResource Include="Resources/check.png"/>
<EmbeddedResource Include="Resources/clock.png"/>
<EmbeddedResource Include="Resources/cloud-arrow-down.png"/>
<EmbeddedResource Include="Resources/file-plus.png"/>
<EmbeddedResource Include="Resources/hard-drives.png"/>
<EmbeddedResource Include="Resources/magnifying-glass.png"/>
<EmbeddedResource Include="Resources/package.png"/>
<EmbeddedResource Include="Resources/prohibit-inset.png"/>
<EmbeddedResource Include="Resources/trash-simple.png"/>
<EmbeddedResource Include="Resources/warning.png"/>
</ItemGroup>

</Project>

0 comments on commit 79089c0

Please sign in to comment.