Commit 10b0cdf6 authored by nanahira's avatar nanahira

fixup for 1353

parent a55548f9
Pipeline #5142 passed with stages
in 40 minutes and 36 seconds
......@@ -11,9 +11,9 @@ class replayHeader
@id = 0
@version = 0
@flag = 0
@seed = 0
@time = 0
@dataSizeRaw = []
@hash = 0
@seed = 0
@props = []
getDataSize: ->
......@@ -137,9 +137,9 @@ class Replay
header.id = reader.readInt32()
header.version = reader.readInt32()
header.flag = reader.readInt32()
header.seed = reader.readInt32()
header.time = reader.readInt32()
header.dataSizeRaw = reader.readByteArray 4
header.hash = reader.readInt32()
header.seed = reader.readInt32()
header.props = reader.readByteArray 8
header
......
......@@ -13,9 +13,9 @@
this.id = 0;
this.version = 0;
this.flag = 0;
this.seed = 0;
this.time = 0;
this.dataSizeRaw = [];
this.hash = 0;
this.seed = 0;
this.props = [];
}
......@@ -201,9 +201,9 @@
header.id = reader.readInt32();
header.version = reader.readInt32();
header.flag = reader.readInt32();
header.seed = reader.readInt32();
header.time = reader.readInt32();
header.dataSizeRaw = reader.readByteArray(4);
header.hash = reader.readInt32();
header.seed = reader.readInt32();
header.props = reader.readByteArray(8);
return header;
}
......
......@@ -1191,23 +1191,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) ->
......
......@@ -1567,27 +1567,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(function() {
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