Commit Graph

19 Commits

Author SHA1 Message Date
9d770ef9b2 [Refactor] Implment structured network protocol. 2025-10-11 19:05:14 +01:00
97b60488de [Add] Persistent VFS and database aware commands. 2025-10-07 00:05:40 +01:00
44ca427c0e [Add] Completed the persistance layer. 2025-10-06 20:41:22 +01:00
666b4f554b [Add] File loading and fix local 'exit' command. 2025-10-01 21:38:33 +01:00
ebd1e222d7 [Add] File saving for the fancy new text editor. 2025-09-30 21:37:24 +01:00
c052cf3cbf [Fix] Implement destructors preventing memleaks.
Fixes a bunch of memleaks related to the new Machine and VFS
architecture.

The Machine and vfs_node objects were created with 'new' but were never
properly destroyed, leading to memleaks during CoW operations and on
server shutdown.

- Added a recursive 'delete_vfs_tree' function
- Machine destructor calls this function to lean up its VFS
- CommandProcessor correctly deletes old Machine objects after a CoW
- Player destructor cleans up the player's home machine.
- NetworkManager destructor cleans up all world machines.
2025-09-27 22:18:13 +01:00
e06d6eec37 [Refactor] Implement scriptable Lua API
Large architecture refactor of the scripting system.

Previous implementation required Lua scripts to return "action
tables" which were interpreted by a large and not very flexible at all
if-else ladder in C++. While fine for the initial implementation, it's
not scalable, and it makes it impossible for players to write their own
meaningful tools.
2025-09-27 21:18:05 +01:00
4b21d30567 [Fix] Correct CoW logic and fix rm command fallout. 2025-09-27 18:33:45 +01:00
59783d2408 [Refactor] :O Machines now walk the earth!!
Old vfs_node was getting a bit big for its boots, trying to be a
filesystem, network interface and the whole damn computer all at once.

This server-side refactor introduces a 'Machine' class that rightfully
owns the VFS, network services and other machine-state sh.t.
2025-09-27 17:30:14 +01:00
fde6879720 [Add] Implement nmap network scanner. 2025-09-27 00:13:56 +01:00
5f648440c5 [Add] Implement file I/O and remote CoW. 2025-09-26 23:50:01 +01:00
bb17cf3473 [Add] Implement remote sessions and server exit. 2025-09-26 21:32:08 +01:00
c7e8d97c63 [Add] Add back the SSH functionality. 2025-09-25 23:05:21 +01:00
cb6022116a Just a quick whitespace cleanup. 2025-09-21 23:57:51 +01:00
267d2477de [Add] Implemented Copy-on-Write and scriptable rm.
OK, this commit finally implements the Copy-on-Write architecure I spoke
about in previous commits.. It also refactors command execution to be
safer and more extensible.

To enable CoW and centralise state-changing, command scripts no longer
modify the VFS directly. Instead, they return a table describing their
intended action '{ action = "rm", target = "file.txt" }'. The C++
CommandProcessor is then responsible for interpreting this and executing
it safely.
2025-09-21 23:52:36 +01:00
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
62d5f0526f [Add] Implemented Lua command execution engine.
Replacing hardcoded c++ 'ls' command with a generic system that finds and
runs Lua scripts from the virual file system.
2025-09-21 20:42:25 +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
a73aa4feaf Create hybrid authority model for command processing. 2025-09-21 00:22:04 +01:00