From 58d0b1a89c461467c9ea6229f9a6b3d5ed573da5 Mon Sep 17 00:00:00 2001 From: Simponic Date: Sat, 31 Dec 2022 02:29:38 -0700 Subject: A simple stalling TUI! Also, ensure sessions are counted correctly. Next up, some way of pub-sub across multiple nodes --- lib/chessh/ssh/client.ex | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/chessh/ssh/client.ex (limited to 'lib/chessh/ssh/client.ex') diff --git a/lib/chessh/ssh/client.ex b/lib/chessh/ssh/client.ex new file mode 100644 index 0000000..35893f1 --- /dev/null +++ b/lib/chessh/ssh/client.ex @@ -0,0 +1,16 @@ +defmodule Chessh.SSH.Client do + alias Chessh.SSH.Client + require Logger + + use GenServer + + # TODO: tui_state_stack is like [:menu, :player_settings, :change_password] or [:menu, {:game, game_id}, {:game_chat, game_id}] + + defstruct [:tui_pid, :width, :height, :player_id, :tui_state_stack] + + @impl true + def init([tui_pid, width, height] = args) do + Logger.debug("#{inspect(args)}") + {:ok, %Client{tui_pid: tui_pid, width: width, height: height}} + end +end -- cgit v1.3