Finished up with personal emotes.
This commit is contained in:
parent
a4a1f6a65b
commit
93cece48ea
5 changed files with 103 additions and 50 deletions
|
|
@ -32,6 +32,7 @@ module.exports = class{
|
|||
socket.on("setFlair", (data) => {this.setFlair(socket, data)});
|
||||
socket.on("setHighLevel", (data) => {this.setHighLevel(socket, data)});
|
||||
socket.on("addPersonalEmote", (data) => {this.addPersonalEmote(socket, data)});
|
||||
socket.on("deletePersonalEmote", (data) => {this.deletePersonalEmote(socket, data)});
|
||||
}
|
||||
|
||||
handleChat(socket, data){
|
||||
|
|
@ -112,6 +113,16 @@ module.exports = class{
|
|||
}
|
||||
}
|
||||
|
||||
async deletePersonalEmote(socket, data){
|
||||
//Get user doc from DB based on socket
|
||||
const userDB = await userModel.findOne({user: socket.user.user});
|
||||
|
||||
//if we found a user
|
||||
if(userDB != null){
|
||||
await userDB.deleteEmote(data.name);
|
||||
}
|
||||
}
|
||||
|
||||
relayUserChat(socket, msg, type, links){
|
||||
const user = this.server.getSocketInfo(socket);
|
||||
this.relayChat(user.user, user.flair, user.highLevel, msg, type, socket.chan, links)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue