forked from cory/tildefriends
To calculate an ID, take the utf-8 message, convert it to utf-16, and then throw away the high bytes. Of course.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3834 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -219,7 +219,9 @@ function ebtReplicateSendClock(request, have) {
|
||||
}
|
||||
|
||||
var to_send = {}
|
||||
for (let id of ids) {
|
||||
var offset = Math.floor(Math.random() * ids.length);
|
||||
for (var i = 0; i < ids.length; i++) {
|
||||
var id = ids[(i + offset) % ids.length];
|
||||
if (last_sent[id] === undefined || message[id] > last_sent[id]) {
|
||||
last_sent[id] = to_send[id] = message[id] === -1 ? -1 : message[id] << 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user