Print simple HelloCmd packet

This commit is contained in:
Joscha 2022-02-07 22:44:30 +01:00
parent 0c9f5e91a3
commit 5cf0f76477
5 changed files with 121 additions and 7 deletions

View file

@ -4,3 +4,5 @@ version = "0.1.0"
edition = "2021"
[dependencies]
cove-core = { path = "../cove-core" }
serde_json = "1.0.78"

View file

@ -1,3 +1,12 @@
use cove_core::{Data, HelloCmd, Packet};
fn main() {
println!("Hello, world!");
let packet = Packet {
id: 1337,
data: Data::HelloCmd(HelloCmd {
name: "Garmy".to_string(),
}),
};
println!("{}", serde_json::to_string(&packet).unwrap());
}