Chunk loading
This commit is contained in:
+1
-10
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user