-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathffxivdata.js
More file actions
55 lines (39 loc) · 1.2 KB
/
Copy pathffxivdata.js
File metadata and controls
55 lines (39 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const log4js = require('log4js')
const axios = require('axios')
const HuntnetProxy = require('./lib/huntnetProxy')
const URL_ZONE_INSTANCES = "https://lanaklein14.github.io/ffxivdata/dist/zoneinstances.json"
const logger = log4js.getLogger()
class FFXIVDATA {
constructor() {
this._dataCenters = require('./dist/datacenters.json')
this._regions = require('./dist/regions.json')
this._zones = require('./dist/zones.json')
this._zoneInstances = require('./dist/zoneinstances.json')
this._huntnetProxy = new HuntnetProxy()
}
get dataCenters() {
return this._dataCenters
}
get regions() {
return this._regions
}
get zoneInstances() {
return this._zoneInstances
}
async refreshZoneInstances() {
try {
const res = await axios.get(URL_ZONE_INSTANCES);
this._zoneInstances = res.data;
} catch (error) {
const {
status,
statusText
} = error.response;
logger.error(`Error! HTTP Status: ${status} ${statusText}`);
}
}
huntnetProxy() {
return this._huntnetProxy
}
}
module.exports = FFXIVDATA