diff options
author | metamuffin <yvchraiqi@protonmail.com> | 2022-06-10 10:00:06 +0200 |
---|---|---|
committer | metamuffin <yvchraiqi@protonmail.com> | 2022-06-10 10:00:06 +0200 |
commit | a392a04c83b4e0a8050066280f7efc74d182bcab (patch) | |
tree | 976880f1d223d4a113b50b96ba09e1687040dc17 /src/main.rs | |
parent | f8edbf82aa2a0a7da8808bc2e196e9f219238467 (diff) | |
download | karlender-a392a04c83b4e0a8050066280f7efc74d182bcab.tar karlender-a392a04c83b4e0a8050066280f7efc74d182bcab.tar.bz2 karlender-a392a04c83b4e0a8050066280f7efc74d182bcab.tar.zst |
blub
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index d237df0..e447202 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,6 +7,11 @@ use interface::network_loop; use protocol::{ClientboundPacket, ServerboundPacket}; use std::time::Duration; +use crate::{ + condition::{Condition, Property}, + protocol::Task, +}; + fn main() { let (s, r) = crossbeam_channel::unbounded(); std::thread::spawn(move || network_loop(s)); @@ -17,6 +22,31 @@ fn main_loop(packets: Receiver<(u32, ServerboundPacket, Sender<ClientboundPacket loop { for (client_id, packet, responder) in packets.try_iter() { println!("{:?}, {:?}, {:?}", client_id, packet, responder); + match packet { + ServerboundPacket::Download => { + let _ = responder.send(ClientboundPacket::DownloadResponse(vec![Task { + name: "blub".to_string(), + description: "blob".to_string(), + tags: vec![], + priority: 69.0, + completed: None, + scheduled: None, + occurence: Some(Condition::And(vec![ + Condition::Equal { + modulus: None, + prop: Property::Monthofyear, + value: 1, + }, + Condition::Equal { + modulus: None, + prop: Property::Hour, + value: 12, + }, + ])), + deadline: None, + }])); + } + } } std::thread::sleep(Duration::from_secs_f64(10.0 / 30.0)); } |