This commit is contained in:
y4my4my4m 2023-05-22 23:02:20 +09:00
parent 7e73569e75
commit 7cf40ea1a5
5 changed files with 12 additions and 8 deletions

0
src/Home/Net/Programs/Telnet/Art/TelnetSplash.ans Normal file → Executable file
View file

0
src/Home/Net/Programs/Telnet/Extra/TelnetList.DD Normal file → Executable file
View file

View file

@ -99,7 +99,7 @@ U0 HandleControlCodes(U8 ch) {
SysLog("Fs\n"); SysLog("Fs\n");
break; break;
case 29: case 29:
SysLog("Gs\n"); SysLog("Gs\n");
break; break;
case 30: case 30:
SysLog("Rs\n"); SysLog("Rs\n");
@ -692,7 +692,7 @@ receive_data:
if (!term.sock_ready || force_disconnect) if (!term.sock_ready || force_disconnect)
DocPrint(term.doc, "Error: Connection closed by the remote host.\n"); DocPrint(term.doc, "Error: Connection closed by the remote host.\n");
else { else {
SysLog("goto received_data\n"); //SysLog("goto received_data\n");
goto receive_data; goto receive_data;
} }
break; break;
@ -732,7 +732,7 @@ U0 Telnet(U8 *host=NULL, U16 port=TELNET_PORT) {
StrCopy(Fs->task_title, "TELNET"); StrCopy(Fs->task_title, "TELNET");
Fs->border_src = BDS_CONST; Fs->border_src = BDS_CONST;
Fs->border_attr = LTGREEN << 4 + DriveTextAttrGet(':') & 15; // Fs->border_attr = LTGREEN << 4 + DriveTextAttrGet(':') & 15;
if (dark_mode) Fs->text_attr = WHITE << 4 + BLACK; if (dark_mode) Fs->text_attr = WHITE << 4 + BLACK;
else Fs->text_attr = BLACK << 4 + WHITE; else Fs->text_attr = BLACK << 4 + WHITE;
Fs->title_src = TTS_LOCKED_CONST; Fs->title_src = TTS_LOCKED_CONST;
@ -752,6 +752,7 @@ U0 Telnet(U8 *host=NULL, U16 port=TELNET_PORT) {
show_splash: show_splash:
// SplashScreen // SplashScreen
Fs->border_attr = WHITE << 4 + LTRED;
DocMax; DocMax;
DocClear; DocClear;
// probably should use word wrap? // probably should use word wrap?
@ -766,6 +767,7 @@ show_splash:
// Free(term.buffer); // Free(term.buffer);
} }
else { else {
DocClear;
Print("Error: Could not load splash screen.\n"); Print("Error: Could not load splash screen.\n");
} }
@ -786,6 +788,7 @@ init_connection:
host = NULL; host = NULL;
goto show_splash; goto show_splash;
} }
Fs->border_attr = WHITE << 4 + GREEN;
term.sock_ready = 1; // Signal that the socket is ready term.sock_ready = 1; // Signal that the socket is ready
term.waiting_for_input = FALSE; term.waiting_for_input = FALSE;
@ -871,6 +874,7 @@ init_connection:
host = NULL; host = NULL;
term.sock_ready = 0; term.sock_ready = 0;
term.waiting_for_input = TRUE; term.waiting_for_input = TRUE;
DocClear;
"Telnet connection closed.\n"; "Telnet connection closed.\n";
Sleep(100); Sleep(100);
goto show_splash; goto show_splash;
@ -904,7 +908,7 @@ init_connection:
break; break;
case CH_CTRLS: case CH_CTRLS:
// Save as DD image. // Save as DD image.
StrCopy(term.doc->filename.name, "::/Home/Wallpapers/1024/Default.DD"); StrCopy(term.doc->filename.name, "::/Home/Wallpapers/1024/Default.DD");
DocWrite(term.doc, TRUE); DocWrite(term.doc, TRUE);
break; break;
case CH_CTRLD: case CH_CTRLD:
@ -956,7 +960,7 @@ init_connection:
// dev server // dev server
// Telnet("localhost", 8888); // Telnet("localhost", 8888);
//Telnet; Telnet;
/* /*

View file

@ -1,5 +1,5 @@
Cd(__DIR__); Cd(__DIR__);
#include "TelnetClass" #include "TelnetClass"
#include "TelnetNegotiation" #include "TelnetNegotiation"
U8 IsDigit(U8 ch) { U8 IsDigit(U8 ch) {
@ -118,7 +118,7 @@ U0 DocRelCursorPosSet(CDoc *doc, I64 dx, I64 dy) {
} }
// function to increase/decrease col or row // function to increase/decrease col or row
U0 SetPos(I64 col, I64 row, Bool relativeCol=TRUE, Bool relativeRow=TRUE) { U0 SetPos(I64 col, I64 row, Bool relativeCol=TRUE) {
if (col < 0) { if (col < 0) {
if (relativeCol) if (relativeCol)
term.current_col += col; term.current_col += col;

2
src/Home/Net/Programs/Telnet/TelnetNegotiation.ZC Normal file → Executable file
View file

@ -95,7 +95,7 @@ U0 SendTerminalType(I64 sock)
U0 TelnetNegotiate(I64 sock, U8 *ptr) U0 TelnetNegotiate(I64 sock, U8 *ptr)
{ {
U8 negotiation_code = *(ptr + 1); U8 negotiation_code = *(ptr + 1);
U8 option_code = *(ptr + 2); U8 option_code = *(ptr + 2);