This repository is an old project and has been abandoned. The new version is private, and is a complete overhaul adding new functionality, allowing higher traffic, caching and is generally more secure.
I am leaving this outdated repository public for others who would like to use some of the code for their own project (Poor code and bad practices, but might still be useful).
This is a simple proxy server that fetches Dead By Daylight statistics and total online player count.
-
/?action=getPlayerGameStats&args={"steamid":"<INSERT STEAMID64"}- fetches a JSON file containing game statistics for given steamid profile.Note: Game details setting on a given Steam profile must be public in order to get the stats. Otherwise
500 Internal Server Errorstatus will be received from Steam API. -
/?action=getPlayerCount- fetches total amount of online players currently playing Dead By Daylight. Only players who are logged in to Steam are taken into account. -
/?action=getPlayerInfo&args={"link":"<INSERT STEAM PROFILE LINK>"}Fetches an XML containing steam profile information, including SteamID64. -
/?action=getPlayerTime&args={"steamid":"<INSERT STEAMID64>"}Fetches time played for Dead By Daylight.
Note that all arguments must be passed as string, by using quotes "", otherwise long numbers such as SteamID will lose precision and be rounded to 0 at the end. This will fetch a wrong/invalid profile.
DBD API: (As of 23 of June 2020, the DBD api seems to be down or changed the endpoints and this is currently not working anymore)
-
/?action=getShrineFetches Current Shrine in DBD Store and time remaining.Note: This is currently not working due to incorrect POST body, feel free to correct it.
-
/?action=getOutfitsFetches Current Outfits in DBD StoreNote: This doesn't always include the newest data. Still working on it, again, feel free to correct it :)
-
/?action=getConfigFetches Current DBD config. This lists the latest settings of DBD as well as contains Kraken Decryption Key for CDN which I have not implemented yet. This allows to fetch and decrypt news and other CDN content.
- Install Node.js. Works with version 13.12.0. Should work with newest.
- Clone/download this repository.
- run
npm installfrom the repository directory to install dependencies. - Get Steam API key (if you don't have one, get one here).
- Get a SSL key and certificate, you can get a self signed one using openssl Linux or Windows. Use the following command in the root directory of this project:
openssl req -nodes -x509 -keyout ssl/server-key.pem -out ssl/server-cert.pem. You can also sign it using certified SSL services like Let's Encrypt (a requirement for certain hosting services like Github Pages, openssl doesn't seem to work). - Once everything is done, run
npm start <port>to start the server on desired port, else it will default to443. Make sure your port is open and if running on linux usesudo. You will be prompted for your Steam API Key. It will be saved inauth.jsonin the root folder. Upon next server launch, it will be loaded from there.
Once the server is running, you can request a https request from your website/service using one of the available calls. e.g.
https://<your-domain>/?action=getPlayerCount or locally https://localhost:<port>/?action=getPlayerCount
If Steam or DBD API fails to return a response, the server will return error response with status and the origin API.
{
error: <message>
from: <api name>
statusCode: <code>
message: <data returned from api>
}