Browse Source

bug #1885: Fixed a crash

tags/v0.10.6^2
Shaun 2 years ago
parent
commit
a59e9e2a3c
2 changed files with 11 additions and 6 deletions
  1. +7
    -2
      src/server/components/auth.js
  2. +4
    -4
      src/server/components/stash.js

+ 7
- 2
src/server/components/auth.js View File

@@ -114,10 +114,15 @@ module.exports = {
},

doSaveStash: async function () {
const { username, obj: { stash } } = this;

if (!stash.changed)
return;

await io.setAsync({
key: this.username,
key: username,
table: 'stash',
value: this.obj.stash.serialize(),
value: stash.serialize(),
clean: true,
serialize: true
});


+ 4
- 4
src/server/components/stash.js View File

@@ -87,14 +87,14 @@ module.exports = {
}
}

this.changed = true;

this.getItem(item);

const sendItem = cpnInventory.simplifyItem.call({ obj: {} }, item);

obj.instance.syncer.queue('onAddStashItems', [sendItem], [obj.serverId]);

this.changed = true;

return true;
},

@@ -114,12 +114,12 @@ module.exports = {
return;
}

this.changed = true;

obj.inventory.getItem(item);
items.spliceWhere(i => i === item);

obj.instance.syncer.queue('onRemoveStashItems', [id], [obj.serverId]);

this.changed = true;
},

setActive: function (active) {


Loading…
Cancel
Save