Chunk loading

This commit is contained in:
2025-12-22 20:55:50 +01:00
parent 50a9699bb2
commit efeabe279f
6 changed files with 46 additions and 26 deletions
+1 -10
View File
@@ -1,6 +1,5 @@
use std::{
collections::HashSet,
fs::{self},
net::{TcpListener, TcpStream},
path::{Path, PathBuf},
sync::{
@@ -159,21 +158,13 @@ impl Server {
match self.wrap_err(&client, client.read_t::<types::handshake::ClientDetails>())? {
Some(types::message::WsMessage::Message(types::handshake::ClientDetails {
auth_token,
last_message,
..
})) => {
let auth_res = utils::auth::auth(self, &mut client, &auth_token);
let uuid = self.wrap_err(&client, auth_res)?;
self.wrap_err(
&client,
client.send(types::message::ServerMessage::Authenticated {
uuid,
messages: if let Some(i) = last_message {
self.wrap_err(&client, self.db.get_messages_after_id(i))?
} else {
self.wrap_err(&client, self.db.get_messages_after_id(0))?
},
}),
client.send(types::message::ServerMessage::Authenticated { uuid }),
)?;
}
Some(v) => {