first commit

This commit is contained in:
2025-07-06 00:23:46 +02:00
commit 38f50c8819
1788 changed files with 112878 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using NitroxModel.DataStructures.GameLogic;
using NitroxServer.ConsoleCommands.Abstract;
namespace NitroxServer.ConsoleCommands
{
internal class DirectoryCommand : Command
{
public override IEnumerable<string> Aliases { get; } = new[] { "dir" };
public DirectoryCommand() : base("directory", Perms.CONSOLE, "Opens the current directory of the server")
{
}
protected override void Execute(CallArgs args)
{
string path = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location);
if (!Directory.Exists(path))
{
Log.ErrorSensitive("Unable to open Nitrox directory {path} because it does not exist", path);
return;
}
Log.InfoSensitive("Opening directory {path}", path);
Process.Start(new ProcessStartInfo(path) { UseShellExecute = true, Verb = "open" })?.Dispose();
}
}
}