update username on realtime
This commit is contained in:
@@ -102,7 +102,10 @@ export default async function listenKills() {
|
|||||||
killEntry.max_distance = Math.max(killEntry.max_distance || 0, payload.distance)
|
killEntry.max_distance = Math.max(killEntry.max_distance || 0, payload.distance)
|
||||||
}
|
}
|
||||||
deathEntry.deaths++
|
deathEntry.deaths++
|
||||||
|
deathEntry.attacker_name = payload.victim_name
|
||||||
deathWithWeaponEntry.deaths_with_weapon++
|
deathWithWeaponEntry.deaths_with_weapon++
|
||||||
|
deathWithWeaponEntry.attacker_name = payload.victim_name
|
||||||
|
killEntry.attacker_name = payload.attacker_name
|
||||||
})
|
})
|
||||||
return pgClient
|
return pgClient
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,6 +145,7 @@ router.post(
|
|||||||
//body('servername').customSanitizer(e => e.replace(/[^a-z0-9]/gi, '')),
|
//body('servername').customSanitizer(e => e.replace(/[^a-z0-9]/gi, '')),
|
||||||
validateErrors,
|
validateErrors,
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
|
// Do we check the same thing twice ?????
|
||||||
if (!req.headers.authorization) return res.sendStatus(403)
|
if (!req.headers.authorization) return res.sendStatus(403)
|
||||||
const headers = req.headers.authorization.split(' ')
|
const headers = req.headers.authorization.split(' ')
|
||||||
if (headers[0].toLowerCase() != "bearer") return res.status(403).send("authorization must be token bearer")
|
if (headers[0].toLowerCase() != "bearer") return res.status(403).send("authorization must be token bearer")
|
||||||
@@ -238,7 +239,7 @@ router.post(
|
|||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
res.sendStatus(500)
|
res.sendStatus(500)
|
||||||
console.log({
|
console.error({
|
||||||
killstat_version,
|
killstat_version,
|
||||||
servername,
|
servername,
|
||||||
host,
|
host,
|
||||||
|
|||||||
Reference in New Issue
Block a user