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
6752a562
Commit
6752a562
authored
20 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
External program section module which mostly works. Still has a couple of
quirks that need to be ironed out.
parent
e2f19166
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/xtrn_sec.js
+114
-0
114 additions, 0 deletions
exec/xtrn_sec.js
with
114 additions
and
0 deletions
exec/xtrn_sec.js
0 → 100644
+
114
−
0
View file @
6752a562
// xtrn_sec.js
load
(
"
sbbsdefs.js
"
);
/* text.dat entries */
const
R_ExternalPrograms
=
123
const
NoXtrnPrograms
=
379
const
XtrnProgLstHdr
=
380
const
XtrnProgLstTitles
=
381
const
XtrnProgLstUnderline
=
382
const
XtrnProgLstFmt
=
383
const
WhichXtrnProg
=
384
while
(
bbs
.
online
)
{
if
(
user
.
security
.
restrictions
&
UFLAG_X
)
{
write
(
bbs
.
text
(
R_ExternalPrograms
));
break
;
}
if
(
!
xtrn_area
.
sec_list
.
length
)
{
write
(
bbs
.
text
(
NoXtrnPrograms
));
break
;
}
var
xsec
=
0
;
if
(
xtrn_area
.
sec_list
.
length
>
1
)
{
if
(
file_exists
(
system
.
text_dir
+
"
menu/xtrn_sec.*
"
))
{
bbs
.
menu
(
"
xtrn_sec
"
);
xsec
=
console
.
getnum
(
usrxsecs
);
if
(
xsec
<=
0
)
break
;
xsec
--
;
}
else
{
for
(
i
in
xtrn_area
.
sec_list
)
console
.
uselect
(
Number
(
i
),
"
External Program Section
"
,
xtrn_area
.
sec_list
[
i
].
name
);
xsec
=
console
.
uselect
();
}
}
if
(
xsec
<
0
)
break
;
while
(
bbs
.
online
)
{
if
(
!
xtrn_area
.
sec_list
[
xsec
].
prog_list
.
length
)
{
write
(
bbs
.
text
(
NoXtrnPrograms
));
console
.
pause
();
break
;
}
if
(
file_exists
(
system
.
text_dir
+
"
menu/xtrn
"
+
xtrn_area
.
sec_list
.
number
+
1
+
"
.*
"
))
{
bbs
.
menu
(
system
.
text_dir
+
"
menu/xtrn
"
+
xtrn_area
.
sec_list
.
number
+
1
);
}
else
{
printf
(
bbs
.
text
(
XtrnProgLstHdr
),
xtrn_area
.
sec_list
[
xsec
].
name
);
write
(
bbs
.
text
(
XtrnProgLstTitles
));
if
(
xtrn_area
.
sec_list
[
xsec
].
prog_list
.
length
>=
10
)
{
write
(
"
"
);
write
(
bbs
.
text
(
XtrnProgLstTitles
));
}
console
.
crlf
();
write
(
bbs
.
text
(
XtrnProgLstUnderline
));
if
(
xtrn_area
.
sec_list
[
xsec
].
prog_list
.
length
>=
10
)
{
write
(
"
"
);
write
(
bbs
.
text
(
XtrnProgLstUnderline
));
}
console
.
crlf
();
if
(
xtrn_area
.
sec_list
[
xsec
].
prog_list
.
length
>=
10
)
n
=
(
xtrn_area
.
sec_list
[
xsec
].
prog_list
.
length
/
2
)
+
(
xtrn_area
.
sec_list
[
xsec
].
prog_list
.
length
&
1
);
else
n
=
xtrn_area
.
sec_list
[
xsec
].
prog_list
.
length
;
for
(
i
=
0
;
i
<
n
;
i
++
)
{
printf
(
bbs
.
text
(
XtrnProgLstFmt
),
i
+
1
,
xtrn_area
.
sec_list
[
xsec
].
prog_list
[
i
].
name
,
xtrn_area
.
sec_list
[
xsec
].
prog_list
[
i
].
cost
);
if
(
xtrn_area
.
sec_list
[
xsec
].
prog_list
.
length
>=
10
)
{
j
=
(
xtrn_area
.
sec_list
[
xsec
].
prog_list
.
length
/
2
)
+
i
+
(
xtrn_area
.
sec_list
[
xsec
].
prog_list
.
length
&
1
);
if
(
j
<
xtrn_area
.
sec_list
[
xsec
].
prog_list
.
length
)
{
log
(
format
(
"
%d %d
"
,
j
,
xtrn_area
.
sec_list
[
xsec
].
prog_list
.
length
));
log
(
xtrn_area
.
sec_list
[
xsec
].
prog_list
[
j
]);
write
(
"
"
);
printf
(
bbs
.
text
(
XtrnProgLstFmt
),
j
+
1
,
xtrn_area
.
sec_list
[
xsec
].
prog_list
[
j
].
name
,
xtrn_area
.
sec_list
[
xsec
].
prog_list
[
j
].
cost
);
}
}
console
.
crlf
();
}
bbs
.
node_sync
();
console
.
mnemonics
(
bbs
.
text
(
WhichXtrnProg
));
}
system
.
node_list
[
bbs
.
node_num
-
1
].
aux
=
0
;
/* aux is 0, only if at menu */
bbs
.
action
=
NODE_XTRN
;
bbs
.
node_sync
();
if
((
i
=
console
.
getnum
(
xtrn_area
.
sec_list
[
xsec
].
prog_list
.
length
))
<
1
)
break
;
i
--
;
if
(
file_exists
(
system
.
text_dir
+
"
menu/xtrn/
"
+
xtrn_area
.
sec_list
[
xsec
].
prog_list
[
i
].
code
))
{
menu
(
"
xtrn/
"
+
xtrn_area
.
sec_list
[
xsec
].
prog_list
[
i
].
code
);
console
.
line_counter
=
0
;
}
bbs
.
exec_xtrn
(
xtrn_area
.
sec_list
[
xsec
].
prog_list
[
i
].
code
);
if
(
xtrn_area
.
sec_list
[
xsec
].
prog_list
[
i
].
settingsXTRN_PAUSE
)
bbs
.
line_counter
=
2
;
/* force a pause before CLS */
}
if
(
xtrn_area
.
sec_list
.
length
<
2
)
break
;
}
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