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
5332a0e1
Commit
5332a0e1
authored
Dec 21, 2020
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dns resolve by server
parent
2f440016
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
main.js
main.js
+3
-3
No files found.
main.js
View file @
5332a0e1
...
@@ -223,7 +223,7 @@ let pair = function (userARes, userBRes, serverName) {
...
@@ -223,7 +223,7 @@ let pair = function (userARes, userBRes, serverName) {
playingPlayerPool
.
set
(
client
.
username
,
result
);
playingPlayerPool
.
set
(
client
.
username
,
result
);
playingPlayerTimeout
.
set
(
client
.
username
,
setTimeout
(
timeoutUser
,
config
.
match
.
longestMatchTime
,
client
.
username
));
playingPlayerTimeout
.
set
(
client
.
username
,
setTimeout
(
timeoutUser
,
config
.
match
.
longestMatchTime
,
client
.
username
));
client
.
writeHead
(
200
,
{
'
Content-Type
'
:
'
application/json
'
,
'
Cache-Control
'
:
'
no-cache
'
});
client
.
writeHead
(
200
,
{
'
Content-Type
'
:
'
application/json
'
,
'
Cache-Control
'
:
'
no-cache
'
});
resolve
(
result
).
then
(
r
=>
lookup
(
result
).
then
(
r
=>
client
.
end
(
JSON
.
stringify
(
r
))
client
.
end
(
JSON
.
stringify
(
r
))
);
);
}
}
...
@@ -347,7 +347,7 @@ let matchResponse = function(req, res) {
...
@@ -347,7 +347,7 @@ let matchResponse = function(req, res) {
res
.
writeHead
(
200
,
{
'
Content-Type
'
:
'
application/json
'
,
'
Cache-Control
'
:
'
no-cache
'
});
res
.
writeHead
(
200
,
{
'
Content-Type
'
:
'
application/json
'
,
'
Cache-Control
'
:
'
no-cache
'
});
let
message
=
playingPlayerPool
.
get
(
username
);
let
message
=
playingPlayerPool
.
get
(
username
);
localLog
(
username
+
"
is relining to:
"
+
message
);
localLog
(
username
+
"
is relining to:
"
+
message
);
resolve
(
usernam
e
).
then
(
r
=>
lookup
(
messag
e
).
then
(
r
=>
res
.
end
(
JSON
.
stringify
(
r
))
res
.
end
(
JSON
.
stringify
(
r
))
);
);
return
;
return
;
...
@@ -478,7 +478,7 @@ let textResponse = function (res, text) {
...
@@ -478,7 +478,7 @@ let textResponse = function (res, text) {
res
.
end
(
text
);
res
.
end
(
text
);
};
};
function
resolve
(
result
)
{
function
lookup
(
result
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
dns
.
lookup
(
result
.
address
,
{
family
:
4
},(
err
,
address
,
family
)
=>
{
dns
.
lookup
(
result
.
address
,
{
family
:
4
},(
err
,
address
,
family
)
=>
{
if
(
err
)
{
if
(
err
)
{
...
...
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