# Conflicts: # src/server/components/mob.jstags/v0.11.0
@@ -57,7 +57,7 @@ module.exports = { | |||||
customChannels: [], | customChannels: [], | ||||
play: async function (data) { | play: async function (data) { | ||||
if (!this.username) | |||||
if (!this.username || this.charname) | |||||
return; | return; | ||||
let character = this.characters[data.data.name]; | let character = this.characters[data.data.name]; | ||||
@@ -148,7 +148,7 @@ module.exports = { | |||||
learnAbility: function ({ itemId, slot }) { | learnAbility: function ({ itemId, slot }) { | ||||
let item = this.findItem(itemId); | let item = this.findItem(itemId); | ||||
let statValues = this.obj.stats.values; | let statValues = this.obj.stats.values; | ||||
if (!item) | |||||
if (!item || item.eq) | |||||
return; | return; | ||||
else if (!item.spell) { | else if (!item.spell) { | ||||
item.eq = false; | item.eq = false; | ||||
@@ -130,8 +130,9 @@ module.exports = { | |||||
/* eslint-disable-next-line no-console */ | /* eslint-disable-next-line no-console */ | ||||
console.log('MOB HAS NO SPELLBOOK BUT WANTS TO RESET ROTATION'); | console.log('MOB HAS NO SPELLBOOK BUT WANTS TO RESET ROTATION'); | ||||
/* eslint-disable-next-line no-console */ | /* eslint-disable-next-line no-console */ | ||||
console.log(obj.name, obj.zoneName, obj.x, obj.y); | |||||
console.log(obj.name, obj.zone, obj.zoneName, obj.x, obj.y, obj.components.map(c => c.type).join(',')); | |||||
} | } | ||||
obj.spellbook.resetRotation(); | obj.spellbook.resetRotation(); | ||||
} | } | ||||
} | } | ||||
@@ -12,6 +12,9 @@ module.exports = { | |||||
playing: 0, | playing: 0, | ||||
onHandshake: function (socket) { | onHandshake: function (socket) { | ||||
if (this.players.some(f => f.socket.id === socket.id)) | |||||
return; | |||||
const p = objects.build(); | const p = objects.build(); | ||||
p.socket = socket; | p.socket = socket; | ||||
p.addComponent('auth'); | p.addComponent('auth'); | ||||
@@ -107,6 +110,7 @@ module.exports = { | |||||
//A hack to allow us to actually call methods again (like retrieve the player list) | //A hack to allow us to actually call methods again (like retrieve the player list) | ||||
player.dead = false; | player.dead = false; | ||||
player.permadead = false; | player.permadead = false; | ||||
delete player.auth.charname; | |||||
this.modifyPlayerCount(-1); | this.modifyPlayerCount(-1); | ||||
}, | }, | ||||