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
0a506a3d
Commit
0a506a3d
authored
7 years ago
by
echicken
Browse files
Options
Downloads
Patches
Plain Diff
Restrict bot command to level 90. Use sysop response semaphore files if queue method is disabled.
parent
0562a817
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
xtrn/chat_pager/ircbot/pager.js
+16
-4
16 additions, 4 deletions
xtrn/chat_pager/ircbot/pager.js
xtrn/chat_pager/page_sysop.js
+17
-4
17 additions, 4 deletions
xtrn/chat_pager/page_sysop.js
with
33 additions
and
8 deletions
xtrn/chat_pager/ircbot/pager.js
+
16
−
4
View file @
0a506a3d
...
...
@@ -23,7 +23,9 @@ var settings = load_settings(fullpath(this.dir + '../settings.ini'));
if
(
bot_cfg
!==
null
&&
settings
!==
null
)
{
var
queue
=
new
Queue
(
settings
.
queue
.
queue_name
);
if
(
!
settings
.
queue
.
disabled
)
{
var
queue
=
new
Queue
(
settings
.
queue
.
queue_name
);
}
var
timer
=
new
Timer
();
var
scanner
=
new
Scanner
(
settings
.
scanner
);
var
messages
=
[];
...
...
@@ -58,11 +60,21 @@ if (bot_cfg !== null && settings !== null) {
}
}
Bot_Commands
[
"
CHAT
"
]
=
new
Bot_Command
(
0
,
false
,
false
);
Bot_Commands
[
"
CHAT
"
]
=
new
Bot_Command
(
9
0
,
false
,
false
);
Bot_Commands
[
"
CHAT
"
].
usage
=
get_cmd_prefix
()
+
"
!chat [node]
"
;
Bot_Commands
[
"
CHAT
"
].
command
=
function
(
target
,
onick
,
ouh
,
srv
,
lbl
,
cmd
)
{
var
valname
=
"
chat_
"
+
cmd
[
1
];
queue
.
write
(
system
.
timer
,
valname
);
if
(
cmd
.
length
>
0
)
{
var
nn
=
parseInt
(
cmd
[
1
]);
if
(
isNaN
(
nn
)
||
nn
<
1
||
nn
>
system
.
node_list
.
length
)
{
return
;
}
else
if
(
!
settings
.
queue
.
disabled
)
{
var
valname
=
"
chat_
"
+
cmd
[
1
];
queue
.
write
(
system
.
timer
,
valname
);
}
else
{
var
valname
=
system
.
temp_dir
+
"
syspage_response.
"
+
cmd
[
1
];
file_touch
(
valname
);
}
}
}
}
else
{
...
...
This diff is collapsed.
Click to expand it.
xtrn/chat_pager/page_sysop.js
+
17
−
4
View file @
0a506a3d
...
...
@@ -3,6 +3,8 @@ load('frame.js');
load
(
'
progress-bar.js
'
);
load
(
js
.
exec_dir
+
'
lib.js
'
);
// Flush any existing named values (valname) and return the last one
// (I haven't checked yet, but I assume Queue is FIFO)
function
get_last_queued_value
(
queue
,
valname
)
{
var
val
,
temp_val
;
while
(
typeof
(
temp_val
=
queue
.
read
(
valname
))
!==
'
undefined
'
)
{
...
...
@@ -11,9 +13,17 @@ function get_last_queued_value(queue, valname) {
return
val
;
}
function
get_node_response_time
(
filename
)
{
return
(
file_exists
(
filename
)
?
(
file_date
(
filename
)
*
1000
)
:
null
);
}
function
await_page_response
(
settings
,
frame
)
{
var
queue
=
new
Queue
(
settings
.
queue
.
queue_name
);
var
valname
=
"
chat_
"
+
bbs
.
node_num
;
if
(
!
settings
.
queue
.
disabled
)
{
var
queue
=
new
Queue
(
settings
.
queue
.
queue_name
);
var
valname
=
"
chat_
"
+
bbs
.
node_num
;
}
else
{
var
valname
=
system
.
temp_dir
+
'
syspage_response.
'
+
bbs
.
node_num
;
}
var
answered
=
false
;
var
stime
=
system
.
timer
;
var
utime
=
system
.
timer
;
...
...
@@ -29,10 +39,13 @@ function await_page_response(settings, frame) {
progress_bar
.
set_progress
(
(((
now
-
stime
)
*
1000
)
/
settings
.
terminal
.
wait_time
)
*
100
);
progress_bar
.
cycle
();
utime
=
now
;
}
var
val
=
get_last_queued_value
(
queue
,
valname
);
var
val
=
(
!
settings
.
queue
.
disabled
?
get_last_queued_value
(
queue
,
valname
)
:
get_node_response_time
(
valname
)
);
if
(
typeof
val
==
'
number
'
&&
val
>
stime
)
answered
=
true
;
frame
.
cycle
();
bbs
.
node_sync
();
...
...
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