Browse Source

bug #1898

tags/v0.10.6^2
Shaun 2 years ago
parent
commit
cdea255e4f
3 changed files with 9 additions and 3 deletions
  1. +6
    -1
      src/server/components/auth.js
  2. +1
    -1
      src/server/components/social.js
  3. +2
    -1
      src/server/misc/messages.js

+ 6
- 1
src/server/components/auth.js View File

@@ -348,8 +348,13 @@ module.exports = {
register: async function (msg) {
let credentials = msg.data;

if ((credentials.username === '') || (credentials.password === '')) {
if (credentials.username === '' || credentials.password === '') {
msg.callback(messages.login.allFields);

return;
} else if (credentials.username.length > 32) {
msg.callback(messages.login.maxUsernameLength);

return;
}



+ 1
- 1
src/server/components/social.js View File

@@ -86,7 +86,7 @@ module.exports = {
return;

let source = cons.players.find(c => c.id === sourceId);
if (!source)
if (!source || !source.social)
return;

source.social.sendMessage('invite sent', 'color-yellowB');


+ 2
- 1
src/server/misc/messages.js View File

@@ -5,7 +5,8 @@ module.exports = {
allFields: 'please complete all fields',
illegal: 'illegal characters in username',
incorrect: 'invalid username and password',
charExists: 'character name is taken'
charExists: 'character name is taken',
maxUsernameLength: 'username may not be longer than 32 characters'
},
createCharacter: {
nameLength: 'name must be between 3 and 12 characters'


Loading…
Cancel
Save