epicgames-fortnite-client
Advanced tools
Comparing version 0.1.2 to 0.1.3
module.exports = { | ||
Client: require('./src/Client') | ||
}; |
@@ -0,0 +0,0 @@ MIT License |
{ | ||
"name": "epicgames-fortnite-client", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "The javascript client for Fortnite.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -42,2 +42,16 @@ # node-epicgames-fortnite-client | ||
# Constructor options | ||
```javascript | ||
const FortniteClient = require('epicgames-fortnite-client').Client; | ||
let fortnite = new FortniteClient({ | ||
use_waiting_room: true, //false to ignore waiting room (epicgames load balancer) | ||
http: { | ||
//settings for lib https://github.com/request/request | ||
} | ||
}); | ||
``` | ||
# Methods | ||
@@ -44,0 +58,0 @@ |
@@ -0,0 +0,0 @@ module.exports = Object.freeze({ |
@@ -18,3 +18,4 @@ const ENDPOINT = require('../../resources/Endpoint'); | ||
this.config = Object.assign({ | ||
use_waiting_room: false, | ||
http: {} | ||
@@ -42,7 +43,17 @@ | ||
try { | ||
let waiting_room = new WaitingRoom(ENDPOINT.WAITING_ROOM, this.http); | ||
if(await waiting_room.needWait()){ | ||
//TODO: Show a time, which you have to wait. | ||
let wait = false; | ||
if(this.config.use_waiting_room){ | ||
let waiting_room = new WaitingRoom(ENDPOINT.WAITING_ROOM, this.http); | ||
wait = await waiting_room.needWait(); | ||
} | ||
if(wait){ | ||
this.launcher.debug.print('Problems with servers, need wait ' + wait.expected_wait + ' seconds.'); | ||
let sto = setTimeout(_ => { | ||
clearTimeout(sto); | ||
return this.init(); | ||
}, wait.expected_wait*1000); | ||
}else{ | ||
@@ -66,3 +77,5 @@ | ||
console.log(err); | ||
if(typeof err === 'object') | ||
this.launcher.debug.print(err); | ||
else this.launcher.debug.print(new Error(err)); | ||
@@ -102,3 +115,3 @@ } | ||
console.log(err); | ||
throw new Error(err); | ||
@@ -139,3 +152,3 @@ } | ||
console.log(err); | ||
this.launcher.debug.print(new Error(err)); | ||
@@ -142,0 +155,0 @@ } |
@@ -0,0 +0,0 @@ let Request = require('request'); |
@@ -0,0 +0,0 @@ module.exports = (stats) => { |
@@ -0,0 +0,0 @@ module.exports = { |
@@ -0,0 +0,0 @@ module.exports = (stats) => { |
12011
196
90