let multiplayer name be set in browser storage rather than fully anonymous

This commit is contained in:
Dave Conway-Jones
2024-10-11 09:08:17 +01:00
parent 83acc4836b
commit d457c81547
2 changed files with 8 additions and 5 deletions

View File

@@ -42,7 +42,7 @@ module.exports = {
let user = opts.user
if (!user || user.anonymous) {
user = user || { anonymous: true }
user.username = `Anon ${Math.floor(Math.random()*100)}`
user.username = opts?.data?.name || `Anon ${Math.floor(Math.random()*100)}`
}
session = {
session: opts.data.session,