Files
EscapistsReintroduced/docs/evidence/terrain-registration-2026-10-04/rehost/probe.c.txt
T
jakub 6a667d8deb Capture current mission, AI, map and administration development
Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
2026-10-13 22:52:53 +02:00

39 lines
1.7 KiB
Plaintext

// Private, backend-disabled experiment; never part of the published addon.
modded class ArmaReforgerScripted
{
protected float m_ERRRegistrationProbeWait;
protected bool m_ERRRegistrationProbeStarted;
override void OnUpdate(BaseWorld world, float timeslice)
{
super.OnUpdate(world, timeslice);
if (m_ERRRegistrationProbeStarted || !GetWorld() || !GetGameMode()) return;
m_ERRRegistrationProbeWait += timeslice;
if (m_ERRRegistrationProbeWait < 5 || GameStateTransitions.IsTransitionRequestedOrInProgress()) return;
m_ERRRegistrationProbeStarted = true;
DSConfig config = new DSConfig();
bool hasRunning = GetBackendApi().GetRunningDSConfig(config);
PrintFormat("ERR REGISTRATION PROBE: runningConfig=%1 gameConfig=%2 current=%3", hasRunning, config.game != null, GetWorldFile());
config.bindAddress = "127.0.0.1"; config.bindPort = 2001;
config.game = new DSGameConfig();
config.game.name = "Private registration probe";
config.game.scenarioId = "{C1E20667DCE324ED}Missions/ERR_Everon.conf";
config.game.maxPlayers = 1; config.game.visible = false;
config.game.password = "isolated-test";
config.game.gameProperties = new DSGameProperties();
config.game.gameProperties.battlEye = false;
config.game.mods = {};
foreach (string id : {"2528466DE220D91C", "70C981A53E02B64F"})
{
DSMod mod = new DSMod(); mod.modId = id; config.game.mods.Insert(mod);
}
bool accepted = GameStateTransitions.RequestPublicServerTransition(config);
PrintFormat("ERR REGISTRATION PROBE: publicTransitionFromGameplay=%1", accepted);
if (!accepted) Print("ERR REGISTRATION PROBE COMPLETE: transition rejected");
}
override bool OnGameStart()
{
PrintFormat("ERR REGISTRATION PROBE: worldStarted=%1", GetWorldFile());
return super.OnGameStart();
}
}