mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 15:04:52 +09:00
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:
1 parent
8bfc42c44c
commit
fb53845f2a
1 file changed
+17
@@ -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);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user