Small tweaks I had lying around

This commit is contained in:
GDColon 2021-09-02 19:07:31 -04:00
parent 6cf6e1b0db
commit 8f2a8c7508
4 changed files with 5 additions and 2 deletions

View file

@ -2,6 +2,8 @@ const request = require('request')
module.exports = async (app, req, res) => {
if (req.isGDPS) return res.send("0")
request.post('http://robtopgames.com/Boomlings/get_scores.php', {
form : { secret: app.config.params.secret || "Wmfd2893gb7", name: "Player" } }, function(err, resp, body) {

View file

@ -5,7 +5,7 @@ module.exports = async (app, req, res) => {
let amount = 100;
let count = req.query.count ? parseInt(req.query.count) : null
if (count && count > 0) {
if (count > 5000) amount = 5000
if (count > 10000) amount = 10000
else amount = count;
}

View file

@ -51,6 +51,7 @@
fetch(`../api/boomlings`).then(res => res.json()).then(res => {
if (res == "0") res = []
$('#boomerbox').html('')
$('.ranking').remove()

View file

@ -103,7 +103,7 @@ app.use(async function(req, res, next) {
target = req.server.overrides ? (req.server.overrides[target] || target) : target
let parameters = params.headers ? params : req.gdParams(params)
let endpoint = req.endpoint
if (params.forceGD || (params.form && params.form.forceGD)) endpoint = "http://boomlings.com/database/"
if (params.forceGD || (params.form && params.form.forceGD)) endpoint = "http://www.boomlings.com/database/"
request.post(endpoint + target + '.php', parameters, function(err, res, body) {
let error = err
if (!error && (err || !body || body.match(/^-\d$/) || body.startsWith("error") || body.startsWith("<"))) {