Cover opening the UDP socket from the RCON start heuristic

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Fable 5.1 committed 2026-10-15 16:38:34 +00:00
1 parent 8bfc42c44c
commit fb53845f2a
1 file changed
+17
+17
View File
@@ -379,6 +379,23 @@ describe("host/server", function() {
server.enableLuaUdp = false;
}
});
it("should open the socket when RCON starts", async function() {
const startRcon = server._startRcon;
server._startRcon = async () => {};
server.enableLuaUdp = true;
try {
server._handleOutput(Buffer.from(
" 0.500 Info RemoteCommandProcessor.cpp:133: Starting RCON interface"
), "stdout");
while (!server._udpSocket) {
await wait(1);
}
} finally {
server._startRcon = startRcon;
server.enableLuaUdp = false;
}
assert(server.hostUdpPort > 0, "socket was not opened");
});
it("should not have a host port when not running", function() {
assert.equal(server.hostUdpPort, undefined);
});