Skip to content

Commit 5ac662f

Browse files
committed
add back the static ip list as fallback instead...
1 parent a32b400 commit 5ac662f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/server/redirects.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ const redirects = {
1212
re: "https://g2cf.metastruct.net/reauth",
1313
};
1414

15+
const fallbackIPs = {
16+
eu1: "195.154.166.219:27015",
17+
eu2: "164.92.180.157:27015",
18+
eu3: "116.202.33.7:27015",
19+
us1: "66.42.103.116:27015",
20+
}
21+
1522
async function resolveHostname(hostname) {
1623
try {
1724
return (await dns.lookup(hostname)).address
@@ -32,8 +39,9 @@ module.exports = async app => {
3239

3340
for (const [name, data] of Object.entries(app.config.gameservers)) {
3441
const hostname = data.address;
35-
const ip = await resolveHostname(hostname);
36-
if (!ip) continue;
42+
let ip = await resolveHostname(hostname);
43+
if (!ip && fallbackIPs[name]) { ip = fallbackIPs[name] }
44+
else { continue }
3745
app.get(`/join/${name}/:pwd?`, (req, res) => {
3846
const pwd = (req.params.pwd || "metawebsite").replace(/[^a-zA-Z*0-9:+-\s]+/g, "");
3947
res.redirect(`steam://connect/${ip}/${pwd}`);

0 commit comments

Comments
 (0)