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
dfc4acbe
Commit
dfc4acbe
authored
17 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Add default capability for numeric inputs.
Ensure that node messages and telegrams are delivered during input.
parent
7dd0dd2b
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
xtrn/tw2/tw2.js
+37
-14
37 additions, 14 deletions
xtrn/tw2/tw2.js
with
37 additions
and
14 deletions
xtrn/tw2/tw2.js
+
37
−
14
View file @
dfc4acbe
...
...
@@ -2379,6 +2379,8 @@ function DeletePlayer(player)
twmsg
.
writeln
(
"
-
"
+
player
.
Alias
+
"
deleted from game
"
);
}
var
lastmisc
=
system
.
node_list
[
bbs
.
node_num
-
1
].
misc
;
var
laststatus
=
system
.
node_list
[
bbs
.
node_num
-
1
].
status
;
function
InputFunc
(
values
)
{
var
str
=
''
;
...
...
@@ -2386,7 +2388,7 @@ function InputFunc(values)
var
insertmode
=
true
;
var
key
;
var
origattr
=
console
.
attributes
;
var
match
str
=
''
var
match
val
=
''
;
console
.
line_counter
=
0
;
console
.
attributes
=
"
N
"
;
...
...
@@ -2394,12 +2396,28 @@ InputFuncMainLoop:
for
(;;)
{
key
=
console
.
inkey
(
100
);
if
(
key
==
''
)
{
/* Node status check */
var
newmisc
=
system
.
node_list
[
bbs
.
node_num
-
1
].
misc
;
var
newstatus
=
system
.
node_list
[
bbs
.
node_num
-
1
].
status
;
if
(
newmisc
!=
lastmisc
||
newstatus
!=
laststatus
)
{
console
.
saveline
();
bbs
.
nodesync
();
console
.
write
(
"
\r
"
);
if
(
console
.
line_counter
!=
0
)
{
console
.
crlf
();
console
.
line_counter
=
0
;
}
console
.
restoreline
();
lastmisc
=
system
.
node_list
[
bbs
.
node_num
-
1
].
misc
;
laststatus
=
system
.
node_list
[
bbs
.
node_num
-
1
].
status
;
}
/* Busy loop checking */
}
else
{
switch
(
key
)
{
case
'
\
x1b
'
:
/* Escape */
match
str
=
''
;
match
val
=
''
;
pos
=
0
;
break
InputFuncMainLoop
;
case
'
\r
'
:
...
...
@@ -2424,30 +2442,35 @@ InputFuncMainLoop:
var
value
;
var
exact_match
=
false
;
var
longer_match
=
false
;
match
str
=
''
;
match
val
=
''
;
for
(
value
in
values
)
{
if
(
typeof
(
values
[
value
])
==
'
string
'
)
{
var
ucv
=
values
[
value
].
toUpperCase
();
var
ucs
=
str
.
toUpperCase
();
if
(
ucv
==
ucs
)
{
exact_match
=
true
;
match
str
=
values
[
value
];
match
val
=
values
[
value
];
}
else
if
(
ucv
.
indexOf
(
ucs
)
==
0
)
longer_match
=
true
;
}
else
if
(
typeof
(
values
[
value
])
==
'
object
'
)
{
var
min
=
0
;
var
max
=
4294967295
;
var
def
=
0
;
if
(
values
[
value
].
min
!=
undefined
)
min
=
values
[
value
].
min
;
if
(
values
[
value
].
max
!=
undefined
)
max
=
values
[
value
].
max
;
if
(
values
[
value
].
def
!=
undefined
)
def
=
values
[
value
].
def
;
if
(
str
.
search
(
/^
[
0-9
]
*$/
)
!=-
1
)
{
var
min
=
0
;
var
max
=
4294967296
;
var
cur
=
parseInt
(
str
);
if
(
values
[
value
].
min
!=
undefined
)
min
=
values
[
value
].
min
;
if
(
values
[
value
].
max
!=
undefined
)
max
=
values
[
value
].
max
;
var
cur
=
def
;
if
(
pos
>
0
)
cur
=
parseInt
(
str
);
if
(
cur
>=
min
&&
cur
<=
max
)
{
exact_match
=
true
;
match
str
=
cur
.
toString
()
;
match
val
=
cur
;
}
if
(
cur
*
10
<=
max
)
longer_match
=
true
;
...
...
@@ -2470,8 +2493,8 @@ InputFuncMainLoop:
console
.
write
(
'
\
x08
'
);
pos
--
;
}
console
.
write
(
matchs
tr
);
console
.
attributes
=
origattr
;
console
.
cleartoeol
(
origat
tr
);
console
.
write
(
matchstr
.
toString
())
;
console
.
crlf
();
return
(
matchstr
);
}
...
...
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