Small tweaks I had lying around
This commit is contained in:
parent
6cf6e1b0db
commit
8f2a8c7508
4 changed files with 5 additions and 2 deletions
|
@ -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) {
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
|
||||
fetch(`../api/boomlings`).then(res => res.json()).then(res => {
|
||||
|
||||
if (res == "0") res = []
|
||||
$('#boomerbox').html('')
|
||||
$('.ranking').remove()
|
||||
|
||||
|
|
2
index.js
2
index.js
|
@ -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("<"))) {
|
||||
|
|
Loading…
Add table
Reference in a new issue