Skip to content
Snippets Groups Projects
Commit 389a60d9 authored by rswindell's avatar rswindell
Browse files

cfg buffer is now initialized to NULL.

Node configuration from "first node" is used.
StatsTimer interval is now obtained from Node's statistics interval (was hard-coded to 5 seconds).
parent 674595fd
No related branches found
No related tags found
No related merge requests found
...@@ -1313,8 +1313,10 @@ void __fastcall TMainForm::StartupTimerTick(TObject *Sender) ...@@ -1313,8 +1313,10 @@ void __fastcall TMainForm::StartupTimerTick(TObject *Sender)
} }
if(CtrlDirectory.UpperCase().AnsiPos("MAIN.CNF")) if(CtrlDirectory.UpperCase().AnsiPos("MAIN.CNF"))
CtrlDirectory.SetLength(CtrlDirectory.Length()-8); CtrlDirectory.SetLength(CtrlDirectory.Length()-8);
memset(&cfg,0,sizeof(cfg));
strcpy(cfg.ctrl_dir,CtrlDirectory.c_str()); strcpy(cfg.ctrl_dir,CtrlDirectory.c_str());
cfg.size=sizeof(cfg); cfg.size=sizeof(cfg);
cfg.node_num=bbs_startup.first_node;
if(!load_cfg(&cfg, NULL, TRUE)) { if(!load_cfg(&cfg, NULL, TRUE)) {
Application->MessageBox("Failed to load configuration files.","ERROR" Application->MessageBox("Failed to load configuration files.","ERROR"
,MB_OK|MB_ICONEXCLAMATION); ,MB_OK|MB_ICONEXCLAMATION);
...@@ -1396,6 +1398,7 @@ void __fastcall TMainForm::StartupTimerTick(TObject *Sender) ...@@ -1396,6 +1398,7 @@ void __fastcall TMainForm::StartupTimerTick(TObject *Sender)
ClientForm->Timer->Interval=ClientDisplayInterval*1000; ClientForm->Timer->Interval=ClientDisplayInterval*1000;
ClientForm->Timer->Enabled=true; ClientForm->Timer->Enabled=true;
StatsTimer->Interval=cfg.node_stat_check*1000;
StatsTimer->Enabled=true; StatsTimer->Enabled=true;
Initialized=true; Initialized=true;
...@@ -1740,6 +1743,13 @@ void __fastcall TMainForm::UpTimerTick(TObject *Sender) ...@@ -1740,6 +1743,13 @@ void __fastcall TMainForm::UpTimerTick(TObject *Sender)
AnsiString Str=AnsiString(str); AnsiString Str=AnsiString(str);
if(MainForm->StatusBar->Panels->Items[4]->Text!=Str) if(MainForm->StatusBar->Panels->Items[4]->Text!=Str)
MainForm->StatusBar->Panels->Items[4]->Text=Str; MainForm->StatusBar->Panels->Items[4]->Text=Str;
#if 0
THeapStatus hp=GetHeapStatus();
sprintf(str,"Mem Used: %lu bytes",hp.TotalAllocated);
Str=AnsiString(str);
if(MainForm->StatusBar->Panels->Items[5]->Text!=Str)
MainForm->StatusBar->Panels->Items[5]->Text=Str;
#endif
if(TrayIcon->Visible) { if(TrayIcon->Visible) {
/* Animate TrayIcon when in use */ /* Animate TrayIcon when in use */
AnsiString NumClients; AnsiString NumClients;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment