Skip to content

Commit

Permalink
Added message for newest version upon server start
Browse files Browse the repository at this point in the history
  • Loading branch information
dartasen committed Dec 26, 2022
1 parent 2286395 commit 156ba80
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions NitroxModel/Helper/NitroxUser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public static string GamePath
string path = GameInstallationFinder.Instance.FindGame(errors);
if (!string.IsNullOrWhiteSpace(path) && Directory.Exists(path))
{
GamePlatform = GamePlatforms.GetPlatformByGameDir(path);
return gamePath = path;
}

Expand Down
13 changes: 13 additions & 0 deletions NitroxServer-Subnautica/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ private static async Task StartServer(string[] args)
});
}

if (NitroxUser.IsNewestSubnautica.GetValueOrDefault(false))
{
Log.Error("Due to Subnautica's recent update \"Living Large\", Nitrox is currently not compatible. However you can still use older version of Subnautica in order to play Nitrox. You can do so by following these steps");

if (NitroxUser.GamePlatform?.Platform == Platform.STEAM)
{
Log.Warn("ENSURE NITROX AND SUBNAUTICA ARE CLOSED BEFORE PROCEEDING!");
Log.Warn("Changing Subnautica to Legacy Build on STEAM:\n1. Right click Subnautica in Steam\n2. Click Properties\n3. Click Betas\n4. Select Legacy - Public legacy builds\n5. Close it out and let Steam download and install the Legacy version of Subnautica\n6. Run Subnautica through Steam (It will say \"Subnautica [legacy]\" in your library if you did it right)\n7. Launch Subnautica through Nitrox to play.");
}

throw new Exception("Unable to start server, Nitrox isn't compatible with this Subnautica version");
}

NitroxServiceLocator.InitializeDependencyContainer(new SubnauticaServerAutoFacRegistrar());
NitroxServiceLocator.BeginNewLifetimeScope();

Expand Down
4 changes: 2 additions & 2 deletions NitroxServer/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ public Server(WorldPersistence worldPersistence, World world, ServerConfig serve

public string GetSaveSummary(Perms viewerPerms = Perms.CONSOLE)
{
// TODO: Extend summary with more useful save file data
// Note for later additions: order these lines by their length
StringBuilder builder = new("\n");

if (viewerPerms is Perms.CONSOLE)
{
builder.AppendLine($" - Save location: {Path.GetFullPath(serverConfig.SaveName)}");
}

builder.AppendLine($" - Aurora's state: {world.EventTriggerer.GetAuroraStateSummary()}");
builder.AppendLine($" - Current time: day {world.EventTriggerer.Day} ({Math.Floor(world.EventTriggerer.ElapsedSeconds)}s)");
builder.AppendLine($" - Scheduled goals stored: {world.GameData.StoryGoals.ScheduledGoals.Count}");
Expand Down

0 comments on commit 156ba80

Please sign in to comment.