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
Hide 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) ->
...
@@ -59,7 +59,7 @@ add_log = (message) ->
text
=
mt
.
format
(
'YYYY-MM-DD HH:mm:ss'
)
+
" --> "
+
message
+
"
\n
"
text
=
mt
.
format
(
'YYYY-MM-DD HH:mm:ss'
)
+
" --> "
+
message
+
"
\n
"
res
=
false
res
=
false
try
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
res
=
true
catch
catch
res
=
false
res
=
false
...
@@ -69,7 +69,7 @@ add_log = (message) ->
...
@@ -69,7 +69,7 @@ add_log = (message) ->
default_data
=
loadJSON
(
'./data/default_data.json'
)
default_data
=
loadJSON
(
'./data/default_data.json'
)
setting_save
=
(
settings
)
->
setting_save
=
(
settings
)
->
try
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
catch
e
add_log
(
"save fail"
);
add_log
(
"save fail"
);
return
return
...
...
ygopro-auth.js
View file @
04888860
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
text
=
mt
.
format
(
'
YYYY-MM-DD HH:mm:ss
'
)
+
"
-->
"
+
message
+
"
\n
"
;
text
=
mt
.
format
(
'
YYYY-MM-DD HH:mm:ss
'
)
+
"
-->
"
+
message
+
"
\n
"
;
res
=
false
;
res
=
false
;
try
{
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
;
res
=
true
;
}
catch
(
error
)
{
}
catch
(
error
)
{
res
=
false
;
res
=
false
;
...
@@ -86,7 +86,7 @@
...
@@ -86,7 +86,7 @@
setting_save
=
async
function
(
settings
)
{
setting_save
=
async
function
(
settings
)
{
var
e
;
var
e
;
try
{
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
)
{
}
catch
(
error
)
{
e
=
error
;
e
=
error
;
add_log
(
"
save fail
"
);
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 source diff could not be displayed because it is too large. You can
view the blob
instead.
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