Commit Graph

5 Commits

Author SHA1 Message Date
b30c497769 [Add] CoW foundation and scriptable rm command.
Putting down the nessassary steps for the Copy-on-Write described in the
previous commit. Implemented the first script based write command, 'rm'
2025-09-21 22:39:16 +01:00
ea0605711d [Refactor] Shared VFS template for CoW foundation.
Refactors the Virtual file System creation process to improve memory
efficiency at scale. This is laying the ground work for a copy-on-write
system.

Previously, each new VFS instance was a full copy, which won't scale to
a large number of NPC's. Especially now that we are loading in entire
Lua scripts.

- Added VFSManager class which now manages the lifecycle of all VFS
  instances.
- VFSManager creates a single "template" VFS on initilisation. The
  template holds the shared, read-only directories like '/bin' and their
command scripts.
- When a new VFS is created (for a client or NPC), it links it's 'bin'
  directory to the shared template's '/bin' by pointer rather than
creating a copy of it.

this makes sure the content for *all* common command scripts exists in
memory only once, regardless of the number of NPC's we will later
generate.
2025-09-21 21:50:06 +01:00
fbf70c43b3 [Add] Embedded Lua scripting language.
Over the past couple of commits, the build process now automates the
dependenices you'd normally compile from source.
This commit is focused on laying the foundation for scriptable in-game
commands using Lua.

- sol2 and lua5.4 are the new project dependencies.
- Created a new 'LuaProcessor' class to manage a Lua state and eecute
  scripts.
- The 'CommandProcessor' now contains a 'LuaProcessor' instance.
- Replaced the hardcoded c++ 'ls' command with a system that executes a
  '/bin/ls.lua' script from the Virtual File System.
- Implemented C++ -> Lua bindings for the 'vfs_node' struct, allowing
  Lua scripts to inspect the VFS and perform actions (i.e, list files).
2025-09-21 20:13:43 +01:00
208314f54a [Add] Remote SSH sessions and window management.
This is the beginning of the remote session functionality. It allows
players to connect to different NPC systems via an 'ssh' command.

*Server*
- Can now manage a world of multiple NPC file systems that are
  identified by IP addresses.
- Implemented SSH command to allow connection to remote NPC systems.
  Each remote session is managed via a 'CommandProcessor'.
- 'exit' command causes the remote server to terminate the client
  connection

*Client*
- Terminal can enter a 'remote' state via the SSH command which sends
  subsequent commands to the server.
- the local 'exit' command will close the terminal window.
- Refactored UI object ownership to prevent memory leaks and ensure
  proper cleanup when a window is closed or the terminal application.
2025-09-21 15:22:35 +01:00
a73aa4feaf Create hybrid authority model for command processing. 2025-09-21 00:22:04 +01:00