# HG changeset patch # User unc0rr # Date 1540410739 -7200 # Node ID a4877a16564d6622eb3b4714b70f7c0cb96286a3 # Parent 2568fa516733af18f86c152a1216b3948af91c44 Also report chat and added rooms in log diff -r 2568fa516733 -r a4877a16564d rust/hedgewars-checker/Cargo.toml --- a/rust/hedgewars-checker/Cargo.toml Wed Oct 24 21:07:26 2018 +0200 +++ b/rust/hedgewars-checker/Cargo.toml Wed Oct 24 21:52:19 2018 +0200 @@ -1,6 +1,6 @@ [package] name = "hedgewars-checker" -version = "0.1.0" +version = "1.0.0" authors = ["Andrey Korotaev "] [dependencies] diff -r 2568fa516733 -r a4877a16564d rust/hedgewars-checker/src/main.rs --- a/rust/hedgewars-checker/src/main.rs Wed Oct 24 21:07:26 2018 +0200 +++ b/rust/hedgewars-checker/src/main.rs Wed Oct 24 21:52:19 2018 +0200 @@ -154,6 +154,18 @@ } else if msg[..].starts_with(b"BYE") { warn!("Received BYE: {}", String::from_utf8_lossy(&msg[..])); return Ok(()); + } else if msg[..].starts_with(b"CHAT") { + let body = String::from_utf8_lossy(&msg[5..]); + let mut l = body.lines(); + info!("Chat [{}]: {}", l.next().unwrap(), l.next().unwrap()); + } else if msg[..].starts_with(b"ROOM") { + let body = String::from_utf8_lossy(&msg[5..]); + let mut l = body.lines(); + if let Some(action) = l.next() { + if action == "ADD" { + info!("Room added: {}", l.skip(1).next().unwrap()); + } + } } else if msg[..].starts_with(b"ERROR") { warn!("Received ERROR: {}", String::from_utf8_lossy(&msg[..])); return Ok(());