Commit 5cf4dea49875c1d10bd0a2a6d7797242eb8539e0
Merge branch 'master' of http://gitlab.vchangyi.com/liupengwei/party
Showing
1 changed file
with
1 additions
and
1 deletions
server.js
@@ -53,7 +53,7 @@ io.on('connection', function(socket) { | @@ -53,7 +53,7 @@ io.on('connection', function(socket) { | ||
53 | io.emit('barrage', msg); | 53 | io.emit('barrage', msg); |
54 | clearInterval(timer); | 54 | clearInterval(timer); |
55 | timer = setInterval(function() { | 55 | timer = setInterval(function() { |
56 | - var msg = defaultMsgs[Math.floor(Math.random() * (19 - 0 + 1))]; | 56 | + var msg = defaultMsgs[Math.floor(Math.random() * (defaultMsgs.length - 1 - 0 + 1))]; |
57 | io.emit('barrage', msg); | 57 | io.emit('barrage', msg); |
58 | }, 25000); | 58 | }, 25000); |
59 | }); | 59 | }); |