update username on realtime

This commit is contained in:
2023-05-03 20:27:00 +02:00
parent 6066f2e4b4
commit d3c8d4cecc
2 changed files with 5 additions and 1 deletions
+3
View File
@@ -102,7 +102,10 @@ export default async function listenKills() {
killEntry.max_distance = Math.max(killEntry.max_distance || 0, payload.distance)
}
deathEntry.deaths++
deathEntry.attacker_name = payload.victim_name
deathWithWeaponEntry.deaths_with_weapon++
deathWithWeaponEntry.attacker_name = payload.victim_name
killEntry.attacker_name = payload.attacker_name
})
return pgClient
}
+2 -1
View File
@@ -145,6 +145,7 @@ router.post(
//body('servername').customSanitizer(e => e.replace(/[^a-z0-9]/gi, '')),
validateErrors,
async (req, res) => {
// Do we check the same thing twice ?????
if (!req.headers.authorization) return res.sendStatus(403)
const headers = req.headers.authorization.split(' ')
if (headers[0].toLowerCase() != "bearer") return res.status(403).send("authorization must be token bearer")
@@ -238,7 +239,7 @@ router.post(
})
.catch((e) => {
res.sendStatus(500)
console.log({
console.error({
killstat_version,
servername,
host,