aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/main.rs b/src/main.rs
deleted file mode 100644
index 9a84286..0000000
--- a/src/main.rs
+++ /dev/null
@@ -1,44 +0,0 @@
-pub mod condition;
-pub mod interface;
-pub mod protocol;
-
-use crate::{
- condition::{Condition, Property},
- protocol::Task,
-};
-use crossbeam_channel::Sender;
-use interface::network_loop;
-use protocol::{ClientboundPacket, ServerboundPacket};
-
-fn main() {
- network_loop();
-}
-
-pub fn handle_packet(client: u32, packet: ServerboundPacket, responder: Sender<ClientboundPacket>) {
- println!("{:?}, {:?}, {:?}", client, 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,
- }]));
- }
- }
-}