Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-match
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
MyCard
ygopro-match
Commits
9788dac3
Commit
9788dac3
authored
Jun 25, 2018
by
IamI
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
What, it's a form?!
parent
f884644a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
main.js
main.js
+9
-3
No files found.
main.js
View file @
9788dac3
...
...
@@ -372,10 +372,16 @@ let textResponse = function (res, text) {
// 结束游戏 (POST /finish)
let
endUserResponse
=
function
(
req
,
res
)
{
let
json
=
''
;
req
.
on
(
'
data
'
,
(
data
)
=>
json
+=
data
);
let
form
=
''
;
req
.
on
(
'
data
'
,
(
data
)
=>
form
+=
data
);
req
.
on
(
'
end
'
,
function
()
{
let
result
=
finishUser
(
JSON
.
parse
(
json
));
let
json
=
{};
let
hashes
=
form
.
slice
(
form
.
indexOf
(
'
?
'
)
+
1
).
split
(
'
&
'
);
for
(
let
i
=
0
;
i
<
hashes
.
length
;
i
++
)
{
let
hash
=
hashes
[
i
].
split
(
'
=
'
);
json
[
hash
[
0
]]
=
hash
[
1
];
}
let
result
=
finishUser
(
json
);
res
.
statusCode
=
200
;
res
.
end
(
'
ok
'
);
})
...
...
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