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
04888860
Commit
04888860
authored
Nov 15, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rework server init
parent
de15fb02
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1387 additions
and
1426 deletions
+1387
-1426
ygopro-auth.coffee
ygopro-auth.coffee
+2
-2
ygopro-auth.js
ygopro-auth.js
+2
-2
ygopro-server.coffee
ygopro-server.coffee
+502
-513
ygopro-server.js
ygopro-server.js
+881
-909
No files found.
ygopro-auth.coffee
View file @
04888860
...
...
@@ -59,7 +59,7 @@ add_log = (message) ->
text
=
mt
.
format
(
'YYYY-MM-DD HH:mm:ss'
)
+
" --> "
+
message
+
"
\n
"
res
=
false
try
await
util
.
promisify
(
fs
.
appendFile
)
(
"./logs/"
+
mt
.
format
(
'YYYY-MM-DD'
)
+
".log"
,
text
)
await
fs
.
promises
.
appendFile
(
"./logs/"
+
mt
.
format
(
'YYYY-MM-DD'
)
+
".log"
,
text
)
res
=
true
catch
res
=
false
...
...
@@ -69,7 +69,7 @@ add_log = (message) ->
default_data
=
loadJSON
(
'./data/default_data.json'
)
setting_save
=
(
settings
)
->
try
await
util
.
promisify
(
fs
.
writeFile
)
(
settings
.
file
,
JSON
.
stringify
(
settings
,
null
,
2
))
await
fs
.
promises
.
writeFile
(
settings
.
file
,
JSON
.
stringify
(
settings
,
null
,
2
))
catch
e
add_log
(
"save fail"
);
return
...
...
ygopro-auth.js
View file @
04888860
...
...
@@ -73,7 +73,7 @@
text
=
mt
.
format
(
'
YYYY-MM-DD HH:mm:ss
'
)
+
"
-->
"
+
message
+
"
\n
"
;
res
=
false
;
try
{
await
util
.
promisify
(
fs
.
appendFile
)
(
"
./logs/
"
+
mt
.
format
(
'
YYYY-MM-DD
'
)
+
"
.log
"
,
text
);
await
fs
.
promises
.
appendFile
(
"
./logs/
"
+
mt
.
format
(
'
YYYY-MM-DD
'
)
+
"
.log
"
,
text
);
res
=
true
;
}
catch
(
error
)
{
res
=
false
;
...
...
@@ -86,7 +86,7 @@
setting_save
=
async
function
(
settings
)
{
var
e
;
try
{
await
util
.
promisify
(
fs
.
writeFile
)
(
settings
.
file
,
JSON
.
stringify
(
settings
,
null
,
2
));
await
fs
.
promises
.
writeFile
(
settings
.
file
,
JSON
.
stringify
(
settings
,
null
,
2
));
}
catch
(
error
)
{
e
=
error
;
add_log
(
"
save fail
"
);
...
...
ygopro-server.coffee
View file @
04888860
This diff is collapsed.
Click to expand it.
ygopro-server.js
View file @
04888860
This diff is collapsed.
Click to expand it.
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