public function __construct(&$sock, &$ip, &$port) { parent::__construct($sock, $ip, $port); // Clear screen $this->screenClear(true); // Send welcome message and ask for username $msg = "Welcome to the " . VT100_STYLE_BOLD . "Prism v" . PHPInSimMod::VERSION . VT100_STYLE_RESET . " remote console.\r\n"; $msg .= "Please login with your Prism account details.\r\n\r\n"; $msg .= "Username : "; $this->writeBuf($msg); $this->flush(); $this->loginState = TELNET_ASKED_USERNAME; $this->registerInputCallback($this, 'doLogin', TELNET_MODE_LINEEDIT); }
/** * Returns singleton instance of TelnetServer * * @return TelnetServer TelnetServer singleton */ public static function getInstance() { if (!self::$_instance) { self::$_instance = new self(); } return self::$_instance; }