fix(bridge): read the config before the link thread dials (D154)
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in -1m29s
All checks were successful
PR Checks / plugin-checks (pull_request) Successful in -1m29s
Init() started LinkLoop before Loaded() read the config, so the thread's first dial saw _config == null and used the 7799 fallback on both Oxide and Carbon. One server per host made that its own sidecar by coincidence. With two on a host (the installer's named instances, phase 18), the second server dialled the FIRST server's sidecar, sat in its accept backlog, and the moment the first server's plugin reloaded that sidecar took the second server's connection: the website showed server "alpha" with beta's hostname and wipe. LoadConfigValues() now runs in Init() before the thread starts; Loaded() keeps its log line and the lease/world/reward loads. Walked on the phase 18 rig: three instances (two Oxide, one Carbon 7801), each now dials its own port. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -244,6 +244,13 @@ namespace Oxide.Plugins
|
||||
|
||||
_bootId = ResolveBootId();
|
||||
_wipeId = ResolveWipeId();
|
||||
|
||||
// Before the link thread, not in `Loaded`: both frameworks call `Init` first, and a
|
||||
// thread started here with `_config` still null dials the 7799 fallback. With one
|
||||
// server per host that is its own sidecar by coincidence; with two it is the OTHER
|
||||
// server's, whose sidecar then files this server's history under that one's id
|
||||
// (found by the phase 18 walk, D154).
|
||||
LoadConfigValues();
|
||||
_running = true;
|
||||
|
||||
// Expired link codes are dropped on a timer, not on lookup: an unconfirmed code is
|
||||
@@ -496,7 +503,6 @@ namespace Oxide.Plugins
|
||||
|
||||
private void Loaded()
|
||||
{
|
||||
LoadConfigValues();
|
||||
Puts($"protocol {ProtocolVersion}, serverId '{_config.ServerId}', sidecar {_config.Host}:{_config.Port}");
|
||||
|
||||
// Here rather than at `OnServerInitialized`: the link thread starts in `Init`, so a
|
||||
|
||||
Reference in New Issue
Block a user