From ca6e909df09131e9e73f7089f43cdd459d24fd7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Sat, 28 Nov 2020 02:35:20 +0100 Subject: add ping/pong to mumlib commands --- mumd/src/state.rs | 3 +++ mumlib/src/command.rs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/mumd/src/state.rs b/mumd/src/state.rs index 71f7358..7a4704a 100644 --- a/mumd/src/state.rs +++ b/mumd/src/state.rs @@ -303,6 +303,9 @@ impl State { self.audio.set_output_volume(volume); now!(Ok(None)) } + Command::Ping => { + now!(Ok(Some(CommandResponse::Pong))) + } Command::ServerConnect { host, port, diff --git a/mumlib/src/command.rs b/mumlib/src/command.rs index 8c54b20..73a065d 100644 --- a/mumlib/src/command.rs +++ b/mumlib/src/command.rs @@ -14,6 +14,7 @@ pub enum Command { MuteOther(String, Option), MuteSelf(Option), OutputVolumeSet(f32), + Ping, ServerConnect { host: String, port: u16, @@ -40,6 +41,7 @@ pub enum CommandResponse { MuteStatus { is_muted: bool, }, + Pong, ServerConnect { welcome_message: Option, }, -- cgit v1.2.1