transporttycoon
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -12,2 +12,3 @@ import { PlayerPositions } from './models/PlayerPositions'; | ||
import { OwnedVehicles } from './models/OwnedVehicles'; | ||
import { Weather } from './models/Weather'; | ||
export declare class TransportTycoon { | ||
@@ -27,2 +28,3 @@ private token; | ||
getCharges(): number; | ||
getCurrentWeather(server?: number): Promise<Weather>; | ||
getActiveAirlineRoutes(server?: number): Promise<ActiveAirline>; | ||
@@ -29,0 +31,0 @@ getPlayerPositions(server?: number): Promise<PlayerPositions>; |
@@ -86,2 +86,15 @@ "use strict"; | ||
} | ||
async getCurrentWeather(server = 0) { | ||
if (server - 1 > tycoonServers.length) | ||
return Promise.reject('Please enter a valid server id from 0 - 9.'); | ||
try { | ||
if (this.charges.checking && this.charges.count > 0) | ||
this.charges.count--; | ||
const res = await this.tycoon.get(`http://${tycoonServers[server]}/status/weather.json`); | ||
return Promise.resolve(res.data); | ||
} | ||
catch (err) { | ||
return Promise.reject(err); | ||
} | ||
} | ||
async getActiveAirlineRoutes(server = 0) { | ||
@@ -88,0 +101,0 @@ if (server - 1 > tycoonServers.length) |
{ | ||
"name": "transporttycoon", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Wrapper for the Transport Tycoon FiveM server API", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24874
34
758