mirror of
https://gitlab.acidiclight.dev/sociallydistant/sociallydistant.git
synced 2025-01-22 09:31:47 -05:00
Add support for checking sdsh scripts during build with an MSBuild task
This commit is contained in:
parent
ad83b00da5
commit
77570ed25b
88 changed files with 305 additions and 191 deletions
101
src/SociallyDistant.Framework/BuildTasks/SdshScriptCheckTask.cs
Normal file
101
src/SociallyDistant.Framework/BuildTasks/SdshScriptCheckTask.cs
Normal file
|
@ -0,0 +1,101 @@
|
|||
using Microsoft.Build.Framework;
|
||||
using Microsoft.Build.Utilities;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
|
||||
namespace SociallyDistant.Core.BuildTasks;
|
||||
|
||||
public class SdshScriptCheckTask : Microsoft.Build.Utilities.Task
|
||||
{
|
||||
[Required]
|
||||
public string ScriptsSource { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string ScriptsOutput { get; set; } = string.Empty;
|
||||
|
||||
[Output]
|
||||
public ITaskItem[] Results { get; set; }
|
||||
|
||||
public override bool Execute()
|
||||
{
|
||||
var collectedScripts = new List<string>();
|
||||
var results = new List<ITaskItem>();
|
||||
var result = true;
|
||||
|
||||
foreach (string shFile in Directory.EnumerateFiles(ScriptsSource, "*.sh", SearchOption.AllDirectories))
|
||||
{
|
||||
var parseResult = CheckScriptSyntax(shFile);
|
||||
result &= parseResult;
|
||||
|
||||
results.Add(new TaskItem(shFile, new Dictionary<string, string> { { "IsValid", parseResult.ToString() } }));
|
||||
|
||||
collectedScripts.Add(shFile.Substring(ScriptsSource.Length));
|
||||
}
|
||||
|
||||
Results = results.ToArray();
|
||||
|
||||
if (!result)
|
||||
{
|
||||
this.Log.LogError("Some sdsh scripts failed to parse.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Directory.Exists(ScriptsOutput))
|
||||
Directory.CreateDirectory(ScriptsOutput);
|
||||
|
||||
Log.LogMessage("Cleaning the script output directory...");
|
||||
foreach (string shFile in Directory.EnumerateFiles(ScriptsOutput, "*.sh", SearchOption.AllDirectories))
|
||||
{
|
||||
string relative = shFile.Substring(ScriptsOutput.Length);
|
||||
if (collectedScripts.Contains(relative))
|
||||
continue;
|
||||
|
||||
Log.LogMessage($"Deleting: {shFile}");
|
||||
File.Delete(shFile);
|
||||
}
|
||||
|
||||
foreach (string relative in collectedScripts)
|
||||
{
|
||||
string source = ScriptsSource + relative;
|
||||
string destination = ScriptsOutput + relative;
|
||||
|
||||
string? outputDirectory = Path.GetDirectoryName(destination);
|
||||
|
||||
if (string.IsNullOrEmpty(outputDirectory))
|
||||
continue;
|
||||
|
||||
if (!Directory.Exists(outputDirectory))
|
||||
{
|
||||
Log.LogMessage($"creating: {outputDirectory}");
|
||||
Directory.CreateDirectory(outputDirectory);
|
||||
}
|
||||
|
||||
Log.LogMessage($"Copying: {source} -> {destination}");
|
||||
File.Copy(source, destination);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool CheckScriptSyntax(string path)
|
||||
{
|
||||
using var stream = File.OpenRead(path);
|
||||
using var streamReader = new StreamReader(stream);
|
||||
|
||||
var text = streamReader.ReadToEnd();
|
||||
|
||||
var context = new UserScriptExecutionContext();
|
||||
var parser = new InteractiveShell(context);
|
||||
|
||||
try
|
||||
{
|
||||
parser.ParseScript(text).GetAwaiter().GetResult();
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.LogError($"{path}: parse error: {ex}");
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
#nullable enable
|
||||
|
||||
namespace SociallyDistant.Architecture
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public class ArrayView<TElementType>
|
||||
{
|
|
@ -1,5 +1,5 @@
|
|||
#nullable enable
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public static class CommonScriptHooks
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Consoles
|
||||
namespace SociallyDistant.Core.Core.Scripting.Consoles
|
||||
{
|
||||
public class FileOutputConsole :
|
||||
ITextConsole,
|
|
@ -1,7 +1,7 @@
|
|||
using System.Text;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Consoles
|
||||
namespace SociallyDistant.Core.Core.Scripting.Consoles
|
||||
{
|
||||
public class LineListConsole : ITextConsole
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Consoles
|
||||
namespace SociallyDistant.Core.Core.Scripting.Consoles
|
||||
{
|
||||
public class RedirectedConsole : ITextConsole
|
||||
{
|
|
@ -1,9 +1,9 @@
|
|||
#nullable enable
|
||||
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Modules;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.GlobalCommands
|
||||
namespace SociallyDistant.Core.Core.Scripting.GlobalCommands
|
||||
{
|
||||
public class ExecuteHookCommand : IScriptCommand
|
||||
{
|
||||
|
@ -15,7 +15,7 @@ namespace SociallyDistant.Core.Scripting.GlobalCommands
|
|||
|
||||
string hookName = args[0];
|
||||
|
||||
await SystemModule.GetSystemModule().Context.ScriptSystem.RunHookAsync(hookName);
|
||||
await Application.Instance.Context.ScriptSystem.RunHookAsync(hookName);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,9 +1,8 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Modules;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.GlobalCommands
|
||||
namespace SociallyDistant.Core.Core.Scripting.GlobalCommands
|
||||
{
|
||||
public class SaveGameCommand : IScriptCommand
|
||||
{
|
|
@ -1,9 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.GlobalCommands
|
||||
namespace SociallyDistant.Core.Core.Scripting.GlobalCommands
|
||||
{
|
||||
public class WorldFlagCommand : IScriptCommand
|
||||
{
|
||||
|
@ -15,7 +13,7 @@ namespace SociallyDistant.Core.Scripting.GlobalCommands
|
|||
worldflag get <flag> - Sets the specified world flag in the current world.
|
||||
worldflag run-if-set <flag> <command> [args...] - Runs the specified command with the given arguments if the given world flag is set.
|
||||
worldflag run-if-unset <flag> <command> [args...] - Runs the specified command with the given arguments if the given world flag isn't set.";
|
||||
internal WorldFlagCommand(IWorldManager worldManager)
|
||||
public WorldFlagCommand(IWorldManager worldManager)
|
||||
{
|
||||
this.worldManager = worldManager;
|
||||
}
|
|
@ -2,15 +2,16 @@
|
|||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.FileSystems;
|
||||
using SociallyDistant.Core.OS.Network;
|
||||
using SociallyDistant.OS.FileSystems;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public sealed class HypervisorComputer : IComputer
|
||||
{
|
||||
private readonly IUser user;
|
||||
private readonly IFileSystem hypervisorFileSystem = new HypervisorFileSystem();
|
||||
|
||||
|
||||
public bool IsPlayer => true;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name => "socially-distant";
|
||||
|
|
@ -1,9 +1,8 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.OS.FileSystems;
|
||||
using SociallyDistant.OS.FileSystems;
|
||||
using SociallyDistant.OS.FileSystems.Immutable;
|
||||
using SociallyDistant.Core.OS.FileSystems.Immutable;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public sealed class HypervisorFileSystem : IFileSystem
|
||||
{
|
|
@ -1,16 +1,16 @@
|
|||
#nullable enable
|
||||
using System.Runtime.CompilerServices;
|
||||
using SociallyDistant.Architecture;
|
||||
using SociallyDistant.Core.Core.Systems;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public sealed class HypervisorProcess : ISystemProcess
|
||||
{
|
||||
private readonly int id;
|
||||
private readonly IEnvironmentVariableProvider environment = new SimpleEnvironmentVariableProvider();
|
||||
private readonly UniqueIntGenerator idGenerator;
|
||||
|
||||
private readonly ISystemProcess? parent;
|
||||
private readonly List<ISystemProcess> children = new List<ISystemProcess>();
|
||||
private readonly IUser user;
|
|
@ -1,7 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public sealed class HypervisorUser : IUser
|
||||
{
|
|
@ -1,5 +1,5 @@
|
|||
#nullable enable
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public interface ICommandShell
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public interface ITerminalProcessController
|
||||
{
|
|
@ -1,7 +1,6 @@
|
|||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public class AssignmentInstruction : ShellInstruction
|
||||
{
|
|
@ -1,8 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public sealed class BranchEvaluator : ShellInstruction
|
||||
{
|
|
@ -1,8 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public sealed class BranchInstruction : ShellInstruction
|
||||
{
|
|
@ -1,8 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public class CommandData
|
||||
{
|
|
@ -1,8 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public sealed class CommandExpansion : IArgumentEvaluator
|
||||
{
|
|
@ -2,7 +2,7 @@
|
|||
using System.Text;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public sealed class CommandExpansionConsole : ITextConsole
|
||||
{
|
|
@ -1,8 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public sealed class EmptyShellInstruction : ShellInstruction
|
||||
{
|
|
@ -1,9 +1,8 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Core.Scripting.Parsing;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.Scripting.Parsing;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public sealed class FunctionDeclaration : ShellInstruction
|
||||
{
|
|
@ -1,10 +1,9 @@
|
|||
#nullable enable
|
||||
|
||||
using System.Text;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public interface IArgumentEvaluator
|
||||
{
|
|
@ -1,8 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public sealed class LogicalAndInstruction : ShellInstruction
|
||||
{
|
|
@ -1,8 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public sealed class LogicalOrInstruction : ShellInstruction
|
||||
{
|
|
@ -1,7 +1,6 @@
|
|||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public sealed class ParallelInstruction : ShellInstruction
|
||||
{
|
|
@ -1,8 +1,7 @@
|
|||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Core.Scripting.Consoles;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.Scripting.Consoles;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public sealed class PipeInstruction : ShellInstruction
|
||||
{
|
|
@ -1,7 +1,6 @@
|
|||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public sealed class SequentialInstruction : ShellInstruction
|
||||
{
|
|
@ -1,9 +1,8 @@
|
|||
#nullable enable
|
||||
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public abstract class ShellInstruction
|
||||
{
|
|
@ -1,9 +1,8 @@
|
|||
#nullable enable
|
||||
using System.Text.RegularExpressions;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public sealed class ShellPattern : ShellInstruction
|
||||
{
|
|
@ -1,7 +1,6 @@
|
|||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public sealed class SingleInstruction : ShellInstruction
|
||||
{
|
|
@ -1,8 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public class VariableAccessEvaluator : IArgumentEvaluator
|
||||
{
|
|
@ -1,8 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Instructions
|
||||
namespace SociallyDistant.Core.Core.Scripting.Instructions
|
||||
{
|
||||
public sealed class WhileLoop : ShellInstruction
|
||||
{
|
|
@ -3,15 +3,11 @@
|
|||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using Serilog;
|
||||
using SociallyDistant.Architecture;
|
||||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Core.Scripting.Instructions;
|
||||
using SociallyDistant.Core.Core.Scripting.Parsing;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.Scripting.Instructions;
|
||||
using SociallyDistant.Core.Scripting.Parsing;
|
||||
using SociallyDistant.GamePlatform;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public class InteractiveShell :
|
||||
ITerminalProcessController,
|
||||
|
@ -184,7 +180,7 @@ namespace SociallyDistant.Core.Scripting
|
|||
{
|
||||
try
|
||||
{
|
||||
return await scriptTree.RunAsync(this.consoleDevice ?? new UnityTextConsole(), this);
|
||||
return await scriptTree.RunAsync(this.consoleDevice ?? new HostConsole(), this);
|
||||
}
|
||||
catch (ScriptEndException endException)
|
||||
{
|
|
@ -1,14 +1,12 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Core.Scripting.Consoles;
|
||||
using SociallyDistant.Core.Modules;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.FileSystems;
|
||||
using SociallyDistant.Core.Scripting.Consoles;
|
||||
using SociallyDistant.Core.OS.FileSystems.Host;
|
||||
using SociallyDistant.Core.Shell.Commands;
|
||||
using SociallyDistant.OS.Devices;
|
||||
using SociallyDistant.OS.FileSystems.Host;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public class OperatingSystemExecutionContext : IInteractiveShellContext
|
||||
{
|
||||
|
@ -45,8 +43,7 @@ namespace SociallyDistant.Core.Scripting
|
|||
if (HandleBuiltin(name, args, console, callSite ?? this))
|
||||
return 0;
|
||||
|
||||
var sys = SystemModule.GetSystemModule();
|
||||
CustomCommandAsset? customCommand = sys.Context.ContentManager.GetContentOfType<CustomCommandAsset>()
|
||||
CustomCommandAsset? customCommand = Application.Instance.Context.ContentManager.GetContentOfType<CustomCommandAsset>()
|
||||
.FirstOrDefault(x => x.Name == name);
|
||||
|
||||
if (customCommand != null)
|
||||
|
@ -136,7 +133,7 @@ namespace SociallyDistant.Core.Scripting
|
|||
|
||||
private async Task<int?> HandleCustomCommand(CustomCommandAsset command, string name, string[] args, ITextConsole console)
|
||||
{
|
||||
if (command.IsPlayerOnly && process.User.Computer is not PlayerComputer)
|
||||
if (command.IsPlayerOnly && process.User.Computer.IsPlayer)
|
||||
return null;
|
||||
|
||||
var consoleWrapper = new ConsoleWrapper(console);
|
||||
|
@ -208,8 +205,7 @@ namespace SociallyDistant.Core.Scripting
|
|||
|
||||
private DateTime GetCurrentTime()
|
||||
{
|
||||
var system = SystemModule.GetSystemModule();
|
||||
IWorld world = system.Context.WorldManager.World;
|
||||
IWorld world = Application.Instance.Context.WorldManager.World;
|
||||
|
||||
return world.GlobalWorldState.Value.Now;
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.Tasks;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public sealed class OperatingSystemScript : IShellScript
|
||||
{
|
|
@ -1,8 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Parsing
|
||||
namespace SociallyDistant.Core.Core.Scripting.Parsing
|
||||
{
|
||||
public class LocalScriptExecutionContext : IScriptExecutionContext
|
||||
{
|
|
@ -1,9 +1,8 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Core.Scripting.Instructions;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.Scripting.Instructions;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Parsing
|
||||
namespace SociallyDistant.Core.Core.Scripting.Parsing
|
||||
{
|
||||
public class ScriptFunction : IScriptFunction
|
||||
{
|
|
@ -1,12 +1,10 @@
|
|||
#nullable enable
|
||||
|
||||
using System.Text;
|
||||
using SociallyDistant.Architecture;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Scripting.Instructions;
|
||||
using SociallyDistant.Core.Core.Scripting.Instructions;
|
||||
|
||||
// hello world
|
||||
namespace SociallyDistant.Core.Scripting.Parsing
|
||||
namespace SociallyDistant.Core.Core.Scripting.Parsing
|
||||
{
|
||||
public class ScriptParser
|
||||
{
|
|
@ -1,9 +1,8 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Core.Scripting.Instructions;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.Scripting.Instructions;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.Parsing
|
||||
namespace SociallyDistant.Core.Core.Scripting.Parsing
|
||||
{
|
||||
public class TextArgumentEvaluator : IArgumentEvaluator
|
||||
{
|
|
@ -1,5 +1,5 @@
|
|||
#nullable enable
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public abstract class ScriptCommandProvider
|
||||
{
|
|
@ -1,7 +1,5 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public class ScriptContextCommand
|
||||
{
|
|
@ -1,6 +1,6 @@
|
|||
#nullable enable
|
||||
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public sealed class ScriptEndException : Exception
|
||||
{
|
|
@ -1,12 +1,10 @@
|
|||
#nullable enable
|
||||
using System.Diagnostics;
|
||||
using Serilog;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Core.Scripting.Parsing;
|
||||
using SociallyDistant.Core.Modules;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.Scripting.Parsing;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public class ScriptExecutionContext : IScriptExecutionContext
|
||||
{
|
||||
|
@ -40,8 +38,7 @@ namespace SociallyDistant.Core.Scripting
|
|||
if (functionResult != null)
|
||||
return functionResult;
|
||||
|
||||
var system = SystemModule.GetSystemModule();
|
||||
IGameContext gameContext = system.Context;
|
||||
IGameContext gameContext = Application.Instance.Context;
|
||||
|
||||
// Search for global commands first
|
||||
IScriptCommand? globalCommand = gameContext.ScriptSystem.GetGlobalCommand(name);
|
|
@ -1,13 +1,10 @@
|
|||
#nullable enable
|
||||
|
||||
using System.Diagnostics;
|
||||
using Serilog;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Modules;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.GamePlatform;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public class ScriptSystem : IScriptSystem
|
||||
{
|
||||
|
@ -15,7 +12,7 @@ namespace SociallyDistant.Core.Scripting
|
|||
private readonly Dictionary<string, IScriptCommand> globalCommands = new Dictionary<string, IScriptCommand>();
|
||||
private readonly IGameContext game;
|
||||
|
||||
internal ScriptSystem(IGameContext game)
|
||||
public ScriptSystem(IGameContext game)
|
||||
{
|
||||
this.game = game;
|
||||
}
|
||||
|
@ -29,7 +26,7 @@ namespace SociallyDistant.Core.Scripting
|
|||
if (command == null)
|
||||
return;
|
||||
|
||||
await command.ExecuteAsync(context, console ?? new UnityTextConsole(), name, args);
|
||||
await command.ExecuteAsync(context, console ?? new HostConsole(), name, args);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public class ShellScriptAsset
|
||||
{
|
|
@ -2,7 +2,7 @@
|
|||
using System.Text.RegularExpressions;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public class ShellTester
|
||||
{
|
|
@ -1,8 +1,6 @@
|
|||
using System.Text;
|
||||
using SociallyDistant.Architecture;
|
||||
using SociallyDistant.Core.Core;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public static class ShellUtility
|
||||
{
|
|
@ -1,7 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Architecture
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public class SimpleEnvironmentVariableProvider : IEnvironmentVariableProvider
|
||||
{
|
|
@ -1,9 +1,7 @@
|
|||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Core.WorldData.Data;
|
||||
using SociallyDistant.Core.Core.WorldData.Data;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.WorldCommands
|
||||
namespace SociallyDistant.Core.Core.Scripting.WorldCommands
|
||||
{
|
||||
public class SetPlayerIspCommand : WorldCommand
|
||||
{
|
|
@ -1,8 +1,6 @@
|
|||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.WorldCommands
|
||||
namespace SociallyDistant.Core.Core.Scripting.WorldCommands
|
||||
{
|
||||
public class SpawnIspCommand : WorldCommand
|
||||
{
|
|
@ -1,20 +1,16 @@
|
|||
#nullable enable
|
||||
|
||||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Modules;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting.WorldCommands
|
||||
namespace SociallyDistant.Core.Core.Scripting.WorldCommands
|
||||
{
|
||||
public abstract class WorldCommand : IScriptCommand
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public async Task ExecuteAsync(IScriptExecutionContext context, ITextConsole console, string name, string[] args)
|
||||
{
|
||||
var systemModule = SystemModule.GetSystemModule();
|
||||
|
||||
IGameContext game = systemModule.Context;
|
||||
IGameContext game = Application.Instance.Context;
|
||||
IWorldManager worldManager = game.WorldManager;
|
||||
|
||||
await OnExecute(worldManager, context, console, name, args);
|
|
@ -1,7 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Scripting.WorldCommands;
|
||||
using SociallyDistant.Core.Core.Scripting.WorldCommands;
|
||||
|
||||
namespace SociallyDistant.Core.Scripting
|
||||
namespace SociallyDistant.Core.Core.Scripting
|
||||
{
|
||||
public sealed class WorldScriptCommandProvider : ScriptCommandProvider
|
||||
{
|
22
src/SociallyDistant.Framework/OS/Devices/HostConsole.cs
Normal file
22
src/SociallyDistant.Framework/OS/Devices/HostConsole.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
using Serilog;
|
||||
|
||||
namespace SociallyDistant.Core.OS.Devices;
|
||||
|
||||
public class HostConsole : ITextConsole
|
||||
{
|
||||
public string WindowTitle { get; set; } = string.Empty;
|
||||
public bool IsInteractive { get; } = false;
|
||||
public void ClearScreen()
|
||||
{
|
||||
}
|
||||
|
||||
public void WriteText(string text)
|
||||
{
|
||||
Log.Information(text);
|
||||
}
|
||||
|
||||
public ConsoleInputData? ReadInput()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -5,21 +5,10 @@ using SociallyDistant.Core.OS.Network;
|
|||
|
||||
namespace SociallyDistant.Core.OS.Devices
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
|
||||
public sealed class NetworkServiceAttribute : Attribute
|
||||
{
|
||||
private readonly string id;
|
||||
|
||||
public string Id => id;
|
||||
|
||||
public NetworkServiceAttribute(string id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
public interface IComputer
|
||||
{
|
||||
bool IsPlayer { get; }
|
||||
|
||||
string Name { get; }
|
||||
bool FindUserById(int id, out IUser? user);
|
||||
bool FindUserByName(string username, out IUser? user);
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
namespace SociallyDistant.Core.OS.Devices;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
|
||||
public sealed class NetworkServiceAttribute : Attribute
|
||||
{
|
||||
private readonly string id;
|
||||
|
||||
public string Id => id;
|
||||
|
||||
public NetworkServiceAttribute(string id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.OS.FileSystems.Host
|
||||
namespace SociallyDistant.Core.OS.FileSystems.Host
|
||||
{
|
||||
public class FileInputConsole :
|
||||
ITextConsole,
|
|
@ -1,9 +1,8 @@
|
|||
#nullable enable
|
||||
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.FileSystems;
|
||||
|
||||
namespace SociallyDistant.OS.FileSystems.Immutable
|
||||
namespace SociallyDistant.Core.OS.FileSystems.Immutable
|
||||
{
|
||||
public class ImmutableDirectoryEntry : IDirectoryEntry
|
||||
{
|
|
@ -1,8 +1,6 @@
|
|||
#nullable enable
|
||||
|
||||
using SociallyDistant.Core.OS.FileSystems;
|
||||
|
||||
namespace SociallyDistant.OS.FileSystems.Immutable
|
||||
namespace SociallyDistant.Core.OS.FileSystems.Immutable
|
||||
{
|
||||
public class ImmutableDirectoryTree
|
||||
{
|
|
@ -1,9 +1,8 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.FileSystems;
|
||||
|
||||
namespace SociallyDistant.OS.FileSystems
|
||||
namespace SociallyDistant.Core.OS.FileSystems
|
||||
{
|
||||
public class VirtualFileSystem : IVirtualFileSystem
|
||||
{
|
|
@ -9,6 +9,8 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Build.Framework" Version="17.10.4" />
|
||||
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.10.4" />
|
||||
<PackageReference Include="Serilog" Version="4.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
|
||||
<PackageReference Include="System.Reactive" Version="6.0.1" />
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Serilog;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Core.Systems;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.Tasks;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#nullable enable
|
||||
|
||||
using System.Collections;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Architecture
|
||||
|
|
44
src/SociallyDistant/CheckSdshScripts.targets
Normal file
44
src/SociallyDistant/CheckSdshScripts.targets
Normal file
|
@ -0,0 +1,44 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<!--
|
||||
* This UsingTask element declares a custom MSBuild task named "ScriptValidatorTask".
|
||||
|
||||
* It specifies the assembly file where the task is defined from the current file's directory
|
||||
-->
|
||||
<UsingTask
|
||||
TaskName="SdshScriptCheckTask"
|
||||
AssemblyFile="$(OutDir)/SociallyDistant.Framework.dll" />
|
||||
|
||||
<!--
|
||||
* This defines a new MSBuild Target named "ValidateScripts".
|
||||
|
||||
* The BeforeTargets attribute specifies that this target should run before the "Build" target, so we can validate
|
||||
before a build is performed
|
||||
-->
|
||||
<Target Name="ValidateScripts" AfterTargets="Build">
|
||||
<!--
|
||||
* This executes the custom ScriptValidatorTask that is in the SociallyDistant.Framework.dll assembly
|
||||
|
||||
* It passes the ShellScripts above as the ScriptPaths parameter.
|
||||
|
||||
* ContinueOnError="false" means the build will stop if this task fails at any point
|
||||
|
||||
* The Output element captures the task's ValidationResults output into an MSBuild property named ScriptValidationResults.
|
||||
-->
|
||||
<SdshScriptCheckTask
|
||||
ScriptsSource="$(MSBuildProjectDirectory)/Content"
|
||||
ScriptsOutput="$(OutDir)Content/"
|
||||
ContinueOnError="false">
|
||||
<Output TaskParameter="Results" PropertyName="ScriptValidationResults" />
|
||||
</SdshScriptCheckTask>
|
||||
|
||||
<!--
|
||||
This Error task will cause the build to fail if any script validation failed.
|
||||
It checks the IsValid metadata of each ScriptValidationResults item.
|
||||
If IsValid is false for any item, it displays an error message with the script's identity (path).
|
||||
-->
|
||||
<Error
|
||||
Text="Script validation failed for: %(ScriptValidationResults.Identity)"
|
||||
Condition="'%(ScriptValidationResults.IsValid)' == 'false'" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -1,9 +1,9 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Architecture;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Modules;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.Tasks;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
using SociallyDistant.OS.Devices;
|
||||
|
||||
namespace SociallyDistant.Commands.CoreUtils
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
using System.Diagnostics;
|
||||
using System.Net.Mime;
|
||||
using SociallyDistant.Core.ContentManagement;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Modules;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
|
||||
namespace SociallyDistant.GamePlatform.ContentManagement
|
||||
{
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
using SociallyDistant.Core.Chat;
|
||||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
using SociallyDistant.Core.Scripting.Instructions;
|
||||
using SociallyDistant.Core.Core.Scripting.Instructions;
|
||||
using SociallyDistant.Core.Social;
|
||||
using SociallyDistant.GamePlatform;
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ using SociallyDistant.Core.Chat;
|
|||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Modules;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
using SociallyDistant.Core.Social;
|
||||
using SociallyDistant.Core.WorldData;
|
||||
|
||||
|
|
|
@ -2,11 +2,10 @@
|
|||
|
||||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Core.Scripting.Instructions;
|
||||
using SociallyDistant.Core.Core.Scripting.Parsing;
|
||||
using SociallyDistant.Core.Core.WorldData.Data;
|
||||
using SociallyDistant.Core.OS.Network;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
using SociallyDistant.Core.Scripting.Instructions;
|
||||
using SociallyDistant.Core.Scripting.Parsing;
|
||||
using SociallyDistant.GamePlatform;
|
||||
|
||||
namespace SociallyDistant.GameplaySystems.Hacking.Assets
|
||||
|
|
|
@ -5,7 +5,6 @@ using SociallyDistant.Core.Modules;
|
|||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.FileSystems;
|
||||
using SociallyDistant.Core.OS.Network;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
using SociallyDistant.GameplaySystems.NonPlayerComputers;
|
||||
using SociallyDistant.Player;
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ using SociallyDistant.Core.Core;
|
|||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Core.WorldData.Data;
|
||||
using SociallyDistant.Core.Modules;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
using SociallyDistant.Core.Social;
|
||||
using SociallyDistant.Core.WorldData;
|
||||
using SociallyDistant.GameplaySystems.Social;
|
||||
|
|
|
@ -8,7 +8,6 @@ using SociallyDistant.Core.Core.WorldData.Data;
|
|||
using SociallyDistant.Core.Missions;
|
||||
using SociallyDistant.Core.Modules;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
using SociallyDistant.Core.Social;
|
||||
using SociallyDistant.Core.WorldData;
|
||||
using SociallyDistant.GameplaySystems.Social;
|
||||
|
|
|
@ -2,10 +2,9 @@
|
|||
using SociallyDistant.Architecture;
|
||||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Core.Scripting.Instructions;
|
||||
using SociallyDistant.Core.Core.Scripting.Parsing;
|
||||
using SociallyDistant.Core.Missions;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
using SociallyDistant.Core.Scripting.Instructions;
|
||||
using SociallyDistant.Core.Scripting.Parsing;
|
||||
using SociallyDistant.Core.Social;
|
||||
using SociallyDistant.GamePlatform;
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
using System.Diagnostics;
|
||||
using Serilog;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Core.Scripting.GlobalCommands;
|
||||
using SociallyDistant.Core.Core.Scripting.StandardModules;
|
||||
using SociallyDistant.Core.Missions;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.Scripting.GlobalCommands;
|
||||
|
||||
namespace SociallyDistant.GameplaySystems.Missions
|
||||
{
|
||||
|
|
|
@ -30,7 +30,9 @@ namespace SociallyDistant.GameplaySystems.NonPlayerComputers
|
|||
private ISystemProcess systemd;
|
||||
private IWorldManager world = null!;
|
||||
private ServiceManager? serviceManager;
|
||||
|
||||
|
||||
public bool IsPlayer => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name => worldData.HostName;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.OS.FileSystems;
|
||||
using SociallyDistant.Core.OS.FileSystems.Immutable;
|
||||
using SociallyDistant.OS.FileSystems;
|
||||
using SociallyDistant.OS.FileSystems.Immutable;
|
||||
|
||||
namespace SociallyDistant.GameplaySystems.NonPlayerComputers
|
||||
{
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
using SociallyDistant.Core.Scripting.Instructions;
|
||||
using SociallyDistant.Core.Scripting.Parsing;
|
||||
using SociallyDistant.Core.Core.Scripting.Instructions;
|
||||
using SociallyDistant.Core.Core.Scripting.Parsing;
|
||||
using SociallyDistant.Core.Social;
|
||||
using SociallyDistant.GamePlatform;
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ using SociallyDistant.Core.Core;
|
|||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Core.WorldData.Data;
|
||||
using SociallyDistant.Core.Modules;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
using SociallyDistant.Core.Social;
|
||||
using SociallyDistant.Player;
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#nullable enable
|
||||
using System.Text;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Core.Serialization;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.Network;
|
||||
using SociallyDistant.Core.OS.Network.MessageTransport;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
using SociallyDistant.Core.Serialization.Binary;
|
||||
|
||||
namespace SociallyDistant.NetworkServices.Ssh
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Architecture;
|
||||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Modules;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.FileSystems;
|
||||
using SociallyDistant.Core.OS.FileSystems.Host;
|
||||
using SociallyDistant.Core.OS.Network;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
using SociallyDistant.GamePlatform;
|
||||
using SociallyDistant.GameplaySystems.Networld;
|
||||
using SociallyDistant.OS.FileSystems;
|
||||
using SociallyDistant.OS.FileSystems.Host;
|
||||
using SociallyDistant.Player;
|
||||
|
||||
namespace SociallyDistant.OS.Devices
|
||||
|
@ -32,6 +31,8 @@ namespace SociallyDistant.OS.Devices
|
|||
private ISystemProcess? systemd;
|
||||
private PlayerInfo playerInfo;
|
||||
|
||||
public bool IsPlayer => true;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name { get; private set; } = "localhost";
|
||||
public PlayerUser PlayerUser => playerUser;
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.FileSystems;
|
||||
using SociallyDistant.Core.OS.FileSystems.Host;
|
||||
using SociallyDistant.Core.OS.FileSystems.Immutable;
|
||||
using SociallyDistant.OS.FileSystems;
|
||||
using SociallyDistant.OS.FileSystems.Immutable;
|
||||
|
||||
namespace SociallyDistant.OS.Devices
|
||||
{
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
<!-- Asset importer overrides -->
|
||||
<Import Project=".\Content\ContentOverrides.targets" />
|
||||
<Import Project=".\CheckSdshScripts.targets" />
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\vendor\MonoGame.ImGuiNet\MonoGame.ImGuiNet\Monogame.ImGuiNet.csproj" />
|
||||
|
@ -94,4 +95,8 @@
|
|||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Content\Scripts\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -17,7 +17,6 @@ using SociallyDistant.Core.Core.WorldData.Data;
|
|||
using SociallyDistant.Core.Modules;
|
||||
using SociallyDistant.Core.OS;
|
||||
using SociallyDistant.Core.OS.Network.MessageTransport;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
using SociallyDistant.Core.Serialization.Binary;
|
||||
using SociallyDistant.Core.Shell;
|
||||
using SociallyDistant.Core.Shell.Common;
|
||||
|
|
|
@ -10,11 +10,10 @@ using SociallyDistant.Core.ContentManagement;
|
|||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.Core.Config;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Core.Scripting.GlobalCommands;
|
||||
using SociallyDistant.Core.Modules;
|
||||
using SociallyDistant.Core.OS.Devices;
|
||||
using SociallyDistant.Core.OS.Tasks;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
using SociallyDistant.Core.Scripting.GlobalCommands;
|
||||
using SociallyDistant.Core.Shell;
|
||||
using SociallyDistant.GamePlatform;
|
||||
using SociallyDistant.GameplaySystems.Chat;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
using AcidicGUI.Layout;
|
||||
using AcidicGUI.Widgets;
|
||||
using Microsoft.Xna.Framework;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Programs;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
using SociallyDistant.Core.Shell.Windowing;
|
||||
using SociallyDistant.Core.UI.Terminal;
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ using System.Reactive.Subjects;
|
|||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.Core.Scripting;
|
||||
using SociallyDistant.Core.Modules;
|
||||
using SociallyDistant.Core.Scripting;
|
||||
using SociallyDistant.Core.UI.Shell;
|
||||
|
||||
namespace SociallyDistant.UI;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#nullable enable
|
||||
using SociallyDistant.Core.Core;
|
||||
using SociallyDistant.Core.OS.FileSystems;
|
||||
using SociallyDistant.OS.FileSystems.Immutable;
|
||||
using SociallyDistant.Core.OS.FileSystems.Immutable;
|
||||
using SociallyDistant.Player;
|
||||
|
||||
namespace SociallyDistant.VfsMapping
|
||||
|
|
Loading…
Reference in a new issue