Add localStorage flag for connecting to alt server list
This commit is contained in:
parent
a33f3d8bb0
commit
72bd3e4c98
2 changed files with 14 additions and 2 deletions
|
|
@ -1119,8 +1119,17 @@ setupCallbacks = function() {
|
|||
return;
|
||||
}
|
||||
|
||||
var servers;
|
||||
if (socketConfig.alt && socketConfig.alt.length > 0 &&
|
||||
localStorage.useAltServer) {
|
||||
servers = socketConfig.alt;
|
||||
console.log("Using alt servers: " + JSON.stringify(servers));
|
||||
} else {
|
||||
servers = socketConfig.servers;
|
||||
}
|
||||
|
||||
var chosenServer = null;
|
||||
socketConfig.servers.forEach(function (server) {
|
||||
servers.forEach(function (server) {
|
||||
if (chosenServer === null) {
|
||||
chosenServer = server;
|
||||
} else if (server.secure && !chosenServer.secure) {
|
||||
|
|
@ -1130,6 +1139,8 @@ setupCallbacks = function() {
|
|||
}
|
||||
});
|
||||
|
||||
console.log("Connecting to " + JSON.stringify(chosenServer));
|
||||
|
||||
if (chosenServer === null) {
|
||||
makeAlert("Error",
|
||||
"Socket.io configuration was unable to find a suitable server",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue