From 39f31b305f429ee7e5158ba828108ecb1e5d823d Mon Sep 17 00:00:00 2001 From: Li Chen Min <59439991+MCasdfghjk@users.noreply.github.com> Date: Sat, 4 Apr 2026 01:58:37 +0800 Subject: [PATCH] Add Hong Kong server option for China region MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Hong Kong as a server option for users whose Windows region setting is set to China. However, I don’t know the Region_ID yet, so this is currently just a UI option. --- index.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/index.js b/index.js index 3974e32..35546dc 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,12 @@ app.use((req, res, next) => { const MatchmakingHost = "204.12.195.98"; const MatchmakingPort = 9000; -const matchmakingUDPServerDiscoveryPayload = {"servers":[{"location_id":6,"region_id":"336d1f3e-3ecb-11eb-a7dc-3b7705f20f56","ipv4":MatchmakingHost,"ipv6":"","port":MatchmakingPort}]} +const matchmakingUDPServerDiscoveryPayload = { + servers: [ + { location_id: 6, region_id: "336d1f3e-3ecb-11eb-a7dc-3b7705f20f56", ipv4: MatchmakingHost, ipv6: "", port: MatchmakingPort }, + { location_id: 10, region_id: "11111111-2222-4333-8444-555555555501", ipv4: MatchmakingHost, ipv6: "", port: MatchmakingPort }, + ], +}; app.get("/", (req, res) => { res.status(200).json(matchmakingUDPServerDiscoveryPayload); @@ -138,16 +143,11 @@ const TEMP_USER_ID = "76561198211631084" let PartyPresence = "InMatching"; -function BuildRegionList(){ - //[{RegionId: "336d1f3e-3ecb-11eb-a7dc-3b7705f20f56", RegionName: "us-east1"}] - - let RegionList = []; - - for(let Region in matchmakingUDPServerDiscoveryPayload.servers){ - RegionList.push({RegionId: Region.regionid, RegionName: "us-east1"}); - } - - return RegionList; +function BuildRegionList() { + return [ + { RegionId: matchmakingUDPServerDiscoveryPayload.servers[0].region_id, RegionName: "us-east1" }, + { RegionId: matchmakingUDPServerDiscoveryPayload.servers[1].region_id, RegionName: "asia-east2" }, + ]; } let fs = require("fs"); @@ -580,4 +580,4 @@ app.listen(process.env.PORT || 8000, () => { matchmakingTCPServer.listen(9000); }) -}); \ No newline at end of file +});