-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ArcticZeroo/develop
Merges develop into master to bring it up to date with Mineplex's API
- Loading branch information
Showing
20 changed files
with
340 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
require('./lib/Prototypes'); | ||
var MineplexAPIWrapper = require(`./lib/MineplexAPIWrapper`); | ||
module.exports = MineplexAPIWrapper; | ||
module.exports = MineplexAPIWrapper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
class Fountain{ | ||
constructor(data){ | ||
this.brawlActive = data.brawlActive; | ||
this.percent = data.percent; | ||
} | ||
|
||
isBrawlActive(){ | ||
return this.brawlActive; | ||
} | ||
|
||
getBrawlActiveString(){ | ||
return (this.brawlActive) ? 'active' : 'inactive'; | ||
} | ||
|
||
getPercentFull(){ | ||
return this.percent; | ||
} | ||
|
||
getMultiplier(){ | ||
var percentFull = this.getPercentFull(); | ||
if(percentFull >= 300) return 3.0; | ||
if(percentFull >= 200) return 2.0; | ||
return 1.0; | ||
} | ||
} | ||
|
||
module.exports = Fountain; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
let RegionStatus = require('./RegionStatus'); | ||
|
||
class NetworkStatus{ | ||
constructor(data){ | ||
this.us = new RegionStatus('US', data.US); | ||
this.eu = new RegionStatus('EU', data.EU); | ||
this.playerCount = data.playerCount; | ||
} | ||
|
||
getPlayerCount(){ | ||
return this.playerCount; | ||
} | ||
|
||
getRegionEuStatus(){ | ||
return this.us; | ||
} | ||
|
||
getRegionUsStatus(){ | ||
return this.eu; | ||
} | ||
} | ||
|
||
module.exports = NetworkStatus; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
class RegionStatus{ | ||
constructor(region, data){ | ||
this.region = region; | ||
|
||
this.status = data.status; | ||
|
||
this.playerCount = data.playerCount; | ||
|
||
this.motd = [data.motd.mainLine]; | ||
for(let motdLine of data.motd.otherLines){ | ||
this.motd.push(motdLine); | ||
} | ||
} | ||
|
||
getRegion(){ | ||
return this.region; | ||
} | ||
|
||
getStatus(){ | ||
return this.status; | ||
} | ||
|
||
getPlayerCount(){ | ||
return this.playerCount; | ||
} | ||
|
||
getMotdLines(){ | ||
return this.motd; | ||
} | ||
|
||
getMotd(){ | ||
return this.motd.join('\n'); | ||
} | ||
|
||
toJSON(){ | ||
return { | ||
status : this.getStatus(), | ||
motd : this.getMotdLines(), | ||
playerCount : this.getPlayerCount(), | ||
} | ||
} | ||
} | ||
|
||
module.exports = RegionStatus; |
Oops, something went wrong.