Skip to content

Commit b34109c

Browse files
committed
default servers in config file
1 parent 89fc24f commit b34109c

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

src/assets/assetLoader.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,9 @@
3838
"nameList":{
3939
"path":"assets/nameList.txt",
4040
"type":"text"
41+
},
42+
"config":{
43+
"path":"assets/config.json",
44+
"type":"text"
4145
}
4246
}

src/assets/config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"minecraftProduction": "185.228.139.97:25564",
3+
"minecraftDevelopment":"localhost:25565",
4+
"proxyHTTPS": "wss:web-minecraft-proxy.herokuapp.com:443",
5+
"proxyHTTP": "ws:web-minecraft-proxy.herokuapp.com:80"
6+
}

src/scripts/Setup.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ async function Setup (game) {
4040
document.body.appendChild(game.stats.dom)
4141
}
4242
game.distanceBasedFog = new DistanceBasedFog(game)
43+
game.servers = {
44+
production: game.al.get('config').minecraftProduction,
45+
development: game.al.get('config').minecraftDevelopment
46+
}
4347
UrlParams(game).then((password) => {
4448
game.password = password
4549
$('.loadingText').text(`Connecting to ${game.server}...`)

src/scripts/UrlParams.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ function UrlParams (game) {
2525
reload = true
2626
if (game.production) {
2727
if (document.location.protocol === 'https:') {
28-
game.proxy = 'wss:web-minecraft-proxy.herokuapp.com:443'
28+
game.proxy = game.al.get('config').proxyHTTPS
2929
} else {
30-
game.proxy = 'ws:web-minecraft-proxy.herokuapp.com:80'
30+
game.proxy = game.al.get('config').proxyHTTP
3131
}
3232
} else {
3333
game.proxy = 'local'

src/scripts/index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ class Game {
1313
} else {
1414
console.log('Running in development mode')
1515
}
16-
this.servers = {
17-
production: '185.228.139.97:25564',
18-
development: 'localhost:25565'
19-
}
2016
this.fov = {
2117
normal: 70,
2218
sprint: 80

0 commit comments

Comments
 (0)