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
c14022ca
Commit
c14022ca
authored
Apr 05, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge custom dialogues part
parent
142b232a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
19 deletions
+34
-19
ygopro-server.coffee
ygopro-server.coffee
+15
-9
ygopro-server.js
ygopro-server.js
+19
-10
No files found.
ygopro-server.coffee
View file @
c14022ca
...
@@ -2590,7 +2590,7 @@ load_dialogues = global.load_dialogues = (callback) ->
...
@@ -2590,7 +2590,7 @@ load_dialogues = global.load_dialogues = (callback) ->
return
return
return
return
load_dialogues_custom
=
global
.
load_dialogues_custom
=
()
->
load_dialogues_custom
=
global
.
load_dialogues_custom
=
(
callback
)
->
request
request
url
:
settings
.
modules
.
dialogues
.
get_custom
url
:
settings
.
modules
.
dialogues
.
get_custom
json
:
true
json
:
true
...
@@ -2602,6 +2602,8 @@ load_dialogues_custom = global.load_dialogues_custom = () ->
...
@@ -2602,6 +2602,8 @@ load_dialogues_custom = global.load_dialogues_custom = () ->
else
else
setting_change
(
dialogues
,
"dialogues_custom"
,
body
)
setting_change
(
dialogues
,
"dialogues_custom"
,
body
)
log
.
info
"custom dialogues loaded"
,
_
.
size
dialogues
.
dialogues_custom
log
.
info
"custom dialogues loaded"
,
_
.
size
dialogues
.
dialogues_custom
if
callback
callback
(
error
,
body
)
return
return
return
return
...
@@ -4129,10 +4131,12 @@ if settings.modules.http
...
@@ -4129,10 +4131,12 @@ if settings.modules.http
response
.
writeHead
(
200
)
response
.
writeHead
(
200
)
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['密码错误', 0]"
))
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['密码错误', 0]"
))
return
return
_async
.
auto
({
tasks
=
{
tips
:
load_tips
,
tips
:
load_tips
tips_zh
:
load_tips_zh
}
},
(
err
)
->
if
settings
.
modules
.
tips
.
get_zh
tasks
.
tips_zh
=
load_tips_zh
_async
.
auto
(
tasks
,
(
err
)
->
response
.
writeHead
(
200
)
response
.
writeHead
(
200
)
if
(
err
)
if
(
err
)
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['tip fail', '"
+
settings
.
modules
.
tips
.
get
+
"']"
))
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['tip fail', '"
+
settings
.
modules
.
tips
.
get
+
"']"
))
...
@@ -4145,10 +4149,12 @@ if settings.modules.http
...
@@ -4145,10 +4149,12 @@ if settings.modules.http
response
.
writeHead
(
200
)
response
.
writeHead
(
200
)
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['密码错误', 0]"
))
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['密码错误', 0]"
))
return
return
_async
.
auto
({
tasks
=
{
dialogues
:
load_dialogues
,
dialogues
:
load_dialogues
dialogues_custom
:
load_dialogues_custom
}
},
(
err
)
->
if
settings
.
modules
.
dialogues
.
get_custom
tasks
.
dialogues_custom
=
load_dialogues_custom
_async
.
auto
(
tasks
,
(
err
)
->
response
.
writeHead
(
200
)
response
.
writeHead
(
200
)
if
(
err
)
if
(
err
)
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['dialogues fail', '"
+
settings
.
modules
.
dialogues
.
get
+
"']"
))
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['dialogues fail', '"
+
settings
.
modules
.
dialogues
.
get
+
"']"
))
...
...
ygopro-server.js
View file @
c14022ca
...
@@ -3250,7 +3250,7 @@
...
@@ -3250,7 +3250,7 @@
});
});
};
};
load_dialogues_custom
=
global
.
load_dialogues_custom
=
function
()
{
load_dialogues_custom
=
global
.
load_dialogues_custom
=
function
(
callback
)
{
request
({
request
({
url
:
settings
.
modules
.
dialogues
.
get_custom
,
url
:
settings
.
modules
.
dialogues
.
get_custom
,
json
:
true
json
:
true
...
@@ -3263,6 +3263,9 @@
...
@@ -3263,6 +3263,9 @@
setting_change
(
dialogues
,
"
dialogues_custom
"
,
body
);
setting_change
(
dialogues
,
"
dialogues_custom
"
,
body
);
log
.
info
(
"
custom dialogues loaded
"
,
_
.
size
(
dialogues
.
dialogues_custom
));
log
.
info
(
"
custom dialogues loaded
"
,
_
.
size
(
dialogues
.
dialogues_custom
));
}
}
if
(
callback
)
{
callback
(
error
,
body
);
}
});
});
};
};
...
@@ -5068,7 +5071,7 @@
...
@@ -5068,7 +5071,7 @@
return
callback
+
"
(
"
+
text
+
"
);
"
;
return
callback
+
"
(
"
+
text
+
"
);
"
;
};
};
requestListener
=
function
(
request
,
response
)
{
requestListener
=
function
(
request
,
response
)
{
var
archive_args
,
archive_name
,
archive_process
,
check
,
death_room_found
,
duellog
,
error
,
filename
,
getpath
,
key
,
len2
,
len3
,
len4
,
m
,
n
,
o
,
parseQueryString
,
pass_validated
,
ref3
,
ref4
,
replay
,
ret_keys
,
room
,
roomsjson
,
u
;
var
archive_args
,
archive_name
,
archive_process
,
check
,
death_room_found
,
duellog
,
error
,
filename
,
getpath
,
key
,
len2
,
len3
,
len4
,
m
,
n
,
o
,
parseQueryString
,
pass_validated
,
ref3
,
ref4
,
replay
,
ret_keys
,
room
,
roomsjson
,
tasks
,
u
;
parseQueryString
=
true
;
parseQueryString
=
true
;
u
=
url
.
parse
(
request
.
url
,
parseQueryString
);
u
=
url
.
parse
(
request
.
url
,
parseQueryString
);
if
(
u
.
pathname
===
'
/api/getrooms
'
)
{
if
(
u
.
pathname
===
'
/api/getrooms
'
)
{
...
@@ -5321,10 +5324,13 @@
...
@@ -5321,10 +5324,13 @@
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['密码错误', 0]
"
));
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['密码错误', 0]
"
));
return
;
return
;
}
}
_async
.
auto
({
tasks
=
{
tips
:
load_tips
,
tips
:
load_tips
tips_zh
:
load_tips_zh
};
},
function
(
err
)
{
if
(
settings
.
modules
.
tips
.
get_zh
)
{
tasks
.
tips_zh
=
load_tips_zh
;
}
_async
.
auto
(
tasks
,
function
(
err
)
{
response
.
writeHead
(
200
);
response
.
writeHead
(
200
);
if
(
err
)
{
if
(
err
)
{
return
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['tip fail', '
"
+
settings
.
modules
.
tips
.
get
+
"
']
"
));
return
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['tip fail', '
"
+
settings
.
modules
.
tips
.
get
+
"
']
"
));
...
@@ -5338,10 +5344,13 @@
...
@@ -5338,10 +5344,13 @@
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['密码错误', 0]
"
));
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['密码错误', 0]
"
));
return
;
return
;
}
}
_async
.
auto
({
tasks
=
{
dialogues
:
load_dialogues
,
dialogues
:
load_dialogues
dialogues_custom
:
load_dialogues_custom
};
},
function
(
err
)
{
if
(
settings
.
modules
.
dialogues
.
get_custom
)
{
tasks
.
dialogues_custom
=
load_dialogues_custom
;
}
_async
.
auto
(
tasks
,
function
(
err
)
{
response
.
writeHead
(
200
);
response
.
writeHead
(
200
);
if
(
err
)
{
if
(
err
)
{
return
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['dialogues fail', '
"
+
settings
.
modules
.
dialogues
.
get
+
"
']
"
));
return
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['dialogues fail', '
"
+
settings
.
modules
.
dialogues
.
get
+
"
']
"
));
...
...
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