Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
dd34bb37
Commit
dd34bb37
authored
1 year ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
When adding a node, prompt to update Terminal Server LastNode value
This is an easily overlooked setting, let's make it easier
parent
b968c904
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/scfg/scfgnode.c
+27
-1
27 additions, 1 deletion
src/sbbs3/scfg/scfgnode.c
with
27 additions
and
1 deletion
src/sbbs3/scfg/scfgnode.c
+
27
−
1
View file @
dd34bb37
...
...
@@ -18,6 +18,7 @@
****************************************************************************/
#include
"scfg.h"
#include
"sbbs_ini.h"
static
char
*
node_path_help
=
"`Node Directory:`
\n
"
...
...
@@ -29,6 +30,29 @@ static char* node_path_help =
"that can be accessed by `ALL` nodes of the BBS.
\n
"
;
void
adjust_last_node
()
{
char
ini_fname
[
MAX_PATH
+
1
];
const
char
*
section
=
"bbs"
;
const
char
*
key
=
"LastNode"
;
sbbs_get_ini_fname
(
ini_fname
,
cfg
.
ctrl_dir
);
FILE
*
fp
=
iniOpenFile
(
ini_fname
,
/* modify */
false
);
str_list_t
ini
=
iniReadFile
(
fp
);
iniCloseFile
(
fp
);
uint
last_node
=
iniGetUInteger
(
ini
,
section
,
key
,
cfg
.
sys_nodes
);
char
prompt
[
128
];
SAFEPRINTF
(
prompt
,
"Update Terminal Server 'LastNode' value to %u"
,
cfg
.
sys_nodes
);
if
(
last_node
<
cfg
.
sys_nodes
&&
uifc
.
confirm
(
prompt
))
{
fp
=
iniOpenFile
(
ini_fname
,
/* modify */
true
);
iniSetUInteger
(
&
ini
,
section
,
key
,
cfg
.
sys_nodes
,
NULL
);
iniWriteFile
(
fp
,
ini
);
iniCloseFile
(
fp
);
}
iniFreeStringList
(
ini
);
}
void
node_menu
()
{
char
str
[
81
],
savnode
=
0
;
...
...
@@ -92,6 +116,7 @@ void node_menu()
--
cfg
.
sys_nodes
;
cfg
.
new_install
=
new_install
;
save_main_cfg
(
&
cfg
,
backup_level
);
adjust_last_node
();
refresh_cfg
(
&
cfg
);
}
continue
;
...
...
@@ -112,7 +137,7 @@ void node_menu()
}
sprintf
(
tmp
,
"Node %d Directory"
,
i
);
uifc
.
helpbuf
=
node_path_help
;
j
=
uifc
.
input
(
WIN_MID
,
0
,
0
,
tmp
,
str
,
50
,
K_EDIT
);
j
=
uifc
.
input
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
tmp
,
str
,
50
,
K_EDIT
);
uifc
.
changes
=
0
;
if
(
j
<
2
)
continue
;
...
...
@@ -125,6 +150,7 @@ void node_menu()
save_node_cfg
(
&
cfg
,
backup_level
);
save_main_cfg
(
&
cfg
,
backup_level
);
free_node_cfg
(
&
cfg
);
adjust_last_node
();
refresh_cfg
(
&
cfg
);
continue
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment