/// <summary> /// Remove terminal from disconnected telnet client /// </summary> /// <param name="telnetClient"></param> private void ClientDisconnected(TelnetClient telnetClient) { var terminalManager = Services.GetService <IModuleManager>().GetManager <ITerminalManager>(); terminalManager.DestroyTerminal(telnetClient.GetTerminal()); telnetClient.SetTerminal(null); }
/// <summary> /// Assign new telnet client an environment terminal and send greeting /// </summary> /// <param name="telnetClient"></param> private void ClientConnected(TelnetClient telnetClient) { var terminalManager = Services.GetService <IModuleManager>().GetManager <ITerminalManager>(); telnetClient.SetTerminal(terminalManager.RequestTerminal("Telnet", telnetClient.GetRemoteAddress())); telnetClient.GetTerminal().GetDataBag()["step"] = "connected"; TelnetServer.ClearClientScreen(telnetClient); TelnetServer.SendMessageToClient(telnetClient, "Terminal granted " + telnetClient.GetTerminal().GetId() + ".\r\n\r\n" + "Welcome to Before Our Time. For help type \"help\".\r\n\r\n" + "Welcome> "); }