From ea2073c3c9b7a0ce17e8ef4bf56d5cb6eb66e6d3 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 18 Nov 2020 20:36:36 +0000 Subject: [PATCH] checkaccount command Signed-off-by: Ian Jackson --- src/cmdlistener.rs | 6 ++++++ src/commands.rs | 1 + 2 files changed, 7 insertions(+) diff --git a/src/cmdlistener.rs b/src/cmdlistener.rs index ee74b66d..3eaa4e9e 100644 --- a/src/cmdlistener.rs +++ b/src/cmdlistener.rs @@ -141,6 +141,12 @@ fn execute(cs: &mut CommandStream, cmd: MgmtCommand) -> MgmtResponse { Fine }, + CheckAccount() => { + let ag = AccountsGuard::lock(); + let _ok = ag.lookup(&cs.current_account()?.notional_account)?; + Fine + } + CreateGame { game, insns } => { let mut ag = AccountsGuard::lock(); let mut games = games_lock(); diff --git a/src/commands.rs b/src/commands.rs index 21756ecd..7ef0c69f 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -14,6 +14,7 @@ pub enum MgmtCommand { DeleteAccount(AccountName), SelectAccount(AccountName), // success does not mean account exists + CheckAccount(), // success *does* mean account exists and we have access CreateGame { game: InstanceName, -- 2.30.2