Compare commits

...

2 Commits

Author SHA1 Message Date
ThePendulum 701cf82af8 1.5.16 2021-11-16 00:40:04 +01:00
ThePendulum 9c5bcbdd22 Stripping off @-prefix from points username. 2021-11-16 00:40:02 +01:00
3 changed files with 5 additions and 4 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "schat2-clive",
"version": "1.5.15",
"version": "1.5.16",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "schat2-clive",
"version": "1.5.15",
"version": "1.5.16",
"license": "ISC",
"dependencies": {
"bhttp": "^1.2.8",

View File

@ -1,6 +1,6 @@
{
"name": "schat2-clive",
"version": "1.5.15",
"version": "1.5.16",
"description": "Game host for SChat 2-powered chat sites",
"main": "src/app.js",
"scripts": {

View File

@ -72,7 +72,8 @@ async function setPoints(defaultKey, user, value, { mode = 'add', key } = {}) {
await fs.writeFile(`./points-${instance}.json`, JSON.stringify(points, null, 4));
}
function getPoints(game, username, { user, room, command }) {
function getPoints(game, rawUsername, { user, room, command }) {
const username = rawUsername?.replace(/^@/, '');
const gamePoints = points[command] || points[game.key];
const userPoints = username