Fix multiple chat messages in one update appearing out of order

This commit is contained in:
James Lyne 2021-01-05 22:03:27 +00:00
parent 652a63e278
commit 022a5914c2

View File

@ -524,8 +524,9 @@ function buildUpdates(data: Array<any>): DynmapUpdates {
}
}
//Sort chat by newest first
updates.chat = updates.chat.sort((one, two) => {
return one.timestamp - two.timestamp;
return two.timestamp - one.timestamp;
});
console.debug(`Updates: ${accepted} accepted. Rejected: `, dropped);