mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Added so name is used instead of guid on skipping
This commit is contained in:
@@ -337,14 +337,14 @@ io.on('connection', function(socket){
|
|||||||
{
|
{
|
||||||
change_song(coll);
|
change_song(coll);
|
||||||
socket.emit("toast", "skip");
|
socket.emit("toast", "skip");
|
||||||
io.sockets.emit('chat,'+coll, rndName(guid) + " skipped");
|
io.sockets.emit('chat,'+coll, name + " skipped");
|
||||||
}/*else if(get_time() - docs[0]["startTime"] < 10 && lists[coll].length == 2 && !error)
|
}/*else if(get_time() - docs[0]["startTime"] < 10 && lists[coll].length == 2 && !error)
|
||||||
{
|
{
|
||||||
socket.emit("toast", "notyetskip");
|
socket.emit("toast", "notyetskip");
|
||||||
}*/else if(!contains(docs[0]["skips"], guid)){
|
}*/else if(!contains(docs[0]["skips"], guid)){
|
||||||
db.collection(coll).update({views:{$exists:true}}, {$push:{skips:guid}}, function(err, d){
|
db.collection(coll).update({views:{$exists:true}}, {$push:{skips:guid}}, function(err, d){
|
||||||
socket.emit("toast", (Math.ceil(lists[coll].length/2) - docs[0]["skips"].length-1) + " more are needed to skip!");
|
socket.emit("toast", (Math.ceil(lists[coll].length/2) - docs[0]["skips"].length-1) + " more are needed to skip!");
|
||||||
socket.broadcast.emit('chat,'+coll, rndName(guid) + " voted to skip");
|
socket.broadcast.emit('chat,'+coll, name + " voted to skip");
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
socket.emit("toast", "alreadyskip");
|
socket.emit("toast", "alreadyskip");
|
||||||
|
|||||||
Reference in New Issue
Block a user