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
cd0c2bd0
Commit
cd0c2bd0
authored
21 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Added more hotkeys to the main display.
parent
e3793956
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/umonitor/umonitor.c
+100
-18
100 additions, 18 deletions
src/sbbs3/umonitor/umonitor.c
with
100 additions
and
18 deletions
src/sbbs3/umonitor/umonitor.c
+
100
−
18
View file @
cd0c2bd0
...
...
@@ -76,6 +76,8 @@ enum {
,
MODE_AUX
,
MODE_EXTAUX
};
#define CTRL(x) (x&037)
/********************/
/* Global Variables */
...
...
@@ -399,7 +401,7 @@ void node_toggles(int nodenum) {
break
;
case
5
:
/* Down */
if
(
node
.
status
=
=
NODE_
INUSE
||
node
.
status
==
NODE_
LOGON
)
if
(
node
.
status
!
=
NODE_
WFC
&&
node
.
status
!=
NODE_
OFFLINE
)
node
.
misc
^=
NODE_DOWN
;
else
{
if
(
node
.
status
!=
NODE_OFFLINE
)
...
...
@@ -473,13 +475,36 @@ int dospy(int nodenum, bbs_startup_t *bbs_startup) {
return
(
0
);
}
int
sendmessage
(
int
nodenum
,
node_t
*
node
)
{
char
str
[
80
],
str2
[
80
];
uifc
.
input
(
WIN_MID
,
0
,
0
,
"Telegram"
,
str2
,
58
,
K_WRAP
|
K_MSG
);
sprintf
(
str
,
"
\1
n
\1
y
\1
hMessage From Sysop:
\1
w %s"
,
str2
);
if
(
getnodedat
(
&
cfg
,
nodenum
,
node
,
NULL
))
return
(
-
1
);
if
(
node
->
useron
==
0
)
return
(
-
1
);
putsmsg
(
&
cfg
,
node
->
useron
,
str
);
return
(
0
);
}
int
clearerrors
(
int
nodenum
,
node_t
*
node
)
{
if
(
getnodedat
(
&
cfg
,
nodenum
,
node
,
&
nodefile
))
{
uifc
.
msg
(
"getnodedat() failed! (Nothing done)"
);
return
(
-
1
);
}
node
->
errors
=
0
;
putnodedat
(
&
cfg
,
nodenum
,
node
,
nodefile
);
return
(
0
);
}
int
main
(
int
argc
,
char
**
argv
)
{
char
**
opt
;
char
**
mopt
;
int
main_dflt
=
0
;
int
main_bar
=
0
;
char
revision
[
16
];
char
str
[
256
],
str2
[
256
],
ctrl_dir
[
41
],
*
p
;
char
str
[
256
],
ctrl_dir
[
41
],
*
p
;
char
title
[
256
];
int
i
,
j
;
node_t
node
;
...
...
@@ -677,8 +702,14 @@ int main(int argc, char** argv) {
uifc
.
helpbuf
=
"`Synchronet Monitor:`
\n
"
"
\n
CTRL-E displays the error log"
"
\n
CTRL-S spys on the currently selected node"
"
\n
ToDo: Add more help."
;
"
\n
F12 spys on the currently selected node"
"
\n
F11 send message to the currently selected node"
"
\n
DEL Clear errors on currently selected node"
"
\n
CTRL-L Lock node toggle"
"
\n
CTRL-R Rerun node"
"
\n
CTRL-D Down node toggle"
"
\n
CTRL-I Interrupt node"
"
\n
ToDo: Add more help. (Explain what you're looking at)"
;
j
=
uifc
.
list
(
WIN_ORG
|
WIN_MID
|
WIN_ESC
|
WIN_ACT
|
WIN_DYN
,
0
,
0
,
70
,
&
main_dflt
,
&
main_bar
,
title
,
mopt
);
...
...
@@ -708,11 +739,73 @@ int main(int argc, char** argv) {
continue
;
}
if
(
j
==-
21
)
{
/* CTRL-S */
if
(
j
==-
2
-
KEY_DC
)
{
/* Clear errors */
clearerrors
(
main_dflt
+
1
,
&
node
);
continue
;
}
if
(
j
==-
2
-
KEY_F
(
10
))
{
/* Chat */
uifc
.
msg
(
"Option not implemented"
);
continue
;
}
if
(
j
==-
2
-
KEY_F
(
11
))
{
/* Send message */
sendmessage
(
main_dflt
+
1
,
&
node
);
continue
;
}
if
(
j
==-
2
-
KEY_F
(
12
))
{
/* Spy */
dospy
(
main_dflt
+
1
,
&
bbs_startup
);
continue
;
}
if
(
j
==-
2
-
CTRL
(
'l'
))
{
/* Lock node */
if
(
getnodedat
(
&
cfg
,
main_dflt
+
1
,
&
node
,
&
nodefile
))
{
uifc
.
msg
(
"Error reading node data!"
);
continue
;
}
node
.
misc
^=
NODE_LOCK
;
putnodedat
(
&
cfg
,
main_dflt
+
1
,
&
node
,
nodefile
);
continue
;
}
if
(
j
==-
2
-
CTRL
(
'r'
))
{
/* Rerun node */
if
(
getnodedat
(
&
cfg
,
main_dflt
+
1
,
&
node
,
&
nodefile
))
{
uifc
.
msg
(
"Error reading node data!"
);
continue
;
}
node
.
misc
^=
NODE_RRUN
;
putnodedat
(
&
cfg
,
main_dflt
+
1
,
&
node
,
nodefile
);
continue
;
}
if
(
j
==-
2
-
CTRL
(
'd'
))
{
/* Down node */
if
(
getnodedat
(
&
cfg
,
main_dflt
+
1
,
&
node
,
&
nodefile
))
{
uifc
.
msg
(
"Error reading node data!"
);
continue
;
}
if
(
node
.
status
!=
NODE_WFC
&&
node
.
status
!=
NODE_OFFLINE
)
node
.
misc
^=
NODE_DOWN
;
else
{
if
(
node
.
status
!=
NODE_OFFLINE
)
node
.
status
=
NODE_OFFLINE
;
else
node
.
status
=
NODE_WFC
;
}
putnodedat
(
&
cfg
,
main_dflt
+
1
,
&
node
,
nodefile
);
continue
;
}
if
(
j
==-
2
-
CTRL
(
'i'
))
{
/* Interrupt node */
if
(
getnodedat
(
&
cfg
,
main_dflt
+
1
,
&
node
,
&
nodefile
))
{
uifc
.
msg
(
"Error reading node data!"
);
continue
;
}
node
.
misc
^=
NODE_INTR
;
putnodedat
(
&
cfg
,
main_dflt
+
1
,
&
node
,
nodefile
);
continue
;
}
if
(
j
<=
-
2
)
continue
;
...
...
@@ -754,22 +847,11 @@ int main(int argc, char** argv) {
break
;
case
2
:
if
(
getnodedat
(
&
cfg
,
j
+
1
,
&
node
,
&
nodefile
))
{
uifc
.
msg
(
"getnodedat() failed! (Nothing done)"
);
break
;
}
node
.
errors
=
0
;
putnodedat
(
&
cfg
,
j
+
1
,
&
node
,
nodefile
);
clearerrors
(
j
+
1
,
&
node
);
break
;
case
3
:
/* Send message */
uifc
.
input
(
WIN_MID
,
0
,
0
,
"Telegram"
,
str2
,
58
,
K_WRAP
|
K_MSG
);
sprintf
(
str
,
"
\1
n
\1
y
\1
hMessage From Sysop:
\1
w %s"
,
str2
);
if
(
getnodedat
(
&
cfg
,
j
+
1
,
&
node
,
NULL
))
break
;
if
(
node
.
useron
==
0
)
break
;
putsmsg
(
&
cfg
,
node
.
useron
,
str
);
sendmessage
(
j
+
1
,
&
node
);
break
;
case
-
1
:
...
...
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