Skip to content

Commit

Permalink
Add more servers
Browse files Browse the repository at this point in the history
Added servers: Singapore, Dubai, Austria, Brazil, South Africa, Chile,
Peru, India, Japan
  • Loading branch information
MeLlamoPablo committed Jan 4, 2017
1 parent 5809103 commit 26870a5
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/commands/general/add-inhouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ module.exports = new Clapp.Command({
new Clapp.Flag({
name: "server",
desc: "The inhouse server. Possible values are:\n" +
"US West, US East, Luxembourg, Australia, Stockholm\n" +
"If you wish to have another server added, please talk to this bot's author.",
"US West, US East, Luxembourg, Australia, Stockholm, Singapore, Dubai, Austria," +
" Brazil, South Africa, Chile, Peru, India, Japan.",
type: "string",
default: cfg.dota.defaultServer,
alias: "s",
Expand All @@ -106,6 +106,15 @@ module.exports = new Clapp.Command({
case "luxembourg":
case "australia":
case "stockholm":
case "singapore":
case "dubai":
case "austria":
case "brazil":
case "southafrica":
case "chile":
case "peru":
case "india":
case "japan":
return true;
default:
return false;
Expand Down
29 changes: 29 additions & 0 deletions lib/modules/dotahandler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,35 @@ class DotaHandler {
case "stockholm":
server = Dota2.ServerRegion.STOCKHOLM;
break;
case "singapore":
server = Dota2.ServerRegion.SINGAPORE;
break;
case "dubai":
server = Dota2.ServerRegion.DUBAI;
break;
case "austria":
server = Dota2.ServerRegion.AUSTRIA;
break;
case "brazil":
server = Dota2.ServerRegion.BRAZIL;
break;
case "southafrica":
server = Dota2.ServerRegion.SOUTHAFRICA;
break;
case "chile":
server = Dota2.ServerRegion.CHILE;
break;
case "peru":
server = Dota2.ServerRegion.PERU;
break;
case "india":
server = Dota2.ServerRegion.INDIA;
break;
case "japan":
server = Dota2.ServerRegion.JAPAN;
break;
default:
return reject(new Error("Unknown server " + inhouseProps.server));
}

let gamemode;
Expand Down
27 changes: 27 additions & 0 deletions lib/modules/summaryhandler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,33 @@ class SummaryHandler {
case "stockholm":
inhouseProps.server = "Stockholm";
break;
case "singapore":
inhouseProps.server = "Singapore";
break;
case "dubai":
inhouseProps.server = "Dubai";
break;
case "austria":
inhouseProps.server = "Austria";
break;
case "brazil":
inhouseProps.server = "Brazil";
break;
case "southafrica":
inhouseProps.server = "South Africa";
break;
case "chile":
inhouseProps.server = "Chile";
break;
case "peru":
inhouseProps.server = "Peru";
break;
case "india":
inhouseProps.server = "India";
break;
case "japan":
inhouseProps.server = "Japan";
break;
}

inhouseProps.autoBalance = inhouseProps.autoBalance ? "Enabled" : "Disabled";
Expand Down

0 comments on commit 26870a5

Please sign in to comment.