mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed message about trying to skip
This commit is contained in:
@@ -323,10 +323,10 @@ io.on('connection', function(socket){
|
||||
}else if(get_time() - docs[0]["startTime"] < 10 && lists[coll].length == 2 && !error)
|
||||
{
|
||||
socket.emit("toast", "notyetskip");
|
||||
}else if(!contains(docs[0]["skips"], guid) && get_time() - docs[0]["startTime"] >= 30){
|
||||
}else if(!contains(docs[0]["skips"], guid) && get_time() - docs[0]["startTime"] >= 10){
|
||||
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!");
|
||||
io.sockets.emit('chat,'+coll, rndName(guid) + " tried to skip!");
|
||||
socket.broadcast.emit('chat,'+coll, rndName(guid) + " tried to skip!");
|
||||
});
|
||||
}else{
|
||||
socket.emit("toast", "alreadyskip");
|
||||
@@ -492,7 +492,6 @@ function vote(coll, id, guid, socket)
|
||||
db.collection(coll).update({id:id}, {$push :{guids: guid}}, function(err, docs)
|
||||
{
|
||||
socket.emit("toast", "voted");
|
||||
socket.broadcast.emit('chat,'+coll, rndName(guid) + " voted to skip");
|
||||
sort_list(coll, undefined, false, true);
|
||||
});
|
||||
//sort_list(coll, undefined, false);
|
||||
|
||||
Reference in New Issue
Block a user