Ver código fonte

fixed linting issues

tags/v0.3.2
Big Bad Waffle 5 anos atrás
pai
commit
e91b3bdbbe
7 arquivos alterados com 19 adições e 17 exclusões
  1. +4
    -6
      src/client/js/misc/helpers.js
  2. +2
    -2
      src/client/ui/templates/messages/messages.js
  3. +0
    -1
      src/client/ui/templates/tooltipItem/tooltipItem.js
  4. +1
    -1
      src/server/components/equipment.js
  5. +0
    -2
      src/server/globals.js
  6. +1
    -1
      src/server/objects/objects.js
  7. +11
    -4
      src/server/security/ioFirebase.js

+ 4
- 6
src/client/js/misc/helpers.js Ver arquivo

@@ -1,5 +1,3 @@
/* global _, scale, scaleMult, isMobile */

window.isMobile = /Mobi|Android/i.test(navigator.userAgent);
window.scale = isMobile ? 32 : 40;
window.scaleMult = isMobile ? 4 : 5;
@@ -59,8 +57,8 @@ Object.defineProperty(Object.prototype, 'has', {
}
});

//eslint-disable-next-line no-extend-native
if (!String.prototype.padStart) {
//eslint-disable-next-line no-extend-native
String.prototype.padStart = function padStart (targetLength, padString) {
targetLength = targetLength >> 0;
padString = String(typeof padString !== 'undefined' ? padString : ' ');
@@ -75,17 +73,17 @@ if (!String.prototype.padStart) {
};
}

//eslint-disable-next-line no-extend-native
if (!String.prototype.padStart) {
//eslint-disable-next-line no-extend-native
String.prototype.padStart = function padStart (targetLength, padString) {
targetLength = targetLength >> 0; //truncate if number, or convert non-number to 0;
targetLength = targetLength >> 0;
padString = String(typeof padString !== 'undefined' ? padString : ' ');
if (this.length >= targetLength)
return String(this);
targetLength = targetLength - this.length;
if (targetLength > padString.length)
padString += padString.repeat(targetLength / padString.length); //append to original to ensure we are longer than needed
padString += padString.repeat(targetLength / padString.length);
return padString.slice(0, targetLength) + String(this);
};


+ 2
- 2
src/client/ui/templates/messages/messages.js Ver arquivo

@@ -127,6 +127,8 @@ define([
clickKey: function (key) {
window.navigator.vibrate(20);

let elInput = this.find('input');

const handler = {
caps: () => {
this.kbUpper = (this.kbUpper + 1) % 3;
@@ -138,7 +140,6 @@ define([
},

backspace: () => {
let elInput = this.find('input');
elInput.val(elInput.val().slice(0, -1));
this.find('.input').html(elInput.val());
},
@@ -156,7 +157,6 @@ define([
return;
}

let elInput = this.find('input');
elInput.val(elInput.val() + key);
this.checkChatLength();



+ 0
- 1
src/client/ui/templates/tooltipItem/tooltipItem.js Ver arquivo

@@ -182,7 +182,6 @@ define([

let compareImplicitStats = compare.implicitStats;
tempImplicitStats.forEach(s => {
let statName = s.stat;
let statValue = s.value;

let f = compareImplicitStats.find(c => c.stat === statValue);


+ 1
- 1
src/server/components/equipment.js Ver arquivo

@@ -344,4 +344,4 @@ module.exports = {

this.obj.instance.syncer.queue('onInspectTarget', result, [this.obj.serverId]);
}
};
};

+ 0
- 2
src/server/globals.js Ver arquivo

@@ -1,5 +1,3 @@
/* global io, extend, cons, _, atlas, leaderboard, clientConfig */

global.io = require('./security/io');
global.extend = require('./misc/clone');
global.cons = require('./security/connections');


+ 1
- 1
src/server/objects/objects.js Ver arquivo

@@ -54,7 +54,7 @@ module.exports = {
cpn.transfer();
}

this.physics.addObject(obj, obj.x, obj.y);
//this.physics.addObject(obj, obj.x, obj.y);

return obj;
},


+ 11
- 4
src/server/security/ioFirebase.js Ver arquivo

@@ -7,8 +7,8 @@ module.exports = {
db: null,
io: null,

init: async function (io, convert) {
this.io = io;
init: async function (oldIo, convert) {
this.io = oldIo;

firebase.initializeApp(fConfig);
this.db = firebase.database();
@@ -75,10 +75,12 @@ module.exports = {

for (let table of tables) {
if (skip.includes(table)) {
//eslint-disable-next-line no-console
console.log(`Skipping ${table}`);
continue;
}

//eslint-disable-next-line no-console
console.log(`Converting ${table}`);
if (table === 'character') {
await this.convertCorrupted('character', {}, true);
@@ -98,14 +100,17 @@ module.exports = {
});

let length = records.length;
//eslint-disable-next-line no-console
console.log(`${length} records`);
let i = 0;
for (let record of records) {
//eslint-disable-next-line no-console
console.log(++i + '/' + length);
//if (table === 'login' && i < 12400)
// continue;

if (!record.key || record.key.indexOf('.') > -1 || record.key.indexOf('$') > -1 || record.key.indexOf('#') > -1) {
//eslint-disable-next-line no-console
console.log(`Invalid key ${record.key}`);
fs.appendFileSync(`failed-${table}`, record.key + '\r\n');
continue;
@@ -122,8 +127,8 @@ module.exports = {

let length = records.length;
let i = 0;
let failed = [];
for (let record of records) {
//eslint-disable-next-line no-console
console.log(++i + '/' + length);
let charList = record.value;
for (let charName of charList) {
@@ -137,8 +142,10 @@ module.exports = {
});

if (!character) {
if (showErrors)
if (showErrors) {
//eslint-disable-next-line no-console
console.log(charName + ' failed');
}
} else
await this.write(table, charName, character);
} catch (e) {}


Carregando…
Cancelar
Salvar