chore: initialize standalone UPM package
Publish UPM package / publish (push) Failing after 1s

This commit is contained in:
2026-08-26 02:50:36 +08:00
commit b9011b9e65
26 changed files with 551 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
#nullable enable
using System;
using System.Linq;
using Cysharp.Threading.Tasks;
using ShrinkApp;
namespace ShrinkNetwork.Integration.App
{
[ShrinkAppModuleInstaller]
[Obsolete("ClassicHost compatibility only. ContextLoader projects should use ShrinkNetworkAppComponent from a composition root.")]
public sealed class ShrinkNetworkAppInstaller : IShrinkAppModuleInstaller
{
public string ModuleId => "shrink.network";
public int Order => -1400;
public System.Collections.Generic.IReadOnlyList<string> DependsOn => Array.Empty<string>();
public void RegisterServices(ShrinkAppContext context)
{
context.Services.Register(new ShrinkNetworkAppService(ShrinkNetworkRuntime.Default));
}
public UniTask InitializeAsync(ShrinkAppContext context)
{
return UniTask.CompletedTask;
}
}
public sealed class ShrinkNetworkAppService
{
public ShrinkNetworkAppService(ShrinkNetworkService service)
{
Service = service ?? throw new ArgumentNullException(nameof(service));
}
public ShrinkNetworkService Service { get; }
public ShrinkNetworkServiceDiagnosticsSnapshot GetDiagnosticsSnapshot()
=> Service.GetDiagnosticsSnapshot();
public System.Collections.Generic.IReadOnlyList<string> GetSessionSummaries()
{
return Service.Sessions.Values
.OrderBy(session => session.SessionId)
.Select(session => $"session={session.SessionId}, remote={session.RemoteAddress}, peer={session.PeerKind}")
.ToArray();
}
}
}