mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-15 23:20:01 -04:00
allow tracker to reject outdated servers
This commit is contained in:
parent
55dece7bc3
commit
c6f06d9724
5 changed files with 19 additions and 9 deletions
|
@ -17,10 +17,8 @@ https.get(
|
|||
|
||||
file.on("finish", () => {
|
||||
fs.chmodSync(`${dir}/${appname}`, "755");
|
||||
setTimeout(() => {
|
||||
// this timeout shouldn't be needed, but it is
|
||||
start();
|
||||
}, 2000);
|
||||
// this timeout shouldn't be needed, but it is
|
||||
setTimeout(start, 2000);
|
||||
});
|
||||
})
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import { AdriftServer, connectTracker } from "./server";
|
|||
|
||||
import WebSocket from "isomorphic-ws";
|
||||
import { answerRtc, bufferToArrayBuffer } from "./rtc";
|
||||
import { PROTOCOL_VERSION } from "protocol";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
|
@ -50,9 +51,9 @@ app.ws("/dev-ws", (ws, _req) => {
|
|||
});
|
||||
|
||||
try {
|
||||
let tracker = new WebSocket("ws://localhost:17776/join");
|
||||
let tracker = new WebSocket(`ws://localhost:17776/join?protocol=${PROTOCOL_VERSION}`);
|
||||
tracker.onerror = console.error;
|
||||
connectTracker(tracker);
|
||||
} catch (_) {}
|
||||
} catch (_) { }
|
||||
|
||||
app.listen(3000, () => console.log("listening"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue