Commit d5bca1cc authored by nanahira's avatar nanahira

fix seed

parent b0b2380a
Pipeline #5640 failed with stages
in 6 minutes and 27 seconds
......@@ -1198,23 +1198,7 @@ SOCKET_flush_data = global.SOCKET_flush_data = (sk, datas) ->
return true
getSeedTimet = global.getSeedTimet = (count) ->
ret = []
for i in [0...count]
curTime = null
while !curTime or _.any(ret, (time) ->
return time == curTime.unix()
)
curTime = moment()
offset = Math.floor(Math.random() * 240) - 120
if offset > 0
curTime = curTime.add(offset, "s")
else if offset < 0
curTime = curTime.subtract(-offset, "s")
ret.push(curTime.unix())
ret.sort((a, b) ->
return a - b
)
return ret
return _.range(count).map(() => 0)
class Room
constructor: (name, @hostinfo) ->
......
......@@ -1582,27 +1582,9 @@
};
getSeedTimet = global.getSeedTimet = function(count) {
var curTime, i, j, offset, ref, ret;
ret = [];
for (i = j = 0, ref = count; (0 <= ref ? j < ref : j > ref); i = 0 <= ref ? ++j : --j) {
curTime = null;
while (!curTime || _.any(ret, function(time) {
return time === curTime.unix();
})) {
curTime = moment();
offset = Math.floor(Math.random() * 240) - 120;
if (offset > 0) {
curTime = curTime.add(offset, "s");
} else if (offset < 0) {
curTime = curTime.subtract(-offset, "s");
}
}
ret.push(curTime.unix());
}
ret.sort(function(a, b) {
return a - b;
return _.range(count).map(() => {
return 0;
});
return ret;
};
Room = class Room {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment