mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-07-16 00:44:59 +00:00
improve observer mode and disconnect
This commit is contained in:
parent
25b4a53a00
commit
78e791f763
39 changed files with 877 additions and 837 deletions
|
|
@ -232,6 +232,9 @@ wss.on("connection", (ws) => {
|
|||
|
||||
ws.on("close", () => {
|
||||
relayLog.info("Browser client disconnected");
|
||||
// Clear retry state so we never auto-reconnect without a browser client.
|
||||
lastJoinAddress = null;
|
||||
retryCount = 0;
|
||||
if (retryTimer) {
|
||||
clearTimeout(retryTimer);
|
||||
retryTimer = null;
|
||||
|
|
@ -288,19 +291,6 @@ wss.on("connection", (ws) => {
|
|||
break;
|
||||
}
|
||||
|
||||
case "disconnect": {
|
||||
relayLog.info("Disconnect requested");
|
||||
if (retryTimer) {
|
||||
clearTimeout(retryTimer);
|
||||
retryTimer = null;
|
||||
}
|
||||
if (gameConnection) {
|
||||
gameConnection.disconnect();
|
||||
gameConnection = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "sendCommand": {
|
||||
if (gameConnection) {
|
||||
const authEvents = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue