File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff 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+
1522async 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 - z A - Z * 0 - 9 : + - \s ] + / g, "" ) ;
3947 res . redirect ( `steam://connect/${ ip } /${ pwd } ` ) ;
You can’t perform that action at this time.
0 commit comments