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
58f7f47d
Commit
58f7f47d
authored
12 years ago
by
echicken
Browse files
Options
Downloads
Patches
Plain Diff
Updateded to work more gooder with recent ansiEdit.js changes.
parent
9f2d38cd
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/syncwall/syncwall.js
+27
-15
27 additions, 15 deletions
xtrn/syncwall/syncwall.js
with
27 additions
and
15 deletions
xtrn/syncwall/syncwall.js
+
27
−
15
View file @
58f7f47d
...
...
@@ -6,7 +6,7 @@ load("json-client.js");
js
.
branch_limit
=
0
;
var
chDelay
=
1
5
;
// Milliseconds between characters when loading the buffer
var
chDelay
=
1
0
;
// Milliseconds between characters when loading the buffer
var
server
=
"
bbs.electronicchicken.com
"
;
// IP or hostname of the JSON server
var
port
=
10088
;
// Port that "server" is listening on
var
chBuffer
=
100
;
// Max character history to read at once
...
...
@@ -18,10 +18,18 @@ var lastUser = "";
var
lastSystem
=
""
;
var
userInput
=
""
;
var
bgColours
=
[
BG_BLUE
,
BG_CYAN
,
BG_GREEN
,
BG_MAGENTA
,
BG_RED
,
BG_BROWN
];
var
bgColours
=
[
BG_BLUE
,
BG_CYAN
,
BG_GREEN
,
BG_MAGENTA
,
BG_RED
,
BG_BROWN
];
var
ansiClient
=
new
JSONClient
(
server
,
port
);
if
(
!
ansiClient
.
socket
.
is_connected
)
exit
();
if
(
!
ansiClient
.
socket
.
is_connected
)
exit
();
var
frame
,
topBar
,
bottomBar
,
ansi
;
...
...
@@ -40,9 +48,11 @@ function init() {
}
function
drawStuff
(
update
)
{
if
(
update
.
oper
.
toUpperCase
()
==
"
SUBSCRIBE
"
||
update
.
oper
.
toUpperCase
()
==
"
UNSUBSCRIBE
"
)
return
;
if
(
update
.
oper
.
toUpperCase
()
==
"
SUBSCRIBE
"
||
update
.
oper
.
toUpperCase
()
==
"
UNSUBSCRIBE
"
)
return
;
var
location
=
update
.
location
.
split
(
"
.
"
).
shift
().
toUpperCase
();
if
(
location
!=
"
CANVAS
"
)
return
;
if
(
location
!=
"
CANVAS
"
)
return
;
putCh
(
update
.
data
,
false
);
return
;
}
...
...
@@ -85,7 +95,8 @@ function loadHistory() {
index
+=
chBuffer
;
endex
+=
chBuffer
;
while
(
canvas
.
length
>
0
)
{
frame
.
cycle
();
if
(
frame
.
cycle
())
console
.
gotoxy
(
80
,
24
);
putCh
(
canvas
.
shift
(),
true
);
var
cmd
=
console
.
inkey
(
K_NONE
,
chDelay
);
if
(
ascii
(
cmd
)
==
27
)
{
...
...
@@ -96,9 +107,8 @@ function loadHistory() {
var
canvas
=
ansiClient
.
read
(
"
syncwall
"
,
"
canvas.
"
+
monthYear
+
"
.data
"
,
1
);
ansi
.
putChar
({
x
:
1
,
y
:
1
,
ch
:
"
CLEAR
"
,
attr
:
0
});
for
(
var
c
in
canvas
)
{
for
(
var
y
in
canvas
[
c
])
{
for
(
var
y
in
canvas
[
c
])
ansi
.
putChar
(
canvas
[
c
][
y
]);
}
}
index
=
canvasLength
;
break
;
...
...
@@ -115,12 +125,15 @@ function loadHistory() {
function
main
()
{
while
(
ascii
(
userInput
)
!=
27
)
{
if
(
frame
.
cycle
())
console
.
gotoxy
(
80
,
24
);
if
(
frame
.
cycle
())
console
.
gotoxy
(
80
,
24
);
ansiClient
.
cycle
();
userInput
=
console
.
inkey
(
K_NONE
,
5
);
if
(
userInput
==
""
)
continue
;
if
(
userInput
==
""
)
continue
;
ch
=
ansi
.
getcmd
(
userInput
);
if
(
!
ch
.
ch
)
continue
;
if
(
!
ch
.
ch
)
continue
;
if
(
lastUser
!=
user
.
alias
||
lastSystem
!=
system
.
name
)
{
bottomBar
.
attr
=
BG_BLUE
|
WHITE
;
bottomBar
.
clear
();
...
...
@@ -130,11 +143,10 @@ function main() {
}
ch
.
userAlias
=
user
.
alias
;
ch
.
system
=
system
.
name
;
if
(
ch
.
ch
==
"
CLEAR
"
)
{
if
(
ch
.
ch
==
"
CLEAR
"
)
ansiClient
.
write
(
"
syncwall
"
,
"
canvas.
"
+
monthYear
+
"
.data
"
,
{},
2
);
}
else
{
else
ansiClient
.
write
(
"
syncwall
"
,
"
canvas.
"
+
monthYear
+
"
.data.
"
+
ch
.
x
+
"
.
"
+
ch
.
y
,
{
x
:
ch
.
x
,
y
:
ch
.
y
,
ch
:
ch
.
ch
,
attr
:
ch
.
attr
},
2
);
}
ansiClient
.
write
(
"
syncwall
"
,
"
canvas.
"
+
monthYear
+
"
.ch
"
,
ch
,
2
);
ansiClient
.
push
(
"
syncwall
"
,
"
canvas.
"
+
monthYear
+
"
.history
"
,
ch
,
2
);
}
...
...
@@ -143,4 +155,4 @@ function main() {
init
();
loadHistory
();
main
();
cleanUp
();
cleanUp
();
\ No newline at end of file
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