-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlib.rs
More file actions
22 lines (18 loc) · 636 Bytes
/
lib.rs
File metadata and controls
22 lines (18 loc) · 636 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use std::net::UdpSocket;
use anyhow::Result;
use rosc::OscPacket;
#[no_mangle]
#[allow(clippy::needless_pass_by_value)]
#[tokio::main(flavor = "current_thread")]
async extern "Rust" fn load(socket: UdpSocket) -> Result<()> {
println!("Debug Enabled");
let mut buf = [0u8; rosc::decoder::MTU];
loop {
let size = socket.recv(&mut buf).unwrap();
let (_buf, packet) = rosc::decoder::decode_udp(&buf[..size]).unwrap();
let OscPacket::Message(packet) = packet else {
continue; // I don't think VRChat uses bundles
};
println!("{} | {:?}", packet.addr, packet.args);
}
}