- tweak: fix resolving think
This commit is contained in:
@@ -1,14 +1,57 @@
|
||||
using Nebula.Shared;
|
||||
using Nebula.Shared.Models;
|
||||
using Nebula.Shared.Services;
|
||||
using Nebula.Shared.Utils;
|
||||
using Robust.LoaderApi;
|
||||
|
||||
namespace Nebula.Runner;
|
||||
|
||||
[ServiceRegister]
|
||||
public class App(DebugService debugService)
|
||||
public sealed class App(DebugService debugService, RunnerService runnerService, ContentService contentService) : IRedialApi
|
||||
{
|
||||
|
||||
public void Run(string[] args)
|
||||
public async Task Run(string[] args1)
|
||||
{
|
||||
debugService.Log("HELLO!!! " + string.Join(" ",args));
|
||||
debugService.Log("HELLO!!! ");
|
||||
|
||||
var login = Environment.GetEnvironmentVariable("AUTH_LOGIN") ?? "Alexandra";
|
||||
var urlraw = Environment.GetEnvironmentVariable("GAME_URL") ?? "ss14://localhost";
|
||||
|
||||
var url = urlraw.ToRobustUrl();
|
||||
|
||||
using var cancelTokenSource = new CancellationTokenSource();
|
||||
var buildInfo = await contentService.GetBuildInfo(url, cancelTokenSource.Token);
|
||||
|
||||
|
||||
var args = new List<string>
|
||||
{
|
||||
// Pass username to launched client.
|
||||
// We don't load username from client_config.toml when launched via launcher.
|
||||
"--username", login,
|
||||
|
||||
// Tell game we are launcher
|
||||
"--cvar", "launch.launcher=true"
|
||||
};
|
||||
|
||||
var connectionString = url.ToString();
|
||||
if (!string.IsNullOrEmpty(buildInfo.BuildInfo.ConnectAddress))
|
||||
connectionString = buildInfo.BuildInfo.ConnectAddress;
|
||||
|
||||
// We are using the launcher. Don't show main menu etc..
|
||||
// Note: --launcher also implied --connect.
|
||||
// For this reason, content bundles do not set --launcher.
|
||||
args.Add("--launcher");
|
||||
|
||||
args.Add("--connect-address");
|
||||
args.Add(connectionString);
|
||||
|
||||
args.Add("--ss14-address");
|
||||
args.Add(url.ToString());
|
||||
|
||||
await runnerService.Run(args.ToArray(), buildInfo, this, cancelTokenSource.Token);
|
||||
}
|
||||
|
||||
public void Redial(Uri uri, string text = "")
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
@@ -12,6 +13,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
|
||||
<PackageReference Include="SharpZstd.Interop" Version="1.5.5-beta1"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Reflection;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Nebula.Shared;
|
||||
|
||||
@@ -11,6 +12,7 @@ public static class Program
|
||||
services.AddServices();
|
||||
|
||||
var serviceProvider = services.BuildServiceProvider();
|
||||
serviceProvider.GetService<App>()!.Run(args);
|
||||
var task = serviceProvider.GetService<App>()!.Run(args);
|
||||
task.Wait();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user