feat: add missing message handlers

This commit is contained in:
michel
2024-09-13 20:58:04 +02:00
committed by Michel de Graaf
parent 6281b0c89e
commit 10f4a34ae4
34 changed files with 1889 additions and 564 deletions
+20
View File
@@ -0,0 +1,20 @@
use std::sync::mpsc::Sender;
use crate::{
message::{Message, MessageHandler},
server::ServerOperation,
};
pub struct ParentSpeedRatioHandler;
// The server sends us a speed ratio determining the number of children we can have in the distributed network. The maximum number of children is our upload speed divided by the speed ratio.
impl MessageHandler for ParentSpeedRatioHandler {
fn get_code(&self) -> u8 {
84
}
fn handle(&self, message: &mut Message, _sender: Sender<ServerOperation>) {
let number = message.read_int32();
println!("Parent min speed: {}", number);
}
}