--- sbbs/sbbs3/ctrl/telnetcfgdlgunit.cpp 2018/04/24 16:39:34 1.1.1.1 +++ sbbs/sbbs3/ctrl/telnetcfgdlgunit.cpp 2018/04/24 16:40:45 1.1.1.2 @@ -1,12 +1,12 @@ /* Synchronet Control Panel (GUI Borland C++ Builder Project for Win32) */ -/* $Id: telnetcfgdlgunit.cpp,v 1.1.1.1 2018/04/24 16:39:34 root Exp $ */ +/* $Id: telnetcfgdlgunit.cpp,v 1.1.1.2 2018/04/24 16:40:45 root Exp $ */ /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2003 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -82,19 +82,31 @@ void __fastcall TTelnetCfgDlg::FormShow( FirstNodeEdit->Text=AnsiString((int)MainForm->bbs_startup.first_node); LastNodeEdit->Text=AnsiString((int)MainForm->bbs_startup.last_node); + XtrnYieldEdit->Text=AnsiString( + (int)MainForm->bbs_startup.xtrn_polls_before_yield); AutoStartCheckBox->Checked=MainForm->SysAutoStart; AnswerSoundEdit->Text=AnsiString(MainForm->bbs_startup.answer_sound); HangupSoundEdit->Text=AnsiString(MainForm->bbs_startup.hangup_sound); CmdLogCheckBox->Checked=MainForm->bbs_startup.options&BBS_OPT_DEBUG_TELNET; - KeepAliveCheckBox->Checked=MainForm->bbs_startup.options&BBS_OPT_KEEP_ALIVE; + TelnetGaCheckBox->Checked + =!(MainForm->bbs_startup.options&BBS_OPT_NO_TELNET_GA); XtrnMinCheckBox->Checked=MainForm->bbs_startup.options&BBS_OPT_XTRN_MINIMIZED; AutoLogonCheckBox->Checked=MainForm->bbs_startup.options&BBS_OPT_AUTO_LOGON; HostnameCheckBox->Checked =!(MainForm->bbs_startup.options&BBS_OPT_NO_HOST_LOOKUP); + IdentityCheckBox->Checked + =MainForm->bbs_startup.options&BBS_OPT_GET_IDENT; + RLoginEnabledCheckBox->Checked =MainForm->bbs_startup.options&BBS_OPT_ALLOW_RLOGIN; RLogin2ndNameCheckBox->Checked =MainForm->bbs_startup.options&BBS_OPT_USE_2ND_RLOGIN; + QWKEventsCheckBox->Checked + =!(MainForm->bbs_startup.options&BBS_OPT_NO_QWK_EVENTS); + EventsCheckBox->Checked + =!(MainForm->bbs_startup.options&BBS_OPT_NO_EVENTS); + JavaScriptCheckBox->Checked + =!(MainForm->bbs_startup.options&BBS_OPT_NO_JAVASCRIPT); RLoginEnabledCheckBoxClick(Sender); PageControl->ActivePage=GeneralTabSheet; @@ -106,8 +118,7 @@ void __fastcall TTelnetCfgDlg::OKBtnClic char str[128],*p; DWORD addr; - sprintf(str,"%.*s",sizeof(str)-1 - ,TelnetInterfaceEdit->Text.c_str()); + SAFECOPY(str,TelnetInterfaceEdit->Text.c_str()); p=str; while(*p && *p<=' ') p++; if(*p && isdigit(*p)) { @@ -125,8 +136,7 @@ void __fastcall TTelnetCfgDlg::OKBtnClic } else MainForm->bbs_startup.telnet_interface=0; - sprintf(str,"%.*s",sizeof(str)-1 - ,RLoginInterfaceEdit->Text.c_str()); + SAFECOPY(str,RLoginInterfaceEdit->Text.c_str()); p=str; while(*p && *p<=' ') p++; if(*p && isdigit(*p)) { @@ -149,21 +159,35 @@ void __fastcall TTelnetCfgDlg::OKBtnClic MainForm->bbs_startup.first_node=FirstNodeEdit->Text.ToIntDef(1); MainForm->bbs_startup.last_node=LastNodeEdit->Text.ToIntDef(1); + MainForm->bbs_startup.xtrn_polls_before_yield + =XtrnYieldEdit->Text.ToIntDef(10); + MainForm->SysAutoStart=AutoStartCheckBox->Checked; - sprintf(MainForm->bbs_startup.answer_sound,"%.*s" - ,sizeof(MainForm->bbs_startup.answer_sound)-1 + SAFECOPY(MainForm->bbs_startup.answer_sound ,AnswerSoundEdit->Text.c_str()); - sprintf(MainForm->bbs_startup.hangup_sound,"%.*s" - ,sizeof(MainForm->bbs_startup.hangup_sound)-1 + SAFECOPY(MainForm->bbs_startup.hangup_sound ,HangupSoundEdit->Text.c_str()); - if(KeepAliveCheckBox->Checked==true) - MainForm->bbs_startup.options|=BBS_OPT_KEEP_ALIVE; + if(TelnetGaCheckBox->Checked==false) + MainForm->bbs_startup.options|=BBS_OPT_NO_TELNET_GA; else - MainForm->bbs_startup.options&=~BBS_OPT_KEEP_ALIVE; + MainForm->bbs_startup.options&=~BBS_OPT_NO_TELNET_GA; if(XtrnMinCheckBox->Checked==true) MainForm->bbs_startup.options|=BBS_OPT_XTRN_MINIMIZED; else MainForm->bbs_startup.options&=~BBS_OPT_XTRN_MINIMIZED; + if(QWKEventsCheckBox->Checked==true) + MainForm->bbs_startup.options&=~BBS_OPT_NO_QWK_EVENTS; + else + MainForm->bbs_startup.options|=BBS_OPT_NO_QWK_EVENTS; + if(EventsCheckBox->Checked==true) + MainForm->bbs_startup.options&=~BBS_OPT_NO_EVENTS; + else + MainForm->bbs_startup.options|=BBS_OPT_NO_EVENTS; + if(JavaScriptCheckBox->Checked==true) + MainForm->bbs_startup.options&=~BBS_OPT_NO_JAVASCRIPT; + else + MainForm->bbs_startup.options|=BBS_OPT_NO_JAVASCRIPT; + if(AutoLogonCheckBox->Checked==true) MainForm->bbs_startup.options|=BBS_OPT_AUTO_LOGON; else @@ -176,6 +200,11 @@ void __fastcall TTelnetCfgDlg::OKBtnClic MainForm->bbs_startup.options|=BBS_OPT_NO_HOST_LOOKUP; else MainForm->bbs_startup.options&=~BBS_OPT_NO_HOST_LOOKUP; + if(IdentityCheckBox->Checked==true) + MainForm->bbs_startup.options|=BBS_OPT_GET_IDENT; + else + MainForm->bbs_startup.options&=~BBS_OPT_GET_IDENT; + if(RLoginEnabledCheckBox->Checked==true) MainForm->bbs_startup.options|=BBS_OPT_ALLOW_RLOGIN; else @@ -215,15 +244,17 @@ void __fastcall TTelnetCfgDlg::RLoginEna RLoginInterfaceEdit->Enabled = RLoginEnabledCheckBox->Checked; RLoginIPallowButton->Enabled = RLoginEnabledCheckBox->Checked; RLogin2ndNameCheckBox->Enabled = RLoginEnabledCheckBox->Checked; + RLoginPortLabel->Enabled = RLoginEnabledCheckBox->Checked; + RLoginInterfaceLabel->Enabled = RLoginEnabledCheckBox->Checked; } //--------------------------------------------------------------------------- void __fastcall TTelnetCfgDlg::RLoginIPallowButtonClick(TObject *Sender) { - char filename[MAX_PATH]; + char filename[MAX_PATH+1]; - sprintf(filename,"%sRLOGIN.CAN" - ,MainForm->cfg.text_dir); + sprintf(filename,"%srlogin.cfg" + ,MainForm->cfg.ctrl_dir); Application->CreateForm(__classid(TTextFileEditForm), &TextFileEditForm); TextFileEditForm->Filename=AnsiString(filename); TextFileEditForm->Caption="Allowed IP addresses for RLogin";