Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
syntax_j
mycard
Commits
0a8be1c5
Commit
0a8be1c5
authored
Oct 28, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network
parent
58a77ca9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
app/apps.service.ts
app/apps.service.ts
+10
-9
apps.json
apps.json
+1
-1
No files found.
app/apps.service.ts
View file @
0a8be1c5
...
@@ -526,7 +526,7 @@ export class AppsService {
...
@@ -526,7 +526,7 @@ export class AppsService {
maotama
;
maotama
;
network
(
app
:
App
,
server
)
{
network
(
app
:
App
,
server
)
{
if
(
!
this
.
maotama
)
{
if
(
!
this
.
maotama
)
{
this
.
maotama
=
sudo
.
fork
(
'
maotama
'
)
this
.
maotama
=
sudo
.
fork
(
'
maotama
'
)
}
}
...
@@ -535,22 +535,23 @@ export class AppsService {
...
@@ -535,22 +535,23 @@ export class AppsService {
let
connection
=
new
WebSocket
(
server
.
url
);
let
connection
=
new
WebSocket
(
server
.
url
);
let
id
;
let
id
;
connection
.
onmessage
=
(
event
)
=>
{
connection
.
onmessage
=
(
event
)
=>
{
let
message
=
<
{
action
:
string
;
arguments
:
any
[]}
>
JSON
.
parse
(
event
.
data
);
console
.
log
(
event
.
data
);
console
.
log
(
message
);
let
[
action
,
args
]
=
event
.
data
.
split
(
'
'
,
2
);
switch
(
message
.
action
)
{
let
[
address
,
port
]
=
args
.
split
(
'
:
'
);
case
'
listen
'
:
switch
(
action
)
{
this
.
connections
.
set
(
app
,
`
${
message
.
arguments
[
0
]}
:
${
message
.
arguments
[
1
]}
`
);
case
'
LISTEN
'
:
this
.
connections
.
set
(
app
,
args
);
this
.
ref
.
tick
();
this
.
ref
.
tick
();
break
;
break
;
case
'
connect
'
:
case
'
CONNECT
'
:
id
=
setInterval
(()
=>
{
id
=
setInterval
(()
=>
{
child
.
send
({
child
.
send
({
action
:
'
connect
'
,
action
:
'
connect
'
,
arguments
:
[
app
.
network
.
port
,
message
.
arguments
[
1
],
message
.
arguments
[
0
]
]
arguments
:
[
app
.
network
.
port
,
port
,
address
]
})
})
},
200
);
},
200
);
break
;
break
;
case
'
connected
'
:
case
'
CONNECTED
'
:
clearInterval
(
id
);
clearInterval
(
id
);
break
;
break
;
}
}
...
...
apps.json
View file @
0a8be1c5
...
@@ -1394,7 +1394,7 @@
...
@@ -1394,7 +1394,7 @@
"servers"
:
[
"servers"
:
[
{
{
"id"
:
"tiramisu"
,
"id"
:
"tiramisu"
,
"url"
:
"ws
s://tiramisu.mycard.moe:10800
"
"url"
:
"ws
://wudizhanche.mycard.moe:10800/
"
}
}
]
]
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment