Skip to content

Commit ade664b

Browse files
committed
improve chat performance
1 parent ff94fa7 commit ade664b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Zero-K.info/Controllers/LobbyController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ await Global.Server.GhostSay(new Say()
205205
}
206206
ret = ret
207207
.Where(x => x.Target == model.Channel && x.SayPlace == SayPlace.Channel)
208-
.OrderByDescending(x => x.Time).Take(200);
208+
.OrderByDescending(x => x.LobbyChatHistoryID).Take(200);
209209
}
210210
else if (!string.IsNullOrEmpty(model.User))
211211
{
@@ -226,7 +226,7 @@ await Global.Server.GhostSay(new Say()
226226
//Users can abuse rename to gain access to other users PMs, it's a feature
227227
ret = ret
228228
.Where(x => (x.User == model.User && x.Target == Global.Account.Name || x.User == Global.Account.Name && x.Target == model.User) && x.SayPlace == SayPlace.User)
229-
.OrderByDescending(x => x.Time);
229+
.OrderByDescending(x => x.LobbyChatHistoryID);
230230
}
231231
else
232232
{

Zero-K.info/Views/Lobby/LobbyChat.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
if (document.getElementById('chatbox').value == '') {
4242
$('form#form').trigger('submit');
4343
}
44+
setTimeout(updateChat, 5000);
4445
}
45-
setInterval(updateChat, 5000);
4646
updateChat();
4747
</script>

0 commit comments

Comments
 (0)