This commit is contained in:
Frank Harris 2026-06-07 19:15:52 -05:00
parent 8f5ad2984a
commit 6cf58ae408
3 changed files with 17 additions and 3 deletions

View file

@ -23,8 +23,9 @@
use warnings;
use strict;
use Cwd; # Fast way to get the current directory
use lib getcwd();
use Cwd qw(getcwd); # Fast way to get the current directory
use FindBin qw($Bin);
use lib $Bin;
use Frontier::Daemon::OGP::Forking; # Forking XML-RPC server
use File::Copy; # Simple file copy functions
use File::Copy::Recursive

View file

@ -29,6 +29,19 @@ if not exist "%WD%OGP\ogp_agent.pl" (
exit /b 1
)
if not exist "%WD%OGP\Cfg\Config.pm" (
echo Creating default Cfg\Config.pm from Config.pm.default...
copy /Y "%WD%OGP\Cfg\Config.pm.default" "%WD%OGP\Cfg\Config.pm" >nul
)
if not exist "%WD%OGP\Cfg\Preferences.pm" (
echo Creating default Cfg\Preferences.pm from Preferences.pm.default...
copy /Y "%WD%OGP\Cfg\Preferences.pm.default" "%WD%OGP\Cfg\Preferences.pm" >nul
)
if not exist "%WD%OGP\Cfg\bash_prefs.cfg" (
echo Creating default Cfg\bash_prefs.cfg from bash_prefs.cfg.default...
copy /Y "%WD%OGP\Cfg\bash_prefs.cfg.default" "%WD%OGP\Cfg\bash_prefs.cfg" >nul
)
REM Verify gameserver user exists
net user %AGENT_USER%
if errorlevel 1 (

View file

@ -39,6 +39,6 @@ Common installed layout:
The launcher checks `%~dp0bin\bash.exe`, `C:\OGP64\bin\bash.exe`, `C:\cygwin64\bin\bash.exe`, and `C:\cygwin\bin\bash.exe`. Missing-bash errors should print every checked path and pause in manual use.
Generated config files under `/OGP/Cfg` are production state. Installer/startup may create them from `.default` templates if missing, but update logic must preserve them. Restart-time auto-update may replace only `/OGP/ogp_agent.pl`; it must not overwrite `Cfg/Config.pm`, `Cfg/Preferences.pm`, `Cfg/bash_prefs.cfg`, service settings, passwords, server data, or logs.
Generated config files under `/OGP/Cfg` are production state. `C:\OGP64\agent_start.bat` may create them from `.default` templates if missing, but update logic must preserve them. Restart-time auto-update may replace only `/OGP/ogp_agent.pl`; it must not overwrite `Cfg/Config.pm`, `Cfg/Preferences.pm`, `Cfg/bash_prefs.cfg`, service settings, passwords, server data, or logs.
When the Windows agent starts, `C:\OGP64\agent_start.bat` should be launched from the Cygwin root itself. It verifies the `gameserver` account, normalizes text files, validates `OGP\ogp_agent.pl`, and then launches the agent in the same console window. It should not call an installer wrapper from the start script.