Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro
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
nanahira
srvpro
Commits
aa5473b9
Commit
aa5473b9
authored
Feb 13, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mc'
parents
fc478fe0
3527332d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
26 deletions
+34
-26
ygopro-server.js
ygopro-server.js
+34
-26
No files found.
ygopro-server.js
View file @
aa5473b9
...
...
@@ -1643,7 +1643,7 @@
}
return
false
;
});
ygopro
.
ctos_follow
(
'
HS_KICK
'
,
true
,
function
(
buffer
,
info
,
client
,
server
)
{
var
j
,
len
,
player
,
ref
,
room
;
room
=
ROOM_all
[
client
.
rid
];
...
...
@@ -2485,7 +2485,7 @@
return
callback
+
"
(
"
+
text
+
"
);
"
;
};
requestListener
=
function
(
request
,
response
)
{
var
archive_args
,
archive_name
,
archive_process
,
duellog
,
error
,
filename
,
getpath
,
j
,
k
,
len
,
len1
,
parseQueryString
,
pass_validated
,
player
,
ref
,
replay
_file
,
room
,
roomsjson
,
u
;
var
archive_args
,
archive_name
,
archive_process
,
duellog
,
error
,
filename
,
getpath
,
j
,
k
,
len
,
len1
,
parseQueryString
,
pass_validated
,
player
,
ref
,
replay
,
room
,
roomsjson
,
u
;
parseQueryString
=
true
;
u
=
url
.
parse
(
request
.
url
,
parseQueryString
);
pass_validated
=
u
.
query
.
pass
===
settings
.
modules
.
http
.
password
;
...
...
@@ -2563,32 +2563,40 @@
archive_process
=
spawn
(
settings
.
modules
.
tournament_mode
.
replay_archive_tool
,
archive_args
,
{
cwd
:
settings
.
modules
.
tournament_mode
.
replay_path
});
archive_process
.
on
(
'
error
'
,
(
err
)
=>
{
response
.
writeHead
(
403
);
response
.
end
(
"
Failed packing replays.
"
+
err
);
});
archive_process
.
on
(
'
exit
'
,
(
code
)
=>
{
return
fs
.
readFile
(
settings
.
modules
.
tournament_mode
.
replay_path
+
archive_name
,
function
(
error
,
buffer
)
{
if
(
error
)
{
response
.
writeHead
(
403
);
response
.
end
(
"
Failed sending replays.
"
+
error
);
}
else
{
response
.
writeHead
(
200
,
{
"
Content-Type
"
:
"
application/octet-stream
"
,
"
Content-Disposition
"
:
"
attachment
"
});
response
.
end
(
buffer
);
}
});
});
archive_process
.
on
(
'
error
'
,
(
function
(
_this
)
{
return
function
(
err
)
{
response
.
writeHead
(
403
);
response
.
end
(
"
Failed packing replays.
"
+
err
);
};
})(
this
));
archive_process
.
on
(
'
exit
'
,
(
function
(
_this
)
{
return
function
(
code
)
{
return
fs
.
readFile
(
settings
.
modules
.
tournament_mode
.
replay_path
+
archive_name
,
function
(
error
,
buffer
)
{
if
(
error
)
{
response
.
writeHead
(
403
);
response
.
end
(
"
Failed sending replays.
"
+
error
);
}
else
{
response
.
writeHead
(
200
,
{
"
Content-Type
"
:
"
application/octet-stream
"
,
"
Content-Disposition
"
:
"
attachment
"
});
response
.
end
(
buffer
);
}
});
};
})(
this
));
archive_process
.
stdout
.
setEncoding
(
'
utf8
'
);
archive_process
.
stdout
.
on
(
'
data
'
,
function
(
data
)
{
return
log
.
info
(
"
archive process:
"
+
data
);
});
archive_process
.
stdout
.
on
(
'
data
'
,
(
function
(
_this
)
{
return
function
(
data
)
{
return
log
.
info
(
"
archive process:
"
+
data
);
};
})(
this
));
archive_process
.
stderr
.
setEncoding
(
'
utf8
'
);
archive_process
.
stderr
.
on
(
'
data
'
,
function
(
data
)
{
return
log
.
warn
(
"
archive error:
"
+
data
);
});
archive_process
.
stderr
.
on
(
'
data
'
,
(
function
(
_this
)
{
return
function
(
data
)
{
return
log
.
warn
(
"
archive error:
"
+
data
);
};
})(
this
));
}
catch
(
error1
)
{
error
=
error1
;
response
.
writeHead
(
403
);
...
...
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