mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-27 15:07:14 +00:00
fix(capture): start and stop the replay sandbox on Windows too
The sandbox launched its servers with fork, setpgid and waitpid only. Starting, waiting and stopping now go through one small platform section: POSIX keeps the process group, Windows uses CreateProcess in a job object that is ended as one (and dies with the tool). Environment overrides are cleared in the tool itself, program names get .exe on Windows, and shared folders fall back to a copy where links can't be made. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
#include <filesystem>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "json.hpp"
|
||||
|
||||
@@ -16,6 +15,9 @@
|
||||
* read-only; CDServer.sqlite is copied. The folder is deleted afterwards unless it is kept.
|
||||
*/
|
||||
namespace Sandbox {
|
||||
// A started process: its pid, or its process handle on Windows (0: none)
|
||||
using ProcessHandle = intptr_t;
|
||||
|
||||
struct Options {
|
||||
std::filesystem::path serverDir; // built servers (MasterServer, AuthServer, ChatServer, WorldServer, migrations, ...)
|
||||
std::filesystem::path root; // sandboxes are made in here
|
||||
@@ -47,7 +49,7 @@ namespace Sandbox {
|
||||
private:
|
||||
Options m_Options;
|
||||
std::filesystem::path m_Dir;
|
||||
pid_t m_Master{};
|
||||
ProcessHandle m_Master{};
|
||||
bool m_Keep{};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user