@@ -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; | ||||
@@ -12,6 +12,9 @@ module.exports = { | |||||
playing: 0, | playing: 0, | ||||
onHandshake: function (socket) { | onHandshake: function (socket) { | ||||
if (this.players.some(p => p.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); | ||||
}, | }, | ||||